Commit 13529104 authored by fangxinjiang's avatar fangxinjiang

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

parents 407c6ea9 95b8cbf3
...@@ -789,5 +789,10 @@ public class InsurancesConstants { ...@@ -789,5 +789,10 @@ public class InsurancesConstants {
*/ */
public static final String NO_UPDATE_DETAIL_JURISDICTION = "无更新当前保单信息的权限"; 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; package com.yifu.cloud.plus.v1.yifu.insurances.util;
import cn.hutool.json.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper; 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 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.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.io.File; import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/** /**
* @author zhaji * @author zhaji
...@@ -16,39 +25,158 @@ import java.io.File; ...@@ -16,39 +25,158 @@ import java.io.File;
* *
* @date 2022-08-05 09:42:33 * @date 2022-08-05 09:42:33
*/ */
@Slf4j
@Component
public class EKPUtil { 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对象,且包含上传功能的样例 * 多层级的VO对象,且包含上传功能的样例
* 注意key的书写格式,类似EL表达式的方式,属性关系用'.', 列表和数组关系用[],Map关系用["xxx"] * 注意key的书写格式,类似EL表达式的方式,属性关系用'.', 列表和数组关系用[],Map关系用["xxx"]
*/ */
public static void testAddNewsInRestTemplate() throws Exception{ public static String sendToEKP(EKPInteractiveParam param){
System.out.println("开始推送EKP");
RestTemplate yourRestTemplate = new RestTemplate(); RestTemplate yourRestTemplate = new RestTemplate();
TInsuranceSettlePushParam formValues = new TInsuranceSettlePushParam(); TInsuranceSettlePushParam pushParam = InsuranceDetail2PushParam(param);
String jsonObject = new ObjectMapper().writeValueAsString(formValues); try{
String formValues = new ObjectMapper().writeValueAsString(pushParam);
//指向EKP的接口url //指向EKP的接口url
String url = "http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel";
//把ModelingAppModelParameterAddForm转换成MultiValueMap //把ModelingAppModelParameterAddForm转换成MultiValueMap
JSONObject loginName = new JSONObject();
loginName.append("LoginName",LoginName);
String loginData = new ObjectMapper().writeValueAsString(loginName);
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>(); MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject", new String("接口发起流程".getBytes("UTF-8"),"ISO-8859-1") ); wholeForm.add("docSubject", new String(docSubject.getBytes("UTF-8"),"ISO-8859-1") );
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}"); //wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docStatus", 20); wholeForm.add("docCreator", loginData);
wholeForm.add("fdModelId", "181d73279372e5a55438a47d7436ab7e"); wholeForm.add("docStatus", docStatus);
wholeForm.add("fdFlowId", "18267f206233f29cbd3c5ee425c9408a"); 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") );
//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(); HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入 //如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON //addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers.setContentType(MediaType.MULTIPART_FORM_DATA); headers.setContentType(MediaType.MULTIPART_FORM_DATA);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果 //必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers); HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
//有返回值的情况 VO可以替换成具体的JavaBean //有返回值的情况 VO可以替换成具体的JavaBean
System.out.println("交易开始");
ResponseEntity<String> obj = yourRestTemplate.exchange(url, HttpMethod.POST, entity, String.class); ResponseEntity<String> obj = yourRestTemplate.exchange(url, HttpMethod.POST, entity, String.class);
System.out.println("交易结束");
System.out.println("obj"+obj);
String body = obj.getBody(); 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; ...@@ -14,7 +14,7 @@ import java.io.Serializable;
@Data @Data
@Tag(name = "项目类") @Tag(name = "项目类")
public class Dept implements Serializable { 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; 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 lombok.Data;
import org.springframework.cglib.core.Local;
import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Date;
/** /**
* @author zhaji * @author zhaji
...@@ -11,160 +18,200 @@ import java.time.LocalDate; ...@@ -11,160 +18,200 @@ import java.time.LocalDate;
* @date 2022-08-05 10:32:16 * @date 2022-08-05 10:32:16
*/ */
@Data @Data
public class TInsuranceSettlePushParam { public class TInsuranceSettlePushParam{
/** /**
* ID主键 36位 * ID主键 36位
*/ */
private String fd_id ; private String fd_id ;
/** /**
* 单据类型 200 单选(预估单,实缴单,差异单) * 单据类型 200 单选(1,预估单,2,实缴单,3,差异单)
*/ */
private String fd_3adfe6af71a1cc; @Schema(description = "单据类型")
private Integer fd_3adfe6af71a1cc;
/** /**
* 项目编码 200 * 项目编码 200
*/ */
@Schema(description = "项目编码")
private String fd_3adfe658c6229e; private String fd_3adfe658c6229e;
/** /**
* 项目名称 200 * 项目名称 200
*/ */
@Schema(description = "项目名称")
private String fd_3adfe6592b4158; private String fd_3adfe6592b4158;
/** /**
* 单号 200 * 单号 200
*/ */
@Schema(description = "单号")
private String fd_3adfe67a9f6364; private String fd_3adfe67a9f6364;
/** /**
* 客户编码 200 * 客户编码 200
*/ */
@Schema(description = "客户编码")
private String fd_3adfe6598281e8; private String fd_3adfe6598281e8;
/** /**
* 客户名称 200 * 客户名称 200
*/ */
@Schema(description = "客户名称")
private String fd_3adfe7a2688902; private String fd_3adfe7a2688902;
/** /**
* 发生日期 "xxxx--xx--xx" * 发生日期 "xxxx--xx--xx"
*/ */
private LocalDate fd_3adfe67c24dace; @Schema(description = "发生日期")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private String fd_3adfe67c24dace;
/** /**
* 姓名 200 * 姓名 200
*/ */
@Schema(description = "姓名")
private String fd_3adfe65d759650; private String fd_3adfe65d759650;
/** /**
* 身份证号 200 * 身份证号 200
*/ */
@Schema(description = "身份证号")
private String fd_3adfe65dbd9f68; private String fd_3adfe65dbd9f68;
/** /**
* 发票号 200 * 发票号 200
*/ */
@Schema(description = "发票号")
private String fd_3adfe65e0cd094; private String fd_3adfe65e0cd094;
/** /**
* 险种 200 * 险种 200
*/ */
@Schema(description = "险种")
private String fd_3adfe65f6599e4; private String fd_3adfe65f6599e4;
/** /**
* 保险公司 200 * 保险公司 200
*/ */
@Schema(description = "保险公司")
private String fd_3adfe65ea04728; private String fd_3adfe65ea04728;
/** /**
* 保单号 200 * 保单号 200
*/ */
@Schema(description = "保单号")
private String fd_3adfe65e60e110; private String fd_3adfe65e60e110;
/** /**
* 保险开始日期 "xxxx--xx--xx" * 保险开始日期 "xxxx--xx--xx"
*/ */
private LocalDate fd_3adfe6b7e0ede8; @Schema(description = "保险开始日期")
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
private String fd_3adfe6b7e0ede8;
/** /**
* 保险结束日期 "xxxx--xx--xx" * 保险结束日期 "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 * 事故或残疾 200
*/ */
@Schema(description = "事故或残疾")
private String fd_3adfe6609aa810; 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; private String fd_3adfe6ec6a8cbe;
/** /**
* 收款状态 200 单选(已收,未收) * 收款状态 200 单选(1未收,2已收)
*/ */
@Schema(description = "收款状态")
private String fd_3adfe6ef5dfaac; private String fd_3adfe6ef5dfaac;
/** /**
* 收入结算单号 200 * 收入结算单号 200
*/ */
@Schema(description = "收入结算单号")
private String fd_3adfe79fd04606; private String fd_3adfe79fd04606;
/** /**
* 收款认领单号 200 * 收款认领单号 200
*/ */
@Schema(description = "收款认领单号")
private String fd_3adfe7a117f086; private String fd_3adfe7a117f086;
/** /**
* 应支出 精确到小数点后两位 * 应支出 精确到小数点后两位
*/ */
@Schema(description = "应支出")
private Double fd_3adfe6e3911ffe; private Double fd_3adfe6e3911ffe;
/** /**
* 支出结算状态 200 单选(已结算,结算中,未结算) * 支出结算状态 200 单选(已结算,结算中,未结算)
*/ */
@Schema(description = "支出结算状态")
private String fd_3adfe6eda67236; private String fd_3adfe6eda67236;
/** /**
* 付款状态 200 单选(已收,未收) * 付款状态 200 单选(已收,未收)
*/ */
@Schema(description = "付款状态")
private String fd_3adfe6f05531ec; private String fd_3adfe6f05531ec;
/** /**
* 支出结算单号 200 * 支出结算单号 200
*/ */
@Schema(description = "支出结算单号")
private String fd_3adfe7a035849c; private String fd_3adfe7a035849c;
/** /**
* 付款单号 200 * 付款单号 200
*/ */
@Schema(description = "付款单号")
private String fd_3adfe7a08eba96; private String fd_3adfe7a08eba96;
/** /**
* 结算月份 200 * 结算月份 200
*/ */
@Schema(description = "结算月份")
private String fd_3aea2f0180eccc; private String fd_3aea2f0180eccc;
/**
* 状态 200
*/
@Schema(description = "状态1新增结算单,2作废结算信息,3更新保单信息")
private String fd_3af9197b31071c;
} }
...@@ -442,8 +442,8 @@ public class TInsuranceDetailController { ...@@ -442,8 +442,8 @@ public class TInsuranceDetailController {
*/ */
@Operation(summary = "查询项目列表", description = "查询项目列表") @Operation(summary = "查询项目列表", description = "查询项目列表")
@GetMapping("/deptList") @GetMapping("/deptList")
public R getDeptList() { public R getDeptList(){
return tInsuranceDetailService.getDeptListByUser(); return tInsuranceDetailService.getDeptList();
} }
/** /**
......
...@@ -42,6 +42,9 @@ import java.util.*; ...@@ -42,6 +42,9 @@ import java.util.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -405,12 +408,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -405,12 +408,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart())) .eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd())) .eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
BeanCopyUtils.copyProperties(detail,newDetail); BeanCopyUtils.copyProperties(detail,newDetail);
detail.setIsEffect(CommonConstants.ONE_INT); detail.setIsEffect(CommonConstants.ONE_INT);
detail.setIsOverdue(null); detail.setIsOverdue(null);
detail.setUpdateTime(LocalDateTime.now());
this.updateById(detail); this.updateById(detail);
//新数据置为待办理 //新数据置为待办理
newDetail.setId(null); newDetail.setId(null);
...@@ -445,7 +449,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -445,7 +449,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
replace.setToInsuranceDetailId(newDetail.getId()); replace.setToInsuranceDetailId(newDetail.getId());
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId()) .eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(one).isPresent()){ if (Optional.ofNullable(one).isPresent()){
...@@ -547,6 +550,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -547,6 +550,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(!LocalDateUtil.isDate(param.getPolicyEnd(),LocalDateUtil.NORM_DATE_PATTERN)){ if(!LocalDateUtil.isDate(param.getPolicyEnd(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_END_PARSE_ERROR); 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 (byId.getSignFlag() == CommonConstants.ZERO_INT){
if(!LocalDateUtil.isFutureDate(param.getPolicyStart())){ if(!LocalDateUtil.isFutureDate(param.getPolicyStart())){
...@@ -557,7 +565,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -557,7 +565,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda() TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName()) .eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceCompany::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceCompany).isPresent()){ if (!Optional.ofNullable(insuranceCompany).isPresent()){
...@@ -570,7 +577,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -570,7 +577,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceType::getName, param.getInsuranceTypeName()) .eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId()) .eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceType::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceType).isPresent()){ if (!Optional.ofNullable(insuranceType).isPresent()){
...@@ -581,7 +587,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -581,7 +587,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard()) .eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId()) .eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeStandard::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(typeStandard).isPresent()){ if (!Optional.ofNullable(typeStandard).isPresent()){
...@@ -602,7 +607,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -602,7 +607,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId()) .eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeRate::getMonth, month) .eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeRate::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(typeRate).isPresent()){ if (!Optional.ofNullable(typeRate).isPresent()){
...@@ -638,7 +642,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -638,7 +642,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(insuranceDetail).isPresent() && !insuranceDetail.getId().equals(param.getId())){ if (Optional.ofNullable(insuranceDetail).isPresent() && !insuranceDetail.getId().equals(param.getId())){
...@@ -674,7 +678,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -674,7 +678,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
...@@ -714,7 +718,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -714,7 +718,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId()) .eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){ if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail insuranceDetail = this.getById(one.getFromInsuranceDetailId()); TInsuranceDetail insuranceDetail = this.getById(one.getFromInsuranceDetailId());
...@@ -727,7 +730,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -727,7 +730,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//被替换者无效 //被替换者无效
insuranceDetail.setIsEffect(CommonConstants.ONE_INT); insuranceDetail.setIsEffect(CommonConstants.ONE_INT);
insuranceDetail.setIsOverdue(CommonConstants.ONE_INT); insuranceDetail.setIsOverdue(null);
insuranceDetail.setUpdateTime(LocalDateTime.now()); insuranceDetail.setUpdateTime(LocalDateTime.now());
this.updateById(insuranceDetail); this.updateById(insuranceDetail);
//替换记录成功 //替换记录成功
...@@ -854,7 +857,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -854,7 +857,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO.setRemark(InsurancesConstants.ADD); listVO.setRemark(InsurancesConstants.ADD);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId()) .eq(TInsuranceReplace::getToInsuranceDetailId, listVO.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){ if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId()); TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId());
...@@ -937,7 +939,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -937,7 +939,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda() TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId()) .eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
.orderByDesc(TInsuranceReplace::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){ if (Optional.ofNullable(one).isPresent()){
//替换记录变为失败 //替换记录变为失败
...@@ -1046,6 +1047,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1046,6 +1047,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT); detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT); detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
successList.add(detail); successList.add(detail);
}else{ }else{
//根据结算类型判断是否需要计算预估保费 //根据结算类型判断是否需要计算预估保费
...@@ -1066,6 +1068,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1066,6 +1068,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT); detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT); detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
//保费存储 //保费存储
TInsuranceSettle settle = new TInsuranceSettle(); TInsuranceSettle settle = new TInsuranceSettle();
...@@ -1099,6 +1102,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1099,6 +1102,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT); detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT); detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
//保费存储 //保费存储
TInsuranceSettle settle = new TInsuranceSettle(); TInsuranceSettle settle = new TInsuranceSettle();
...@@ -1128,6 +1132,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1128,6 +1132,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsEffect(CommonConstants.ZERO_INT); detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT); detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
successList.add(detail); successList.add(detail);
} }
} }
...@@ -1182,7 +1187,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1182,7 +1187,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart())) .eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(success.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd())) .eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (StringUtils.isNotBlank(success.getInvoiceNo())){ if (StringUtils.isNotBlank(success.getInvoiceNo())){
...@@ -1477,7 +1482,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1477,7 +1482,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda() TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName()) .eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceCompany::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceCompany).isPresent()){ if (!Optional.ofNullable(insuranceCompany).isPresent()){
...@@ -1492,7 +1496,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1492,7 +1496,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceType::getName, param.getInsuranceTypeName()) .eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId()) .eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceType::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceType).isPresent()){ if (!Optional.ofNullable(insuranceType).isPresent()){
...@@ -1505,7 +1508,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1505,7 +1508,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard()) .eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId()) .eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeStandard::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(typeStandard).isPresent()){ if (!Optional.ofNullable(typeStandard).isPresent()){
...@@ -1528,7 +1530,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1528,7 +1530,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId()) .eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeRate::getMonth, month) .eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeRate::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(typeRate).isPresent()){ if (!Optional.ofNullable(typeRate).isPresent()){
...@@ -1578,7 +1579,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1578,7 +1579,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(insuranceDetail).isPresent()){ if (Optional.ofNullable(insuranceDetail).isPresent()){
...@@ -1617,7 +1618,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1617,7 +1618,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
...@@ -1850,7 +1851,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1850,7 +1851,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(limitOne).isPresent()){ if (!Optional.ofNullable(limitOne).isPresent()){
...@@ -1866,7 +1867,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1866,7 +1867,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda() TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName()) .eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceCompany::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceCompany).isPresent()){ if (!Optional.ofNullable(insuranceCompany).isPresent()){
...@@ -1881,7 +1881,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1881,7 +1881,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceType::getName, param.getInsuranceTypeName()) .eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId()) .eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceType::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(insuranceType).isPresent()){ if (!Optional.ofNullable(insuranceType).isPresent()){
...@@ -1894,7 +1893,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1894,7 +1893,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard()) .eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId()) .eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeStandard::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(typeStandard).isPresent()){ if (!Optional.ofNullable(typeStandard).isPresent()){
...@@ -1917,7 +1915,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1917,7 +1915,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId()) .eq(TInsuranceTypeRate::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeRate::getMonth, month) .eq(TInsuranceTypeRate::getMonth, month)
.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceTypeRate::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(typeRate).isPresent()){ if (!Optional.ofNullable(typeRate).isPresent()){
...@@ -1978,7 +1975,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1978,7 +1975,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(insuranceDetail).isPresent()){ if (Optional.ofNullable(insuranceDetail).isPresent()){
...@@ -2184,7 +2181,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2184,7 +2181,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart())) .eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd())) .eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(detail).isPresent()){ if (!Optional.ofNullable(detail).isPresent()){
...@@ -2270,7 +2267,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2270,7 +2267,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(replace).isPresent()){ if (Optional.ofNullable(replace).isPresent()){
...@@ -2308,7 +2305,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2308,7 +2305,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT) wrapper -> wrapper.eq(TInsuranceDetail::getIsOverdue,CommonConstants.ZERO_INT)
.or().isNull(TInsuranceDetail::getIsOverdue) .or().isNull(TInsuranceDetail::getIsOverdue)
) )
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
...@@ -2410,7 +2407,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2410,7 +2407,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart())) .eq(TInsuranceDetail::getPolicyStart, LocalDateUtil.parseLocalDate(param.getPolicyStart()))
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd())) .eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(param.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(detail).isPresent()){ if (!Optional.ofNullable(detail).isPresent()){
...@@ -2445,7 +2442,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2445,7 +2442,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail batchPolicyNo = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail batchPolicyNo = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo()) .eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (!Optional.ofNullable(batchPolicyNo).isPresent()){ if (!Optional.ofNullable(batchPolicyNo).isPresent()){
...@@ -2469,7 +2466,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2469,7 +2466,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail addPolicyNo = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda() TInsuranceDetail addPolicyNo = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo()) .eq(TInsuranceDetail::getPolicyNo, param.getPolicyNo())
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT) .eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL) .last(CommonConstants.LAST_ONE_SQL)
); );
if (Optional.ofNullable(addPolicyNo).isPresent()){ if (Optional.ofNullable(addPolicyNo).isPresent()){
...@@ -2870,7 +2867,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2870,7 +2867,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){ public R<List<RefundExportListVo>> getInsuranceRefundHandlingList(RefundExportListParam param){
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
List<RefundExportListVo> refundExportList; List<RefundExportListVo> refundExportList;
//todo 根据登录人获取数据权限 //todo 根据登录人获取数据权限
...@@ -2908,9 +2904,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2908,9 +2904,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceRefund refund = new TInsuranceRefund(); TInsuranceRefund refund = new TInsuranceRefund();
detail.setId(record.getId()); detail.setId(record.getId());
//update状态由「待减员」置为「减员中」 //update状态由「待减员」置为「减员中」
detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detailList.add(detail); detailList.add(detail);
refund.setInsDetailId(record.getId()); refund.setInsDetailId(record.getId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT); refund.setReduceHandleStatus(CommonConstants.TWO_INT);
...@@ -2924,9 +2919,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2924,9 +2919,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
for (TInsuranceDetail s : detailList) { for (TInsuranceDetail s : detailList) {
updateWrapper.eq(TInsuranceDetail :: getId,s.getId()) updateWrapper.eq(TInsuranceDetail :: getId,s.getId())
.set(TInsuranceDetail :: getUpdateBy,user.getId()) .set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT);
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.TWO_INT)
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper); update(updateWrapper);
} }
} }
...@@ -2980,8 +2973,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2980,8 +2973,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
}else{ }else{
if (CommonConstants.ZERO_INT == deleteFlag ){ if (CommonConstants.ZERO_INT == deleteFlag ){
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setReduceHandleStatus(refundType); tInsuranceDetail.setReduceHandleStatus(refundType);
if(CommonConstants.FOUR_INT == refundType){ if(CommonConstants.FOUR_INT == refundType){
tInsuranceDetail.setIsOverdue(null); tInsuranceDetail.setIsOverdue(null);
...@@ -2990,8 +2981,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2990,8 +2981,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else { }else {
tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT); tInsuranceDetail.setBuyHandleStatus(CommonConstants.THREE_INT);
} }
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
successList.add(tInsuranceDetail); successList.add(tInsuranceDetail);
//新增减员记录 //更新减员记录
refund.setInsDetailId(tInsuranceDetail.getId()); refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId()); refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now()); refund.setCreateTime(LocalDateTime.now());
...@@ -3026,33 +3018,53 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3026,33 +3018,53 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList) { public R settleMonthChange(List<SettleMonthChangeCheckParam> settleMonthCheckList) {
//初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(50, 50, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(settleMonthCheckList)){ if(!Common.isNotEmpty(settleMonthCheckList)){
return R.failed(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY); return R.failed(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
} }
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList,user); Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList,user);
//todo 生成EKP通知,通知ekp变更结算月份 //todo 生成EKP通知,通知ekp变更结算月份
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<TInsuranceOperate> operateList = new ArrayList<>(); List<TInsuranceOperate> operateList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
if(CollectionUtils.isNotEmpty(successList)){ 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<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,success.getId()) updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,success.getSettleMonth()) .set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId()) .set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()); .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper); update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate(); TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(success.getId()); insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId()); insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname()); insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now()); insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE); insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
operateList.add(insuranceOperate); 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); tInsuranceOperateService.saveBatch(operateList);
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
return R.ok(errorList,"导入成功"); return R.ok(errorList,"导入成功");
} }
...@@ -3073,9 +3085,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3073,9 +3085,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList,user); Map<String, List<DeptChangeCheckParam>> stringListMap = deptChangeCheck(deptChangeCheckList,user);
//todo 生成EKP通知,通知ekp变更结算所属项目 //todo 生成EKP通知,通知ekp变更结算所属项目
List<DeptChangeCheckParam> successList = stringListMap.get("successList"); 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)){ if(CollectionUtils.isNotEmpty(successList)){
for (DeptChangeCheckParam success : successList) { for (DeptChangeCheckParam success : successList) {
TInsuranceDetail one = getOne(lambdaQuery().getWrapper().eq(TInsuranceDetail::getId, success.getId()));
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
Integer oldSettleType = success.getOldSettleType(); Integer oldSettleType = success.getOldSettleType();
Integer newSettleType = success.getNewSettleType(); Integer newSettleType = success.getNewSettleType();
...@@ -3382,38 +3396,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3382,38 +3396,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateTime(LocalDateTime.now()); insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE); insuranceOperate.setOperateDesc(InsurancesConstants.DEPT_CHANGE);
operateList.add(insuranceOperate); operateList.add(insuranceOperate);
detailList.add(one);
} }
} }
tInsuranceOperateService.saveBatch(operateList); tInsuranceOperateService.saveBatch(operateList);
List<DeptChangeCheckParam> errorList = stringListMap.get("errorList"); List<DeptChangeCheckParam> errorList = stringListMap.get("errorList");
try{ //EKPUtil.testAddNewsInRestTemplate(detailList);
EKPUtil.testAddNewsInRestTemplate();
}catch (Exception e){
System.out.println(e.getMessage());
}
return R.ok(errorList,"导入成功"); 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 * 发送变更项目至EKP
* *
...@@ -3421,18 +3412,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3421,18 +3412,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param successList * @param successList
* @return void * @return void
*/ */
private void updateDept2EKP(List<DeptChangeCheckParam> successList) { private void updateDeptNo2EKP(List<TInsuranceDetail> successList) {
for (DeptChangeCheckParam param : successList) { for (TInsuranceDetail 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 * 发送作废信息至EKP
...@@ -3637,7 +3621,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3637,7 +3621,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)) .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)) .eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL); .last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper); List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){ if (list.size()>1){
...@@ -3808,6 +3792,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3808,6 +3792,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16); Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16);
List<SettleMonthChangeCheckParam> errorList = new ArrayList<>(); List<SettleMonthChangeCheckParam> errorList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = new ArrayList<>(); List<SettleMonthChangeCheckParam> successList = new ArrayList<>();
List<EKPInteractiveParam> ekpList = new ArrayList<>();
for (SettleMonthChangeCheckParam param : settleMonthCheckList) { for (SettleMonthChangeCheckParam param : settleMonthCheckList) {
//员工姓名 //员工姓名
String empName = param.getEmpName(); String empName = param.getEmpName();
...@@ -3830,6 +3815,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3830,6 +3815,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
errorList.add(param); errorList.add(param);
continue; continue;
} }
//项目所属权限验证
if(!deptNoList.stream().anyMatch(u ->u.equals(deptNo))){ if(!deptNoList.stream().anyMatch(u ->u.equals(deptNo))){
param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST); param.setErrorMessage(InsurancesConstants.DEPT_NO_NOT_IN_USER_DEPT_LIST);
errorList.add(param); errorList.add(param);
...@@ -3910,7 +3896,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3910,7 +3896,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName) .eq(TInsuranceDetail :: getInsuranceTypeName,insuranceTypeName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) ) .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart) )
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)) .eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL); .last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper); List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){ if (list.size()>1){
...@@ -4000,6 +3986,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4000,6 +3986,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
} }
param.setId(insuranceDetail.getId()); param.setId(insuranceDetail.getId());
EKPInteractiveParam ekpInteractiveParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(insuranceDetail,ekpInteractiveParam);
ekpInteractiveParam.setSettleMonth(settleMonth);
ekpList.add(ekpInteractiveParam);
successList.add(param); successList.add(param);
} }
map.put("errorList",errorList); map.put("errorList",errorList);
...@@ -4159,7 +4149,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4159,7 +4149,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName) .eq(TInsuranceDetail :: getInsuranceCompanyName,insuranceCompanyName)
.eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart)) .eq(TInsuranceDetail :: getPolicyStart,LocalDateUtil.parseLocalDate(policyStart))
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd)) .eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd))
.orderByDesc(TInsuranceDetail::getCreateTime) .orderByDesc(TInsuranceDetail::getUpdateTime)
.last(CommonConstants.LAST_ONE_SQL); .last(CommonConstants.LAST_ONE_SQL);
List<TInsuranceDetail> list = list(queryWrapper); List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){ if (list.size()>1){
...@@ -4286,7 +4276,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -4286,7 +4276,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/ */
@Override @Override
public R getDeptList(){ 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(); R<TSettleDomainListVo> tSettleDomainListVoR = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (null != tSettleDomainListVoR && tSettleDomainListVoR.getCode() == CommonConstants.SUCCESS && Common.isNotNull(tSettleDomainListVoR.getData())) { if (null != tSettleDomainListVoR && tSettleDomainListVoR.getCode() == CommonConstants.SUCCESS && Common.isNotNull(tSettleDomainListVoR.getData())) {
TSettleDomainListVo data = tSettleDomainListVoR.getData(); TSettleDomainListVo data = tSettleDomainListVoR.getData();
...@@ -4299,7 +4291,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -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 ...@@ -4433,5 +4426,32 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return sql; 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: ...@@ -15,3 +15,10 @@ spring:
username: root username: root
password: yf_zsk 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 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; ...@@ -39,9 +39,9 @@ import java.util.Date;
*/ */
@Data @Data
@TableName("t_approval_record") @TableName("t_approval_record")
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode()
@Schema(description = "审批记录表") @Schema(description = "审批记录表")
public class TApprovalRecord extends BaseEntity { public class TApprovalRecord {
/** /**
* 主键 * 主键
...@@ -60,8 +60,7 @@ public class TApprovalRecord extends BaseEntity { ...@@ -60,8 +60,7 @@ public class TApprovalRecord extends BaseEntity {
/** /**
* 节点id * 节点id
*/ */
@ExcelAttribute(name = "节点id", isNotEmpty = true, errorInfo = "节点id不能为空", maxLength = 32) @ExcelAttribute(name = "节点id", maxLength = 32)
@NotBlank(message = "节点id不能为空")
@Length(max = 32, message = "节点id不能超过32个字符") @Length(max = 32, message = "节点id不能超过32个字符")
@ExcelProperty("节点id") @ExcelProperty("节点id")
private String nodeId; private String nodeId;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.salary.service.impl; package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.context.AnalysisContext;
...@@ -32,13 +31,16 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; ...@@ -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.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; 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.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.entity.TSalaryStandard;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper; 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.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo; 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.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
...@@ -58,6 +60,10 @@ import java.util.List; ...@@ -58,6 +60,10 @@ import java.util.List;
@Log4j2 @Log4j2
@Service @Service
public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService { public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMapper, TSalaryStandard> implements TSalaryStandardService {
@Autowired
private TApprovalRecordService approvalRecordService;
/** /**
* 标准薪酬工资表简单分页查询 * 标准薪酬工资表简单分页查询
* *
...@@ -234,15 +240,29 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -234,15 +240,29 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
TSalaryStandard tSalaryStandard = baseMapper.selectById(id); TSalaryStandard tSalaryStandard = baseMapper.selectById(id);
if (Common.isNotNull(tSalaryStandard)) { if (Common.isNotNull(tSalaryStandard)) {
//新增流程进展明细
TApprovalRecord tApprovalRecord = new TApprovalRecord();
if (CommonConstants.ZERO_STRING.equals(auditFlag)) { if (CommonConstants.ZERO_STRING.equals(auditFlag)) {
tSalaryStandard.setStatus(CommonConstants.TWO_INT); tSalaryStandard.setStatus(CommonConstants.TWO_INT);
tApprovalRecord.setApprovalResult(CommonConstants.ZERO_STRING);
} else { } else {
tSalaryStandard.setStatus(CommonConstants.FIVE_INT); tSalaryStandard.setStatus(CommonConstants.FIVE_INT);
tApprovalRecord.setApprovalResult(CommonConstants.ONE_STRING);
} }
if (Common.isNotNull(auditRemark)) {
tSalaryStandard.setRemark(auditRemark); tSalaryStandard.setRemark(auditRemark);
tApprovalRecord.setApprovalOpinion(auditRemark);
}
tSalaryStandard.setAuditUser(user.getId()); tSalaryStandard.setAuditUser(user.getId());
tSalaryStandard.setAuditTime(DateUtil.getCurrentDateTime()); tSalaryStandard.setAuditTime(DateUtil.getCurrentDateTime());
baseMapper.updateById(tSalaryStandard); 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(); return R.ok();
......
...@@ -95,7 +95,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable { ...@@ -95,7 +95,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
* 社保缴纳月份empNo * 社保缴纳月份empNo
*/ */
@Length(max = 6, message = "社保缴纳月份不能超过6个字符") @Length(max = 6, message = "社保缴纳月份不能超过6个字符")
@ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6) @ExcelAttribute(name = "社保缴纳月份", isNotEmpty = true, errorInfo = "社保缴纳月份不可为空", maxLength = 6,isInteger = true)
@Schema(description = "社保缴纳月份") @Schema(description = "社保缴纳月份")
@ExcelProperty("社保缴纳月份") @ExcelProperty("社保缴纳月份")
private String socialPayMonth; private String socialPayMonth;
...@@ -103,7 +103,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable { ...@@ -103,7 +103,7 @@ public class TPaymentHeFeiVo extends RowIndex implements Serializable {
* 社保生成月份 * 社保生成月份
*/ */
@Length(max = 6, message = "社保生成月份不能超过6个字符") @Length(max = 6, message = "社保生成月份不能超过6个字符")
@ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6) @ExcelAttribute(name = "社保生成月份", isNotEmpty = true, errorInfo = "社保生成月份不可为空", maxLength = 6,isInteger = true)
@Schema(description = "社保生成月份") @Schema(description = "社保生成月份")
@ExcelProperty("社保生成月份") @ExcelProperty("社保生成月份")
private String socialCreateMonth; private String socialCreateMonth;
......
...@@ -38,6 +38,15 @@ import java.util.Date; ...@@ -38,6 +38,15 @@ import java.util.Date;
@Data @Data
public class TPaymentInfoVo extends RowIndex implements Serializable { 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 { ...@@ -115,7 +124,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 社保缴纳月份 * 社保缴纳月份
*/ */
@Length(max = 6, message = "社保缴纳月份 不能超过6 个字符") @Length(max = 6, message = "社保缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "社保缴纳月份", maxLength = 6) @ExcelAttribute(name = "社保缴纳月份", maxLength = 6,isInteger = true)
@Schema(description = "社保缴纳月份") @Schema(description = "社保缴纳月份")
@ExcelProperty("社保缴纳月份") @ExcelProperty("社保缴纳月份")
private String socialPayMonth; private String socialPayMonth;
...@@ -123,7 +132,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable { ...@@ -123,7 +132,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 社保生成月份 * 社保生成月份
*/ */
@Length(max = 6, message = "社保生成月份 不能超过6 个字符") @Length(max = 6, message = "社保生成月份 不能超过6 个字符")
@ExcelAttribute(name = "社保生成月份", maxLength = 6) @ExcelAttribute(name = "社保生成月份", maxLength = 6,isInteger = true)
@Schema(description = "社保生成月份") @Schema(description = "社保生成月份")
@ExcelProperty("社保生成月份") @ExcelProperty("社保生成月份")
private String socialCreateMonth; private String socialCreateMonth;
...@@ -146,7 +155,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable { ...@@ -146,7 +155,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 公积金缴纳月份 * 公积金缴纳月份
*/ */
@Length(max = 6, message = "公积金缴纳月份 不能超过6 个字符") @Length(max = 6, message = "公积金缴纳月份 不能超过6 个字符")
@ExcelAttribute(name = "公积金缴纳月份", maxLength = 6) @ExcelAttribute(name = "公积金缴纳月份", maxLength = 6,isInteger = true)
@Schema(description = "公积金缴纳月份") @Schema(description = "公积金缴纳月份")
@ExcelProperty("公积金缴纳月份") @ExcelProperty("公积金缴纳月份")
private String providentPayMonth; private String providentPayMonth;
...@@ -154,7 +163,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable { ...@@ -154,7 +163,7 @@ public class TPaymentInfoVo extends RowIndex implements Serializable {
* 公积金生成月份 * 公积金生成月份
*/ */
@Length(max = 6, message = "公积金生成月份 不能超过6 个字符") @Length(max = 6, message = "公积金生成月份 不能超过6 个字符")
@ExcelAttribute(name = "公积金生成月份", maxLength = 6) @ExcelAttribute(name = "公积金生成月份", maxLength = 6,isInteger = true)
@Schema(description = "公积金生成月份") @Schema(description = "公积金生成月份")
@ExcelProperty("公积金生成月份") @ExcelProperty("公积金生成月份")
private String providentCreateMonth; private String providentCreateMonth;
......
...@@ -19,14 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.social.controller; ...@@ -19,14 +19,12 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.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.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil; 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.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; 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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoImportLogService; 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 org.apache.commons.lang.StringUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement; import io.swagger.v3.oas.annotations.security.SecurityRequirement;
...@@ -57,19 +55,15 @@ public class TPaymentInfoImportLogController { ...@@ -57,19 +55,15 @@ public class TPaymentInfoImportLogController {
@Operation(description = "导出社保导入日志") @Operation(description = "导出社保导入日志")
@GetMapping("/exportPaymentInfoLog") @GetMapping("/exportPaymentInfoLog")
public void exportPaymentInfoLog(HttpServletResponse response) { public String exportPaymentInfoLog(HttpServletResponse response) {
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT; String key = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT;
String importRandom = (String) redisUtil.get(key); String importRandom = (String) redisUtil.get(key);
if (StringUtils.isBlank(importRandom)) { if (StringUtils.isBlank(importRandom)) {
ServiceUtil.runTimeExceptionDiy("当前社保数据还未导入完成或者数据不存在"); return importRandom;
} }
String res = tPaymentInfoImportLogService.exportPaymentInfoLog(response, importRandom); return null;
if (Common.isNotNull(res)){
ServiceUtil.runTimeExceptionDiy(res);
} }
}
/** /**
* @description: 清空社保导入日志表 * @description: 清空社保导入日志表
......
...@@ -54,6 +54,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R; ...@@ -54,6 +54,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
...@@ -497,7 +498,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -497,7 +498,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// 处理第一个0位元素 // 处理第一个0位元素
final List<TPaymentInfoVo> finalList = list.subList(0, 1); final List<TPaymentInfoVo> finalList = list.subList(0, 1);
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() -> CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2, executeImportSocialList(user, atomicLine, random, finalList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
CommonConstants.ONE_INT, errorMessageList), yfSocialImportThreadPoolExecutor); CommonConstants.ONE_INT, errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -512,7 +513,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -512,7 +513,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList; List<TPaymentInfoVo> finalTempList = tempList;
final int idx = i - partSize + 2; final int idx = i - partSize + 2;
CompletableFuture.supplyAsync(() -> CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2, executeImportSocialList(user, atomicLine, random, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
idx, errorMessageList), yfSocialImportThreadPoolExecutor); idx, errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -538,7 +539,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -538,7 +539,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<TPaymentInfoVo> finalTempList = tempList; List<TPaymentInfoVo> finalTempList = tempList;
int finalLastIdx = lastIdx + 1; int finalLastIdx = lastIdx + 1;
CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() -> CompletableFuture<List<ErrorMessage>> listCompletableFuture = CompletableFuture.supplyAsync(() ->
executeImportSocialList(user, atomicLine, random, list, areaMap, areaMap2, executeImportSocialList(user, atomicLine, random, finalTempList, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap, paymentInfoPensionMap, paymentInfoBigMap, paymentInfoBirMap,
paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
finalLastIdx, errorMessageList), yfSocialImportThreadPoolExecutor); finalLastIdx, errorMessageList), yfSocialImportThreadPoolExecutor);
...@@ -557,7 +558,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -557,7 +558,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} while (computeFlag); } while (computeFlag);
String importSuccessKey = user.getId() + CommonConstants.DOWN_LINE_STRING + CommonConstants.PAYMENT_SOCIAL_WAIT_EXPORT; 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) { } catch (Exception e) {
log.error("社保缴费库数据批量导入异常:" + e); log.error("社保缴费库数据批量导入异常:" + e);
...@@ -1021,6 +1024,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1021,6 +1024,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSocialSum(BigDecimalUtils.safeAdd( paymentInfo.setSocialSum(BigDecimalUtils.safeAdd(
paymentInfo.getUnitSocialSum(), paymentInfo.getSocialSecurityPersonalSum())); paymentInfo.getUnitSocialSum(), paymentInfo.getSocialSecurityPersonalSum()));
paymentInfo.setSumAll(paymentInfo.getSocialSum()); paymentInfo.setSumAll(paymentInfo.getSocialSum());
paymentInfo.setCreateBy(user.getId());
paymentInfo.setCreateName(user.getNickname());
if (null != paymentInfo && Common.isEmpty(paymentInfo.getSocialId())) { if (null != paymentInfo && Common.isEmpty(paymentInfo.getSocialId())) {
paymentInfo.setSocialId(UUID.randomUUID().toString()); paymentInfo.setSocialId(UUID.randomUUID().toString());
} }
...@@ -1272,7 +1277,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1272,7 +1277,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
AreaVo areaList = areaListR.getData(); AreaVo areaList = areaListR.getData();
if (null != areaList && !areaList.getSysAreaList().isEmpty()) { if (null != areaList && !areaList.getSysAreaList().isEmpty()) {
for (SysArea area : areaList.getSysAreaList()) { 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 ...@@ -1376,8 +1381,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!")); + CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
continue; continue;
} }
if (null != fundMap || null != fundMapTemp) { if (fundMap.size() >CommonConstants.ZERO_INT || fundMapTemp.size() >CommonConstants.ZERO_INT) {
if (null != fundMap) { if (fundMap.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMap.get(infoVo.getEmpIdcard()); fund = (TProvidentFund) fundMap.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验 //对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) { if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
...@@ -1387,10 +1392,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1387,10 +1392,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
} }
areaArray = infoVo.getProvidentPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING); 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( if (null == fund || (null != fund && !ServiceUtil.checkMothForPaymentImport(
fund.getProvidentStart(), infoVo.getProvidentPayMonth(), fund.getFundReduceDate()))) { fund.getProvidentStart(), infoVo.getProvidentPayMonth(), fund.getFundReduceDate()))) {
if (null != fundMapTemp) { if (fundMapTemp.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMapTemp.get(infoVo.getEmpIdcard()); fund = (TProvidentFund) fundMapTemp.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验 //对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) { if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
...@@ -1406,7 +1411,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1406,7 +1411,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
for (TProvidentFund f : fundListTemp) { for (TProvidentFund f : fundListTemp) {
if (f.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport( if (f.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport(
f.getProvidentStart(), infoVo.getProvidentPayMonth(), f.getFundReduceDate())) { f.getProvidentStart(), infoVo.getProvidentPayMonth(), f.getFundReduceDate())) {
fund = checkAddress(areaArray, areaMap, f); fund = checkAddress(areaArray, areaMap,f);
if (null != fund) { if (null != fund) {
break; break;
} }
...@@ -1432,7 +1437,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1432,7 +1437,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//计算公积金合计,个人金额和单位金额一致 //计算公积金合计,个人金额和单位金额一致
infoVo.setProvidentSum(BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getUnitProvidentSum())); infoVo.setProvidentSum(BigDecimalUtils.safeAdd(infoVo.getUnitProvidentSum(), infoVo.getUnitProvidentSum()));
// 判重 // 判重
if (null != paymentInfoMap) { if (paymentInfoMap.size() >CommonConstants.ZERO_INT) {
paymentInfo = (TPaymentInfo) paymentInfoMap.get(infoVo.getProvidentPayAddr() paymentInfo = (TPaymentInfo) paymentInfoMap.get(infoVo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING + CommonConstants.DOWN_LINE_STRING
+ infoVo.getEmpIdcard().trim() + infoVo.getEmpIdcard().trim()
...@@ -1849,6 +1854,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -1849,6 +1854,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//对身份证与人员姓名的对应关系进行校验 //对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) { if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!")); errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
} }
if (socialInfo != null && socialInfo.getSocialStartDate() == null) { if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() + "的社保起缴日期为空!")); errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() + "的社保起缴日期为空!"));
...@@ -2104,6 +2110,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2104,6 +2110,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum())); payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
payExists.setSumAll(payExists.getSocialSum()); payExists.setSumAll(payExists.getSocialSum());
payExists.setCreateBy(user.getId());
payExists.setCreateName(user.getNickname());
if (null != payExists && Common.isEmpty(payExists.getSocialId())) { if (null != payExists && Common.isEmpty(payExists.getSocialId())) {
payExists.setSocialId(UUID.randomUUID().toString()); payExists.setSocialId(UUID.randomUUID().toString());
} }
...@@ -2230,12 +2238,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2230,12 +2238,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} }
if (areaArray.length >= CommonConstants.TWO_INT) { if (areaArray.length >= CommonConstants.TWO_INT) {
if (null != s.getFundProvince()) { 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 (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 (areaArray.length >= CommonConstants.THREE_INT) {
if (null != s.getFundTown() && areaArray[CommonConstants.TWO_INT].equals( if (null != s.getFundTown() && areaArray[CommonConstants.TWO_INT].equals(
areaMap.get(String.valueOf(s.getFundTown())))) { areaMap.get(s.getFundTown()))) {
return s; return s;
} }
} else { } else {
...@@ -2255,7 +2263,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2255,7 +2263,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
} else if (areaArray.length == 1) { } else if (areaArray.length == 1) {
if (null != s.getFundProvince() && null == s.getFundCity()) { 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; return s;
} }
} else { } else {
......
...@@ -32,7 +32,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; ...@@ -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.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; 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.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.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*; import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*; import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
...@@ -84,6 +83,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -84,6 +83,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Autowired @Autowired
private TDispatchInfoService dispatchInfoService; private TDispatchInfoService dispatchInfoService;
@Autowired
private SysHouseHoldInfoMapper sysHouseHoldInfoMapper;
/** /**
* 预派单记录简单分页查询 * 预派单记录简单分页查询
* *
...@@ -577,7 +579,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -577,7 +579,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
@Override @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<>(); List<ErrorMessage> errorList = new ArrayList<>();
R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId); R<TSettleDomainSelectVo> domainR = archivesDaprUtil.getSettleDomainSelectVoById(departId);
// 获取区域数据MAP // 获取区域数据MAP
...@@ -631,12 +634,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -631,12 +634,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setPreStatus(CommonConstants.ZERO_STRING); info.setPreStatus(CommonConstants.ZERO_STRING);
// 为验重添加到MAP // 为验重添加到MAP
existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info); existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
if (Common.isEmpty(info.getExceptionContent())) { if (!Common.isEmpty(info.getExceptionContent())) {
errorList.add(new ErrorMessage(i, "保存成功!", CommonConstants.GREEN));
} else {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
errorList.add(new ErrorMessage(i, "保存成功!" +
info.getExceptionContent(), CommonConstants.RED));
} }
baseMapper.insert(info); baseMapper.insert(info);
} }
...@@ -705,12 +704,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -705,12 +704,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
// 为验重添加到MAP // 为验重添加到MAP
existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info); existsMap.put(info.getEmpIdcard() + CommonConstants.DOWN_LINE_STRING + info.getPayAddress(), info);
if (Common.isEmpty(info.getExceptionContent())) { if (!Common.isEmpty(info.getExceptionContent())) {
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS, CommonConstants.GREEN));
} else {
info.setPreStatus(CommonConstants.ONE_STRING); info.setPreStatus(CommonConstants.ONE_STRING);
errorList.add(new ErrorMessage(i, CommonConstants.SAVE_SUCCESS +
info.getExceptionContent(), CommonConstants.RED));
} }
baseMapper.insert(info); baseMapper.insert(info);
} }
...@@ -978,11 +973,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -978,11 +973,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setContractEndAdd(info.getContractEnd()); info.setContractEndAdd(info.getContractEnd());
info.setContractStartAdd(info.getContractStart()); info.setContractStartAdd(info.getContractStart());
baseMapper.updatePreDispatchInfoById(info); 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) { private static boolean isaBoolean(LocalDateTime temp, LocalDateTime now) {
...@@ -1116,8 +1106,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -1116,8 +1106,13 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd()))); info.setContractTermAdd(Integer.toString(Common.getYearOfTime(info.getContractStart(), info.getContractEnd())));
// 默认工时制 综合工时制2 // 默认工时制 综合工时制2
info.setWorkingHoursAdd(CommonConstants.TWO_STRING); 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 ...@@ -2207,7 +2202,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
Common.isNotNull(preInfo.getPensionStart())){ Common.isNotNull(preInfo.getPensionStart())){
importVo.setPensionStart(DateUtil.getFirstDay(preInfo.getPensionStart())); importVo.setPensionStart(DateUtil.getFirstDay(preInfo.getPensionStart()));
if (Common.isNotNull(preInfo.getPensionAddress())){ 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(), SysBaseSetInfo socialBaseSet = getSysBaseSetInfo(preInfo.getSocialProvince(),preInfo.getSocialCity(),
preInfo.getSocialTown(),preInfo.getSocialHouseAdd(),CommonConstants.ZERO_STRING); preInfo.getSocialTown(),preInfo.getSocialHouseAdd(),CommonConstants.ZERO_STRING);
...@@ -2333,7 +2329,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -2333,7 +2329,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
importVo.setProvidentPer(preInfo.getFundPersonalPer()); importVo.setProvidentPer(preInfo.getFundPersonalPer());
} }
if (Common.isNotNull(preInfo.getFundAddress())){ if (Common.isNotNull(preInfo.getFundAddress())){
importVo.setProvidentHousehold(preInfo.getFundHouseAdd()); SysHouseHoldInfo sysHouseHoldInfo = sysHouseHoldInfoMapper.selectById(preInfo.getFundHouseAdd());
importVo.setProvidentHousehold(sysHouseHoldInfo.getName());
} }
} }
......
...@@ -197,10 +197,11 @@ ...@@ -197,10 +197,11 @@
a.SOCIAL_PAY_ADDR, a.SOCIAL_PAY_ADDR,
a.SOCIAL_PAY_MONTH, a.SOCIAL_PAY_MONTH,
a.SOCIAL_CREATE_MONTH, a.SOCIAL_CREATE_MONTH,
a.CREATE_USER, a.CREATE_BY,
a.UPDATE_TIME,
a.UPDATE_BY,
a.CREATE_NAME,
a.CREATE_TIME, a.CREATE_TIME,
a.LAST_UPDATE_USER,
a.LAST_UPDATE_TIME,
a.LOCK_STATUS, a.LOCK_STATUS,
a.SUM_ALL, a.SUM_ALL,
a.PROVIDENT_PAY_MONTH, a.PROVIDENT_PAY_MONTH,
......
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