Commit 7e044a3f authored by huyuchen's avatar huyuchen

huych-商险和社保基数配置日志新增

parent 21543dfa
......@@ -116,6 +116,7 @@
<module>yifu-ekp</module>
<module>yifu-process</module>
<module>yifu-csp</module>
<module>yifu-batch</module>
</modules>
<dependencyManagement>
......
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateConverter;
......@@ -20,6 +21,7 @@ import java.time.LocalDateTime;
* @date 2025-12-12
*/
@Data
@ColumnWidth(17)
@Tag(name = "商险明细项目变更日志导出VO")
public class InsuranceChangeLogExportVo implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -119,3 +121,4 @@ public class InsuranceChangeLogExportVo implements Serializable {
private String reason;
}
......@@ -357,7 +357,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*
* @author huych
* @param param 查询参数
* @return {@link long}
* @return
*/
long getInsuranceChangeLogExportCount(@Param("param") InsuredParam param);
......
......@@ -7,12 +7,18 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TBusinessOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TBusinessOperateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TBusinessOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancesChangeLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
......@@ -24,6 +30,9 @@ import static com.alibaba.fastjson.serializer.SerializerFeature.*;
@Service
public class TBusinessOperateServiceImpl extends ServiceImpl<TBusinessOperateMapper, TBusinessOperate> implements TBusinessOperateService {
@Resource
private TInsurancesChangeLogService insurancesChangeLogService;
/**
* 保存修改记录
*
......@@ -69,7 +78,27 @@ public class TBusinessOperateServiceImpl extends ServiceImpl<TBusinessOperateMap
public List<TBusinessOperate> getOperateListByBusinessId(String businessId) {
List<TBusinessOperate> list = this.baseMapper.selectList(Wrappers.<TBusinessOperate>query().lambda()
.eq(TBusinessOperate::getBusinessId,businessId));
return list;
//查询项目变更的操作记录
List<TInsurancesChangeLog> changeLogList = insurancesChangeLogService.getTInsurancesChangeLoglList(businessId);
if (Common.isNotNull(changeLogList)) {
changeLogList.forEach(changeLog -> {
TBusinessOperate operate = new TBusinessOperate();
operate.setId(changeLog.getId());
operate.setBusinessId(changeLog.getPreId());
operate.setDifferenceInfo(changeLog.getDifferenceInfo());
operate.setOldInfo(changeLog.getOldInfo());
operate.setNewInfo(changeLog.getNewInfo());
operate.setRemark(changeLog.getReason());
operate.setCreateName(changeLog.getCreateName());
operate.setCreateTime(changeLog.getCreateTime());
list.add(operate);
});
}
List<TBusinessOperate> backList = new ArrayList<>();
if (!list.isEmpty()) {
backList = list.stream().sorted(Comparator.comparing(TBusinessOperate::getCreateTime)).collect(Collectors.toList());
}
return backList;
}
private SerializerFeature[] features = new SerializerFeature[] {
......
......@@ -5139,6 +5139,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
if (count > 0) {
out.write("不可导出超过一万行数据,请修改筛选条件后重新导出".getBytes("GBK"));
out.close();
return;
}
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, InsuranceChangeLogExportVo.class).build();
int index = 0;
......@@ -5149,6 +5155,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = this.baseMapper.getInsuranceChangeLogExportList(param);
if (Common.isNotNull(list)) {
for(InsuranceChangeLogExportVo vo: list) {
if (Common.isNotNull(vo.getOperateContent())) {
vo.setOperateContent(vo.getOperateContent().replace("||", "\n"));
}
}
WriteSheet writeSheet = EasyExcel.writerSheet("sheet" + index).build();
excelWriter.write(list, writeSheet);
index++;
......@@ -6490,7 +6501,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setReason("项目变更");
insuranceOperate.setDifferenceInfo("项目名称,项目编码");
insuranceOperate.setDifferenceInfo("deptName,deptNo");
Map<String, String> oldMap = new HashMap<>();
oldMap.put("deptName", success.getOldDeptName());
oldMap.put("deptNo", success.getOldDeptNo());
......
......@@ -2245,7 +2245,7 @@
b.CREATE_TIME as createTime,
CONCAT(
'项目编码:旧值为:', IFNULL(JSON_UNQUOTE(JSON_EXTRACT(b.OLD_INFO, '$.deptNo')), ''), ',新值为:', IFNULL(JSON_UNQUOTE(JSON_EXTRACT(b.NEW_INFO, '$.deptNo')), ''),
'\n项目名称:旧值为:', IFNULL(JSON_UNQUOTE(JSON_EXTRACT(b.OLD_INFO, '$.deptName')), ''), ',新值为:', IFNULL(JSON_UNQUOTE(JSON_EXTRACT(b.NEW_INFO, '$.deptName')), '')
'||', '项目名称:旧值为:', IFNULL(JSON_UNQUOTE(JSON_EXTRACT(b.OLD_INFO, '$.deptName')), ''), ',新值为:', IFNULL(JSON_UNQUOTE(JSON_EXTRACT(b.NEW_INFO, '$.deptName')), '')
) as operateContent,
b.REASON as reason
from t_insurance_detail a
......@@ -2340,10 +2340,10 @@
${param.authSql}
</if>
and b.PRE_ID is not null
order by b.CREATE_TIME desc
<if test="param.limitStart != null and param.limitEnd != null">
limit #{param.limitStart}, #{param.limitEnd}
</if>
order by b.CREATE_TIME desc
</select>
<!-- 导出商险明细项目变更日志统计 -->
......
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