Commit 21e5e43e authored by hongguangwu's avatar hongguangwu

商险加字段

parent 710dbe24
......@@ -322,8 +322,17 @@ public class TInsuranceDetail extends BaseEntity {
@ExcelIgnore
private String bpoFlag;
@Schema(description = "项目名称")
private String deptName;
@Schema(description ="客户id")
private String unitId;
@Schema(description ="客户名称")
private String unitName;
@Schema(description ="客户编码")
private String unitNo;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -183,4 +183,16 @@ public class InsuranceAddParam implements Serializable {
@Schema(description = "是否BPO", name = "bpoFlag")
@ExcelIgnore
private String bpoFlag;
@Schema(description = "项目名称")
private String deptName;
@Schema(description ="客户id")
private String unitId;
@Schema(description ="客户名称")
private String unitName;
@Schema(description ="客户编码")
private String unitNo;
}
......@@ -108,4 +108,16 @@ public class InsuranceReplaceParam implements Serializable {
@ExcelIgnore
private String bpoFlag;
@Schema(description = "项目名称")
private String deptName;
@Schema(description ="客户id")
private String unitId;
@Schema(description ="客户名称")
private String unitName;
@Schema(description ="客户编码")
private String unitNo;
}
......@@ -201,8 +201,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
menuUtil.setAuthSql(user, param);
IPage<InsuranceListVO> insuranceList;
insuranceList = baseMapper.getInsuranceListPage(page,param);
//根据项目编码获取项目名称
setProjectNameByDeptNo(insuranceList.getRecords());
// 购买月数
if (CollectionUtils.isNotEmpty(insuranceList.getRecords())){
insuranceList.getRecords().stream().forEach(e ->{
......@@ -229,8 +227,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
menuUtil.setAuthSql(user, param);
List<InsuranceListVO> insuranceList;
insuranceList = baseMapper.getInsuranceList(param);
//根据项目编码获取项目名称
setProjectNameByDeptNo(insuranceList);
// 购买月数
if (CollectionUtils.isNotEmpty(insuranceList)){
if(insuranceList.size() > CommonConstants.EXPORT_TWENTY_THOUSAND){
......@@ -263,8 +259,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setUpdateBy(user.getId());
}
IPage<InsuranceListVO> insuranceList = baseMapper.getInsuranceHandleListPage(page,param);
//根据项目编码获取项目名称
setProjectNameByDeptNo(insuranceList.getRecords());
// 购买月数
if (CollectionUtils.isNotEmpty(insuranceList.getRecords())){
insuranceList.getRecords().stream().forEach(e ->{
......@@ -436,6 +430,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setEmpIdcardNo(success.getReplaceEmpIdcardNo());
newDetail.setDeptNo(success.getReplaceDeptNo());
newDetail.setDeptId(success.getDeptId());
newDetail.setBpoFlag(success.getBpoFlag());
newDetail.setDeptName(success.getDeptName());
newDetail.setUnitId(success.getUnitId());
newDetail.setUnitName(success.getUnitName());
newDetail.setUnitNo(success.getUnitNo());
//替换项目的结算方式
newDetail.setSettleType(success.getSettleType());
newDetail.setPost(success.getPost());
......@@ -938,6 +937,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateTime(LocalDateTime.now());
if (Common.isNotNull(jsonObject)){
detail.setDeptId(jsonObject.getId());
detail.setDeptName(jsonObject.getDepartName());
detail.setUnitId(jsonObject.getCustomerId());
detail.setUnitName(jsonObject.getCustomerName());
detail.setUnitNo(jsonObject.getCustomerCode());
}
detailList.add(detail);
}
......@@ -1036,6 +1039,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
|| detail.getBuyHandleStatus() == CommonConstants.FIVE_INT){
InsuranceListVO listVO = new InsuranceListVO();
BeanCopyUtils.copyProperties(detail,listVO);
listVO.setProjectName(detail.getDeptName());
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_IS_NOT_ALLOW);
errorList.add(listVO);
}else if(detail.getBuyHandleStatus() == CommonConstants.THREE_INT
......@@ -1043,6 +1047,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
|| detail.getReduceHandleStatus() == CommonConstants.TWO_INT))){
InsuranceListVO listVO = new InsuranceListVO();
BeanCopyUtils.copyProperties(detail,listVO);
listVO.setProjectName(detail.getDeptName());
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW);
errorList.add(listVO);
}else{
......@@ -1170,8 +1175,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//更新状态
this.saveOrUpdateBatch(successList);
}
//根据项目编码获取项目名称
setProjectNameByDeptNo(errorList);
//操作记录
addOperate(operateList,user,InsurancesConstants.ROLLBACK);
return R.ok(errorList,InsurancesConstants.OPERATE_SUCCESS);
......@@ -1254,6 +1257,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(detail.getBuyHandleStatus() != CommonConstants.TWO_INT){
InsuranceListVO listVO = new InsuranceListVO();
BeanCopyUtils.copyProperties(detail,listVO);
listVO.setProjectName(detail.getDeptName());
listVO.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_NOT_TWO);
errorList.add(listVO);
}else {
......@@ -1383,8 +1387,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
});
}
//根据项目编码获取项目名称
setProjectNameByDeptNo(errorList);
//操作记录
if (CollectionUtils.isNotEmpty(successList)){
for (TInsuranceDetail detail : successList) {
......@@ -1946,6 +1948,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptId(projectSetInfoVo.getId());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
......@@ -2702,6 +2708,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setSettleType(Integer.parseInt(settleType));
param.setDeptId(projectSetInfoVo.getId());
param.setBpoFlag(projectSetInfoVo.getBpoFlag());
param.setDeptName(projectSetInfoVo.getDepartName());
param.setUnitId(projectSetInfoVo.getCustomerId());
param.setUnitName(projectSetInfoVo.getCustomerName());
param.setUnitNo(projectSetInfoVo.getCustomerCode());
}
}
}
......@@ -3143,37 +3153,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return String.valueOf(RedisUtil.redis.opsForValue().get(CacheConstants.AREA_VALUE + areaString));
}
/**
* 根据项目编码获取项目名称
*
* @author licancan
* @param insuranceList
* @return void
*/
private void setProjectNameByDeptNo(List<InsuranceListVO> insuranceList) {
if (CollectionUtils.isNotEmpty(insuranceList)){
List<String> collect = insuranceList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
try{
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (data != null) {
for (InsuranceListVO record : insuranceList) {
ProjectSetInfoVo jsonObject = data.get(record.getDeptNo());
if (null != jsonObject) {
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
}
}
}
}
}catch (Exception e){
for (InsuranceListVO record : insuranceList) {
record.setProjectName(CommonConstants.EMPTY_STRING);
}
}
}
}
/**
* 操作记录(无审批remark)
*
......
......@@ -58,6 +58,10 @@
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
<result property="deptId" column="DEPT_ID" jdbcType="VARCHAR"/>
<result property="bpoFlag" column="BPO_FLAG" jdbcType="VARCHAR"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="unitId" column="UNIT_ID" jdbcType="VARCHAR"/>
<result property="unitName" column="UNIT_NAME" jdbcType="VARCHAR"/>
<result property="unitNo" column="UNIT_NO" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,EMP_NAME,
......@@ -71,7 +75,9 @@
BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS,
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME,BPO_FLAG,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME,
DEPT_NAME,UNIT_ID,UNIT_NAME,UNIT_NO
</sql>
<!--投保分页查询-->
......@@ -92,7 +98,8 @@
a.BUY_HANDLE_STATUS as buyHandleStatus,
a.SETTLE_TYPE as settleType,
a.CREATE_USER_DEPT_NAME as createUserDeptName,
a.SETTLE_MONTH as settleMonth
a.SETTLE_MONTH as settleMonth,
a.DEPT_NAME as projectName
from t_insurance_detail a
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on p.USER_ID = #{param.createBy}
......@@ -157,7 +164,8 @@
a.CREATE_NAME as createName,
a.BUY_HANDLE_STATUS as buyHandleStatus,
a.SETTLE_TYPE as settleType,
a.SETTLE_MONTH as settleMonth
a.SETTLE_MONTH as settleMonth,
a.DEPT_NAME as projectName
from t_insurance_detail a
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on p.USER_ID = #{param.createBy}
......@@ -218,7 +226,8 @@
a.CREATE_NAME as createName,
a.BUY_HANDLE_STATUS as buyHandleStatus,
a.SETTLE_TYPE as settleType,
a.SETTLE_MONTH as settleMonth
a.SETTLE_MONTH as settleMonth,
a.DEPT_NAME as projectName
from t_insurance_detail a
<if test="param.authSql != null and param.authSql.trim() != ''">
left join t_insurance_area_res p on p.USER_ID = #{param.createBy}
......
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