Commit 51c0edf8 authored by huyuchen's avatar huyuchen

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

parent 99a4b396
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
/**
* 商险信息变更表
*
* @author huych
* @date 2025-12-11 15:35:05
*/
@Data
@TableName("t_insurances_change_log")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "商险信息变更表")
public class TInsurancesChangeLog extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 商险信息ID
*/
@ExcelAttribute(name = "商险信息ID")
@ExcelProperty("商险信息ID")
@Schema(description = "商险信息ID")
private String preId;
/**
* 差异的信息(属性名称,逗号隔开)
*/
@ExcelAttribute(name = "差异的信息(属性名称,逗号隔开)")
@ExcelProperty("差异的信息(属性名称,逗号隔开)")
@Schema(description = "差异的信息(属性名称,逗号隔开)")
private String differenceInfo;
/**
* 原来的信息
*/
@ExcelAttribute(name = "原来的信息", isNotEmpty = true, errorInfo = "原来的信息不能为空")
@NotBlank(message = "原来的信息不能为空")
@ExcelProperty("原来的信息")
@Schema(description = "原来的信息")
private String oldInfo;
/**
* 新的信息
*/
@ExcelAttribute(name = "新的信息", isNotEmpty = true, errorInfo = "新的信息不能为空")
@NotBlank(message = "新的信息不能为空")
@ExcelProperty("新的信息")
@Schema(description = "新的信息")
private String newInfo;
/**
* 变更原因
*/
@ExcelAttribute(name = "变更原因")
@ExcelProperty("变更原因")
@Schema(description = "变更原因")
private String reason;
}
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.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateConverter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 商险明细项目变更日志导出VO
*
* @author yifu
* @date 2025-12-12
*/
@Data
@Tag(name = "商险明细项目变更日志导出VO")
public class InsuranceChangeLogExportVo implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工姓名")
private String empName;
/**
* 员工身份证号码
*/
@Schema(description = "员工身份证号码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "员工身份证号码")
private String empIdcardNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "险种名称")
private String insuranceTypeName;
/**
* 保单开始日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
@Schema(description = "保单开始日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单开始日期", converter = LocalDateConverter.class)
@DateTimeFormat("yyyy-MM-dd")
private LocalDate policyStart;
/**
* 保单结束日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
@Schema(description = "保单结束日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "保单结束日期", converter = LocalDateConverter.class)
@DateTimeFormat("yyyy-MM-dd")
private LocalDate policyEnd;
/**
* 购买标准
*/
@Schema(description = "购买标准")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "购买标准(元)")
private String buyStandard;
/**
* 操作人
*/
@Schema(description = "操作人")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "操作人")
private String createName;
/**
* 操作时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "操作时间")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "操作时间")
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 操作内容(项目编码和项目名称变更)
*/
@Schema(description = "操作内容")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "操作内容")
private String operateContent;
/**
* 变更原因
*/
@Schema(description = "变更原因")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value = "变更原因")
private String reason;
}
...@@ -493,6 +493,20 @@ public class TInsuranceDetailController { ...@@ -493,6 +493,20 @@ public class TInsuranceDetailController {
tInsuranceDetailService.getInsuredList(param,response); tInsuranceDetailService.getInsuredList(param,response);
} }
/**
* 导出商险明细项目变更日志
*
* @author yifu
* @param param 查询条件
* @param response 响应参数
* @return void
*/
@Operation(summary = "导出商险明细项目变更日志", description = "导出商险明细项目变更日志")
@PostMapping("/exportInsuranceChangeLog")
public void exportInsuranceChangeLog(@RequestBody InsuredParam param, HttpServletResponse response) {
tInsuranceDetailService.exportInsuranceChangeLog(param, response);
}
/** /**
* 已减员列表分页查询 * 已减员列表分页查询
* *
......
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancesChangeLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 入职确认信息变更日志表
*
* @author huych
* @date 2025-12-12 15:35:05
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tInsurancesChangeLog")
@Tag(name = "商险信息变更日志表管理")
public class TInsurancesChangeLogController {
private final TInsurancesChangeLogService insurancesChangeLogService;
/**
* 分页查询
*
* @return {@link R< IPage < TInsurancesChangeLog >>}
*/
@Operation(summary = "分页查询", description = "分页查询")
@PostMapping("/getInsuranceListPage")
public R<IPage<TInsurancesChangeLog>> getInsuranceListPage(Page<TInsurancesChangeLog> page, @RequestBody TInsurancesChangeLog param) {
return R.ok(insurancesChangeLogService.getInsuranceListPage(page, param));
}
/**
* 通过id查询入职确认信息变更日志表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<List<TInsurancesChangeLog>> getById(@PathVariable("id") String id) {
return R.ok(insurancesChangeLogService.getTInsurancesChangeLoglList(id));
}
}
...@@ -343,4 +343,22 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -343,4 +343,22 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
List<String> getInsuranceDetailList(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo); List<String> getInsuranceDetailList(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
List<String> getInsuranceDetailListByClose(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo); List<String> getInsuranceDetailListByClose(@Param("empIdCard") String empIdCard, @Param("deptNo") String deptNo);
/**
* 导出商险明细项目变更日志
*
* @author yifu
* @param param 查询参数
* @return {@link List<InsuranceChangeLogExportVo>}
*/
List<InsuranceChangeLogExportVo> getInsuranceChangeLogExportList(@Param("param") InsuredParam param);
/**
* 导出商险明细项目变更日志统计
*
* @author huych
* @param param 查询参数
* @return {@link long}
*/
long getInsuranceChangeLogExportCount(@Param("param") InsuredParam param);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商险信息信息变更日志明细表
*
* @author huych
* @date 2025-12-11 15:35:05
*/
@Mapper
public interface TInsurancesChangeLogMapper extends BaseMapper<TInsurancesChangeLog> {
/**
* 入商险信息信息变更明细表查询
* @param preId 商险id
* @return
*/
List<TInsurancesChangeLog> getTInsurancesChangeLoglList(@Param("preId") String preId);
/**
* 商险信息信息变更明细表简单分页查询
* @param param 商险信息信息变更明细表
* @return
*/
IPage<TInsurancesChangeLog> getInsuranceListPage(Page<TInsurancesChangeLog> page, @Param("param") TInsurancesChangeLog param);
}
...@@ -256,6 +256,16 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -256,6 +256,16 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
void getInsuredList(InsuredParam param, HttpServletResponse response); void getInsuredList(InsuredParam param, HttpServletResponse response);
/**
* 导出商险明细项目变更日志
*
* @author yifu
* @param param 查询参数
* @param response 响应参数
* @return void
*/
void exportInsuranceChangeLog(InsuredParam param, HttpServletResponse response);
/** /**
* 已减员列表分页查询 * 已减员列表分页查询
* *
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog;
import java.util.List;
/**
* 商险信息信息变更日志明细表
*
* @author huych
* @date 2025-12-11 15:35:05
*/
public interface TInsurancesChangeLogService extends IService<TInsurancesChangeLog> {
/**
* 入职确认信息变更日志明细表查询
* @param preId 商险ID
* @return
*/
List<TInsurancesChangeLog> getTInsurancesChangeLoglList(String preId);
/**
* 入职确认信息变更日志明细表简单分页查询
* @param param 入职确认信息变更日志明细表
* @return
*
*/
IPage<TInsurancesChangeLog> getInsuranceListPage(Page<TInsurancesChangeLog> page, TInsurancesChangeLog param);
}
...@@ -8,6 +8,8 @@ import com.alibaba.excel.read.listener.ReadListener; ...@@ -8,6 +8,8 @@ import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder; import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils; import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -86,6 +88,8 @@ import java.util.concurrent.TimeUnit; ...@@ -86,6 +88,8 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
/** /**
* @author licancan * @author licancan
* @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service实现 * @description 针对表【t_insurance_detail(商险明细表)】的数据库操作Service实现
...@@ -153,7 +157,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -153,7 +157,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private TInsurancePreRenewDetailMapper tInsurancePreRenewDetailMapper; private TInsurancePreRenewDetailMapper tInsurancePreRenewDetailMapper;
@Resource @Resource
private TInsuranceWarnMapper tInsuranceWarnMapper; private TInsuranceWarnMapper tInsuranceWarnMapper;
@Resource
private TInsurancesChangeLogService insurancesChangeLogService;
@Resource @Resource
private TInsurancePreRenewDetailQwService tInsurancePreRenewDetailQwService; private TInsurancePreRenewDetailQwService tInsurancePreRenewDetailQwService;
...@@ -5107,6 +5112,74 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -5107,6 +5112,74 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
/**
* 导出商险明细项目变更日志
*
* @author yifu
* @param param 查询参数
* @param response 响应参数
* @return void
*/
@Override
public void exportInsuranceChangeLog(InsuredParam param, HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser();
param.setCreateBy(user.getId());
menuUtil.setAuthSql(user, param);
if (Common.isNotNull(param.getAuthSql()) && param.getAuthSql().contains("1=2 CONCAT")) {
param.setAuthSql(param.getAuthSql().replace("1=2 CONCAT", "CONCAT"));
}
List<InsuranceChangeLogExportVo> list = new ArrayList<>();
//处理导出
String fileName = "商险明细项目变更日志" + DateUtil.getThisTime() + CommonConstants.XLSX;
long count = this.baseMapper.getInsuranceChangeLogExportCount(param);
ServletOutputStream out = null;
try {
out = response.getOutputStream();
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, InsuranceChangeLogExportVo.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
param.setLimitStart(i);
param.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = this.baseMapper.getInsuranceChangeLogExportList(param);
if (Common.isNotNull(list)) {
WriteSheet writeSheet = EasyExcel.writerSheet("sheet" + index).build();
excelWriter.write(list, writeSheet);
index++;
}
i = i + CommonConstants.EXCEL_EXPORT_LIMIT;
if (Common.isNotNull(list)) {
list.clear();
}
}
} else {
WriteSheet writeSheet = EasyExcel.writerSheet("sheet" + index).build();
excelWriter.write(list, writeSheet);
}
if (Common.isNotNull(list)) {
list.clear();
}
out.flush();
excelWriter.finish();
} catch (Exception e) {
log.error("导出商险明细项目变更日志执行异常", e);
} finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("关闭输出流异常", e);
}
}
}
/** /**
* 已减员列表分页查询 * 已减员列表分页查询
* *
...@@ -6410,23 +6483,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -6410,23 +6483,38 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
} }
//新增操作信息 //新增项目变更的操作信息
TInsuranceOperate insuranceOperate = new TInsuranceOperate(); TInsurancesChangeLog insuranceOperate = new TInsurancesChangeLog();
insuranceOperate.setInsuranceDetailId(success.getId()); insuranceOperate.setPreId(success.getId());
insuranceOperate.setCreateBy(user.getId()); insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname()); insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now()); insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setDisplayFlag(CommonConstants.ZERO_INT); insuranceOperate.setReason("项目变更");
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE); insuranceOperate.setDifferenceInfo("项目名称,项目编码");
operateList.add(insuranceOperate); Map<String, String> oldMap = new HashMap<>();
oldMap.put("deptName", success.getOldDeptName());
oldMap.put("deptNo", success.getOldDeptNo());
insuranceOperate.setOldInfo(JSON.toJSONString(oldMap, features));
Map<String, String> newMap = new HashMap<>();
newMap.put("deptName", success.getNewDeptName());
newMap.put("deptNo", success.getNewDeptNo());
insuranceOperate.setNewInfo(JSON.toJSONString(newMap, features));
insurancesChangeLogService.save(insuranceOperate);
// operateList.add(insuranceOperate);
} }
}); });
} }
tInsuranceOperateService.saveBatch(operateList); //改变原来写法,原来逻辑在执行这段代码前前面的线程任务还在执行operateList并没值,所以日志没保存上
// tInsuranceOperateService.saveBatch(operateList);
List<DeptChangeCheckParam> errorList = stringListMap.get(InsurancesConstants.ERROR_LIST); List<DeptChangeCheckParam> errorList = stringListMap.get(InsurancesConstants.ERROR_LIST);
return R.ok(errorList,InsurancesConstants.IMPORT_SUCCESS); return R.ok(errorList,InsurancesConstants.IMPORT_SUCCESS);
} }
private static final SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty, WriteDateUseDateFormat
};
/** /**
* 根据保险公司名称查询保单明细 * 根据保险公司名称查询保单明细
* *
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancesChangeLogMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancesChangeLogService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 入职确认信息变更日志明细表
*
* @author hgw
* @date 2025-04-07 15:35:05
*/
@Log4j2
@Service
public class TInsurancesChangeLogServiceImpl extends ServiceImpl<TInsurancesChangeLogMapper, TInsurancesChangeLog> implements TInsurancesChangeLogService {
/**
* 入职确认信息变更日志明细表查询
* @param preId 商险ID
* @return
*/
@Override
public List<TInsurancesChangeLog> getTInsurancesChangeLoglList(String preId) {
return baseMapper.getTInsurancesChangeLoglList(preId);
}
/**
* 入职确认信息变更日志明细表简单分页查询
* @param param
* @return
*/
@Override
public IPage<TInsurancesChangeLog> getInsuranceListPage(Page<TInsurancesChangeLog> page, TInsurancesChangeLog param) {
return baseMapper.getInsuranceListPage(page,param);
}
}
...@@ -2231,4 +2231,217 @@ ...@@ -2231,4 +2231,217 @@
</select> </select>
<!-- 导出商险明细项目变更日志 -->
<select id="getInsuranceChangeLogExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceChangeLogExportVo">
select
a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo,
a.INSURANCE_COMPANY_NAME as insuranceCompanyName,
a.INSURANCE_TYPE_NAME as insuranceTypeName,
a.POLICY_START as policyStart,
a.POLICY_END as policyEnd,
a.BUY_STANDARD as buyStandard,
b.CREATE_NAME as createName,
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')), '')
) as operateContent,
b.REASON as reason
from t_insurance_detail a
left join t_insurances_change_log b on a.ID = b.PRE_ID
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = 3
<if test="param.isEffect != null">
and a.IS_EFFECT = #{param.isEffect}
</if>
<if test="param.unitName != null and param.unitName.trim() != ''">
and a.UNIT_NAME like concat(replace(replace(#{param.unitName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.unitNo != null and param.unitNo.trim() != ''">
and a.UNIT_NO like concat(replace(replace(#{param.unitNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and a.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyType != null">
and a.BUY_TYPE = #{param.buyType}
</if>
<if test="param.reduceHandleStatus != null">
and a.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO = #{param.deptNo}
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and a.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyJingQueStart != null and param.policyJingQueStart.trim() != ''">
AND DATE_FORMAT(a.POLICY_START,"%Y-%m-%d") = #{param.policyJingQueStart}
</if>
<if test="param.policyJingQueEnd != null and param.policyJingQueEnd.trim() != ''">
AND DATE_FORMAT(a.POLICY_END,"%Y-%m-%d") = #{param.policyJingQueEnd}
</if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(a.POLICY_START <![CDATA[ >= ]]> #{param.policyStart} and a.POLICY_START <![CDATA[ <= ]]> #{param.policyEnd})
or (a.POLICY_END <![CDATA[ >= ]]> #{param.policyStart} and a.POLICY_END <![CDATA[ <= ]]> #{param.policyEnd})
or (a.POLICY_START <![CDATA[ <= ]]> #{param.policyStart} and a.POLICY_END <![CDATA[ >= ]]> #{param.policyEnd})
)
</if>
<if test="param.createStartTime != null and param.createStartTime.trim() != ''">
and a.CREATE_TIME <![CDATA[ >= ]]> #{param.createStartTime}
</if>
<if test="param.createEndTime != null and param.createEndTime.trim() != ''">
and a.CREATE_TIME <![CDATA[ <= ]]> #{param.createEndTime}
</if>
<if test="param.buyHandleStatus != null">
and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
</if>
<if test="param.isUse != null">
and a.IS_USE = #{param.isUse}
</if>
<if test="param.isOverdue != null">
and a.IS_OVERDUE = #{param.isOverdue}
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
and a.INVOICE_NO like concat('%',replace(replace(#{param.invoiceNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyId != null and param.insuranceCompanyId.trim() != ''">
and a.INSURANCE_COMPANY_ID = #{param.insuranceCompanyId}
</if>
<if test="param.deptNoList != null and param.deptNoList.size > 0">
and a.DEPT_NO in
<foreach collection="param.deptNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.isAdress != null and param.isAdress.trim() != ''">
and a.IS_ADRESS = #{param.isAdress}
</if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and a.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyStandardMin != null and param.buyStandardMin.trim() != ''">
AND a.BUY_STANDARD+0 <![CDATA[ >= ]]> #{param.buyStandardMin}+0
</if>
<if test="param.buyStandardMax != null and param.buyStandardMax.trim() != ''">
AND a.BUY_STANDARD+0 <![CDATA[ <= ]]> #{param.buyStandardMax}+0
</if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
and b.PRE_ID is not null
<if test="param.limitStart != null and param.limitEnd != null">
limit #{param.limitStart}, #{param.limitEnd}
</if>
order by b.CREATE_TIME desc
</select>
<!-- 导出商险明细项目变更日志统计 -->
<select id="getInsuranceChangeLogExportCount" resultType="long">
select
count(*)
from t_insurance_detail a
left join t_insurances_change_log b on a.ID = b.PRE_ID
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = 3
<if test="param.isEffect != null">
and a.IS_EFFECT = #{param.isEffect}
</if>
<if test="param.unitName != null and param.unitName.trim() != ''">
and a.UNIT_NAME like concat(replace(replace(#{param.unitName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.unitNo != null and param.unitNo.trim() != ''">
and a.UNIT_NO like concat(replace(replace(#{param.unitNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.createName != null and param.createName.trim() != ''">
and a.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyType != null">
and a.BUY_TYPE = #{param.buyType}
</if>
<if test="param.reduceHandleStatus != null">
and a.REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
</if>
<if test="param.empName != null and param.empName.trim() != ''">
and a.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and a.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and a.DEPT_NO = #{param.deptNo}
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and a.INSURANCE_COMPANY_NAME = #{param.insuranceCompanyName}
</if>
<if test="param.policyNo != null and param.policyNo.trim() != ''">
and a.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.policyJingQueStart != null and param.policyJingQueStart.trim() != ''">
AND DATE_FORMAT(a.POLICY_START,"%Y-%m-%d") = #{param.policyJingQueStart}
</if>
<if test="param.policyJingQueEnd != null and param.policyJingQueEnd.trim() != ''">
AND DATE_FORMAT(a.POLICY_END,"%Y-%m-%d") = #{param.policyJingQueEnd}
</if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and (
(a.POLICY_START <![CDATA[ >= ]]> #{param.policyStart} and a.POLICY_START <![CDATA[ <= ]]> #{param.policyEnd})
or (a.POLICY_END <![CDATA[ >= ]]> #{param.policyStart} and a.POLICY_END <![CDATA[ <= ]]> #{param.policyEnd})
or (a.POLICY_START <![CDATA[ <= ]]> #{param.policyStart} and a.POLICY_END <![CDATA[ >= ]]> #{param.policyEnd})
)
</if>
<if test="param.createStartTime != null and param.createStartTime.trim() != ''">
and a.CREATE_TIME <![CDATA[ >= ]]> #{param.createStartTime}
</if>
<if test="param.createEndTime != null and param.createEndTime.trim() != ''">
and a.CREATE_TIME <![CDATA[ <= ]]> #{param.createEndTime}
</if>
<if test="param.buyHandleStatus != null">
and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
</if>
<if test="param.isUse != null">
and a.IS_USE = #{param.isUse}
</if>
<if test="param.isOverdue != null">
and a.IS_OVERDUE = #{param.isOverdue}
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
and a.INVOICE_NO like concat('%',replace(replace(#{param.invoiceNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyId != null and param.insuranceCompanyId.trim() != ''">
and a.INSURANCE_COMPANY_ID = #{param.insuranceCompanyId}
</if>
<if test="param.deptNoList != null and param.deptNoList.size > 0">
and a.DEPT_NO in
<foreach collection="param.deptNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.isAdress != null and param.isAdress.trim() != ''">
and a.IS_ADRESS = #{param.isAdress}
</if>
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and a.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyStandardMin != null and param.buyStandardMin.trim() != ''">
AND a.BUY_STANDARD+0 <![CDATA[ >= ]]> #{param.buyStandardMin}+0
</if>
<if test="param.buyStandardMax != null and param.buyStandardMax.trim() != ''">
AND a.BUY_STANDARD+0 <![CDATA[ <= ]]> #{param.buyStandardMax}+0
</if>
<if test="param.authSql != null and param.authSql.trim() != ''">
${param.authSql}
</if>
and b.PRE_ID is not null
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancesChangeLogMapper">
<resultMap id="tInsurancesChangeLogMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancesChangeLog">
<id property="id" column="ID"/>
<result property="preId" column="PRE_ID"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="oldInfo" column="OLD_INFO"/>
<result property="newInfo" column="NEW_INFO"/>
<result property="differenceInfo" column="DIFFERENCE_INFO"/>
<result property="reason" column="reason"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.PRE_ID,
a.CREATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME,
a.OLD_INFO,
a.NEW_INFO,
a.DIFFERENCE_INFO,
a.reason
</sql>
<!--TInsurancesChangeLog简单分页查询-->
<select id="getTInsurancesChangeLoglList" resultMap="tInsurancesChangeLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurances_change_log a
where a.PRE_ID = #{preId}
order by a.create_time asc
</select>
<!--TInsurancesChangeLog简单分页查询-->
<select id="getInsuranceListPage" resultMap="tInsurancesChangeLogMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_insurances_change_log a
where 1=1
<if test="param.preId != null and param.preId.trim() != ''">
and a.PRE_ID = #{param.preId}
</if>
order by a.create_time asc
</select>
</mapper>
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.social.service.impl; package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
...@@ -45,7 +44,6 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper; ...@@ -45,7 +44,6 @@ import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysHouseHoldInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.SysHouseHoldInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService; import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService;
import com.yifu.cloud.plus.v1.yifu.social.service.TForecastLibraryService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.*; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -195,6 +193,11 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -195,6 +193,11 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
if (CommonConstants.ONE_STRING.equals(sysBaseSetInfo.getBaseType())) { if (CommonConstants.ONE_STRING.equals(sysBaseSetInfo.getBaseType())) {
type = CommonConstants.TWO_INT; type = CommonConstants.TWO_INT;
} }
//设置不更新字段
sysBaseSetInfo.setDepartId(old.getDepartId());
sysBaseSetInfo.setFundProList(old.getFundProList());
sysBaseSetInfo.setApplyDate(old.getApplyDate());
sysBaseSetInfo.setIsNew(old.getIsNew());
// 记录变更日志 // 记录变更日志
tSocialLogService.saveModificationRecord(type, old.getId(), old, sysBaseSetInfo); tSocialLogService.saveModificationRecord(type, old.getId(), old, sysBaseSetInfo);
return R.ok(); return R.ok();
...@@ -314,6 +317,8 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -314,6 +317,8 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
@Override @Override
public R<Boolean> updateByIdAsso(String id ,int status) { public R<Boolean> updateByIdAsso(String id ,int status) {
SysBaseSetInfo baseSetInfo = baseMapper.selectById(id); SysBaseSetInfo baseSetInfo = baseMapper.selectById(id);
SysBaseSetInfo oldSetInfo = baseMapper.selectById(id);
if (null == baseSetInfo){ if (null == baseSetInfo){
return R.failed("无对应ID的数据!"); return R.failed("无对应ID的数据!");
} }
...@@ -326,6 +331,9 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -326,6 +331,9 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
baseSetInfo.setStatus(status); baseSetInfo.setStatus(status);
int res = baseMapper.updateById(baseSetInfo); int res = baseMapper.updateById(baseSetInfo);
if (res >= 0){ if (res >= 0){
// 记录状态变更日志
tSocialLogService.saveModificationRecord(CommonConstants.ZERO_STRING.equals(baseSetInfo.getBaseType()) ? 1 : 2
, id, oldSetInfo, baseSetInfo);
return R.ok(); return R.ok();
}else { }else {
return R.failed(CommonConstants.RESULT_DATA_FAIL); return R.failed(CommonConstants.RESULT_DATA_FAIL);
......
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