Commit 74286c55 authored by hongguangwu's avatar hongguangwu

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

parents 6d88f779 d5261b13
......@@ -44,7 +44,7 @@ spec: # 资源规范字段
kubernetes.io/hostname: yfmaster1
containers: # 容器
- name: yifu-insurances # 容器的名字
image: hub.yifucenter.com:5500/qas-mvp/yifu-insurances-biz:1.0.0 # 容器镜像地址
image: 192.168.1.110:5500/qas-mvp/yifu-insurances-biz:1.0.0 # 容器镜像地址
imagePullPolicy: Never # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
......
......@@ -9,6 +9,17 @@ import java.io.Serializable;
* @Author fxj
* @Date 2022/8/5
* @Description
* 派增:
* * 1、派单处社保或公积金状态为待审核、待办理、办理中,项目档案处社保或公积金状态为处理中1;
* * 2、派单处社保或公积金状态为审核不通过或办理失败,项目档案处社保状态为无社保,公积金状态为无公积金0;
* * 3、派单处社保状态为部分办理失败,项目档案处社保状态为部分购买 2
* * 4、派单处社保或公积金状态为办理成功,项目档案处社保或公积金状态为正常 3
* * 派减:
* * 1、派减状态为待审核、待办理、审核不通过、办理失败,项目档案处社保或公积金状态不变;
* * 2、派减状态为办理成功,项目档案处社保或公积金状态变为已派减 4
* * 人员档案处社保或公积金状态根据身份证+项目进行整合:
* * 社保状态优先级:正常>部分购买>处理中>已派减>无社保
* * 公积金状态优先级:正常>处理中>已派减>无公积金
* @Version 1.0
*/
@Data
......
......@@ -56,12 +56,12 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
* @Author fxj
* @Date 2019-10-17
* @param empId
* @param deptId
* @param deptNo
* @param id
* @param status
* @return
**/
int updateInUseStatusById(@Param("empId")String empId, @Param("deptId")String deptId
int updateInUseStatusById(@Param("empId")String empId, @Param("deptNo")String deptNo
, @Param("id")String id, @Param("status")String status);
/**
......
......@@ -97,7 +97,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
String getCode(boolean isNew);
boolean updateInUseStatusById(String empId, String deptId, String ContractId);
boolean updateInUseStatusById(String empId, String deptNo, String ContractId);
/**
* @param tEmployeeContractInfo
......
......@@ -406,8 +406,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
@Override
public boolean updateInUseStatusById(String empId,String deptId,String ContractId){
return baseMapper.updateInUseStatusById(empId, deptId, ContractId, CommonConstants.ONE_STRING) >0;
public boolean updateInUseStatusById(String empId,String deptNo,String ContractId){
return baseMapper.updateInUseStatusById(empId, deptNo, ContractId, CommonConstants.ONE_STRING) >0;
}
@Override
public R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo) {
......
......@@ -2129,14 +2129,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.eq(TEmployeeContractInfo::getDispatchFlag,CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(c)){
//审核通过
if (CommonConstants.ZERO_STRING.equals(vo.getType())){
c.setAuditStatus(CommonConstants.TWO_INT);
c.setInUse(CommonConstants.ZERO_STRING);
contractServicer.updateInUseStatusById(c.getEmpId(),c.getDeptNo(),c.getId());
//审核不同
}else if (CommonConstants.ONE_STRING.equals(vo.getType())){
c.setAuditStatus(CommonConstants.THREE_INT);
c.setInUse(CommonConstants.ONE_STRING);
}
contractServicer.updateInUseStatusById(c.getEmpId(),c.getDeptNo(),c.getSettleDomain());
contractServicer.updateById(c);
}
......
......@@ -455,7 +455,7 @@
<update id="updateInUseStatusById">
update t_employee_contract_info
set IN_USE = #{status}
where EMP_ID = #{empId} and SETTLE_DOMAIN = #{deptId} and ID != #{id}
where EMP_ID = #{empId} and DEPT_NO = #{deptNo} and ID != #{id}
</update>
<!-- 获取当日最大的编码 -->
......
......@@ -488,4 +488,8 @@ public interface ErrorCodes {
* 派增异常: 同一身份证不可分多行派单
*/
String EMP_DISPATCH_EXIST = "emp_dispatch_exist";
/**
* 派增异常: 已存在兼职工伤,请派减后再派增五险
*/
String EMP_DISPATCH_SOCIAL_INJURY_EXISTING_LIMIT = "emp.dispatch.social.injury.existing.limit";
}
......@@ -187,6 +187,8 @@ emp.dispatch.emp.mobile.repeat=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5DF2\u5B58\u5728
emp_dispatch_exist=\u6D3E\u589E\u5F02\u5E38\uFF1A \u540C\u4E00\u8EAB\u4EFD\u8BC1\u4E0D\u53EF\u5206\u591A\u884C\u6D3E\u5355
emp.dispatch.social.injury.existing.limit=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5DF2\u5B58\u5728\u517C\u804C\u5DE5\u4F24\uFF0C\u8BF7\u6D3E\u51CF\u540E\u518D\u6D3E\u589E\u4E94\u9669
......
......@@ -226,6 +226,17 @@ public class ArchivesDaprUtil {
/**
* @Author fxj
* @Description 更新项目档案和人员档案的社保公积金状态
* 派增:
* * 1、派单处社保或公积金状态为待审核、待办理、办理中,项目档案处社保或公积金状态为处理中1;
* * 2、派单处社保或公积金状态为审核不通过或办理失败,项目档案处社保状态为无社保,公积金状态为无公积金0;
* * 3、派单处社保状态为部分办理失败,项目档案处社保状态为部分购买 2
* * 4、派单处社保或公积金状态为办理成功,项目档案处社保或公积金状态为正常 3
* * 派减:
* * 1、派减状态为待审核、待办理、审核不通过、办理失败,项目档案处社保或公积金状态不变;
* * 2、派减状态为办理成功,项目档案处社保或公积金状态变为已派减 4
* * 人员档案处社保或公积金状态根据身份证+项目进行整合:
* * 社保状态优先级:正常>部分购买>处理中>已派减>无社保
* * 公积金状态优先级:正常>处理中>已派减>无公积金
* @Date 19:30 2022/8/1
* @Param type 0 审核通过 1 审核不通过
* @return
......
......@@ -789,5 +789,10 @@ public class InsurancesConstants {
*/
public static final String NO_UPDATE_DETAIL_JURISDICTION = "无更新当前保单信息的权限";
/**
* 保单信息已过期,不能进行出险操作
*/
public static final String INSURANCES_DETAIL_IS_OVERDUE_ERROR = "保单信息已过期,不能进行出险操作";
}
package com.yifu.cloud.plus.v1.yifu.insurances.util;
import cn.hutool.json.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EKPInteractiveParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.TInsuranceSettlePushParam;
import org.springframework.core.io.FileSystemResource;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.io.File;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* @author zhaji
......@@ -16,39 +25,158 @@ import java.io.File;
*
* @date 2022-08-05 09:42:33
*/
@Slf4j
@Component
public class EKPUtil {
@Getter
public static String url;
@Getter
public static String LoginName;
@Getter
private static String fdModelId;
@Getter
private static String fdFlowId;
@Getter
private static String docStatus;
@Getter
private static String docSubject;
@Value("${ekp.url}")
public void setUrl(String db) {
url = db;
}
@Value("${ekp.LoginName}")
public void setLoginName(String db) {
LoginName = db;
}
@Value("${ekp.fdModelId}")
public void setFdModelId(String db) {
fdModelId = db;
}
@Value("${ekp.fdFlowId}")
public void setFdFlowId(String db) {
fdFlowId = db;
}
@Value("${ekp.docStatus}")
public void setDocStatus(String db) {
docStatus = db;
}
@Value("${ekp.docSubject}")
public void setDocSubject(String db) {
docSubject = db;
}
/**
* 多层级的VO对象,且包含上传功能的样例
* 注意key的书写格式,类似EL表达式的方式,属性关系用'.', 列表和数组关系用[],Map关系用["xxx"]
*/
public static void testAddNewsInRestTemplate() throws Exception{
public static String sendToEKP(EKPInteractiveParam param){
System.out.println("开始推送EKP");
RestTemplate yourRestTemplate = new RestTemplate();
TInsuranceSettlePushParam formValues = new TInsuranceSettlePushParam();
String jsonObject = new ObjectMapper().writeValueAsString(formValues);
TInsuranceSettlePushParam pushParam = InsuranceDetail2PushParam(param);
try{
String formValues = new ObjectMapper().writeValueAsString(pushParam);
//指向EKP的接口url
String url = "http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel";
//把ModelingAppModelParameterAddForm转换成MultiValueMap
JSONObject loginName = new JSONObject();
loginName.append("LoginName",LoginName);
String loginData = new ObjectMapper().writeValueAsString(loginName);
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject", new String("接口发起流程".getBytes("UTF-8"),"ISO-8859-1") );
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docStatus", 20);
wholeForm.add("fdModelId", "181d73279372e5a55438a47d7436ab7e");
wholeForm.add("fdFlowId", "18267f206233f29cbd3c5ee425c9408a");
wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") );
//wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docCreator", loginData);
wholeForm.add("docStatus", docStatus);
wholeForm.add("fdModelId", fdModelId);
wholeForm.add("fdFlowId", fdFlowId);
//wholeForm.add("formValues", new String(formValues.getBytes("UTF-8"),"ISO-8859-1"));
wholeForm.add("formValues", new String("{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
//wholeForm.add("formValues", new String("{\"fd_3adfe6af71a1cc\":\"王五\", \"fd_3adfe658c6229e\":\"2019-03-26\", \"fd_3adfe6592b4158\":\"这里内容\"}".getBytes("UTF-8"),"ISO-8859-1") );
System.out.println("wholeForm:"+wholeForm);
HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
//有返回值的情况 VO可以替换成具体的JavaBean
System.out.println("交易开始");
ResponseEntity<String> obj = yourRestTemplate.exchange(url, HttpMethod.POST, entity, String.class);
System.out.println("交易结束");
System.out.println("obj"+obj);
String body = obj.getBody();
System.out.println(body);
if (StringUtils.isBlank(body)){
System.out.println("交易失败"+body);
return body;
}else{
System.out.println("交易成功"+body);
return body;
}
}catch (Exception e){
log.info(e.toString());
return e.getMessage();
}
}
public static TInsuranceSettlePushParam InsuranceDetail2PushParam(EKPInteractiveParam param){
String format = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
TInsuranceSettlePushParam pushParam = new TInsuranceSettlePushParam();
//单据类型
pushParam.setFd_3adfe6af71a1cc(param.getSettleType());
//项目编码
pushParam.setFd_3adfe658c6229e(param.getDeptNo());
//项目名称
pushParam.setFd_3adfe6592b4158(param.getDeptName());
//客户编码
pushParam.setFd_3adfe6598281e8(param.getCustomerCode());
//客户名称
pushParam.setFd_3adfe7a2688902(param.getCustomerName());
//发生日期
pushParam.setFd_3adfe67c24dace(format);
//姓名
pushParam.setFd_3adfe65d759650(param.getEmpName());
//身份证号
pushParam.setFd_3adfe65dbd9f68(param.getEmpIdcardNo());
//发票号
pushParam.setFd_3adfe65e0cd094(param.getInvoiceNo());
//险种
pushParam.setFd_3adfe65f6599e4(param.getInsuranceTypeName());
//保险公司
pushParam.setFd_3adfe65ea04728(param.getInsuranceCompanyName());
//保单号
pushParam.setFd_3adfe65e60e110(param.getPolicyNo());
//保险开始日期
pushParam.setFd_3adfe6b7e0ede8(param.getPolicyStart().toString());
//保险结束日期
pushParam.setFd_3adfe6b847bfe6(param.getPolicyEnd().toString());
//购买标准
pushParam.setFd_3adfe6d55384c6(param.getBuyStandard());
//实际保费
pushParam.setFd_3adfe6610c0d2c(param.getActualPremium());
//医保
pushParam.setFd_3adfe66041a996(param.getMedicalQuota());
//事故或残疾
pushParam.setFd_3adfe6609aa810(param.getDieDisableQuota());
//预估保费
pushParam.setFd_3adfe6e30f2a3c(param.getEstimatePremium());
//结算月
pushParam.setFd_3aea2f0180eccc(param.getSettleMonth());
return pushParam;
}
}
}
......@@ -14,7 +14,7 @@ import java.io.Serializable;
@Data
@Tag(name = "项目类")
public class Dept implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 项目编码
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
/**
* @author zhaji
* @description TODO
* @date 2022-08-08 17:59:20
*/
@Data
public class EKP {
@Value("${ekp.url}")
private String url;
@Value("${ekp.fdModelId}")
private String fdModelId;
@Value("${ekp.fdFlowId}")
private String fdFlowId;
@Value("${ekp.docStatus}")
private String docStatus;
@Value("${ekp.docSubject}")
private String docSubject;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
/**
* @author zhaji
* @description EKP交互类
* @date 2022-08-09 11:09:12
*/
@Data
public class EKPInteractiveParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键")
private String id;
/**
* 单据类型 (0、与薪资合并结算 1、单独结算)
*/
@Schema(description = "单据类型 (0、预估单 1、实缴单)")
private Integer settleType;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String customerName;
/**
* 客户编码
*/
@Schema(description = "客户编码")
private String customerCode;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 发票号
*/
@Schema(description = "发票号")
private String invoiceNo;
/**
* 发生日期
*/
@Schema(description = "发生日期")
private Date happenDate;
/**
* 保单编号
*/
@Schema(description = "保单编号")
private String policyNo;
/**
* 保险公司名称(冗余字段)
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 保单开始时间
*/
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 医疗额度
*/
@Schema(description = "医疗额度")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 实际保费
*/
@Schema(description = "实际保费")
private BigDecimal actualPremium;
/**
* 预估保费
*/
@Schema(description = "预估保费")
private BigDecimal estimatePremium;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
/**
* 单据状态
*/
@Schema(description = "状态:1新增结算单,2作废结算信息,3更新保单信息")
private Integer interactiveType;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.cglib.core.Local;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
/**
* @author zhaji
......@@ -11,160 +18,200 @@ import java.time.LocalDate;
* @date 2022-08-05 10:32:16
*/
@Data
public class TInsuranceSettlePushParam {
public class TInsuranceSettlePushParam{
/**
* ID主键 36位
*/
private String fd_id ;
/**
* 单据类型 200 单选(预估单,实缴单,差异单)
* 单据类型 200 单选(1,预估单,2,实缴单,3,差异单)
*/
private String fd_3adfe6af71a1cc;
@Schema(description = "单据类型")
private Integer fd_3adfe6af71a1cc;
/**
* 项目编码 200
*/
@Schema(description = "项目编码")
private String fd_3adfe658c6229e;
/**
* 项目名称 200
*/
@Schema(description = "项目名称")
private String fd_3adfe6592b4158;
/**
* 单号 200
*/
@Schema(description = "单号")
private String fd_3adfe67a9f6364;
/**
* 客户编码 200
*/
@Schema(description = "客户编码")
private String fd_3adfe6598281e8;
/**
* 客户名称 200
*/
@Schema(description = "客户名称")
private String fd_3adfe7a2688902;
/**
* 发生日期 "xxxx--xx--xx"
*/
private LocalDate fd_3adfe67c24dace;
@Schema(description = "发生日期")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private String fd_3adfe67c24dace;
/**
* 姓名 200
*/
@Schema(description = "姓名")
private String fd_3adfe65d759650;
/**
* 身份证号 200
*/
@Schema(description = "身份证号")
private String fd_3adfe65dbd9f68;
/**
* 发票号 200
*/
@Schema(description = "发票号")
private String fd_3adfe65e0cd094;
/**
* 险种 200
*/
@Schema(description = "险种")
private String fd_3adfe65f6599e4;
/**
* 保险公司 200
*/
@Schema(description = "保险公司")
private String fd_3adfe65ea04728;
/**
* 保单号 200
*/
@Schema(description = "保单号")
private String fd_3adfe65e60e110;
/**
* 保险开始日期 "xxxx--xx--xx"
*/
private LocalDate fd_3adfe6b7e0ede8;
@Schema(description = "保险开始日期")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private String fd_3adfe6b7e0ede8;
/**
* 保险结束日期 "xxxx--xx--xx"
*/
private LocalDate fd_3adfe6b847bfe6;
@Schema(description = "保险结束日期")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private String fd_3adfe6b847bfe6;
/**
* 购买标准 精确到小数点后两位
*/
private Double fd_3adfe6d55384c6;
@Schema(description = "购买标准")
private String fd_3adfe6d55384c6;
/**
* 实际保费 精确到小数点后两位
*/
private Double fd_3adfe6610c0d2c;
@Schema(description = "实际保费")
private BigDecimal fd_3adfe6610c0d2c;
/**
* 医保 精确到小数点后两位
*/
private Double fd_3adfe66041a996;
@Schema(description = "医保")
private String fd_3adfe66041a996;
/**
* 事故或残疾 200
*/
@Schema(description = "事故或残疾")
private String fd_3adfe6609aa810;
/**
* 应收 精确到小数点后两位
* 预估保费(应收) 精确到小数点后两位
*/
private Double fd_3adfe6e30f2a3c;
@Schema(description = "预估保费")
private BigDecimal fd_3adfe6e30f2a3c;
/**
* 应收 200 单选(已结算,结算中,未结算)
* 结算状态 200 单选(1未结算,2结算中,3已结算)
*/
@Schema(description = "结算状态")
private String fd_3adfe6ec6a8cbe;
/**
* 收款状态 200 单选(已收,未收)
* 收款状态 200 单选(1未收,2已收)
*/
@Schema(description = "收款状态")
private String fd_3adfe6ef5dfaac;
/**
* 收入结算单号 200
*/
@Schema(description = "收入结算单号")
private String fd_3adfe79fd04606;
/**
* 收款认领单号 200
*/
@Schema(description = "收款认领单号")
private String fd_3adfe7a117f086;
/**
* 应支出 精确到小数点后两位
*/
@Schema(description = "应支出")
private Double fd_3adfe6e3911ffe;
/**
* 支出结算状态 200 单选(已结算,结算中,未结算)
*/
@Schema(description = "支出结算状态")
private String fd_3adfe6eda67236;
/**
* 付款状态 200 单选(已收,未收)
*/
@Schema(description = "付款状态")
private String fd_3adfe6f05531ec;
/**
* 支出结算单号 200
*/
@Schema(description = "支出结算单号")
private String fd_3adfe7a035849c;
/**
* 付款单号 200
*/
@Schema(description = "付款单号")
private String fd_3adfe7a08eba96;
/**
* 结算月份 200
*/
@Schema(description = "结算月份")
private String fd_3aea2f0180eccc;
/**
* 状态 200
*/
@Schema(description = "状态1新增结算单,2作废结算信息,3更新保单信息")
private String fd_3af9197b31071c;
}
......@@ -442,8 +442,8 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "查询项目列表", description = "查询项目列表")
@GetMapping("/deptList")
public R getDeptList() {
return tInsuranceDetailService.getDeptListByUser();
public R getDeptList(){
return tInsuranceDetailService.getDeptList();
}
/**
......
......@@ -42,6 +42,9 @@ import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
......@@ -405,12 +408,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
BeanCopyUtils.copyProperties(detail,newDetail);
detail.setIsEffect(CommonConstants.ONE_INT);
detail.setIsOverdue(null);
detail.setUpdateTime(LocalDateTime.now());
this.updateById(detail);
//新数据置为待办理
newDetail.setId(null);
......@@ -445,7 +449,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace.setToInsuranceDetailId(newDetail.getId());
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(one).isPresent()){
......@@ -547,6 +550,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(!LocalDateUtil.isDate(param.getPolicyEnd(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_END_PARSE_ERROR);
}
if (!LocalDateUtil.compareDate(param.getPolicyStart(),param.getPolicyEnd())){
return R.failed(InsurancesConstants.POLICY_START_SHOULD_LESS_THAN_POLICY_END);
}
//如果不是补单的,需要校验:保单开始日期 > 当前派单日期
if (byId.getSignFlag() == CommonConstants.ZERO_INT){
if(!LocalDateUtil.isFutureDate(param.getPolicyStart())){
......@@ -557,7 +565,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceCompany::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(insuranceCompany).isPresent()){
......@@ -570,7 +577,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceType::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(insuranceType).isPresent()){
......@@ -581,7 +587,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeStandard::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeStandard).isPresent()){
......@@ -602,7 +607,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeRate::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeRate).isPresent()){
......@@ -638,7 +642,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetail).isPresent() && !insuranceDetail.getId().equals(param.getId())){
......@@ -674,7 +678,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
......@@ -714,7 +718,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail insuranceDetail = this.getById(one.getFromInsuranceDetailId());
......@@ -727,7 +730,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//被替换者无效
insuranceDetail.setIsEffect(CommonConstants.ONE_INT);
insuranceDetail.setIsOverdue(CommonConstants.ONE_INT);
insuranceDetail.setIsOverdue(null);
insuranceDetail.setUpdateTime(LocalDateTime.now());
this.updateById(insuranceDetail);
//替换记录成功
......@@ -854,7 +857,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO.setRemark(InsurancesConstants.ADD);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId());
......@@ -937,7 +939,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
//替换记录变为失败
......@@ -1046,6 +1047,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
successList.add(detail);
}else{
//根据结算类型判断是否需要计算预估保费
......@@ -1066,6 +1068,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
......@@ -1099,6 +1102,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
......@@ -1128,6 +1132,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
successList.add(detail);
}
}
......@@ -1182,7 +1187,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (StringUtils.isNotBlank(success.getInvoiceNo())){
......@@ -1477,7 +1482,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceCompany::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(insuranceCompany).isPresent()){
......@@ -1492,7 +1496,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceType::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(insuranceType).isPresent()){
......@@ -1505,7 +1508,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeStandard::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeStandard).isPresent()){
......@@ -1528,7 +1530,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeRate::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeRate).isPresent()){
......@@ -1578,7 +1579,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetail).isPresent()){
......@@ -1617,7 +1618,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
......@@ -1850,7 +1851,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(limitOne).isPresent()){
......@@ -1866,7 +1867,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceCompany::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(insuranceCompany).isPresent()){
......@@ -1881,7 +1881,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceType::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(insuranceType).isPresent()){
......@@ -1894,7 +1893,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeStandard::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeStandard).isPresent()){
......@@ -1917,7 +1915,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeRate::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(typeRate).isPresent()){
......@@ -1978,7 +1975,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(insuranceDetail).isPresent()){
......@@ -2184,7 +2181,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(detail).isPresent()){
......@@ -2270,7 +2267,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(replace).isPresent()){
......@@ -2308,7 +2305,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue)
)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
......@@ -2410,7 +2407,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(detail).isPresent()){
......@@ -2445,7 +2442,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail batchPolicyNo = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (!Optional.ofNullable(batchPolicyNo).isPresent()){
......@@ -2469,7 +2466,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail addPolicyNo = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL)
);
if (Optional.ofNullable(addPolicyNo).isPresent()){
......@@ -2870,7 +2867,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override
@Transactional(rollbackFor = Exception.class)
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList;
//todo 根据登录人获取数据权限
......@@ -2908,9 +2904,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceRefund refund = new TInsuranceRefund();
detail.setId(record.getId());
//update状态由「待减员」置为「减员中」
detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detailList.add(detail);
refund.setInsDetailId(record.getId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT);
......@@ -2924,9 +2919,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
for (TInsuranceDetail s : detailList) {
updateWrapper.eq(TInsuranceDetail :: getId,s.getId())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT)
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
update(updateWrapper);
}
}
......@@ -2980,8 +2973,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}else{
if (CommonConstants.ZERO_INT == deleteFlag ){
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setIsOverdue(null);
......@@ -2990,8 +2981,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
}
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
successList.add(tInsuranceDetail);
//新增减员记录
//更新减员记录
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
......@@ -3026,33 +3018,53 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Transactional(rollbackFor = Exception.class)
@Override
public R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
//初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(settleMonthCheckList)){
return R.failed(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
}
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList,user);
//todo 生成EKP通知,通知ekp变更结算月份
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
if(CollectionUtils.isNotEmpty(successList)){
for (SettleMonthChangeCheckParam success : successList) {
List<EKPInteractiveParam> deptDetail = getDeptDetail(successList);
for (EKPInteractiveParam ekpInteractiveParam : deptDetail) {
threadPool.execute(() -> {
TInsuranceDetail byId = getById(ekpInteractiveParam.getId());
BeanCopyUtils.copyProperties(byId,ekpInteractiveParam);
String body = EKPUtil.sendToEKP(ekpInteractiveParam);
System.out.println("变更成功后的id为:"+body);
if (!StringUtils.isBlank(body)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId())
.set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth())
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId());
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate);
System.out.println("返回的id为:"+body);
}else{
System.out.println("更新EKP结算月份失败");
for (SettleMonthChangeCheckParam success: successList ){
if(success.getId().equals(ekpInteractiveParam.getId())){
success.setErrorMessage("更新EKP结算月份失败");
errorList.add(success);
}
}
}
});
}
}
tInsuranceOperateService.saveBatch(operateList);
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
return R.ok(errorList,"导入成功");
}
......@@ -3073,9 +3085,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList,user);
//todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>();
List<TInsuranceOperate> operateList = new ArrayList<>(16);
List<TInsuranceDetail> detailList = new ArrayList<>(16);
if(CollectionUtils.isNotEmpty(successList)){
for (DeptChangeCheckParam success : successList) {
TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
Integer oldSettleType = success.getOldSettleType();
Integer newSettleType = success.getNewSettleType();
......@@ -3382,38 +3396,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE);
operateList.add(insuranceOperate);
detailList.add(one);
}
}
tInsuranceOperateService.saveBatch(operateList);
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
try{
EKPUtil.testAddNewsInRestTemplate();
}catch (Exception e){
System.out.println(e.getMessage());
}
//EKPUtil.testAddNewsInRestTemplate(detailList);
return R.ok(errorList,"导入成功");
}
/**
* 发送变更结算月至EKP
*
* @author zhaji
* @param successList
* @return void
*/
private void updateMonth2EKP(List<DeptChangeCheckParam> successList) {
for (DeptChangeCheckParam param : successList) {
String newDeptNo = param.getNewDeptNo();
String oldDeptNo = param.getOldDeptNo();
Integer newSettleType = param.getNewSettleType();
Integer oldSettleType = param.getOldSettleType();
String defaultSettleId = param.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId) && CommonConstants.ZERO_INT == newSettleType){
}
}
}
/**
* 发送变更项目至EKP
*
......@@ -3421,18 +3412,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param successList
* @return void
*/
private void updateDept2EKP(List<DeptChangeCheckParam> successList) {
for (DeptChangeCheckParam param : successList) {
String newDeptNo = param.getNewDeptNo();
String oldDeptNo = param.getOldDeptNo();
Integer newSettleType = param.getNewSettleType();
Integer oldSettleType = param.getOldSettleType();
String defaultSettleId = param.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId) && CommonConstants.ZERO_INT == newSettleType){
private void updateDeptNo2EKP(List<TInsuranceDetail> successList) {
for (TInsuranceDetail param : successList) {
}
}
}
/**
* 发送作废信息至EKP
......@@ -3637,7 +3621,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
......@@ -3808,6 +3792,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16);
List<SettleMonthChangeCheckParam> errorList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = new ArrayList<>();
List<EKPInteractiveParam> ekpList = new ArrayList<>();
for (SettleMonthChangeCheckParam param : settleMonthCheckList) {
//员工姓名
String empName = param.getEmpName();
......@@ -3830,6 +3815,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param);
continue;
}
//项目所属权限验证
if(!deptNoList.stream().anyMatch(u ->u.equals(deptNo))){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
errorList.add(param);
......@@ -3910,7 +3896,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) )
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
......@@ -4000,6 +3986,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param.setId(insuranceDetail.getId());
EKPInteractiveParam ekpInteractiveParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(insuranceDetail,ekpInteractiveParam);
ekpInteractiveParam.setSettleMonth(settleMonth);
ekpList.add(ekpInteractiveParam);
successList.add(param);
}
map.put("errorList",errorList);
......@@ -4159,7 +4149,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime)
.orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
......@@ -4286,7 +4276,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public R getDeptList(){
List<Dept> deptList = new ArrayList<>();
List<TInsuranceDetail> detailList = new ArrayList<>();
//EKPUtil.testAddNewsInRestTemplate(detailList);
/* List<Dept> deptList = new ArrayList<>();
R<TSettleDomainListVo> tSettleDomainListVoR = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (null != tSettleDomainListVoR && tSettleDomainListVoR.getCode() == CommonConstants.SUCCESS && Common.isNotNull(tSettleDomainListVoR.getData())) {
TSettleDomainListVo data = tSettleDomainListVoR.getData();
......@@ -4299,7 +4291,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
return R.ok(deptList);
return R.ok(deptList);*/
return R.ok();
}
/**
......@@ -4433,5 +4426,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return sql;
}
/**
* 获取项目名称,客户编码,客户名称
*
* @author zhaji
* @param list
* @return {@link List< EKPInteractiveParam>}
*/
public List<EKPInteractiveParam> getDeptDetail(List<SettleMonthChangeCheckParam> list){
//根据项目编码获取项目名称
List<String> collect = list.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
List<EKPInteractiveParam> ekpInteractiveParams = new ArrayList<>();
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
EKPInteractiveParam ekpInteractiveParam = new EKPInteractiveParam();
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
for (SettleMonthChangeCheckParam param : list) {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
ekpInteractiveParam.setId(param.getId());
ekpInteractiveParam.setDeptName(projectSetInfoVo.getDepartName());
ekpInteractiveParam.setCustomerName(projectSetInfoVo.getCustomerName());
ekpInteractiveParam.setCustomerCode(projectSetInfoVo.getCustomerCode());
ekpInteractiveParams.add(ekpInteractiveParam);
}
}
return ekpInteractiveParams;
}
}
......@@ -15,3 +15,10 @@ spring:
username: root
password: yf_zsk
url: jdbc:mysql://192.168.1.65:22306/mvp_insurances?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
ekp:
url: http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
fdModelId: '181d73279372e5a55438a47d7436ab7e'
fdFlowId: '18267f206233f29cbd3c5ee425c9408a'
docStatus: '20'
LoginName: 'admin'
docSubject : '接口发起流程'
\ No newline at end of file
......@@ -39,9 +39,9 @@ import java.util.Date;
*/
@Data
@TableName("t_approval_record")
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode()
@Schema(description = "审批记录表")
public class TApprovalRecord extends BaseEntity {
public class TApprovalRecord {
/**
* 主键
......@@ -60,8 +60,7 @@ public class TApprovalRecord extends BaseEntity {
/**
* 节点id
*/
@ExcelAttribute(name = "节点id", isNotEmpty = true, errorInfo = "节点id不能为空", maxLength = 32)
@NotBlank(message = "节点id不能为空")
@ExcelAttribute(name = "节点id", maxLength = 32)
@Length(max = 32, message = "节点id不能超过32个字符")
@ExcelProperty("节点id")
private String nodeId;
......
......@@ -128,13 +128,13 @@ public class TSalaryEmployee extends BaseEntity {
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省")
@ExcelAttribute(name = "开户行省",isArea = true)
@ExcelProperty("开户行省")
private Integer bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市")
@ExcelAttribute(name = "开户行市",isArea = true,parentField = "bankProvince")
@ExcelProperty("开户行市")
private Integer bankCity;
/**
......@@ -168,8 +168,8 @@ public class TSalaryEmployee extends BaseEntity {
/**
* 在职状态(0在职;1离职)
*/
@ExcelAttribute(name = "在职状态(0在职;1离职)")
@ExcelProperty("在职状态(0在职;1离职)")
@ExcelAttribute(name = "在职状态",isDataId = true,readConverterExp = "0=在职,1=离职")
@ExcelProperty("在职状态")
private Integer fileStatus;
}
......@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
......@@ -32,13 +31,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TApprovalRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -58,6 +60,10 @@ import java.util.List;
@Log4j2
@Service
public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService {
@Autowired
private TApprovalRecordService approvalRecordService;
/**
* 标准薪酬工资表简单分页查询
*
......@@ -234,15 +240,29 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
YifuUser user = SecurityUtils.getUser();
TSalaryStandard tSalaryStandard = baseMapper.selectById(id);
if (Common.isNotNull(tSalaryStandard)) {
//新增流程进展明细
TApprovalRecord tApprovalRecord = new TApprovalRecord();
if (CommonConstants.ZERO_STRING.equals(auditFlag)) {
tSalaryStandard.setStatus(CommonConstants.TWO_INT);
tApprovalRecord.setApprovalResult(CommonConstants.ZERO_STRING);
} else {
tSalaryStandard.setStatus(CommonConstants.FIVE_INT);
tApprovalRecord.setApprovalResult(CommonConstants.ONE_STRING);
}
if (Common.isNotNull(auditRemark)) {
tSalaryStandard.setRemark(auditRemark);
tApprovalRecord.setApprovalOpinion(auditRemark);
}
tSalaryStandard.setAuditUser(user.getId());
tSalaryStandard.setAuditTime(DateUtil.getCurrentDateTime());
baseMapper.updateById(tSalaryStandard);
tApprovalRecord.setSalaryId(tSalaryStandard.getId());
tApprovalRecord.setApprovalMan(user.getId());
tApprovalRecord.setApprovalManName(user.getNickname());
tApprovalRecord.setApprovalTime(DateUtil.getCurrentDateTime());
approvalRecordService.save(tApprovalRecord);
}
return R.ok();
......
......@@ -95,7 +95,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
* 社保缴纳月份empNo
*/
@Length(max = 6, message = "社保缴纳月份不能超过6个字符")
@ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6)
@ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6,isInteger = true)
@Schema(description = "社保缴纳月份")
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
......@@ -103,7 +103,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
* 社保生成月份
*/
@Length(max = 6, message = "社保生成月份不能超过6个字符")
@ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6)
@ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6,isInteger = true)
@Schema(description = "社保生成月份")
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
......
......@@ -38,6 +38,15 @@ import java.util.Date;
@Data
public class TPaymentInfoVo extends RowIndex implements Serializable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Length(max = 32, message = "主键 不能超过32 个字符")
@ExcelAttribute(name = "主键", maxLength = 32)
@Schema(description = "主键")
@ExcelProperty("主键")
private String id;
/**
* 员工姓名
*/
......@@ -115,7 +124,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 社保缴纳月份
*/
@Length(max = 6, message = "社保缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6)
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6,isInteger = true)
@Schema(description = "社保缴纳月份")
@ExcelProperty("社保缴纳月份")
private String socialPayMonth;
......@@ -123,7 +132,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 社保生成月份
*/
@Length(max = 6, message = "社保生成月份 不能超过6 个字符")
@ExcelAttribute(name = "社保生成月份", maxLength = 6)
@ExcelAttribute(name = "社保生成月份", maxLength = 6,isInteger = true)
@Schema(description = "社保生成月份")
@ExcelProperty("社保生成月份")
private String socialCreateMonth;
......@@ -146,7 +155,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 公积金缴纳月份
*/
@Length(max = 6, message = "公积金缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6)
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6,isInteger = true)
@Schema(description = "公积金缴纳月份")
@ExcelProperty("公积金缴纳月份")
private String providentPayMonth;
......@@ -154,7 +163,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 公积金生成月份
*/
@Length(max = 6, message = "公积金生成月份 不能超过6 个字符")
@ExcelAttribute(name = "公积金生成月份", maxLength = 6)
@ExcelAttribute(name = "公积金生成月份", maxLength = 6,isInteger = true)
@Schema(description = "公积金生成月份")
@ExcelProperty("公积金生成月份")
private String providentCreateMonth;
......
......@@ -19,14 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoImportLogService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import org.apache.commons.lang.StringUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
......@@ -57,19 +55,15 @@ public class TPaymentInfoImportLogController {
@Operation(description = "导出社保导入日志")
@GetMapping("/exportPaymentInfoLog")
public void exportPaymentInfoLog(HttpServletResponse response) {
public String exportPaymentInfoLog(HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
String importRandom = (String) redisUtil.get(key);
if (StringUtils.isBlank(importRandom)) {
ServiceUtil.runTimeExceptionDiy("当前社保数据还未导入完成或者数据不存在");
return importRandom;
}
String res = tPaymentInfoImportLogService.exportPaymentInfoLog(response, importRandom);
if (Common.isNotNull(res)){
ServiceUtil.runTimeExceptionDiy(res);
return null;
}
}
/**
* @description: 清空社保导入日志表
......
......@@ -342,8 +342,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialFundInfo socialFund;
TDispatchImportVo excel;
EmpDispatchAddVo addVo = new EmpDispatchAddVo();
// 失败项派单
boolean dispatchPart = false;
// 兼职工伤
boolean injury =false;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
dispatchPart = false;
injury= false;
empVo = null;
excel = excelVOList.get(i);
fundSet = fundHoldMap.get(excel.getProvidentHousehold());
......@@ -353,6 +359,23 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVoMap)) {
empVo = empVoMap.get(excel.getEmpIdcard());
}
if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getSocialId())){
// 部分失败
if (CommonConstants.FOUR_STRING.equals(socialFund.getSocialStatus())){
dispatchPart = true;
}
}
// 自定义 只有工伤数据 视为兼职工伤派单
if (Common.isNotNull(excel) && Common.isNotNull(excel.getSocialHousehold())
&& CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
injury = Common.isEmpty(excel.getPensionStart())
&& Common.isEmpty(excel.getMedicalStart())
&& Common.isEmpty(excel.getBirthStart())
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& Common.isNotNull(excel.getWorkInjuryStart())
&& (BigDecimal.ZERO.compareTo(excel.getWorkInjuryCardinal()) <= 0);
}
if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isEmpty(socialSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
......@@ -373,12 +396,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 数据合法情况
if (validImport(errorMessageList, excel,setInfoVo,socialFundMap,empVo,socialSet,fundSet)) {
if (validImport(errorMessageList, excel,setInfoVo,socialFund,empVo,socialSet,fundSet)) {
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
// 是否可以派单: 派单状态、兼职工伤处理
if (validDdispatchStatus(errorMessageList, socialFundMap, excel)) {
if (validDdispatchStatus(errorMessageList, socialFund, excel)) {
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
......@@ -392,7 +415,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 新增派单信息
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel,socialFund);
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel,socialFund,injury);
// 变更社保公积金查询
initSocialFundAddInfo(socialFundAddMap, empVo, socialSet, fundSet, setInfoVo, socialFund, excel);
}
......@@ -401,7 +424,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
addVo.setProjectsMap(projectsMap);
R<EmpDispatchAddVo> res = archivesDaprUtil.addDispatchInfo(addVo);
// 开始插入各种数据了
insertAllInfo(excelVOList, errorMessageList, setInfoVo, res,socialsMap,fundsMap,socialFundAddMap,dispatchMap,excelVOTemp);
insertAllInfo(excelVOList, errorMessageList, setInfoVo, res,socialsMap,fundsMap,socialFundAddMap,dispatchMap,excelVOTemp,dispatchPart);
// 清理map list 等数据
Common.clear(excelVOList);
Common.clear(empAddsMap);
......@@ -436,7 +459,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String, TProvidentFund> fundsMap,
Map<String, TSocialFundInfo> socialFundAddMap,
Map<String, TDispatchInfo> dispatchMap,
Map<String,String> excelVOTemp) {
Map<String,String> excelVOTemp,
boolean dispatchPart) {
Map<String, EmpAddDispatchVo> empAddsMap = null;
Map<String, EmpContractDispatchVo> contractsMap = null;
Map<String, EmpProjectDispatchVo> projectsMap = null;
......@@ -522,7 +546,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(socialFund) && Common.isNotNull(dispatch)){
socialFund.setDispatchId(dispatch.getId());
}
initSocialFundAndInsert(emp, social, fund, socialFund,project);
initSocialFundAndInsert(emp, social, fund, socialFund,project,dispatchPart);
}
// 生成预付数据
if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getId())){
......@@ -611,7 +635,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialInfo social,
TProvidentFund fund,
TSocialFundInfo socialFund,
EmpProjectDispatchVo project) {
EmpProjectDispatchVo project,
boolean dispatchPart) {
if (Common.isNotNull(socialFund)){
if (Common.isNotNull(project)){
socialFund.setEmpNo(project.getEmpCode());
......@@ -631,11 +656,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setFirstBuyMonthSocial(social.getSocialStartDate());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())){
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())
&& !dispatchPart){
socialFund.setUnitBigailmentMoney(social.getUnitBigailmentMoney());
socialFund.setPersonalBigailmentMoney(social.getPersonalBigailmentMoney());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getPensionHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getPensionHandle()) && !dispatchPart){
socialFund.setUnitPensionCardinal(social.getUnitPensionCardinal());
socialFund.setPersonalPensionCardinal(social.getPersonalPensionCardinal());
socialFund.setUnitPensionPer(social.getUnitPensionPer());
......@@ -644,7 +670,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalPersionMoney(BigDecimalUtils.safeMultiply(social.getPersonalPensionCardinal(), social.getPersonalPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setPensionHandle(social.getPensionHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle()) && !dispatchPart){
socialFund.setUnitMedicalCardinal(social.getUnitMedicalCardinal());
socialFund.setPersonalMedicalCardinal(social.getPersonalMedicalCardinal());
socialFund.setUnitMedicalPer(social.getUnitMedicalPer());
......@@ -653,7 +679,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalMedicalMoney(BigDecimalUtils.safeMultiply(social.getPersonalMedicalCardinal(), social.getPersonalMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setMedicalHandle(social.getMedicalHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle()) && !dispatchPart){
socialFund.setUnitUnemploymentCardinal(social.getUnitUnemploymentCardinal());
socialFund.setPersonalUnemploymentCardinal(social.getPersonalUnemploymentCardinal());
socialFund.setPersonalUnemploymentPer(social.getPersonalUnemploymentPer());
......@@ -663,7 +689,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnemployHandle(social.getUnemployHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(social.getIsIllness())){
&& CommonConstants.ZERO_STRING.equals(social.getIsIllness()) && !dispatchPart){
socialFund.setUnitBigailmentCardinal(social.getUnitBigailmentCardinal());
socialFund.setPersonalBigailmentCardinal(social.getPersonalBigailmentCardinal());
socialFund.setUnitBigailmentPer(social.getUnitBigailmentPer());
......@@ -672,13 +698,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalBigailmentMoney(social.getPersonalBigailmentMoney());
socialFund.setBigailmentHandle(social.getBigailmentHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle()) && !dispatchPart){
socialFund.setUnitWorkInjuryCardinal(social.getUnitWorkInjuryCardinal());
socialFund.setUnitWorkUnjuryPer(social.getUnitWorkUnjuryPer());
socialFund.setUnitInjuryMoney(BigDecimalUtils.safeMultiply(social.getUnitWorkInjuryCardinal(), social.getUnitWorkUnjuryPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setWorkInjuryHandle(social.getWorkInjuryHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle()) && !dispatchPart){
socialFund.setUnitBirthCardinal(social.getUnitBirthCardinal());
socialFund.setUnitBirthPer(social.getUnitBirthPer());
socialFund.setUnitBirthMoney(BigDecimalUtils.safeMultiply(social.getUnitBirthCardinal(), social.getUnitBirthPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
......@@ -703,12 +729,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setRecordBase(social.getRecordBase());
socialFund.setTrustRemark(social.getTrustRemark());
socialFund.setPaymentType(social.getPaymentType());
// 处理部分失败项派单的 基数 比例 金额,再办理成功的时候才更新过来 顺序不要变 后面有合计
if (!dispatchPart){
socialFund.setPensionStart(social.getPensionStart());
socialFund.setMedicalStart(social.getMedicalStart());
socialFund.setUnemployStart(social.getUnemployStart());
socialFund.setWorkInjuryStart(social.getWorkInjuryStart());
socialFund.setBirthStart(social.getBirthStart());
socialFund.setBigailmentStart(social.getBigailmentStart());
}
socialFund.setUnitSocialSum(BigDecimalUtils.safeAdd(socialFund.getUnitPersionMoney()
, socialFund.getUnitMedicalMoney(), socialFund.getUnitBirthMoney()
......@@ -785,8 +816,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnitNameFund(setInfoVo.getCustomerName());
socialFund.setSocialStatus(CommonConstants.ZERO_STRING);
socialFund.setSocialAddStatus(CommonConstants.ZERO_STRING);
/*if (!CommonConstants.FOUR_STRING.equals(socialFund.getSocialStatus())){
}*/
socialFund.setSocialReduceStatus(CommonConstants.ONE_STRING_NEGATE);
socialFund.setSocialReduceDate(null);
socialFund.setSocialStartDate(excel.getPensionStart());
......@@ -886,10 +915,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
SysBaseSetInfo socialSet,
SysBaseSetInfo fundSet,
TDispatchImportVo excel,
TSocialFundInfo socialFund) {
TSocialFundInfo socialFund, boolean injury) {
TDispatchInfo dispatch = new TDispatchInfo();
// 初始化派单项
initAddHandleItem(excel, socialFund,dispatch,socialSet);
initAddHandleItem(excel, socialFund,dispatch,socialSet,injury);
dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getId());
dispatch.setCreateTime(LocalDateTime.now());
......@@ -968,37 +997,93 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchMap.put(excel.getEmpIdcard(),dispatch);
}
private void initAddHandleItem(TDispatchImportVo excel, TSocialFundInfo socialFund, TDispatchInfo dispatch, SysBaseSetInfo socialSet) {
private void initAddHandleItem(TDispatchImportVo excel, TSocialFundInfo socialFund, TDispatchInfo dispatch, SysBaseSetInfo socialSet, boolean injury) {
StringBuffer temp = new StringBuffer();
if (Common.isEmpty(socialFund)){
if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isNotNull(excel.getPensionStart())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if (Common.isNotNull(excel.getMedicalStart())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (Common.isNotNull(excel.getBirthStart())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (Common.isNotNull(excel.getWorkInjuryStart())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (Common.isNotNull(excel.getUnemployStart())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if (Common.isNotNull(excel.getBigailmentStart())
&& CommonConstants.ZERO_STRING.equals(socialSet.getIsIllness())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
if (Common.isNotNull(excel.getProvidentHousehold())){
temp.append(DispatchConstants.DISPATCH_FUND);
}
}
if (Common.isNotNull(socialFund)){
if (Common.isNotNull(excel.getSocialHousehold())){
// 兼职工伤派单只生成兼职工伤派单项
if (injury){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getWorkInjuryHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())
|| Common.isEmpty(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
// 非兼职工伤派单 所有可派增的项目都再派单项中
}else {
// 办理失败或已派减 视为可派增
if (CommonConstants.TWO_STRING.equals(socialFund.getPensionHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getPensionHandle())){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getPensionHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
|| CommonConstants.TWO_STRING.equals(socialFund.getPensionHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getPensionHandle())
|| Common.isEmpty(socialFund.getPensionHandle())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getMedicalHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getMedicalHandle())){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getMedicalHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
|| CommonConstants.TWO_STRING.equals(socialFund.getMedicalHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getMedicalHandle())
|| Common.isEmpty(socialFund.getMedicalHandle())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getWorkInjuryHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())
|| Common.isEmpty(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getBirthHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBirthHandle())){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getBirthHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getBirthHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBirthHandle())
|| Common.isEmpty(socialFund.getBirthHandle())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getUnemployHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getUnemployHandle())){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getUnemployHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getUnemployHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getUnemployHandle())
|| Common.isEmpty(socialFund.getUnemployHandle())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if ((CommonConstants.TWO_STRING.equals(socialFund.getBigailmentHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBigailmentHandle()))
if (((CommonConstants.ZERO_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
|| CommonConstants.TWO_STRING.equals(socialFund.getBigailmentHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBigailmentHandle())
|| Common.isEmpty(socialFund.getBigailmentHandle()))
&& CommonConstants.ZERO_STRING.equals(socialSet.getIsIllness())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
}
//公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败9 审核不通过)、派减(5待审核 6待办理 7 办理成功 8 办理失败 )
if (Common.isNotNull(excel.getProvidentHousehold())){
temp.append(DispatchConstants.DISPATCH_FUND);
......@@ -1134,8 +1219,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
social.setEmpName(empVo.getEmpName());
social.setEmpIdcard(empVo.getEmpIdcard());
social.setEmpNo(empVo.getEmpNo());
}
}else {
social.setEmpName(excel.getEmpName());
social.setEmpIdcard(excel.getEmpIdcard());
}
social.setBirthHandle(CommonConstants.ZERO_STRING);
social.setMedicalHandle(CommonConstants.ZERO_STRING);
social.setPensionHandle(CommonConstants.ZERO_STRING);
......@@ -1454,10 +1541,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalBigailmentCardinal(social.getUnitBigailmentCardinal());
socialFund.setPersonalBigailmentPer(social.getUnitBigailmentPer());
}
}
socialFundMap.put(excel.getEmpIdcard(),socialFund);
}
}
}
private void initHoldInfo(List<String> socialholds,
List<String> fundHolds,
Map<String, SysBaseSetInfo> socialHoldMap,
......@@ -1614,11 +1701,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
empAdds.put(excel.getEmpIdcard(),emp);
}
private boolean validDdispatchStatus(List<ErrorMessage> errorMessageList, Map<String, TSocialFundInfo> socialFundMap,
private boolean validDdispatchStatus(List<ErrorMessage> errorMessageList, TSocialFundInfo sf,
TDispatchImportVo excel) {
TSocialFundInfo sf;
if (Common.isNotNull(socialFundMap)) {
sf = socialFundMap.get(excel.getEmpIdcard());
if (Common.isNotNull(sf) && Common.isNotNull(excel.getSocialHousehold())) {
// 拒绝新增1:派单待审核、派单待办理、办理中、办理成功且未派减成功------ 先排除兼职工伤
if (CommonConstants.ZERO_STRING.equals(sf.getSocialAddStatus())
......@@ -1640,7 +1724,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
&& (BigDecimal.ZERO.compareTo(excel.getWorkInjuryCardinal()) <= 0);
if (flag) {
// 有兼职工伤不可重复增 (未派减成功不可新增兼职工伤)
if (CommonConstants.ZERO_STRING.equals(sf.getWorkInjuryHandle())
if ((CommonConstants.ZERO_STRING.equals(sf.getWorkInjuryHandle())
&& !CommonConstants.TEN_STRING.equals(sf.getSocialStatus()))
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_INJURY_EXISTING)));
return true;
......@@ -1656,6 +1741,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_REDUCE)));
return true;
}
}else {
// 五险派单 如果前面兼职工伤没派减 不可派增
flag = (BigDecimalUtils.safeAdd(sf.getUnitPersionMoney(),sf.getUnitBigailmentMoney(),
sf.getUnitBirthMoney(),sf.getUnitMedicalMoney(),sf.getUnitUnemploymentMoney(),
sf.getUnitInjuryMoney()).compareTo(BigDecimalUtils.isNullToZero(sf.getUnitInjuryMoney())) == 0)
&& !(CommonConstants.TEN_STRING.equals(sf.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.TWO_STRING.equals(sf.getWorkInjuryHandle()));
if (flag) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_INJURY_EXISTING_LIMIT)));
return true;
}
}
}
......@@ -1711,7 +1807,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private boolean validImport(List<ErrorMessage> errorMessageList,
TDispatchImportVo excel,
ProjectSetInfoVo setInfoVo,
Map<String, TSocialFundInfo> socialFundMap,
TSocialFundInfo socialFund,
DispatchEmpVo empVo, SysBaseSetInfo socialSet, SysBaseSetInfo fundSet) {
if (Common.isEmpty(setInfoVo)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
......@@ -1853,9 +1949,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return true;
}
TSocialFundInfo socialFund;
if (Common.isNotNull(socialFundMap)){
socialFund = socialFundMap.get(excel.getEmpIdcard());
if (Common.isNotNull(socialFund)){
// 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败 10 审核不通过-增)
if (Common.isNotNull(excel.getSocialHousehold())
......@@ -1882,7 +1975,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return true;
}
}
}
if (Common.isNotNull(excel.getSocialHousehold())){
// 各个社保基数和日期空 默认养老日期和基数
initExcelBaseAndDate(excel);
......@@ -2654,6 +2746,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
&& !(CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
&& CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
&& CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
&& CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
&& CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
&& (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())));
if (flagTemp){
sf.setSocialStatus(CommonConstants.FOUR_STRING);
......@@ -2863,13 +2962,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
initAuditInfo(auditInfo, ( temp + handleRemark), CommonConstants.THREE_STRING, user, temp.toString(), remark);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.THREE_STRING, user, temp.toString(), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + handleRemark), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
auditInfo.setSocialId(dis.getId());
} else {
......@@ -2945,14 +3044,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
temp.append(handleRemark);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(handleRemark);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
dis.setSocialHandleStatus(handleStatus);
......@@ -3058,24 +3157,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
auditInfo.setEmpIdcard(dis.getEmpIdcard());
auditInfoMapper.insert(auditInfo);
baseMapper.updateById(dis);
// 派增办理失败 失败项重新派单办理失败 恢复为部分办理失败
boolean flagTemp = Common.isNotNull(sf) && Common.isNotNull(dis.getSocialId())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())));
if (flagTemp){
sf.setSocialStatus(CommonConstants.FOUR_STRING);
sf.setSocialAddStatus(CommonConstants.THREE_STRING);
}
socialFundMapper.updateById(sf);
//1.派增办理失败 刷新预估数据
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
// 办理失败
if (CommonConstants.ONE_INT == flag){
if (CommonConstants.ONE_INT == flag && CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())){
// 派增办理,全部失败 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf, forecastFlag);
}
......@@ -3132,46 +3218,62 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return forecastFlag;
}
/**
* @Author fxj
* @Description 派增:
* * 1、派单处社保或公积金状态为待审核、待办理、办理中,项目档案处社保或公积金状态为处理中1;
* * 2、派单处社保或公积金状态为审核不通过或办理失败,项目档案处社保状态为无社保,公积金状态为无公积金0;
* * 3、派单处社保状态为部分办理失败,项目档案处社保状态为部分购买 2
* * 4、派单处社保或公积金状态为办理成功,项目档案处社保或公积金状态为正常 3
* * 派减:
* * 1、派减状态为待审核、待办理、审核不通过、办理失败,项目档案处社保或公积金状态不变;
* * 2、派减状态为办理成功,项目档案处社保或公积金状态变为已派减 4
* * 人员档案处社保或公积金状态根据身份证+项目进行整合:
* * 社保状态优先级:正常>部分购买>处理中>已派减>无社保
* * 公积金状态优先级:正常>处理中>已派减>无公积金
* @Date 15:18 2022/8/9
* @Param
* @return
**/
private void initSocialFundStatus(TSocialInfo socialInfo, TProvidentFund providentFund, UpProjectSocialFundVo vo, TSocialFundInfo sf) {
if (Common.isNotNull(socialInfo)){
// 办理失败或审核不通过
if (CommonConstants.TWO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.TWO_STRING.equals(socialInfo.getAuditStatus())){
// 办理失败或审核不通过且无办理成功项
if (CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())
|| (CommonConstants.TEN_STRING.equals(sf.getSocialStatus())
&& !CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
&& !(CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
){
vo.setSocialStatus(CommonConstants.ZERO_STRING);
}
// 待办理或办理中 处理中
if (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())){
// 待办理或办理中或部分办理失败或审核不通过部分办理成功 处理中
if (CommonConstants.ZERO_STRING.equals(sf.getSocialStatus())
|| CommonConstants.TWO_STRING.equals(sf.getSocialStatus())){
vo.setSocialStatus(CommonConstants.ONE_STRING);
}
if (CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
if (CommonConstants.ONE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.THREE_STRING);
}
if (CommonConstants.THREE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.FOUR_STRING);
}
boolean flag = (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
// 部分办理失败或审核不通过部分办理成功
if (CommonConstants.FOUR_STRING.equals(sf.getSocialStatus())
|| (CommonConstants.TEN_STRING.equals(sf.getSocialStatus())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
&&
(!CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (!CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())));
if (flag){
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()))
))){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
if (CommonConstants.THREE_STRING.equals(sf.getSocialStatus())){
vo.setSocialStatus(CommonConstants.THREE_STRING);
}
if (CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())){
vo.setSocialStatus(CommonConstants.FOUR_STRING);
}
}
// 公积金状态 社保状态(字典): 0 无社保 1 处理中 2.正常 3.已派减
if (Common.isNotNull(providentFund)){
......@@ -3242,6 +3344,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
**/
private void setSocialHandleStatus(String handleStatus, String socialType, int flag, TSocialInfo socialInfo
, TDispatchInfo dis, TSocialFundInfo sf) {
// 办理成功 处理社保相关数据 (直接排除五险)
updateSocialByHandle(flag, socialInfo, dis, sf);
// 批量办理,或者办理选择对应的类型,修改对应的办理状态
this.setSocialSixStatus(handleStatus, socialType, socialInfo,sf);
......@@ -3329,6 +3433,84 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
}
private void updateSocialByHandle(int flag, TSocialInfo socialInfo, TDispatchInfo dis, TSocialFundInfo sf) {
if (CommonConstants.ZERO_INT== flag
&& CommonConstants.ZERO_STRING.equals(dis.getType())
&& Common.isNotNull(dis.getSocialId())){
if (CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getIsIllness())){
sf.setUnitBigailmentMoney(socialInfo.getUnitBigailmentMoney());
sf.setPersonalBigailmentMoney(socialInfo.getPersonalBigailmentMoney());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())){
sf.setUnitPensionCardinal(socialInfo.getUnitPensionCardinal());
sf.setPersonalPensionCardinal(socialInfo.getPersonalPensionCardinal());
sf.setUnitPensionPer(socialInfo.getUnitPensionPer());
sf.setPersonalPensionPer(socialInfo.getPersonalPensionPer());
sf.setUnitPersionMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitPensionCardinal(), socialInfo.getUnitPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPersonalPersionMoney(BigDecimalUtils.safeMultiply(socialInfo.getPersonalPensionCardinal(), socialInfo.getPersonalPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPensionHandle(socialInfo.getPensionHandle());
sf.setPensionStart(socialInfo.getPensionStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())){
sf.setUnitMedicalCardinal(socialInfo.getUnitMedicalCardinal());
sf.setPersonalMedicalCardinal(socialInfo.getPersonalMedicalCardinal());
sf.setUnitMedicalPer(socialInfo.getUnitMedicalPer());
sf.setPersonalMedicalPer(socialInfo.getPersonalMedicalPer());
sf.setUnitMedicalMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitMedicalCardinal(), socialInfo.getUnitMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPersonalMedicalMoney(BigDecimalUtils.safeMultiply(socialInfo.getPersonalMedicalCardinal(), socialInfo.getPersonalMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setMedicalHandle(socialInfo.getMedicalHandle());
sf.setMedicalStart(socialInfo.getMedicalStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle())){
sf.setUnitUnemploymentCardinal(socialInfo.getUnitUnemploymentCardinal());
sf.setPersonalUnemploymentCardinal(socialInfo.getPersonalUnemploymentCardinal());
sf.setPersonalUnemploymentPer(socialInfo.getPersonalUnemploymentPer());
sf.setUnitUnemploymentPer(socialInfo.getUnitUnemploymentPer());
sf.setUnitUnemploymentMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitUnemploymentCardinal(), socialInfo.getUnitUnemploymentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPersonalUnemploymentMoney(BigDecimalUtils.safeMultiply(socialInfo.getPersonalUnemploymentCardinal(), socialInfo.getPersonalUnemploymentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setUnemployHandle(socialInfo.getUnemployHandle());
sf.setUnemployStart(socialInfo.getUnemployStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getIsIllness())){
sf.setUnitBigailmentCardinal(socialInfo.getUnitBigailmentCardinal());
sf.setPersonalBigailmentCardinal(socialInfo.getPersonalBigailmentCardinal());
sf.setUnitBigailmentPer(socialInfo.getUnitBigailmentPer());
sf.setPersonalBigailmentPer(socialInfo.getPersonalBigailmentPer());
sf.setUnitBigailmentMoney(socialInfo.getUnitBigailmentMoney());
sf.setPersonalBigailmentMoney(socialInfo.getPersonalBigailmentMoney());
sf.setBigailmentHandle(socialInfo.getBigailmentHandle());
sf.setBigailmentStart(socialInfo.getBigailmentStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle())){
sf.setUnitWorkInjuryCardinal(socialInfo.getUnitWorkInjuryCardinal());
sf.setUnitWorkUnjuryPer(socialInfo.getUnitWorkUnjuryPer());
sf.setUnitInjuryMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitWorkInjuryCardinal(), socialInfo.getUnitWorkUnjuryPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setWorkInjuryHandle(socialInfo.getWorkInjuryHandle());
sf.setWorkInjuryStart(socialInfo.getWorkInjuryStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle())){
sf.setUnitBirthCardinal(socialInfo.getUnitBirthCardinal());
sf.setUnitBirthPer(socialInfo.getUnitBirthPer());
sf.setUnitBirthMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitBirthCardinal(), socialInfo.getUnitBirthPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setBirthHandle(socialInfo.getBirthHandle());
sf.setBirthStart(socialInfo.getBirthStart());
}
sf.setUnitSocialSum(BigDecimalUtils.safeAdd(sf.getUnitPersionMoney()
, sf.getUnitMedicalMoney(), sf.getUnitBirthMoney()
, sf.getUnitInjuryMoney()
, sf.getUnitUnemploymentMoney()
, sf.getUnitBigailmentMoney()));
sf.setPersonalSocialSum(BigDecimalUtils.safeAdd(sf.getPersonalBigailmentMoney()
, sf.getPersonalPersionMoney()
, sf.getPersonalMedicalMoney()
, sf.getPersonalUnemploymentMoney()));
}
}
/**
* @Author fxj
* @Description if flag=obj return value1 else return value2
......
......@@ -54,6 +54,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import com.alibaba.excel.EasyExcel;
......@@ -497,7 +498,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 处理第一个0位元素
final List<TPaymentInfoVo> finalList = list.subList(0, 1);
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2,
executeImportSocialList(user, atomicLine, random, finalList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
CommonConstants.ONE_INT, errorMessageList), yfSocialImportThreadPoolExecutor);
......@@ -512,7 +513,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList;
final int idx = i - partSize + 2;
CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2,
executeImportSocialList(user, atomicLine, random, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
idx, errorMessageList), yfSocialImportThreadPoolExecutor);
......@@ -538,7 +539,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList;
int finalLastIdx = lastIdx + 1;
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2,
executeImportSocialList(user, atomicLine, random, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
finalLastIdx, errorMessageList), yfSocialImportThreadPoolExecutor);
......@@ -557,7 +558,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} while (computeFlag);
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
redisUtil.set(importSuccessKey, random, 1800L);
DecimalFormat df = new DecimalFormat("0.00000");
String maerialRatio = df.format((float)atomicLine.get()/list.size());
redisUtil.set(importSuccessKey, maerialRatio, 1800L);
} catch (Exception e) {
log.error("社保缴费库数据批量导入异常:" + e);
......@@ -1021,6 +1024,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialSum(BigDecimalUtils.safeAdd(
paymentInfo.getUnitSocialSum(), paymentInfo.getSocialSecurityPersonalSum()));
paymentInfo.setSumAll(paymentInfo.getSocialSum());
paymentInfo.setCreateBy(user.getId());
paymentInfo.setCreateName(user.getNickname());
if (null != paymentInfo && Common.isEmpty(paymentInfo.getSocialId())) {
paymentInfo.setSocialId(UUID.randomUUID().toString());
}
......@@ -1272,7 +1277,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) {
areaMap.put(area.getAreaName(), Integer.toString(area.getId()));
areaMap.put(Integer.toString(area.getId()), area.getAreaName());
}
}
}
......@@ -1376,8 +1381,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
continue;
}
if (null != fundMap || null != fundMapTemp) {
if (null != fundMap) {
if (fundMap.size() >CommonConstants.ZERO_INT || fundMapTemp.size() >CommonConstants.ZERO_INT) {
if (fundMap.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMap.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
......@@ -1387,10 +1392,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
areaArray = infoVo.getProvidentPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
fund = checkAddress(areaArray, areaMap, fund);
fund = checkAddress(areaArray, areaMap,fund);
if (null == fund || (null != fund && !ServiceUtil.checkMothForPaymentImport(
fund.getProvidentStart(), infoVo.getProvidentPayMonth(), fund.getFundReduceDate()))) {
if (null != fundMapTemp) {
if (fundMapTemp.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMapTemp.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
......@@ -1406,7 +1411,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (TProvidentFund f : fundListTemp) {
if (f.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport(
f.getProvidentStart(), infoVo.getProvidentPayMonth(), f.getFundReduceDate())) {
fund = checkAddress(areaArray, areaMap, f);
fund = checkAddress(areaArray, areaMap,f);
if (null != fund) {
break;
}
......@@ -1432,7 +1437,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//计算公积金合计,个人金额和单位金额一致
infoVo.setProvidentSum(BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getUnitProvidentSum()));
// 判重
if (null != paymentInfoMap) {
if (paymentInfoMap.size() >CommonConstants.ZERO_INT) {
paymentInfo = (TPaymentInfo) paymentInfoMap.get(infoVo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim()
......@@ -1849,6 +1854,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() + "的社保起缴日期为空!"));
......@@ -2104,6 +2110,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
payExists.setSumAll(payExists.getSocialSum());
payExists.setCreateBy(user.getId());
payExists.setCreateName(user.getNickname());
if (null != payExists && Common.isEmpty(payExists.getSocialId())) {
payExists.setSocialId(UUID.randomUUID().toString());
}
......@@ -2230,12 +2238,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
if (areaArray.length >= CommonConstants.TWO_INT) {
if (null != s.getFundProvince()) {
if (areaArray[0].equals(areaMap.get(String.valueOf(s.getFundProvince())))) {
if (areaArray[0].equals(areaMap.get(s.getFundProvince()))) {
if (null != s.getFundCity()) {
if (areaArray[1].equals(areaMap.get(String.valueOf(s.getFundCity())))) {
if (areaArray[1].equals(areaMap.get(s.getFundCity()))) {
if (areaArray.length >= CommonConstants.THREE_INT) {
if (null != s.getFundTown() && areaArray[CommonConstants.TWO_INT].equals(
areaMap.get(String.valueOf(s.getFundTown())))) {
areaMap.get(s.getFundTown()))) {
return s;
}
} else {
......@@ -2255,7 +2263,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} else if (areaArray.length == 1) {
if (null != s.getFundProvince() && null == s.getFundCity()) {
if (areaArray[0].equals(areaMap.get(String.valueOf(s.getFundProvince())))) {
if (areaArray[0].equals(areaMap.get(s.getFundProvince()))) {
return s;
}
} else {
......
......@@ -32,7 +32,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
......@@ -84,6 +83,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Autowired
private TDispatchInfoService dispatchInfoService;
@Autowired
private SysHouseHoldInfoMapper sysHouseHoldInfoMapper;
/**
* 预派单记录简单分页查询
*
......@@ -577,7 +579,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
@Override
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String socialHouse, String fundHouse, String departId) {
public List<ErrorMessage> batchSavePreDisPatchAdd(List<TPreDispatchInfo> listInfo, YifuUser user, String socialHouse
, String fundHouse, String departId) {
List<ErrorMessage> errorList = new ArrayList<>();
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId);
// 获取区域数据MAP
......@@ -631,12 +634,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setPreStatus(CommonConstants.ZERO_STRING);
// 为验重添加到MAP
existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
if (Common.isEmpty(info.getExceptionContent())) {
errorList.add(new ErrorMessage(i, "保存成功!", CommonConstants.GREEN));
} else {
if (!Common.isEmpty(info.getExceptionContent())) {
info.setPreStatus(CommonConstants.ONE_STRING);
errorList.add(new ErrorMessage(i, "保存成功!" +
info.getExceptionContent(), CommonConstants.RED));
}
baseMapper.insert(info);
}
......@@ -705,12 +704,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
// 为验重添加到MAP
existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
if (Common.isEmpty(info.getExceptionContent())) {
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
} else {
if (!Common.isEmpty(info.getExceptionContent())) {
info.setPreStatus(CommonConstants.ONE_STRING);
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS +
info.getExceptionContent(), CommonConstants.RED));
}
baseMapper.insert(info);
}
......@@ -978,11 +973,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setContractEndAdd(info.getContractEnd());
info.setContractStartAdd(info.getContractStart());
baseMapper.updatePreDispatchInfoById(info);
if (Common.isNotNull(info.getExceptionContent())){
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS+info.getExceptionContent(),CommonConstants.RED));
}else {
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS,CommonConstants.GREEN));
}
}
private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) {
......@@ -1116,8 +1106,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd())));
// 默认工时制 综合工时制2
info.setWorkingHoursAdd(CommonConstants.TWO_STRING);
info.setSocialHouseAdd(socialHouse);
info.setFundHouseAdd(fundHouse);
SysHouseHoldInfo sysHouseHoldInfo = sysHouseHoldInfoMapper.selectOne(Wrappers.<SysHouseHoldInfo>query().lambda()
.eq(SysHouseHoldInfo::getName, socialHouse).eq(SysHouseHoldInfo::getType, CommonConstants.ZERO_STRING));
info.setSocialHouseAdd(sysHouseHoldInfo.getId());
SysHouseHoldInfo sysHouseHoldFund = sysHouseHoldInfoMapper.selectOne(Wrappers.<SysHouseHoldInfo>query().lambda()
.eq(SysHouseHoldInfo::getName, fundHouse).eq(SysHouseHoldInfo::getType, CommonConstants.ONE_STRING));
info.setFundHouseAdd(sysHouseHoldFund.getId());
}
/**
......@@ -2207,7 +2202,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
Common.isNotNull(preInfo.getPensionStart())){
importVo.setPensionStart(DateUtil.getFirstDay(preInfo.getPensionStart()));
if (Common.isNotNull(preInfo.getPensionAddress())){
importVo.setSocialHousehold(preInfo.getSocialHouseAdd());
SysHouseHoldInfo sysHouseHoldInfo = sysHouseHoldInfoMapper.selectById(preInfo.getSocialHouseAdd());
importVo.setSocialHousehold(sysHouseHoldInfo.getName());
}
SysBaseSetInfo socialBaseSet = getSysBaseSetInfo(preInfo.getSocialProvince(),preInfo.getSocialCity(),
preInfo.getSocialTown(),preInfo.getSocialHouseAdd(),CommonConstants.ZERO_STRING);
......@@ -2333,7 +2329,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
importVo.setProvidentPer(preInfo.getFundPersonalPer());
}
if (Common.isNotNull(preInfo.getFundAddress())){
importVo.setProvidentHousehold(preInfo.getFundHouseAdd());
SysHouseHoldInfo sysHouseHoldInfo = sysHouseHoldInfoMapper.selectById(preInfo.getFundHouseAdd());
importVo.setProvidentHousehold(sysHouseHoldInfo.getName());
}
}
......
......@@ -197,10 +197,11 @@
a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH,
a.CREATE_USER,
a.CREATE_BY,
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_TIME,
a.LAST_UPDATE_USER,
a.LAST_UPDATE_TIME,
a.LOCK_STATUS,
a.SUM_ALL,
a.PROVIDENT_PAY_MONTH,
......
......@@ -63,6 +63,7 @@ public class ${className} extends BaseEntity {
#end
#end
@ExcelProperty("$column.comments")
@Schema(description ="$column.comments"#if($column.hidden),hidden=$column.hidden#end)
#if($column.attrType =='LocalDate' || $column.attrType =='LocalDateTime' || $column.attrType =='Date')
private Date $column.lowerAttrName;
#else
......
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