Commit 96a87295 by zhangxingmin

Merge remote-tracking branch 'origin/test' into test

parents 888b2ef2 36276008
......@@ -30,9 +30,9 @@ public class CommissionQueryRequest extends PageDto implements Serializable {
private String policyNo;
/**
* 对账公司
* 对账公司名称
*/
@Schema(description = "对账公司")
@Schema(description = "对账公司名称")
private String reconciliationCompany;
/**
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
......@@ -13,9 +14,10 @@ import lombok.Data;
/**
* 出账记录表
*
* @TableName fortune_account
*/
@TableName(value ="fortune_account")
@TableName(value = "fortune_account")
@Data
public class FortuneAccount implements Serializable {
/**
......@@ -64,9 +66,10 @@ public class FortuneAccount implements Serializable {
*/
private String content;
/**
/**
* 出账数据列表
*/
@TableField(exist = false)
private List<Fortune> fortuneList;
/**
......
......@@ -204,7 +204,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
public Boolean completeFortuneAccount(CompleteFortuneAccountRequest completeFortuneAccountRequest) {
List<String> fortuneAccountBizIdList = completeFortuneAccountRequest.getFortuneAccountBizIdList();
List<FortuneAccount> fortuneAccountList = this.listByIds(fortuneAccountBizIdList);
List<FortuneAccount> fortuneAccountList = this.list(new QueryWrapper<FortuneAccount>().in("fortune_account_biz_id", fortuneAccountBizIdList));
if (CollectionUtils.isEmpty(fortuneAccountList)) {
throw new BusinessException(ResultCode.NULL_ERROR.getCode(), ResultCode.NULL_ERROR.getMessage());
}
......
......@@ -135,8 +135,8 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if (CollUtil.isNotEmpty(fortuneBizIdList)) {
List<Fortune> fortuneList = this.list(new QueryWrapper<Fortune>().in("fortune_biz_id", fortuneBizIdList));
if (CollUtil.isNotEmpty(fortuneList)) {
// 按人分组
Map<String, List<Fortune>> fortuneMap = fortuneList.stream().collect(Collectors.groupingBy(Fortune::getBroker));
// 按人和币种分组
Map<String, List<Fortune>> fortuneMap = fortuneList.stream().collect(Collectors.groupingBy(fortune -> fortune.getBroker() + "_" + fortune.getCurrency()));
// 创建按人分组的导出DTO列表
List<FortuneAccountExportDTO> accountExportDTOList = new ArrayList<>();
......@@ -147,9 +147,10 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
.filter(StringUtils::isNotBlank)
.collect(Collectors.toSet());
// 处理每个的数据
// 处理每个分组的数据
for (Map.Entry<String, List<Fortune>> entry : fortuneMap.entrySet()) {
String broker = entry.getKey();
String broker = entry.getKey().split("_")[0];
String currency = entry.getKey().split("_")[1];
List<Fortune> brokerFortunes = entry.getValue();
FortuneAccountExportDTO accountDTO = new FortuneAccountExportDTO();
......@@ -159,7 +160,7 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
// 设置团队、币种(取第一个记录)
if (CollUtil.isNotEmpty(brokerFortunes)) {
accountDTO.setTeam(brokerFortunes.get(0).getTeam());
accountDTO.setCurrency(brokerFortunes.get(0).getCurrency());
accountDTO.setCurrency(currency);
}
// 计算出账总额
......
......@@ -10,7 +10,6 @@
<result property="broker" column="broker" />
<result property="fortuneAccountDate" column="fortune_account_date" />
<result property="content" column="content" />
<result property="fortuneBizIdList" column="fortune_biz_id_list" />
<result property="remark" column="remark" />
<result property="isDeleted" column="is_deleted" />
<result property="creatorId" column="creator_id" />
......@@ -20,7 +19,7 @@
</resultMap>
<sql id="Base_Column_List">
id,fortune_account_biz_id,broker,fortune_account_date,content,fortune_biz_id_list,remark,
id,fortune_account_biz_id,broker,fortune_account_date,content,remark,
is_deleted,creator_id,updater_id,create_time,update_time
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment