Commit 29668d7c authored by 李灿灿's avatar 李灿灿

Merge branch 'feature-licancan' into 'develop'

导出的excel字段需求变更

See merge request fangxinjiang/yifu!140
parents 036b1a4d 1778e993
......@@ -11,6 +11,10 @@ public class InsurancesConstants {
* 新增
*/
public static final String ADD = "新增";
/**
* 离职
*/
public static final String QUIT = "离职";
/**
* 批增
*/
......
......@@ -801,6 +801,48 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//操作记录
addOperate(detailList,user,InsurancesConstants.EXPORT);
//针对是替换类型的做处理,每一条替换数据对应一条被替换数据
List<InsuranceExportListVO> listVOS = insuranceExportList.stream().filter(e -> e.getBuyType() == CommonConstants.FOUR_INT).collect(Collectors.toList());
List<InsuranceExportListVO> list = new ArrayList<>();
if(CollectionUtils.isNotEmpty(listVOS)){
for (InsuranceExportListVO listVO : listVOS) {
listVO.setRemark(InsurancesConstants.ADD);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId());
if (Optional.ofNullable(byId).isPresent()){
InsuranceExportListVO vo = new InsuranceExportListVO();
BeanCopyUtils.copyProperties(byId,vo);
//购买月数
vo.setBuyMonth(LocalDateUtil.betweenMonth(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
//购买天数
vo.setBuyDay(LocalDateUtil.betweenDay(vo.getPolicyStart().toString(),vo.getPolicyEnd().toString()));
vo.setRemark(InsurancesConstants.QUIT);
vo.setBuyType(CommonConstants.FOUR_INT);
list.add(vo);
}
}
}
if (CollectionUtils.isNotEmpty(list)){
//根据项目编码获取项目名称
List<String> collectList = list.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<SetInfoVo> setInfoByCodesList = archivesDaprUtil.getSetInfoByCodes(collectList);
if (null != setInfoByCodesList && setInfoByCodesList.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodesList.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodesList.getData().getProjectSetInfoVoMap();
for (InsuranceExportListVO record : list) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
}
}
}
insuranceExportList.addAll(list);
}
}
}
return insuranceExportList;
}
......
......@@ -342,7 +342,7 @@
detail.CREATE_NAME as createName,
detail.REMARK as remark
from t_insurance_detail detail
where detail.id in
where detail.DELETE_FLAG = 0 and detail.BUY_HANDLE_STATUS = 1 and detail.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
......
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