Commit 9791b4a6 authored by fangxinjiang's avatar fangxinjiang

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

parents a1245590 9f4ecdfc
...@@ -172,18 +172,22 @@ public class FddContractAttachInfoController { ...@@ -172,18 +172,22 @@ public class FddContractAttachInfoController {
} else { } else {
if (null != util1.getEntityList()) { if (null != util1.getEntityList()) {
List<ErrorMessage> errorInfo = fddContractAttachInfoService.batchAdd(util1.getEntityList()); List<ErrorMessage> errorInfo = fddContractAttachInfoService.batchAdd(util1.getEntityList());
Map<String,Object> variableMap = new HashMap<>(); if (errorInfo.size() > CommonConstants.ZERO_INT) {
Map<Integer,Object> map = new HashMap<>(); Map<String, Object> variableMap = new HashMap<>();
boolean allExitContract = errorInfo.stream().allMatch(e-> checkInfo(e)); Map<Integer, Object> map = new HashMap<>();
boolean allExitContract = errorInfo.stream().allMatch(e -> e.getMessage().equals("存在“在用”的合同"));
if (allExitContract) { if (allExitContract) {
variableMap.put("allMatch","true"); variableMap.put("allMatch", "true");
for (ErrorMessage errorMessage :errorInfo){ for (ErrorMessage errorMessage : errorInfo) {
map.put(errorMessage.getLineNum(),util1.getEntityList().get(errorMessage.getLineNum()-2)); map.put(errorMessage.getLineNum(), util1.getEntityList().get(errorMessage.getLineNum() - 2));
} }
variableMap.put("data",map); variableMap.put("data", map);
return R.ok(variableMap); return R.ok(variableMap, "存在“在用”的合同");
}
return R.failed(errorInfo);
} else {
return R.ok(null,"保存成功");
} }
return new R<>(CommonConstants.dingleDigitIntArray[1], "", errorInfo);
} else { } else {
return R.ok(null,"无数据可导入"); return R.ok(null,"无数据可导入");
} }
...@@ -271,11 +275,9 @@ public class FddContractAttachInfoController { ...@@ -271,11 +275,9 @@ public class FddContractAttachInfoController {
return R.failed("数据为空!"); return R.failed("数据为空!");
} }
List<ErrorMessage> errorInfo = fddContractAttachInfoService.sendTask(entityList); List<ErrorMessage> errorInfo = fddContractAttachInfoService.sendTask(entityList);
return R.ok(errorInfo); if (errorInfo.size() > CommonConstants.ZERO_INT) {
return R.failed(errorInfo);
} }
return R.ok(null,"保存成功");
public boolean checkInfo(ErrorMessage errorMessage) {
Set<String> set = errorMessage.getErrors();
return set.stream().allMatch(e-> e.equals("存在“在用”的合同"));
} }
} }
...@@ -147,6 +147,7 @@ public class FddController { ...@@ -147,6 +147,7 @@ public class FddController {
@Operation(summary = "异步通知", description = "异步通知") @Operation(summary = "异步通知", description = "异步通知")
@RequestMapping(value = "/notifyUrl") @RequestMapping(value = "/notifyUrl")
public R<String> notifyUrl(HttpServletRequest request, HttpServletResponse response) throws Exception { public R<String> notifyUrl(HttpServletRequest request, HttpServletResponse response) throws Exception {
YifuUser user = SecurityUtils.getUser();
checkSign(request); checkSign(request);
String fddEvent = request.getHeader(FDD_EVENT); String fddEvent = request.getHeader(FDD_EVENT);
String fddBizContent = request.getParameter(FDD_BIZ_CONTENT); String fddBizContent = request.getParameter(FDD_BIZ_CONTENT);
...@@ -159,7 +160,6 @@ public class FddController { ...@@ -159,7 +160,6 @@ public class FddController {
if (StringUtils.equals(CommonConstants.TWO_STRING, jsonObject.getString("status"))) { if (StringUtils.equals(CommonConstants.TWO_STRING, jsonObject.getString("status"))) {
//成功 //成功
FddPersonAccount entity = fddPersonAccountService.getById(clientId); FddPersonAccount entity = fddPersonAccountService.getById(clientId);
YifuUser user = SecurityUtils.getUser();
if (entity != null) { if (entity != null) {
entity.setRealStatus(CommonConstants.ONE_STRING); entity.setRealStatus(CommonConstants.ONE_STRING);
entity.setUnionid(unionId); entity.setUnionid(unionId);
...@@ -221,7 +221,7 @@ public class FddController { ...@@ -221,7 +221,7 @@ public class FddController {
e.printStackTrace(); e.printStackTrace();
} }
}); });
return R.ok(null,"success"); return R.ok(null,"成功");
} }
} }
} else if (StringUtils.equals(fddEvent, "sign")) { } else if (StringUtils.equals(fddEvent, "sign")) {
...@@ -254,7 +254,7 @@ public class FddController { ...@@ -254,7 +254,7 @@ public class FddController {
// 2021-3-15 16:24 hgw 全部签名成功,更新合同的状态: // 2021-3-15 16:24 hgw 全部签名成功,更新合同的状态:
if (CommonConstants.TWO_STRING.equals(fddContractInfo.getSendSignStatus()) if (CommonConstants.TWO_STRING.equals(fddContractInfo.getSendSignStatus())
&& CommonConstants.TWO_STRING.equals(fddContractInfo.getReceiveSignStatus())) { && CommonConstants.TWO_STRING.equals(fddContractInfo.getReceiveSignStatus())) {
fddContractAttachInfoService.saveEmpAndAttarch(fddContractInfo); fddContractAttachInfoService.saveEmpAndAttarch(fddContractInfo,user);
TEmployeeContractInfo ec = employeeContractInfoService.getById(fddContractInfo.getContractId()); TEmployeeContractInfo ec = employeeContractInfoService.getById(fddContractInfo.getContractId());
// 如果合同的状态是待电子签,则变更为已电子签 // 如果合同的状态是待电子签,则变更为已电子签
...@@ -263,7 +263,7 @@ public class FddController { ...@@ -263,7 +263,7 @@ public class FddController {
employeeContractInfoService.updateById(ec); employeeContractInfoService.updateById(ec);
} }
} }
return R.ok(null,"success"); return R.ok(null,"成功");
}else if (StringUtils.equals(fddEvent, "notifyUrlVerify")) { }else if (StringUtils.equals(fddEvent, "notifyUrlVerify")) {
return R.ok(null,"success"); return R.ok(null,"success");
} }
......
...@@ -25,8 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo; ...@@ -25,8 +25,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage; import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
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.vo.YifuUser;
import java.io.InputStream;
import java.util.List; import java.util.List;
/** /**
...@@ -53,7 +53,7 @@ public interface FddContractAttachInfoService extends IService<FddContractAttach ...@@ -53,7 +53,7 @@ public interface FddContractAttachInfoService extends IService<FddContractAttach
List<ErrorMessage> sendTask(List<FddContractAttachInfo> entityList); List<ErrorMessage> sendTask(List<FddContractAttachInfo> entityList);
R<String> saveEmpAndAttarch(FddContractInfo fddContractInfo); R<String> saveEmpAndAttarch(FddContractInfo fddContractInfo, YifuUser user);
List<ErrorMessage> batchAdd(List<FddContractAttachInfo> entityList); List<ErrorMessage> batchAdd(List<FddContractAttachInfo> entityList);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.service; package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...@@ -54,4 +55,17 @@ public interface TEmployeeLogService extends IService<TEmployeeLog> { ...@@ -54,4 +55,17 @@ public interface TEmployeeLogService extends IService<TEmployeeLog> {
* @return * @return
**/ **/
<T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo, YifuUser user); <T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo, YifuUser user);
/**
* 生成修改记录
* @Author pwang
* @Date 2022-06-22 11:32
* @param type 类型:0人员档案;1项目档案;2人员和项目档案;3员工合同更新
* @param empId 档案id
* @param projectId 项目id
* @param oldInfo
* @param newInfo
* @return
**/
<T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo, FddContractAttachInfo fddContractAttachInfo);
} }
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -25,17 +23,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -25,17 +23,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants; import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractAttachInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddContractAttachInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil; import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil;
import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
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.constant.SecurityConstants;
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.dapr.config.DaprUpmsProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -47,10 +45,15 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties ...@@ -47,10 +45,15 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.cache.Cache; import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper; import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
...@@ -80,7 +83,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -80,7 +83,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
private TEmployeeProjectMapper tEmployeeProjectMapper; private TEmployeeProjectMapper tEmployeeProjectMapper;
@Autowired @Autowired
private TEmployeeContractInfoService employeeContractInfoService; private TEmployeeContractInfoMapper employeeContractInfoMapper;
@Autowired @Autowired
private TSettleDomainService tSettleDomainService; private TSettleDomainService tSettleDomainService;
...@@ -91,9 +94,6 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -91,9 +94,6 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
@Autowired @Autowired
private FddContractTemplateService fddContractTemplateService; private FddContractTemplateService fddContractTemplateService;
@Autowired
private DaprUpmsProperties daprUpmsProperties;
@Autowired @Autowired
private TEmployeeInfoService employeeInfoService; private TEmployeeInfoService employeeInfoService;
...@@ -107,12 +107,17 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -107,12 +107,17 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
@Autowired @Autowired
private CacheManager cacheManager; private CacheManager cacheManager;
@Autowired
@Lazy
private DoJointTask doJointTask;
ExecutorService executorService = Executors.newFixedThreadPool(10); ExecutorService executorService = Executors.newFixedThreadPool(10);
public static final String NO_VALID_CONTRACT_FOUND = "未获取到有效在用合同,请确认存在对应姓名、身份证、合同起始时间的合同数据"; public static final String NO_VALID_CONTRACT_FOUND = "未获取到有效在用合同,请确认存在对应姓名、身份证、合同起始时间的合同数据";
/** /**
* 法大大合同附属信息表简单分页查询 * 法大大合同附属信息表简单分页查询
*
* @param fddContractAttachInfo 法大大合同附属信息表 * @param fddContractAttachInfo 法大大合同附属信息表
* @return * @return
*/ */
...@@ -123,6 +128,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -123,6 +128,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
/** /**
* 获取有附属信息但是没有法大大电子合同的数据 * 获取有附属信息但是没有法大大电子合同的数据
*
* @param empIdcard * @param empIdcard
* @return * @return
*/ */
...@@ -175,7 +181,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -175,7 +181,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
try { try {
//如果已经实名发送电子合同 //如果已经实名发送电子合同
FddContractAttachInfo fddContractAttachInfo = this.getById(attachInfo.getId()); FddContractAttachInfo fddContractAttachInfo = this.getById(attachInfo.getId());
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo,user); R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo, user);
if (returnR != null) { if (returnR != null) {
//记录返回信息 //记录返回信息
if (returnR.getCode() == CommonConstants.SUCCESS) { if (returnR.getCode() == CommonConstants.SUCCESS) {
...@@ -191,31 +197,33 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -191,31 +197,33 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
}); });
} }
i++; i++;
errorList.add(new ErrorMessage(i, "保存成功", CommonConstants.GREEN));
} }
return errorList; return errorList;
} }
/** /**
*
* @Author hyc
* @Date 2022-06-02
* @param fddContractInfo * @param fddContractInfo
* @return R * @return R
* @Author hyc
* @Date 2022-06-02
**/ **/
@Override @Override
@Transactional @Transactional
public R<String> saveEmpAndAttarch(FddContractInfo fddContractInfo) { public R<String> saveEmpAndAttarch(FddContractInfo fddContractInfo,YifuUser user) {
List<TEmployeeInfo> updateList = new ArrayList();
try { try {
FddContractAttachInfo fddContractAttachInfo = this.getOne(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, fddContractInfo.getContractId())); FddContractAttachInfo fddContractAttachInfo = this.getOne(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, fddContractInfo.getContractId())
.eq(FddContractAttachInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (fddContractAttachInfo != null && fddContractAttachInfo.getContractId().equals(fddContractAttachInfo.getId())) { if (fddContractAttachInfo != null && fddContractAttachInfo.getContractId().equals(fddContractAttachInfo.getId())) {
FddContractTemplate fddContractTemplate = fddContractTemplateService.getOne(Wrappers.<FddContractTemplate>query().lambda() FddContractTemplate fddContractTemplate = fddContractTemplateService.getOne(Wrappers.<FddContractTemplate>query().lambda()
.eq(FddContractTemplate::getId, fddContractInfo.getFddTemplateId())); .eq(FddContractTemplate::getId, fddContractInfo.getFddTemplateId()));
TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, fddContractAttachInfo.getDepartNo())); TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, fddContractAttachInfo.getDepartNo())
TCustomerInfo tCustomerInfo = tCustomerInfoService.getOne(Wrappers.<TCustomerInfo>query().lambda().eq(TCustomerInfo::getId, settleDomain.getCustomerId())); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
TCustomerInfo tCustomerInfo = tCustomerInfoService.getOne(Wrappers.<TCustomerInfo>query().lambda().eq(TCustomerInfo::getId, settleDomain.getCustomerId())
.eq(TCustomerInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
//查询项目档案 //查询项目档案
TEmployeeProject tEmployeeProject = employeeProjectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda().eq(TEmployeeProject::getDeptId, settleDomain.getId()) TEmployeeProject tEmployeeProject = employeeProjectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getDeptNo,settleDomain.getDepartNo()) .eq(TEmployeeProject::getDeptNo, settleDomain.getDepartNo())
.eq(TEmployeeProject::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TEmployeeProject::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING));
//查询人员档案 //查询人员档案
...@@ -228,79 +236,99 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -228,79 +236,99 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
TEmployeeProject tEmployeeProjectCompare = employeeProjectMapper.selectById(tEmployeeProject.getId()); TEmployeeProject tEmployeeProjectCompare = employeeProjectMapper.selectById(tEmployeeProject.getId());
if (CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) { if (CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
tEmployeeProject.setProjectStatus(CommonConstants.ZERO_INT); tEmployeeProject.setProjectStatus(CommonConstants.ZERO_INT);
tEmployeeProject.setLeaveReason(CommonConstants.EMPTY_STRING);
tEmployeeProject.setLeaveTime(null);
tEmployeeProject.setLeaveRemark(CommonConstants.EMPTY_STRING);
tEmployeeProject.setLeaveUser(CommonConstants.EMPTY_STRING);
} }
//判断人员档案的状态,如果是减档状态就复档 //判断人员档案的状态,如果是减档状态就复档
TEmployeeInfo tEmployeeInfoCompare = employeeInfoService.getById(tEmployeeProject.getEmpId());
if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()) { if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()) {
tEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT); tEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT);
tEmployeeInfo.setLeaveReason(CommonConstants.EMPTY_STRING);
tEmployeeInfo.setLeaveTime(null);
tEmployeeInfo.setLeaveRemark(CommonConstants.EMPTY_STRING);
tEmployeeInfo.setLeaveUser(CommonConstants.EMPTY_STRING);
tEmployeeInfo.setLeaveUserName(CommonConstants.EMPTY_STRING);
} }
//更新项目档案 //更新项目档案
tEmployeeProject.setEmpNatrue(fddContractTemplate.getType()); tEmployeeProject.setEmpNatrue(fddContractAttachInfo.getEmpNatrue());
tEmployeeProject.setPost(fddContractAttachInfo.getPost()); tEmployeeProject.setPost(fddContractAttachInfo.getPost());
tEmployeeProject.setContractStatus(CommonConstants.ONE_INT);
employeeProjectMapper.updateById(tEmployeeProject); employeeProjectMapper.updateById(tEmployeeProject);
//保存操作记录 //保存操作记录
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1],"",tEmployeeProject.getId(),tEmployeeProjectCompare,tEmployeeProject); tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), tEmployeeProjectCompare, tEmployeeProject);
//更新人员档案 //更新人员档案
tEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone()); tEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone());
tEmployeeInfo.setEmpNatrue(fddContractTemplate.getType()); tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
employeeInfoService.updateById(tEmployeeInfo); updateList.add(tEmployeeInfo);
//保存操作记录
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],tEmployeeProject.getId(),"",tEmployeeInfoCompare,tEmployeeInfo);
TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId()) .eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
//无可用合同 //无可用合同
if (null == employeeContractInfo) { if (null == employeeContractInfo) {
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo = new TEmployeeContractInfo();
saveTEmployeeContractInfo(newEmployeeContractInfo, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo,tCustomerInfo, tEmployeeProject); saveTEmployeeContractInfo(newEmployeeContractInfo, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, tEmployeeProject);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo);
} else { } else {
//已有合同设置状态为不在用 //已有合同设置状态为不在用
employeeContractInfo.setInUse(CommonConstants.ONE_STRING); employeeContractInfo.setInUse(CommonConstants.ONE_STRING);
employeeContractInfoService.updateById(employeeContractInfo); employeeContractInfoMapper.updateById(employeeContractInfo);
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo2 = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo2 = new TEmployeeContractInfo();
saveTEmployeeContractInfo(newEmployeeContractInfo2, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo,tCustomerInfo, tEmployeeProject); saveTEmployeeContractInfo(newEmployeeContractInfo2, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, tEmployeeProject);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo2); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo2);
} }
doJointTask.updateFddEmployeeInfo(updateList, fddContractAttachInfo);
} else { } else {
//判断人员档案是否存在,不存在就新增人员档案,存在则判断档案状态,如果是减档就复档 //判断人员档案是否存在,不存在就新增人员档案,存在则判断档案状态,如果是减档就复档
if (Common.isNotNull(tEmployeeInfo)) { if (Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo employeeInfoCompare = employeeInfoService.getById(tEmployeeProject.getEmpId());
if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()) { if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()) {
tEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT); tEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT);
tEmployeeInfo.setLeaveReason(CommonConstants.EMPTY_STRING);
tEmployeeInfo.setLeaveTime(null);
tEmployeeInfo.setLeaveRemark(CommonConstants.EMPTY_STRING);
tEmployeeInfo.setLeaveUser(CommonConstants.EMPTY_STRING);
tEmployeeInfo.setLeaveUserName(CommonConstants.EMPTY_STRING);
} }
//更新人员档案 //更新人员档案
tEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone()); tEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone());
tEmployeeInfo.setEmpNatrue(fddContractTemplate.getType()); tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
tEmployeeInfo.setProjectNum(CommonConstants.ONE_INT + employeeInfoCompare.getProjectNum()); updateList.add(tEmployeeInfo);
employeeInfoService.updateById(tEmployeeInfo);
//保存操作记录
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],tEmployeeProject.getId(),"",employeeInfoCompare,tEmployeeInfo);
//新增项目档案 //新增项目档案
TEmployeeProject project = new TEmployeeProject(); TEmployeeProject project = new TEmployeeProject();
saveEmployeeproject(fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo,tCustomerInfo, project); saveEmployeeproject(fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, project);
//新增合同
TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo();
saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo, tCustomerInfo, project);
//更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1);
doJointTask.updateFddEmployeeInfo(updateList, fddContractAttachInfo);
} else { } else {
//新增人员档案 //新增人员档案
TEmployeeInfo newEmployeeInfo = new TEmployeeInfo(); TEmployeeInfo newEmployeeInfo = new TEmployeeInfo();
newEmployeeInfo.setEmpName(fddContractAttachInfo.getEmpName()); newEmployeeInfo.setEmpName(fddContractAttachInfo.getEmpName());
newEmployeeInfo.setEmpIdcard(fddContractAttachInfo.getEmpIdcard()); newEmployeeInfo.setEmpIdcard(fddContractAttachInfo.getEmpIdcard());
newEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone()); newEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone());
newEmployeeInfo.setEmpNatrue(fddContractTemplate.getType()); newEmployeeInfo.setEmpNatrue(fddContractAttachInfo.getEmpNatrue());
newEmployeeInfo.setEmpCode(getCode()); newEmployeeInfo.setEmpCode(getCode());
newEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT); newEmployeeInfo.setFileStatus(CommonConstants.ZERO_INT);
newEmployeeInfo.setDeleteFlag(CommonConstants.ZERO_STRING); newEmployeeInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
newEmployeeInfo.setStatus(CommonConstants.ZERO_INT); newEmployeeInfo.setStatus(CommonConstants.ZERO_INT);
newEmployeeInfo.setProjectNum(CommonConstants.ONE_INT); newEmployeeInfo.setProjectNum(CommonConstants.ONE_INT);
newEmployeeInfo.setFileSource(CommonConstants.dingleDigitStrArray[4]); newEmployeeInfo.setFileSource(CommonConstants.dingleDigitStrArray[6]);
newEmployeeInfo.setCreateBy(fddContractAttachInfo.getCreateBy());
newEmployeeInfo.setCreateName(fddContractAttachInfo.getCreateName());
newEmployeeInfo.setUpdateBy(fddContractAttachInfo.getUpdateBy());
newEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
Date date = IdCardUtil.getBirthdate(fddContractAttachInfo.getEmpIdcard()); Date date = IdCardUtil.getBirthdate(fddContractAttachInfo.getEmpIdcard());
if (null != date) { if (null != date) {
...@@ -313,17 +341,18 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -313,17 +341,18 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//新增项目档案 //新增项目档案
TEmployeeProject newTEmpProject = new TEmployeeProject(); TEmployeeProject newTEmpProject = new TEmployeeProject();
saveEmployeeproject(fddContractAttachInfo, settleDomain, fddContractTemplate, newEmployeeInfo,tCustomerInfo, tEmployeeProject); saveEmployeeproject(fddContractAttachInfo, settleDomain, fddContractTemplate, newEmployeeInfo, tCustomerInfo, newTEmpProject);
//新增合同 //新增合同
TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo(); TEmployeeContractInfo newEmployeeContractInfo1 = new TEmployeeContractInfo();
saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, tEmployeeInfo,tCustomerInfo,newTEmpProject); saveTEmployeeContractInfo(newEmployeeContractInfo1, fddContractAttachInfo, settleDomain, fddContractTemplate, newEmployeeInfo, tCustomerInfo, newTEmpProject);
//更新合同id //更新合同id
updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1); updateContractId(fddContractInfo, fddContractAttachInfo, newEmployeeContractInfo1);
} }
} }
} }
}catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
log.error("保存异常:" + e.getMessage()); log.error("保存异常:" + e.getMessage());
return R.failed("保存异常:" + e.getMessage()); return R.failed("保存异常:" + e.getMessage());
} }
...@@ -333,7 +362,6 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -333,7 +362,6 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
@Override @Override
public List<ErrorMessage> batchAdd(List<FddContractAttachInfo> entityList) { public List<ErrorMessage> batchAdd(List<FddContractAttachInfo> entityList) {
List<ErrorMessage> errorList = new ArrayList<>(); List<ErrorMessage> errorList = new ArrayList<>();
Set<String> errorMsg;
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
Map<String, Integer> sameCheck = new HashMap<>(); Map<String, Integer> sameCheck = new HashMap<>();
...@@ -341,38 +369,41 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -341,38 +369,41 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
try { try {
if (null != entityList && !entityList.isEmpty()) { if (null != entityList && !entityList.isEmpty()) {
for (FddContractAttachInfo attachInfo : entityList) { for (FddContractAttachInfo attachInfo : entityList) {
errorMsg = new HashSet<>();
i++; i++;
String sameInfo = attachInfo.getEmpIdcard() + "_" + attachInfo.getDepartNo()
String sameInfo = attachInfo.getEmpNatrue() + "_" + attachInfo.getDepartNo()
+ "_" + attachInfo.getFddTemplateId() + "_" + attachInfo.getContractStart() + "_" + attachInfo.getFddTemplateId() + "_" + attachInfo.getContractStart()
+ "_" + attachInfo.getContractEnd(); + "_" + attachInfo.getContractEnd();
if (sameCheck.get(sameInfo) != null) { if (sameCheck.get(sameInfo) != null) {
errorMsg.add("第" + (i) + "行与第" + sameCheck.get(sameInfo) + "行重复!"); errorList.add(new ErrorMessage(i, "第" + (i) + "行与第" + sameCheck.get(sameInfo) + "行重复!", CommonConstants.RED));
continue;
} else { } else {
sameCheck.put(sameInfo, i); sameCheck.put(sameInfo, i);
} }
//判断计时计件工资必填 //判断计时计件工资必填
if (CommonConstants.ONE_STRING.equals(attachInfo.getSalaryType()) && Common.isEmpty(attachInfo.getSalaryStandardPerHour())) { if (CommonConstants.ONE_STRING.equals(attachInfo.getSalaryType()) && Common.isEmpty(attachInfo.getSalaryStandardPerHour())) {
errorMsg.add("计时工资不能为空"); errorList.add(new ErrorMessage(i, "计时工资不能为空", CommonConstants.RED));
continue;
} }
if (CommonConstants.TWO_STRING.equals(attachInfo.getSalaryType()) && Common.isEmpty(attachInfo.getSalaryStandardPerPiece())) { if (CommonConstants.TWO_STRING.equals(attachInfo.getSalaryType()) && Common.isEmpty(attachInfo.getSalaryStandardPerPiece())) {
errorMsg.add("计件工资不能为空"); errorList.add(new ErrorMessage(i, "计件工资不能为空", CommonConstants.RED));
continue;
} }
//结算主体编码是否准确 //结算主体编码是否准确
TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, attachInfo.getDepartNo()) TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, attachInfo.getDepartNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)); .eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(settleDomain)) { if (Common.isEmpty(settleDomain)) {
errorMsg.add("项目编码有误"); errorList.add(new ErrorMessage(i, "项目编码有误", CommonConstants.RED));
} else { continue;
}
//查询员工合同 //查询员工合同
TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId()) .eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (employeeContractInfo != null) { if (employeeContractInfo != null) {
long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId())); long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId()));
if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().before(employeeContractInfo.getContractEnd())) { if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().before(employeeContractInfo.getContractEnd())) {
errorMsg.add("已导入合同相关基础数据"); errorList.add(new ErrorMessage(i, "已导入合同相关基础数据", CommonConstants.RED));
continue;
} }
List<FddContractTemplate> fddContractTemplateList = fddContractTemplateService.list(Wrappers.<FddContractTemplate>query().lambda() List<FddContractTemplate> fddContractTemplateList = fddContractTemplateService.list(Wrappers.<FddContractTemplate>query().lambda()
...@@ -380,13 +411,15 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -380,13 +411,15 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
.eq(FddContractTemplate::getModifyUploadStatus, CommonConstants.dingleDigitStrArray[1])); .eq(FddContractTemplate::getModifyUploadStatus, CommonConstants.dingleDigitStrArray[1]));
//如果模板存在则生成法大大电子合同数据 //如果模板存在则生成法大大电子合同数据
if (fddContractTemplateList.size() == CommonConstants.ZERO_INT) { if (fddContractTemplateList.size() == CommonConstants.ZERO_INT) {
errorMsg.add("未获取到有效的合同模板"); errorList.add(new ErrorMessage(i, "未获取到有效的合同模板", CommonConstants.RED));
continue;
} }
if (fddContractTemplateList.size() != CommonConstants.ONE_INT) { if (fddContractTemplateList.size() != CommonConstants.ONE_INT) {
errorMsg.add("法大大合同有效合同模板存在多条"); errorList.add(new ErrorMessage(i, "法大大合同有效合同模板存在多条", CommonConstants.RED));
continue;
} else { } else {
errorMsg.add("存在“在用”的合同"); errorList.add(new ErrorMessage(i, "存在“在用”的合同", CommonConstants.RED));
} continue;
} }
} }
...@@ -395,13 +428,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -395,13 +428,9 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//新签 //新签
employeeParamR = fddContractInfoService.generalEmployeeParam(attachInfo, false); employeeParamR = fddContractInfoService.generalEmployeeParam(attachInfo, false);
if (CommonConstants.FAIL == employeeParamR.getCode()) { if (CommonConstants.FAIL == employeeParamR.getCode()) {
errorMsg.add(employeeParamR.getMsg()); errorList.add(new ErrorMessage(i, employeeParamR.getMsg(), CommonConstants.RED));
continue;
} }
// 数据合法情况
if (!CollUtil.isEmpty(errorMsg)) {
// 数据不合法
errorList.add(new ErrorMessage(i, errorMsg));
} else {
//保存合同数据 //保存合同数据
attachInfo.setContractId(CommonConstants.EMPTY_STRING); attachInfo.setContractId(CommonConstants.EMPTY_STRING);
...@@ -449,14 +478,13 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -449,14 +478,13 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
} }
}); });
} }
errorList.add(new ErrorMessage(i, "保存成功", CommonConstants.GREEN));
}
} }
} else { } else {
errorList.add(new ErrorMessage(i, "无数据保存")); errorList.add(new ErrorMessage(i, "无数据保存"));
} }
} catch (Exception e) { } catch (Exception e) {
log.error("合同数据批量新增异常" + e.getMessage()); log.error("合同数据批量新增异常" + e.getMessage());
errorList.add(new ErrorMessage(i, "合同数据批量新增异常:" + e.getMessage()));
return errorList; return errorList;
} }
return errorList; return errorList;
...@@ -470,22 +498,22 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -470,22 +498,22 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
if (null != entityList && !entityList.isEmpty()) { if (null != entityList && !entityList.isEmpty()) {
for (FddContractAttachInfo attachInfo : entityList) { for (FddContractAttachInfo attachInfo : entityList) {
//查询员工合同 //查询员工合同
TEmployeeContractInfo employeeContractInfoValid = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractInfoValid = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpName, attachInfo.getEmpName()).eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpName, attachInfo.getEmpName()).eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getIsObsolete, CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart())); .eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart()));
if(employeeContractInfoValid==null){ if (employeeContractInfoValid == null) {
errorList.add(new ErrorMessage(i, NO_VALID_CONTRACT_FOUND, CommonConstants.RED)); errorList.add(new ErrorMessage(i, NO_VALID_CONTRACT_FOUND, CommonConstants.RED));
continue; continue;
} }
if(StringUtils.equals(CommonConstants.ONE_STRING,employeeContractInfoValid.getContractType())){ if (StringUtils.equals(CommonConstants.ONE_STRING, employeeContractInfoValid.getContractType())) {
if(employeeContractInfoValid.getContractEnd()==null){ if (employeeContractInfoValid.getContractEnd() == null) {
errorList.add(new ErrorMessage(i, "员工合同结束时间为空", CommonConstants.RED)); errorList.add(new ErrorMessage(i, "员工合同结束时间为空", CommonConstants.RED));
continue; continue;
} }
} }
//查询员工合同是否存在 //查询员工合同是否存在
TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractInfo = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpName, attachInfo.getEmpName()).eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()) .eq(TEmployeeContractInfo::getEmpName, attachInfo.getEmpName()).eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING) .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)
.and(wrapper -> wrapper.and(wrapper2 -> wrapper2.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart()) .and(wrapper -> wrapper.and(wrapper2 -> wrapper2.eq(TEmployeeContractInfo::getContractStart, attachInfo.getContractStart())
...@@ -526,7 +554,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -526,7 +554,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
* @Description: 更新合同id * @Description: 更新合同id
* @return: * @return:
**/ **/
public void updateContractId (FddContractInfo fddContractInfo, FddContractAttachInfo fddContractAttachInfo,TEmployeeContractInfo newEmployeeContractInfo) { public void updateContractId(FddContractInfo fddContractInfo, FddContractAttachInfo fddContractAttachInfo, TEmployeeContractInfo newEmployeeContractInfo) {
//更新合同id //更新合同id
fddContractAttachInfo.setContractId(newEmployeeContractInfo.getId()); fddContractAttachInfo.setContractId(newEmployeeContractInfo.getId());
this.updateById(fddContractAttachInfo); this.updateById(fddContractAttachInfo);
...@@ -547,11 +575,11 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -547,11 +575,11 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
* @Description: 新增合同 * @Description: 新增合同
* @return: * @return:
**/ **/
public void saveTEmployeeContractInfo (TEmployeeContractInfo newEmployeeContractInfo, FddContractAttachInfo fddContractAttachInfo,TSettleDomain settleDomain,FddContractTemplate fddContractTemplate, public void saveTEmployeeContractInfo(TEmployeeContractInfo newEmployeeContractInfo, FddContractAttachInfo fddContractAttachInfo, TSettleDomain settleDomain, FddContractTemplate fddContractTemplate,
TEmployeeInfo tEmployeeInfo, TCustomerInfo tCustomerInfo, TEmployeeProject tEmployeeProject) { TEmployeeInfo tEmployeeInfo, TCustomerInfo tCustomerInfo, TEmployeeProject tEmployeeProject) {
TEmployeeContractInfo employeeContractCount = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda() TEmployeeContractInfo employeeContractCount = employeeContractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId()) .eq(TEmployeeContractInfo::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING)); .eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT));
//合同表里没有在用的合同 //合同表里没有在用的合同
if (null == employeeContractCount) { if (null == employeeContractCount) {
newEmployeeContractInfo.setEmpName(fddContractAttachInfo.getEmpName()); newEmployeeContractInfo.setEmpName(fddContractAttachInfo.getEmpName());
...@@ -574,22 +602,50 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -574,22 +602,50 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
newEmployeeContractInfo.setFileProvince(tEmployeeInfo.getFileProvince()); newEmployeeContractInfo.setFileProvince(tEmployeeInfo.getFileProvince());
newEmployeeContractInfo.setFileTown(tEmployeeInfo.getFileTown()); newEmployeeContractInfo.setFileTown(tEmployeeInfo.getFileTown());
newEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING); newEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
newEmployeeContractInfo.setIsSign(CommonConstants.dingleDigitIntArray[1]);
//远程接口传参 newEmployeeContractInfo.setAuditStatus(CommonConstants.dingleDigitIntArray[2]);
JSONObject jsonObject = new JSONObject(); newEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
jsonObject.put("value",fddContractTemplate.getType()); newEmployeeContractInfo.setCustomerId(tCustomerInfo.getId());
jsonObject.put("type","personnel_type"); newEmployeeContractInfo.setDeptNo(fddContractAttachInfo.getDepartNo());
R<String> res = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId() newEmployeeContractInfo.setUnitNo(tCustomerInfo.getCustomerCode());
, "/dict/inner/getLableFronValue", jsonObject, Map.class, SecurityConstants.FROM_IN); newEmployeeContractInfo.setFddFlag(CommonConstants.ONE_STRING);
if (res != null) { newEmployeeContractInfo.setEmpNatrue(fddContractAttachInfo.getEmpNatrue());
//电子合同模板对应的“员工类型” newEmployeeContractInfo.setCreateBy(fddContractAttachInfo.getCreateBy());
newEmployeeContractInfo.setContractName(res.getData()); newEmployeeContractInfo.setCreateName(fddContractAttachInfo.getCreateName());
} else { newEmployeeContractInfo.setUpdateBy(fddContractAttachInfo.getUpdateBy());
newEmployeeContractInfo.setContractName(""); if (Common.isNotNull(fddContractAttachInfo.getPeriodStart())) {
} newEmployeeContractInfo.setPeriodStart(localDate2Date(fddContractAttachInfo.getPeriodStart()));
//设置状态为在用 }
newEmployeeContractInfo.setInUse(CommonConstants.ONE_STRING); if (Common.isNotNull(fddContractAttachInfo.getPeriodEnd())) {
employeeContractInfoService.save(newEmployeeContractInfo); newEmployeeContractInfo.setPeriodEnd(localDate2Date(fddContractAttachInfo.getPeriodEnd()));
}
if (Common.isNotNull(fddContractAttachInfo.getPeriodSalaryPerMonth())) {
newEmployeeContractInfo.setPeriodSalaryPerMonth(fddContractAttachInfo.getPeriodSalaryPerMonth());
}
newEmployeeContractInfo.setSalaryType(fddContractAttachInfo.getSalaryType());
if (Common.isNotNull(fddContractAttachInfo.getSalaryStandardPerHour())) {
newEmployeeContractInfo.setSalaryStandardPerHour(fddContractAttachInfo.getSalaryStandardPerHour());
}
if (Common.isNotNull(fddContractAttachInfo.getSalaryStandardPerPiece())) {
newEmployeeContractInfo.setSalaryStandardPerPiece(fddContractAttachInfo.getSalaryStandardPerPiece());
}
String contractName = "";
// 渲染字典值
Map<String, String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "personnel_type");
if (Common.isNotNull(dicObj)) {
contractName = dicObj.get(fddContractTemplate.getType());
}
newEmployeeContractInfo.setContractName(contractName);
int monthDiff = DateUtil.getMonthDiff(fddContractAttachInfo.getContractStart(), fddContractAttachInfo.getContractEnd());
BigDecimal b = new BigDecimal(String.valueOf(monthDiff / 12.0));
b = b.setScale(1, BigDecimal.ROUND_HALF_UP);
newEmployeeContractInfo.setContractTerm(String.valueOf(b));
newEmployeeContractInfo.setApplyNo(this.getSqCode());
employeeContractInfoMapper.insert(newEmployeeContractInfo);
} }
} }
...@@ -605,11 +661,11 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -605,11 +661,11 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
* @Description: 新增项目档案 * @Description: 新增项目档案
* @return: * @return:
**/ **/
public void saveEmployeeproject(FddContractAttachInfo fddContractAttachInfo,TSettleDomain settleDomain,FddContractTemplate fddContractTemplate, public void saveEmployeeproject(FddContractAttachInfo fddContractAttachInfo, TSettleDomain settleDomain, FddContractTemplate fddContractTemplate,
TEmployeeInfo newEmployeeInfo, TCustomerInfo tCustomerInfo, TEmployeeProject newTEmpProject) { TEmployeeInfo newEmployeeInfo, TCustomerInfo tCustomerInfo, TEmployeeProject newTEmpProject) {
//新增项目档案 //新增项目档案
newTEmpProject.setEmpName(fddContractAttachInfo.getEmpName()); newTEmpProject.setEmpName(fddContractAttachInfo.getEmpName());
newTEmpProject.setEmpId(newEmployeeInfo.getId());
newTEmpProject.setEmpIdcard(fddContractAttachInfo.getEmpIdcard()); newTEmpProject.setEmpIdcard(fddContractAttachInfo.getEmpIdcard());
newTEmpProject.setEmpPhone(fddContractAttachInfo.getEmpPhone()); newTEmpProject.setEmpPhone(fddContractAttachInfo.getEmpPhone());
newTEmpProject.setDeptId(settleDomain.getId()); newTEmpProject.setDeptId(settleDomain.getId());
...@@ -621,9 +677,16 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -621,9 +677,16 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
newTEmpProject.setUnitNo(tCustomerInfo.getCustomerCode()); newTEmpProject.setUnitNo(tCustomerInfo.getCustomerCode());
newTEmpProject.setContractType(fddContractTemplate.getType()); newTEmpProject.setContractType(fddContractTemplate.getType());
newTEmpProject.setStatus(CommonConstants.dingleDigitIntArray[0]); newTEmpProject.setStatus(CommonConstants.dingleDigitIntArray[0]);
newTEmpProject.setPost(fddContractAttachInfo.getPost()); newTEmpProject.setEmpNatrue(fddContractAttachInfo.getEmpNatrue());
newTEmpProject.setEmpNatrue(newEmployeeInfo.getEmpNatrue());
newTEmpProject.setEmpCode(newEmployeeInfo.getEmpCode()); newTEmpProject.setEmpCode(newEmployeeInfo.getEmpCode());
newTEmpProject.setBusinessPrimaryType(settleDomain.getBusinessPrimaryType());
newTEmpProject.setBusinessSecondType(settleDomain.getBusinessSecondType());
newTEmpProject.setBusinessThirdType(settleDomain.getBusinessThirdType());
newTEmpProject.setProjectSource(CommonConstants.dingleDigitStrArray[7]);
newTEmpProject.setContractStatus(CommonConstants.ONE_INT);
newTEmpProject.setCreateBy(fddContractAttachInfo.getCreateBy());
newTEmpProject.setCreateName(fddContractAttachInfo.getCreateName());
newTEmpProject.setUpdateBy(fddContractAttachInfo.getUpdateBy());
String empNO = ""; String empNO = "";
empNO = getEmpNo(newTEmpProject.getDeptNo()); empNO = getEmpNo(newTEmpProject.getDeptNo());
newTEmpProject.setEmpNo(empNO); newTEmpProject.setEmpNo(empNO);
...@@ -673,4 +736,56 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -673,4 +736,56 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
return zeroArr[num] + nowNums; return zeroArr[num] + nowNums;
} }
/**
* @param
* @Description: 获取 申请编码
* @Author: hgw
* @Date: 2022/6/22 17:52
* @return: java.lang.String
**/
private synchronized String getSqCode() {
String nowDay = DateUtil.getThisDay();
Cache cache = cacheManager.getCache(CacheConstants.EVERYDAY_EMP_CONTRACT_CODE);
Object nowNumObj = cache.get(nowDay);
int nowNums = 1;
if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1;
} else {
String empCode = null;
try {
empCode = employeeContractInfoMapper.getMaxContractCode();
nowNums = Integer.parseInt(empCode) + 1;
} catch (NumberFormatException e) {
log.error("获取人员合同当日最大编码时出错:" + empCode);
nowNums = 1;
}
}
cache.put(nowDay, nowNums);
return "HT" + nowDay + this.getFourNum(String.valueOf(nowNums));
}
/**
* @param nowNums 数字
* @Description: 获取四位字符型数字
* @Author: hgw
* @Date: 2022-6-30 16:05:25
* @return: 五位字符型数字
**/
private String getFourNum(String nowNums) {
if (nowNums.length() >= 4) {
return nowNums.substring(0, 4);
}
String[] zeroArr = {"0", "00", "000"};
int num = 3 - nowNums.length();
return zeroArr[num] + nowNums;
}
public static Date localDate2Date(LocalDate localDate) {
if (null == localDate) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
} }
...@@ -74,6 +74,7 @@ import java.io.IOException; ...@@ -74,6 +74,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.*; import java.util.*;
...@@ -118,9 +119,16 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe ...@@ -118,9 +119,16 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
private OSSUtil ossUtil; private OSSUtil ossUtil;
@Autowired @Autowired
private TSettleDomainService tSettleDomainService; private TSettleDomainService tSettleDomainService;
@Autowired
private TAttaInfoService tAttaInfoService;
@Override @Override
public R<String> saveEmpContract(FddContractAttachInfo fddContractAttachInfo,YifuUser user) throws ApiException { public R<String> saveEmpContract(FddContractAttachInfo fddContractAttachInfo,YifuUser user) throws ApiException {
long haveFddConCount = this.count(Wrappers.<FddContractInfo>query().lambda().eq(FddContractInfo::getContractId, fddContractAttachInfo.getContractId())
.eq(FddContractInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (haveFddConCount > CommonConstants.ZERO_INT) {
return R.failed("已存在法大大电子合同");
}
if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) { if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) {
return R.failed("当前用户不是电子合同导入用户,不能操作"); return R.failed("当前用户不是电子合同导入用户,不能操作");
} }
...@@ -576,17 +584,25 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe ...@@ -576,17 +584,25 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
String key = name + ".zip"; String key = name + ".zip";
ossUtil.uploadFileByStream(bis, key, null); ossUtil.uploadFileByStream(bis, key, null);
// 1:保存为 // 1:保存为
// TEmpAtta empAtta = BasicServiceUtil.initTEmpAttaForInsert(name, key, (long) rspData.getFileBytes().length); TAttaInfo attaInfo = initUnitAttaForInsert(name, key, (long)rspData.getFileBytes().length);
// empAttaService.save(empAtta); attaInfo.setRelationType(CommonConstants.FOUR_STRING);
// MEmpContractAtta contractAtta = new MEmpContractAtta(); attaInfo.setDomainId(entity.getContractId());
// contractAtta.setAttaId(empAtta.getId()); tAttaInfoService.save(attaInfo);
// contractAtta.setContractId(employeeContractInfo.getId());
// mempContractAttaService.save(contractAtta);
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda() FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda()
.eq(FddContractAttachInfo::getContractId,entity.getContractId()).last(CommonConstants.LAST_ONE_SQL)); .eq(FddContractAttachInfo::getContractId,entity.getContractId()).last(CommonConstants.LAST_ONE_SQL));
if (fddContractAttachInfo != null) { if (fddContractAttachInfo != null) {
fddContractAttachInfo.setIsMove(CommonConstants.ONE_INT); fddContractAttachInfo.setIsMove(CommonConstants.ONE_INT);
fddContractAttachInfoMapper.updateById(fddContractAttachInfo); fddContractAttachInfoMapper.updateById(fddContractAttachInfo);
TEmployeeContractInfo tEmployeeContractInfo = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getId,fddContractAttachInfo.getContractId())
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
tEmployeeContractInfo.setIsFile(CommonConstants.ZERO_STRING);
employeeContractInfoService.updateById(tEmployeeContractInfo);
} }
return R.ok(); return R.ok();
} finally { } finally {
...@@ -921,4 +937,24 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe ...@@ -921,4 +937,24 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
return R.failed(rsp.getMsg()); return R.failed(rsp.getMsg());
} }
} }
/**
* 对象初始化
* @param fileName
* @param key
* @param fileSize
* @return
*/
private TAttaInfo initUnitAttaForInsert(String fileName, String key, long fileSize) {
TAttaInfo unitAtta = new TAttaInfo();
char point = '.';
unitAtta.setAttaName(fileName);
unitAtta.setAttaSize(fileSize);
unitAtta.setAttaSrc(key);
if (key.lastIndexOf(point) >= 0) {
unitAtta.setAttaType(key.substring(key.lastIndexOf(point)));
}
unitAtta.setCreateTime(LocalDateTime.now());
return unitAtta;
}
} }
...@@ -437,7 +437,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -437,7 +437,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeProjectService.updateById(tEmployeeProject); tEmployeeProjectService.updateById(tEmployeeProject);
} }
// 更新档案、项目合同状态为(1在用) // 更新档案、项目合同状态为(1在用)
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(tEmployeeContractInfo.getEmpId()); TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(contractInfo.getEmpId());
if (tEmployeeInfo != null) { if (tEmployeeInfo != null) {
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT); tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
tEmployeeInfoService.updateById(tEmployeeInfo); tEmployeeInfoService.updateById(tEmployeeInfo);
...@@ -457,7 +457,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -457,7 +457,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
// 更新档案、项目合同状态为(0无合同 1在用 2不在用) // 更新档案、项目合同状态为(0无合同 1在用 2不在用)
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(tEmployeeContractInfo.getEmpId()); TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getById(contractInfo.getEmpId());
if (tEmployeeInfo != null) { if (tEmployeeInfo != null) {
// 判断人员有无审核通过的其他合同 // 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query() TEmployeeContractInfo contractInfoInUse = this.getOne(Wrappers.<TEmployeeContractInfo>query()
......
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeLogMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
...@@ -94,6 +95,36 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm ...@@ -94,6 +95,36 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm
return null; return null;
} }
@Override
public <T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo, FddContractAttachInfo fddContractAttachInfo) {
try{
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
if(!Common.isEmpty(differenceKey)){
TEmployeeLog employeeLog = new TEmployeeLog();
employeeLog.setProjectId(projectId);
employeeLog.setType(type);
employeeLog.setEmpId(empId);
employeeLog.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(fddContractAttachInfo)) {
employeeLog.setCreateBy(fddContractAttachInfo.getCreateBy());
employeeLog.setCreateName(fddContractAttachInfo.getCreateName());
employeeLog.setUpdateBy(fddContractAttachInfo.getUpdateBy());
}
employeeLog.setOldInfo(JSON.toJSONString(oldInfo,features));
employeeLog.setNewInfo(JSON.toJSONString(newInfo,features));
employeeLog.setDifferenceInfo(differenceKey);
baseMapper.insert(employeeLog);
return employeeLog;
}
}catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
}
return null;
}
private SerializerFeature[] features = new SerializerFeature[] { private SerializerFeature[] features = new SerializerFeature[] {
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty, WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty,WriteDateUseDateFormat WriteNullStringAsEmpty,WriteDateUseDateFormat
......
package com.yifu.cloud.plus.v1.yifu.archives.utils; package com.yifu.cloud.plus.v1.yifu.archives.utils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
...@@ -77,4 +78,44 @@ public class DoJointTask { ...@@ -77,4 +78,44 @@ public class DoJointTask {
log.info("档案-批量更新人员档案结束"); log.info("档案-批量更新人员档案结束");
} }
/**
* @Description: 合同-批量更换负责人
* @Author: huyc
* @Date: 2022-7-8
* @return: void
**/
@Async
public void updateFddEmployeeInfo(List<TEmployeeInfo> tEmployeeInfoList, FddContractAttachInfo fddContractAttachInfo) {
log.info("法大大档案-批量更新人员档案-线程开始");
try {
for(TEmployeeInfo tEmployeeInfo:tEmployeeInfoList) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoService.getById(tEmployeeInfo.getId());
//查询该人员所有的项目档案
List<TEmployeeProject> list = tEmployeeProjectService.list(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, tEmployeeInfo.getEmpIdcard())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
if (Common.isNotNull(list)) {
Set<String> empNatrue = list.stream().map(TEmployeeProject::getEmpNatrue).collect(Collectors.toSet());
if (empNatrue.stream().anyMatch(e -> e.equals(CommonConstants.ZERO_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
} else if (empNatrue.stream().anyMatch(e -> e.equals(CommonConstants.ONE_STRING))) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
} else {
tEmployeeInfo.setEmpNatrue(CommonConstants.TWO_STRING);
}
tEmployeeInfo.setProjectNum(list.size());
} else {
tEmployeeInfo.setProjectNum(CommonConstants.ZERO_INT);
}
tEmployeeInfoService.updateById(tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0]
, tEmployeeInfo.getId(), "", tEmployeeInfoOld, tEmployeeInfo,fddContractAttachInfo);
}
} catch (Exception e) {
log.error("法大大档案-批量更新人员档案错误", e);
}
log.info("法大大档案-批量更新人员档案结束");
}
} }
...@@ -119,6 +119,6 @@ ...@@ -119,6 +119,6 @@
1=1 1=1
<include refid="fddPersonAccount_where"/> <include refid="fddPersonAccount_where"/>
</where> </where>
GROUP BY a.ID_CARD ORDER BY a.CREATE_TIME desc GROUP BY a.ID_CARD,a.MOBLIE ORDER BY a.CREATE_TIME desc
</select> </select>
</mapper> </mapper>
...@@ -124,6 +124,8 @@ public interface CommonConstants { ...@@ -124,6 +124,8 @@ public interface CommonConstants {
String FOUR_STRING = "4"; String FOUR_STRING = "4";
String FIVE_STRING = "5";
/** /**
* number 0 * number 0
*/ */
......
package com.yifu.cloud.plus.v1.yifu.common.core.util; package com.yifu.cloud.plus.v1.yifu.common.core.util;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
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.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
...@@ -950,4 +951,23 @@ public class ExcelUtil <T> implements Serializable { ...@@ -950,4 +951,23 @@ public class ExcelUtil <T> implements Serializable {
this.setErrorInfo(errorList); this.setErrorInfo(errorList);
this.setErrorMessageHashMap(errorMessageHashMap); this.setErrorMessageHashMap(errorMessageHashMap);
} }
/**
* @param clazz
* @Author: wangan
* @Date: 2020/9/28
* @Description: 获取导出中文字段
* @return: com.yifu.cloud.v1.common.core.util.R
**/
public static R<List<String>> getExportfieldsName(Class<?> clazz){
ArrayList<String> exportfieldsName = Lists.newArrayList();
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
ExcelAttribute annotation = field.getAnnotation(ExcelAttribute.class);
if (annotation != null && Common.isNotNull(annotation.name()) && annotation.needExport()) {
exportfieldsName.add(annotation.name());
}
}
return R.ok(exportfieldsName,"成功");
}
} }
...@@ -27,6 +27,10 @@ public class InsurancesConstants { ...@@ -27,6 +27,10 @@ public class InsurancesConstants {
* 非投保退回状态,无法删除 * 非投保退回状态,无法删除
*/ */
public static final String DELETE_ERROR = "非投保退回状态,无法删除"; public static final String DELETE_ERROR = "非投保退回状态,无法删除";
/**
* 不允许编辑
*/
public static final String EDIT_NOT_ALLOW = "不允许编辑";
/** /**
* 投保信息已存在 * 投保信息已存在
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -26,24 +28,29 @@ public class TInsuranceCompany extends BaseEntity { ...@@ -26,24 +28,29 @@ public class TInsuranceCompany extends BaseEntity {
/** /**
* 保险公司id * 保险公司id
*/ */
@Schema(description = "保险公司id")
@TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
/** /**
* 保险公司名称 * 保险公司名称
*/ */
@NotBlank(message = "保险公司名称不能为空") @NotBlank(message = "保险公司名称不能为空")
@Schema(description = "保险公司名称")
private String companyName; private String companyName;
/** /**
* 保险公司地址 * 保险公司地址
*/ */
@NotBlank(message = "保险公司地址不能为空") @NotBlank(message = "保险公司地址不能为空")
@Schema(description = "保险公司地址")
private String companyAddress; private String companyAddress;
/** /**
* 对接人 * 对接人
*/ */
@NotBlank(message = "对接人不能为空") @NotBlank(message = "对接人不能为空")
@Schema(description = "对接人")
private String companyDocking; private String companyDocking;
/** /**
...@@ -51,6 +58,7 @@ public class TInsuranceCompany extends BaseEntity { ...@@ -51,6 +58,7 @@ public class TInsuranceCompany extends BaseEntity {
*/ */
@NotBlank(message = "计费方式不能为空") @NotBlank(message = "计费方式不能为空")
@StringVal({"0","1"}) @StringVal({"0","1"})
@Schema(description = "计费方式")
private String billingType; private String billingType;
/** /**
......
...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableId; ...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -21,7 +20,7 @@ import java.time.LocalDateTime; ...@@ -21,7 +20,7 @@ import java.time.LocalDateTime;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName("t_insurance_detail") @TableName("t_insurance_detail")
@Tag(name = "商险明细表") @Schema(description = "商险明细表")
public class TInsuranceDetail extends BaseEntity { public class TInsuranceDetail extends BaseEntity {
/** /**
* 主键 * 主键
......
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -16,7 +15,7 @@ import java.time.LocalDateTime; ...@@ -16,7 +15,7 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@TableName("t_insurance_replace") @TableName("t_insurance_replace")
@Tag(name = "商险替换表") @Schema(description = "商险替换表")
public class TInsuranceReplace implements Serializable { public class TInsuranceReplace implements Serializable {
private static final long serialVersionUID = -8528017421473755436L; private static final long serialVersionUID = -8528017421473755436L;
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -23,36 +25,43 @@ public class TInsuranceType extends BaseEntity { ...@@ -23,36 +25,43 @@ public class TInsuranceType extends BaseEntity {
/** /**
* 险种id * 险种id
*/ */
@Schema(description = "险种id")
@TableId(type = IdType.ASSIGN_ID)
private Long id; private Long id;
/** /**
* 险种名称 * 险种名称
*/ */
@NotBlank(message = "险种名称不能为空") @NotBlank(message = "险种名称不能为空")
@Schema(description = "险种名称")
private String name; private String name;
/** /**
* 保险公司主键ID * 保险公司主键ID
*/ */
@NotBlank(message = "所属保险公司不能为空") @NotBlank(message = "所属保险公司不能为空")
@Schema(description = "保险公司主键ID")
private String insuranceCompanyId; private String insuranceCompanyId;
/** /**
* 收款单位名称 * 收款单位名称
*/ */
@NotBlank(message = "收款单位名称不能为空") @NotBlank(message = "收款单位名称不能为空")
@Schema(description = "收款单位名称")
private String receiptUnitName; private String receiptUnitName;
/** /**
* 收款银行名称 * 收款银行名称
*/ */
@NotBlank(message = "收款银行名称不能为空") @NotBlank(message = "收款银行名称不能为空")
@Schema(description = "收款银行名称")
private String bankName; private String bankName;
/** /**
* 收款银行账号 * 收款银行账号
*/ */
@NotBlank(message = "收款银行账号不能为空") @NotBlank(message = "收款银行账号不能为空")
@Schema(description = "收款银行账号")
private String bankNo; private String bankNo;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -22,24 +24,29 @@ public class TInsuranceTypeRate extends BaseEntity { ...@@ -22,24 +24,29 @@ public class TInsuranceTypeRate extends BaseEntity {
/** /**
* 费率id * 费率id
*/ */
@Schema(description = "费率id")
@TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
/** /**
* 险种ID * 险种ID
*/ */
@NotBlank(message = "所属险种不能为空") @NotBlank(message = "所属险种不能为空")
@Schema(description = "险种ID")
private String insuranceTypeId; private String insuranceTypeId;
/** /**
* 月数 * 月数
*/ */
@NotBlank(message = "月不能为空") @NotBlank(message = "月不能为空")
@Schema(description = "月数")
private String month; private String month;
/** /**
* 费率 * 费率
*/ */
@NotBlank(message = "费率不能为空") @NotBlank(message = "费率不能为空")
@Schema(description = "费率")
private String rate; private String rate;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -7,6 +9,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; ...@@ -7,6 +9,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
/** /**
* 购买标准表 * 购买标准表
...@@ -17,29 +21,40 @@ import lombok.EqualsAndHashCode; ...@@ -17,29 +21,40 @@ import lombok.EqualsAndHashCode;
@TableName("t_insurance_type_standard") @TableName("t_insurance_type_standard")
@Tag(name = "购买标准表") @Tag(name = "购买标准表")
public class TInsuranceTypeStandard extends BaseEntity { public class TInsuranceTypeStandard extends BaseEntity {
/** /**
* * 购买标准id
*/ */
@Schema(description = "保险公司id")
@TableId(type = IdType.ASSIGN_ID)
private String id; private String id;
/** /**
* 险种主键ID * 险种主键ID
*/ */
@Schema(description = "险种主键ID")
@NotBlank(message = "险种主键ID不能为空")
private Long insuranceTypeId; private Long insuranceTypeId;
/** /**
* 购买标准 * 购买标准
*/ */
@Schema(description = "购买标准")
@NotBlank(message = "购买标准不能为空")
private String buyStandard; private String buyStandard;
/** /**
* 医疗额度 * 医疗额度
*/ */
@Schema(description = "医疗额度")
@NotBlank(message = "医疗额度不能为空")
private String medicalQuota; private String medicalQuota;
/** /**
* 身故或残疾额度 * 身故或残疾额度
*/ */
@Schema(description = "身故或残疾额度")
@NotBlank(message = "身故或残疾额度不能为空")
private String dieDisableQuota; private String dieDisableQuota;
/** /**
......
...@@ -149,6 +149,11 @@ public class LocalDateUtil { ...@@ -149,6 +149,11 @@ public class LocalDateUtil {
return flag; return flag;
} }
//获取指定时间的指定格式
public static String formatTime(LocalDate time, String pattern) {
return time.format(DateTimeFormatter.ofPattern(pattern));
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println(isCurrentOrFutureMonth("2023-1")); System.out.println(isCurrentOrFutureMonth("2023-1"));
} }
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -11,7 +10,7 @@ import java.io.Serializable; ...@@ -11,7 +10,7 @@ import java.io.Serializable;
* @date 2022-07-18 17:03:31 * @date 2022-07-18 17:03:31
*/ */
@Data @Data
@Tag(name = "商险办理新增入参") @Schema(description = "商险办理新增入参")
public class InsuranceAddParam implements Serializable { public class InsuranceAddParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
/** /**
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -13,7 +12,7 @@ import java.time.LocalDate; ...@@ -13,7 +12,7 @@ import java.time.LocalDate;
* @date 2022-07-20 08:43:31 * @date 2022-07-20 08:43:31
*/ */
@Data @Data
@Tag(name = "商险办理批增入参") @Schema(description = "商险办理批增入参")
public class InsuranceBatchParam implements Serializable { public class InsuranceBatchParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
/** /**
......
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -17,7 +16,7 @@ import java.time.LocalDateTime; ...@@ -17,7 +16,7 @@ import java.time.LocalDateTime;
* @date 2022-07-20 19:23:17 * @date 2022-07-20 19:23:17
*/ */
@Data @Data
@Tag(name = "投保详情VO") @Schema(description = "投保详情VO")
public class InsuranceDetailVO implements Serializable { public class InsuranceDetailVO implements Serializable {
private static final long serialVersionUID = 628032758008497542L; private static final long serialVersionUID = 628032758008497542L;
/** /**
...@@ -191,24 +190,48 @@ public class InsuranceDetailVO implements Serializable { ...@@ -191,24 +190,48 @@ public class InsuranceDetailVO implements Serializable {
@Schema(description = "商险购买地省") @Schema(description = "商险购买地省")
private String insuranceProvinceName; private String insuranceProvinceName;
/**
* 商险购买地省code
*/
@Schema(description = "商险购买地省code")
private Integer insuranceProvince;
/** /**
* 商险购买地市 * 商险购买地市
*/ */
@Schema(description = "商险购买地市") @Schema(description = "商险购买地市")
private String insuranceCityName; private String insuranceCityName;
/**
* 商险购买地市code
*/
@Schema(description = "商险购买地市code")
private Integer insuranceCity;
/** /**
* 商险办理省 * 商险办理省
*/ */
@Schema(description = "商险办理省") @Schema(description = "商险办理省")
private String insuranceHandleProvinceName; private String insuranceHandleProvinceName;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
private Integer insuranceHandleProvince;
/** /**
* 商险办理城市 * 商险办理城市
*/ */
@Schema(description = "商险办理城市") @Schema(description = "商险办理城市")
private String insuranceHandleCityName; private String insuranceHandleCityName;
/**
* 商险办理城市code
*/
@Schema(description = "商险办理城市code")
private Integer insuranceHandleCity;
/** /**
* 创建人姓名 * 创建人姓名
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* @author licancan
* @description 投保编辑入参
* @date 2022-07-21 11:33:30
*/
@Data
@Schema(description = "投保编辑入参")
public class InsuranceEditParam implements Serializable {
private static final long serialVersionUID = -7742645628926325904L;
/**
* 主键
*/
@Schema(description = "主键")
@NotBlank(message = "主键不能为空")
private String id;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
@Size(max = 20, message = "员工姓名不可超过20位")
@NotBlank(message = "员工姓名不能为空")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
@NotBlank(message = "员工身份证号不能为空")
private String empIdcardNo;
/**
* 保单开始时间
*/
@Schema(description = "保单开始时间")
@NotBlank(message = "保单开始时间不能为空")
private String policyStart;
/**
* 保单结束时间
*/
@Schema(description = "保单结束时间")
@NotBlank(message = "保单结束时间不能为空")
private String policyEnd;
/**
* 岗位
*/
@Schema(description = "岗位")
@NotBlank(message = "岗位不能为空")
private String post;
/**
* 险种名称
*/
@Schema(description = "险种名称")
@NotBlank(message = "险种名称不能为空")
private String insuranceTypeName;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
@NotBlank(message = "保险公司名称不能为空")
private String insuranceCompanyName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
@NotBlank(message = "购买标准不能为空")
private String buyStandard;
/**
* 商险购买地省code
*/
@Schema(description = "商险购买地省code")
@NotNull(message = "商险购买地省ID不能为空")
private Integer insuranceProvince;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
@NotBlank(message = "商险购买地省不能为空")
private String insuranceProvinceName;
/**
* 商险购买地市code
*/
@Schema(description = "商险购买地市code")
@NotNull(message = "商险购买地市ID不能为空")
private Integer insuranceCity;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
@NotBlank(message = "商险购买地市不能为空")
private String insuranceCityName;
/**
* 商险办理省code
*/
@Schema(description = "商险办理省code")
@NotNull(message = "商险办理省ID不能为空")
private Integer insuranceHandleProvince;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
@NotBlank(message = "商险办理省不能为空")
private String insuranceHandleProvinceName;
/**
* 商险办理城市code
*/
@Schema(description = "商险办理城市code")
@NotNull(message = "商险办理城市ID不能为空")
private Integer insuranceHandleCity;
/**
* 商险办理城市
*/
@Schema(description = "商险办理城市")
@NotBlank(message = "商险办理城市不能为空")
private String insuranceHandleCityName;
/***********************************以下字段由系统算出,前端不用传,是为了方便入库***********************************/
/**
* 医疗额度
*/
private String medicalQuota;
/**
* 身故或残疾额度
*/
private String dieDisableQuota;
/**
* 险种主键
*/
private Long insuranceTypeId;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author licancan
* @description 导出办理请求参数
* @date 2022-07-21 14:21:06
*/
@Data
@Schema(description = "导出办理请求参数")
public class InsuranceExportListParam implements Serializable {
private static final long serialVersionUID = 3623027153213352936L;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 商险id集合
*/
@Schema(description = "商险id集合")
private List<String> idList;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author licancan
* @description 导出办理VO
* @date 2022-07-21 14:21:39
*/
@Data
@Schema(description = "导出办理VO")
public class InsuranceExportListVO implements Serializable {
private static final long serialVersionUID = -8159190612104775933L;
/**
* 主键
*/
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
private String post;
/**
* 商险购买地省
*/
@Schema(description = "商险购买地省")
private String insuranceProvinceName;
/**
* 商险购买地市
*/
@Schema(description = "商险购买地市")
private String insuranceCityName;
/**
* 商险办理省
*/
@Schema(description = "商险办理省")
private String insuranceHandleProvinceName;
/**
* 商险办理城市
*/
@Schema(description = "商险办理城市")
private String insuranceHandleCityName;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 保险公司名称(冗余字段)
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 医疗额度
*/
@Schema(description = "医疗额度")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
/**
* 结算类型 (0、预估 1、实缴)
*/
@Schema(description = "结算类型 (0、预估 1、实缴)")
private Integer settleType;
/**
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 备注
*/
@Schema(description = "备注")
private String remark;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -12,7 +11,7 @@ import java.io.Serializable; ...@@ -12,7 +11,7 @@ import java.io.Serializable;
* @date 2022-07-20 16:14:19 * @date 2022-07-20 16:14:19
*/ */
@Data @Data
@Tag(name = "投保列表请求参数") @Schema(description = "投保列表请求参数")
public class InsuranceListParam implements Serializable { public class InsuranceListParam implements Serializable {
private static final long serialVersionUID = -4692341622141432288L; private static final long serialVersionUID = -4692341622141432288L;
......
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -15,7 +14,7 @@ import java.time.LocalDate; ...@@ -15,7 +14,7 @@ import java.time.LocalDate;
* @date 2022-07-20 16:18:41 * @date 2022-07-20 16:18:41
*/ */
@Data @Data
@Tag(name = "投保列表VO") @Schema(description = "投保列表VO")
public class InsuranceListVO implements Serializable { public class InsuranceListVO implements Serializable {
private static final long serialVersionUID = -6673220061558171816L; private static final long serialVersionUID = -6673220061558171816L;
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import java.io.Serializable;
/**
* @author zhaji
* @description 减员办理返回类
* @date 2022-07-21 11:47:16
*/
public class InsuranceRefundHandlingListVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaji
* @description 减员办理查询条件
* @date 2022-07-21 11:40:47
*/
@Data
@Tag(name = "减员办理查询条件")
public class InsuranceRefundHandlingParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaji
* @description 减员办理类
* @date 2022-07-21 11:56:40
*/
@Data
@Tag(name = "减员办理类")
public class InsuranceRefundListParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
@Schema(name = "办理类型")
@NotBlank(message = "办理类型不能为空")
private String refundType;
@Schema(name = "办理列表")
@NotBlank(message = "办理列表不能为空")
private List<TInsuranceDetail> insuranceRefundList;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaji
* @description 已投保列表
* @date 2022-07-21 11:31:30
*/
@Data
@Tag(name = "已投保列表")
public class InsuranceRefundListVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
/**
* @author zhaji
* @description 已减员查询列表参数
* @date 2022-07-21 11:24:03
*/
@Data
@Tag(name = "已减员查询列表参数")
public class InsuranceRefundParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 保险公司ID
*/
@Schema(description = "保险公司ID")
private String insuranceCompanyId;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 保单开始时间
*/
@Schema(description = "保单开始时间")
private String policyStart;
/**
* 保单结束时间
*/
@Schema(description = "保单结束时间")
private String policyEnd;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import java.io.Serializable;
/**
* @author zhaji
* @description 减员办理返回类
* @date 2022-07-21 12:30:37
*/
public class InsuranceRefundResultVo implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
/** /**
* @author licancan * @author licancan
...@@ -13,7 +11,7 @@ import java.time.LocalDate; ...@@ -13,7 +11,7 @@ import java.time.LocalDate;
* @date 2022-07-20 08:43:31 * @date 2022-07-20 08:43:31
*/ */
@Data @Data
@Tag(name = "商险办理替换入参") @Schema(description = "商险办理替换入参")
public class InsuranceReplaceParam implements Serializable { public class InsuranceReplaceParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L; private static final long serialVersionUID = -2689686777914935788L;
......
...@@ -15,6 +15,11 @@ import java.util.List; ...@@ -15,6 +15,11 @@ import java.util.List;
@Data @Data
public class InsuranceTypeVo extends TInsuranceType { public class InsuranceTypeVo extends TInsuranceType {
/**
* 所属保险公司名称
*/
private String insuranceCompanyName;
/** /**
* 费率信息 * 费率信息
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @author zhaji
* @description 已投保查询返回类
* @date 2022-07-21 09:46:09
*/
@Data
@Tag(name = "已投保查询返回类")
public class InsuredListVo implements Serializable {
private static final long serialVersionUID = -6673220061558171816L;
//订单编号、姓名、身份证、投保类型、项目、岗位、保单起止日期、购买月数、保单生效日期、保险公司、是否出险、险种、购买标准 减员状态、
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String projectName;
/**
* 项目编码
*/
@JsonIgnore
private String deptNo;
/**
* 投保岗位
*/
@Schema(description = "投保岗位")
private String post;
/**
* 保单开始时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单开始时间")
private LocalDate policyStart;
/**
* 保单结束时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
@Schema(description = "保单结束时间")
private LocalDate policyEnd;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 结算类型 (0、预估 1、实缴)
*/
@Schema(description = "结算类型 (0、预估 1、实缴)")
private Integer settleType;
/**
* 结算月
*/
@Schema(description = "结算月")
private String settleMonth;
//订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* @author zhaji
* @description 已投保列表查询条件
* @date 2022-07-21 09:25:34
*/
@Data
@Tag(name = "已投保列表查询条件")
public class InsuredParam implements Serializable {
private static final long serialVersionUID = -2689686777914935788L;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 保单号
*/
@Schema(description = "保单号")
private String policyNo;
/**
* 保险公司ID
*/
@Schema(description = "保险公司ID")
private String insuranceCompanyId;
/**
* 保单开始时间
*/
@Schema(description = "保单开始时间")
private String policyStart;
/**
* 保单结束时间
*/
@Schema(description = "保单结束时间")
private String policyEnd;
/**
* 发票号
*/
@Schema(description = "发票号")
private String invoiceNo;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 是否出险 0未出险 1已出险
*/
@Schema(description = "是否出险 0未出险 1已出险")
private Integer isUse;
/**
* 是否有效 0有效 1无效
*/
@Schema(description = "是否有效 0有效 1无效")
private Integer isEffect;
/**
* 是否过期 0未过期 1已过期
*/
@Schema(description = "是否过期 0未过期 1已过期")
private Integer isOverdue;
/**
* 派单日期
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "派单日期")
@ExcelProperty("派单日期")
private LocalDateTime createTime;
}
...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller; ...@@ -3,7 +3,6 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.InsuranceRefundCheck;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService; import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
...@@ -11,7 +10,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; ...@@ -11,7 +10,6 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -111,11 +109,25 @@ public class TInsuranceDetailController { ...@@ -111,11 +109,25 @@ public class TInsuranceDetailController {
*/ */
@GetMapping("/deleteInsurance") @GetMapping("/deleteInsurance")
@Operation(summary = "通过id删除", description = "通过id删除") @Operation(summary = "通过id删除", description = "通过id删除")
//@PreAuthorize("@pms.hasPermission('temployeeinfo_del')") //@PreAuthorize("@pms.hasPermission('insurance_del')")
public R<String> deleteInsurance(@RequestParam String id) { public R<String> deleteInsurance(@RequestParam String id) {
return tInsuranceDetailService.deleteInsurance(id); return tInsuranceDetailService.deleteInsurance(id);
} }
/**
* 编辑
*
* @author licancan
* @param param
* @return {@link R<String>}
*/
@PostMapping("/editInsurance")
@Operation(summary = "编辑", description = "编辑")
//@PreAuthorize("@pms.hasPermission('insurance_edit')")
public R<String> editInsurance(@RequestBody @Valid InsuranceEditParam param) {
return tInsuranceDetailService.editInsurance(param);
}
/** /**
* 通过id查询 * 通过id查询
* *
...@@ -129,6 +141,45 @@ public class TInsuranceDetailController { ...@@ -129,6 +141,45 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.getInsuranceDetailById(id)); return R.ok(tInsuranceDetailService.getInsuranceDetailById(id));
} }
/**
* 导出办理
*
* @author licancan
* @param param
* @return {@link R<List<InsuranceExportListVO>>}
*/
@Operation(summary = "导出办理", description = "导出办理")
@PostMapping("/getInsuranceExportList")
public R<List<InsuranceExportListVO>> getInsuranceExportList(@RequestBody InsuranceExportListParam param) {
return R.ok(tInsuranceDetailService.getInsuranceExportList(param));
}
/**
* 投保退回
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
@Operation(summary = "投保退回", description = "投保退回")
@PostMapping("/rollBackInsurance")
public R<String> rollBackInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){
return tInsuranceDetailService.rollBackInsurance(idList);
}
/**
* 办理成功
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
@Operation(summary = "办理成功", description = "办理成功")
@PostMapping("/successfulInsurance")
public R<String> successfulInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<String> idList){
return tInsuranceDetailService.successfulInsurance(idList);
}
/***********************减员办理********************************/ /***********************减员办理********************************/
/** /**
* 导入减员校验 * 导入减员校验
...@@ -142,4 +193,97 @@ public class TInsuranceDetailController { ...@@ -142,4 +193,97 @@ public class TInsuranceDetailController {
return tInsuranceDetailService.checkInsuranceRefundList(insuranceRefundCheckList); return tInsuranceDetailService.checkInsuranceRefundList(insuranceRefundCheckList);
} }
/**
* 已投保列表分页查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询条件
* @return {@link R<IPage<InsuredListVo>>}
*/
@Operation(summary = "已投保列表分页查询", description = "已投保列表分页查询")
@PostMapping("/getInsuredListPage")
public R<IPage<InsuredListVo>> getInsuredListPage(Page<InsuredListVo> page, @RequestBody InsuredParam param) {
return R.ok(tInsuranceDetailService.getInsuredListPage(page, param));
}
/**
* 已投保列表不分页查询
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List<InsuredListVo>>}
*/
@Operation(summary = "已投保列表不分页查询", description = "已投保列表不分页查询")
@PostMapping("/getInsuredList")
public R<List<InsuredListVo>> getInsuredList(@RequestBody InsuredParam param) {
return R.ok(tInsuranceDetailService.getInsuredList(param));
}
/**
* 已减员列表分页查询
*
* @author zhaji
* @param param 查询条件
* @return {@link R<IPage< InsuranceRefundListVo >>}
*/
@Operation(summary = "已减员列表分页查询", description = "已减员列表分页查询")
@PostMapping("/getInsuranceRefundPageList")
public R<IPage<InsuranceRefundListVo>> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundPageList(page,param));
}
/**
* 已减员列表不分页查询
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List< InsuranceRefundListVo >>}
*/
@Operation(summary = "已减员列表不分页查询", description = "已减员列表不分页查询")
@PostMapping("/getInsuranceRefundList")
public R<List<InsuranceRefundListVo>> getInsuranceRefundList(@RequestBody InsuranceRefundParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundList(param));
}
/**
* 减员办理列表分页查询
*
* @author zhaji
* @param param 查询条件
* @return {@link R<IPage< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "减员办理列表分页查询", description = "减员办理列表分页查询")
@PostMapping("/getInsuranceRefundHandlingPageList")
public R<IPage<InsuranceRefundHandlingListVo>> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, @RequestBody InsuranceRefundHandlingParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingPageList(page,param));
}
/**
* 减员办理列表不分页查询
*
* @author zhaji
* @param param 查询条件
* @return {@link R<List< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "减员办理列表不分页查询", description = "减员办理列表不分页查询")
@PostMapping("/getInsuranceRefundHandlingList")
public R<List<InsuranceRefundHandlingListVo>> getInsuranceRefundHandlingList(@RequestBody InsuranceRefundHandlingParam param) {
return R.ok(tInsuranceDetailService.getInsuranceRefundHandlingList(param));
}
/**
* 减员办理
*
* @author zhaji
* @param insuranceDetail 减员信息
* @return {@link R<List< InsuranceRefundHandlingListVo >>}
*/
@Operation(summary = "减员办理", description = "减员办理")
@PostMapping("/updateInsuranceRefund")
public R updateInsuranceRefund(@RequestBody InsuranceRefundListParam insuranceDetail) {
return tInsuranceDetailService.updateInsuranceRefund(insuranceDetail);
}
} }
...@@ -40,7 +40,7 @@ public class TInsuranceTypeController { ...@@ -40,7 +40,7 @@ public class TInsuranceTypeController {
*/ */
@Operation(summary = "分页查询", description = "分页查询") @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" ) @GetMapping("/page" )
public R<IPage<TInsuranceType>> getTCertRecordPage(Page page, TInsuranceType insuranceType) { public R<IPage<InsuranceTypeVo>> getInsuranceTypePage(Page page, @RequestBody TInsuranceType insuranceType) {
return R.ok(insuranceTypeService.pageDiy(page, insuranceType)); return R.ok(insuranceTypeService.pageDiy(page, insuranceType));
} }
......
...@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListParam;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -48,5 +46,42 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -48,5 +46,42 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/ */
InsuranceDetailVO getInsuranceDetailById(@Param("id") String id); InsuranceDetailVO getInsuranceDetailById(@Param("id") String id);
/**
* 导出办理勾选查询结果
*
* @author licancan
* @param idList
* @return {@link List<InsuranceExportListVO>}
*/
List<InsuranceExportListVO> getInsuranceExportListBySelect(@Param("idList") List<String> idList);
/**
* 导出办理非勾选查询结果
*
* @author licancan
* @param param
* @return {@link List< InsuranceExportListVO>}
*/
List<InsuranceExportListVO> getInsuranceExportList(@Param("param") InsuranceExportListParam param);
/***********************减员办理********************************/ /***********************减员办理********************************/
/**
* 已投保列表分页查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredListVo>}
*/
IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, @Param("param") InsuredParam param);
/**
* 已投保列表不分页查询
*
* @author zhaji
* @param param
* @return {@link List<InsuredListVo>}
*/
List<InsuredListVo> getInsuredList(@Param("param") InsuredParam param);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.mapper; package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeStandard;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -34,4 +38,14 @@ public interface TInsuranceTypeMapper extends BaseMapper<TInsuranceType> { ...@@ -34,4 +38,14 @@ public interface TInsuranceTypeMapper extends BaseMapper<TInsuranceType> {
* @return {@link List< TInsuranceTypeStandard>} * @return {@link List< TInsuranceTypeStandard>}
*/ */
List<TInsuranceTypeStandard> selectInsuranceTypeStandardList(String id); List<TInsuranceTypeStandard> selectInsuranceTypeStandardList(String id);
/**
* 险种分页查询
*
* @author zhaji
* @param page 分页参数
* @param insuranceType 查询参数
* @return {@link IPage< InsuranceTypeVo>}
*/
IPage<InsuranceTypeVo> selectInsuranceTypePage(Page page, @Param("insuranceType") TInsuranceType insuranceType);
} }
...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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.insurances.entity.InsuranceRefundCheck;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail; import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
...@@ -73,6 +72,15 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -73,6 +72,15 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
R<String> deleteInsurance(String id); R<String> deleteInsurance(String id);
/**
* 编辑
*
* @author licancan
* @param param
* @return {@link R<String>}
*/
R<String> editInsurance(InsuranceEditParam param);
/** /**
* 通过id查询 * 通过id查询
* *
...@@ -82,6 +90,33 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -82,6 +90,33 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
InsuranceDetailVO getInsuranceDetailById(String id); InsuranceDetailVO getInsuranceDetailById(String id);
/**
* 导出办理
*
* @author licancan
* @param param
* @return {@link List<InsuranceExportListVO>}
*/
List<InsuranceExportListVO> getInsuranceExportList(InsuranceExportListParam param);
/**
* 投保退回
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
R<String> rollBackInsurance(List<String> idList);
/**
* 办理成功
*
* @author licancan
* @param idList
* @return {@link R<String>}
*/
R<String> successfulInsurance(List<String> idList);
/***********************减员办理********************************/ /***********************减员办理********************************/
/** /**
* 减员导入校验 * 减员导入校验
...@@ -92,4 +127,69 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -92,4 +127,69 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
R checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList); R checkInsuranceRefundList(List<InsuranceRefundCheck> insuranceRefundCheckList);
/**
* 已投保列表分页查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage< InsuredListVo>}
*/
IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param);
/**
* 已投保列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuredListVo>}
*/
List<InsuredListVo> getInsuredList(InsuredParam param);
/**
* 已减员列表分页查询
*
* @author zhaji
* @param page 分页数据
* @param param 查询参数
* @return {@link IPage< InsuranceRefundListVo >}
*/
IPage<InsuranceRefundListVo> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param);
/**
* 已减员列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo >}
*/
List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param);
/**
* 减员办理列表分页查询
*
* @author zhaji
* @param page 分页数据
* @param param 查询参数
* @return {@link IPage< InsuranceRefundHandlingListVo>}
*/
IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param);
/**
* 减员办理列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>}
*/
List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundHandlingParam param);
/**
* 减员办理
*
* @author zhaji
* @param insuranceDetail 办理类
* @return {@link R}
*/
R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail);
} }
...@@ -23,7 +23,7 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> { ...@@ -23,7 +23,7 @@ public interface TInsuranceTypeService extends IService<TInsuranceType> {
* @param insuranceType 分页查询参数 * @param insuranceType 分页查询参数
* @return {@link IPage< TInsuranceType>} * @return {@link IPage< TInsuranceType>}
*/ */
IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType); IPage<InsuranceTypeVo> pageDiy(Page page,TInsuranceType insuranceType);
/** /**
* 新增险种信息 * 新增险种信息
......
...@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service; ...@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
...@@ -186,7 +187,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -186,7 +187,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
BeanCopyUtils.copyProperties(success,detail); BeanCopyUtils.copyProperties(success,detail);
//购买类型,默认为「批增」 //购买类型,默认为「批增」
detail.setBuyType(CommonConstants.THREE_INT); detail.setBuyType(CommonConstants.THREE_INT);
//投保状态:待投保??? //投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT); detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setCreateBy(user.getId()); detail.setCreateBy(user.getId());
detail.setCreateName(user.getNickname()); detail.setCreateName(user.getNickname());
...@@ -296,6 +297,102 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -296,6 +297,102 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.ok(InsurancesConstants.OPERATE_SUCCESS); return R.ok(InsurancesConstants.OPERATE_SUCCESS);
} }
/**
* 编辑
*
* @param param
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> editInsurance(InsuranceEditParam param) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
TInsuranceDetail byId = this.getById(param.getId());
if (null == byId){
return R.failed(InsurancesConstants.DATA_IS_NOT_EXIST);
}
if (byId.getBuyHandleStatus() == CommonConstants.FOUR_INT && byId.getBuyType() != CommonConstants.FOUR_INT){
// 身份证号位数校验(18 位合法)
if (ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
// 保单开始日期 > 当前派单日期
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_START_PARSE_ERROR);
}
if(!LocalDateUtil.isDate(param.getPolicyEnd(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_END_PARSE_ERROR);
}
if(!LocalDateUtil.isFutureDate(param.getPolicyStart())){
return R.failed(InsurancesConstants.POLICY_START_SHOULD_IS_FUTURE);
}
// 保险公司-险种-购买标准 是否存在
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
.eq(TInsuranceCompany::getCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT)
);
if (!Optional.ofNullable(insuranceCompany).isPresent()){
return R.failed(InsurancesConstants.INSURANCE_COMPANY_NAME_NOT_EXIST);
}else {
TInsuranceType insuranceType = tInsuranceTypeService.getOne(Wrappers.<TInsuranceType>query().lambda()
.eq(TInsuranceType::getName, param.getInsuranceTypeName())
.eq(TInsuranceType::getInsuranceCompanyId, insuranceCompany.getId())
.eq(TInsuranceType::getDeleteFlag, CommonConstants.ZERO_INT)
);
if (!Optional.ofNullable(insuranceType).isPresent()){
return R.failed(InsurancesConstants.INSURANCE_TYPE_NAME_NOT_EXIST);
}else {
TInsuranceTypeStandard typeStandard = tInsuranceTypeStandardService.getOne(Wrappers.<TInsuranceTypeStandard>query().lambda()
.eq(TInsuranceTypeStandard::getBuyStandard, param.getBuyStandard())
.eq(TInsuranceTypeStandard::getInsuranceTypeId, insuranceType.getId())
.eq(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ZERO_INT)
);
if (!Optional.ofNullable(typeStandard).isPresent()){
return R.failed(InsurancesConstants.BUY_STANDARD_NOT_EXIST);
}else {
// "医疗额度" 和 "身故或残疾",由系统根据 保险公司+险种+ 购买标准 关联查询,并补全
// 这里计算好赋值,是为了方便入库
param.setMedicalQuota(typeStandard.getMedicalQuota());
param.setDieDisableQuota(typeStandard.getDieDisableQuota());
param.setInsuranceTypeId(typeStandard.getInsuranceTypeId());
}
}
}
//记录查重校验:姓名 + 身份证号 + 保险公司 + 险种 + 保单开始日期~保单结束日期区间 是唯一(剔除退回、过期状态的记录)
//todo 时间区间
Set<Integer> setRStatus = Sets.newHashSet();
setRStatus.add(CommonConstants.FOUR_INT);
TInsuranceDetail insuranceDetail = this.baseMapper.selectOne(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getEmpName, param.getEmpName())
.eq(TInsuranceDetail::getEmpIdcardNo, param.getEmpIdcardNo())
.eq(TInsuranceDetail::getInsuranceCompanyName, param.getInsuranceCompanyName())
.eq(TInsuranceDetail::getInsuranceTypeName, param.getInsuranceTypeName())
.eq(TInsuranceDetail::getPolicyStart, param.getPolicyStart())
.eq(TInsuranceDetail::getPolicyEnd, param.getPolicyEnd())
.notIn(TInsuranceDetail::getBuyHandleStatus, setRStatus)
.eq(TInsuranceDetail::getIsOverdue, CommonConstants.ZERO_INT)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
);
if (Optional.ofNullable(insuranceDetail).isPresent()){
return R.failed(InsurancesConstants.DATA_IS_EXIST);
}
BeanCopyUtils.copyProperties(param,byId);
//投保状态:待投保
byId.setBuyHandleStatus(CommonConstants.ONE_INT);
byId.setPolicyStart(LocalDateUtil.parseLocalDate(param.getPolicyStart()));
byId.setPolicyEnd(LocalDateUtil.parseLocalDate(param.getPolicyEnd()));
byId.setUpdateBy(user.getId());
byId.setUpdateTime(LocalDateTime.now());
this.updateById(byId);
}else {
return R.failed(InsurancesConstants.EDIT_NOT_ALLOW);
}
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
/** /**
* 通过id查询 * 通过id查询
* *
...@@ -309,6 +406,123 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -309,6 +406,123 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return insuranceDetailVO; return insuranceDetailVO;
} }
/**
* 导出办理
*
* @param param
* @return {@link List<InsuranceExportListVO>}
* @author licancan
*/
@Override
public List<InsuranceExportListVO> getInsuranceExportList(InsuranceExportListParam param) {
YifuUser user = SecurityUtils.getUser();
List<InsuranceExportListVO> insuranceExportList;
//todo 根据登录人获取数据权限
//如勾选项不为空,则导出勾选记录;否则导出当前筛选条件下 && 「待投保」的结果集
if (CollectionUtils.isNotEmpty(param.getIdList())){
insuranceExportList = baseMapper.getInsuranceExportListBySelect(param.getIdList());
}else {
insuranceExportList = baseMapper.getInsuranceExportList(param);
}
if (CollectionUtils.isNotEmpty(insuranceExportList)){
List<TInsuranceDetail> detailList = new ArrayList<>();
//根据项目编码获取项目名称
List<String> collect = insuranceExportList.stream().map(e -> e.getDeptNo()).distinct().collect(Collectors.toList());
R<Map> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(collect);
if (null != setInfoByCodes && setInfoByCodes.getCode() != CommonConstants.SUCCESS && MapUtils.isNotEmpty(setInfoByCodes.getData())) {
Map data = setInfoByCodes.getData();
for (InsuranceExportListVO record : insuranceExportList) {
JSONObject jsonObject = (JSONObject) data.get(record.getDeptNo());
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getString("departName")).orElse(""));
}
TInsuranceDetail detail = new TInsuranceDetail();
detail.setId(record.getId());
//update状态由「待投保」置为「投保中」
detail.setBuyHandleStatus(CommonConstants.TWO_INT);
if (record.getBuyType() == CommonConstants.ONE_INT){
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
}
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
detailList.add(detail);
}
}
//批量更新
if (CollectionUtils.isNotEmpty(detailList)){
this.saveOrUpdateBatch(detailList);
}
}
return insuranceExportList;
}
/**
* 投保退回
*
* @param idList
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> rollBackInsurance(List<String> idList) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if (CollectionUtils.isEmpty(idList)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList);
if (CollectionUtils.isNotEmpty(detailList)){
detailList.stream().forEach(e ->{
// 记录状态置为「退回」
e.setBuyHandleStatus(CommonConstants.FOUR_INT);
e.setUpdateBy(user.getId());
e.setUpdateTime(LocalDateTime.now());
});
//更新
this.saveOrUpdateBatch(detailList);
}
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
/**
* 办理成功
*
* @param idList
* @return {@link R<String>}
* @author licancan
*/
@Override
public R<String> successfulInsurance(List<String> idList) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if (CollectionUtils.isEmpty(idList)){
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
List<TInsuranceDetail> detailList = baseMapper.selectBatchIds(idList);
if (CollectionUtils.isNotEmpty(detailList)){
for (TInsuranceDetail detail : detailList) {
if (detail.getBuyType() == CommonConstants.THREE_INT){
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
}
//记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT);
//记录的有效状态,置为「有效」
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
}
//更新
this.saveOrUpdateBatch(detailList);
//todo 根据结算类型推送ekp
}
return R.ok(InsurancesConstants.OPERATE_SUCCESS);
}
/** /**
* 商险新增校验 * 商险新增校验
* *
...@@ -915,5 +1129,93 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -915,5 +1129,93 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
return null; return null;
} }
/**
* 已投保列表分页查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询参数
* @return {@link IPage< InsuredListVo>}
*/
@Override
public IPage<InsuredListVo> getInsuredListPage(Page<InsuredListVo> page, InsuredParam param) {
return null;
}
/**
* 已投保列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuredListVo>}
*/
@Override
public List<InsuredListVo> getInsuredList(InsuredParam param) {
return null;
}
/**
* 已减员列表分页查询
*
* @author zhaji
* @param page 分页数据
* @param param 查询参数
* @return {@link IPage< InsuranceRefundListVo >}
*/
@Override
public IPage<InsuranceRefundListVo> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, InsuranceRefundParam param) {
return null;
}
/**
* 已减员列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundListVo >}
*/
@Override
public List<InsuranceRefundListVo> getInsuranceRefundList(InsuranceRefundParam param) {
return null;
}
/**
* 减员办理列表分页查询
*
* @author zhaji
* @param page 分页数据
* @param param 查询参数
* @return {@link IPage< InsuranceRefundHandlingListVo>}
*/
@Override
public IPage<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingPageList(Page<InsuranceRefundHandlingParam> page, InsuranceRefundHandlingParam param) {
return null;
}
/**
* 减员办理列表不分页查询
*
* @author zhaji
* @param param 查询参数
* @return {@link List< InsuranceRefundHandlingListVo>}
*/
@Override
public List<InsuranceRefundHandlingListVo> getInsuranceRefundHandlingList(InsuranceRefundHandlingParam param) {
return null;
}
/**
* 减员办理
*
* @author zhaji
* @param insuranceDetail 办理类
* @return {@link R}
*/
@Override
public R updateInsuranceRefund(InsuranceRefundListParam insuranceDetail) {
return null;
}
} }
...@@ -98,7 +98,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat ...@@ -98,7 +98,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
if (!Common.isNumber(rate)){ if (!Common.isNumber(rate)){
return R.failed("当前费率格式不正确"); return R.failed("当前费率格式不正确");
} }
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,insuranceTypeId)
.eq(TInsuranceTypeRate :: getRate,insuranceTypeRate.getRate()).eq(TInsuranceTypeRate:: getMonth ,insuranceTypeRate.getMonth());
List<TInsuranceTypeRate> list = this.list(queryWrapper);
if (list.isEmpty()){
return R.ok(this.baseMapper.insert(insuranceTypeRate)); return R.ok(this.baseMapper.insert(insuranceTypeRate));
}else{
return R.failed("当前险种已存在相同的费率");
}
} }
} }
...@@ -45,10 +45,8 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, ...@@ -45,10 +45,8 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link IPage< TInsuranceType>} * @return {@link IPage< TInsuranceType>}
*/ */
@Override @Override
public IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType) { public IPage<InsuranceTypeVo> pageDiy(Page page, TInsuranceType insuranceType) {
LambdaQueryWrapper<TInsuranceType> wrapper = new LambdaQueryWrapper<>(); return this.baseMapper.selectInsuranceTypePage(page,insuranceType);
wrapper.orderByDesc(TInsuranceType::getCreateTime);
return this.baseMapper.selectPage(page,wrapper);
} }
/** /**
......
...@@ -111,6 +111,16 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp ...@@ -111,6 +111,16 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (!Common.isNumber(dieDisableQuota)){ if (!Common.isNumber(dieDisableQuota)){
return R.failed("当前身故或残疾额度格式不正确"); return R.failed("当前身故或残疾额度格式不正确");
} }
LambdaQueryWrapper<TInsuranceTypeStandard> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeStandard::getInsuranceTypeId,insuranceTypeStandard.getInsuranceTypeId())
.eq(TInsuranceTypeStandard::getBuyStandard,insuranceTypeStandard.getBuyStandard())
.eq(TInsuranceTypeStandard::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceTypeStandard> list = list(queryWrapper);
if(list.isEmpty()){
return R.ok(this.baseMapper.insert(insuranceTypeStandard)); return R.ok(this.baseMapper.insert(insuranceTypeStandard));
}else{
return R.failed("当前险种下的购买标准已存在");
}
} }
} }
...@@ -169,13 +169,165 @@ ...@@ -169,13 +169,165 @@
detail.IS_EFFECT as isEffect, detail.IS_EFFECT as isEffect,
detail.IS_OVERDUE as isOverdue, detail.IS_OVERDUE as isOverdue,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName, detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_PROVINCE as insuranceProvince,
detail.INSURANCE_CITY_NAME as insuranceCityName, detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_CITY as insuranceCity,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName, detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_PROVINCE as insuranceHandleProvince,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName, detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.INSURANCE_HANDLE_CITY as insuranceHandleCity,
detail.CREATE_NAME as createName, detail.CREATE_NAME as createName,
detail.CREATE_TIME as createTime detail.CREATE_TIME as createTime
from t_insurance_detail detail from t_insurance_detail detail
left join t_insurance_settle tis on detail.DEFAULT_SETTLE_ID = tis.ID left join t_insurance_settle tis on detail.DEFAULT_SETTLE_ID = tis.ID
where detail.ID = #{id} where detail.ID = #{id}
</select> </select>
<select id="getInsuranceExportListBySelect" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType,
detail.CREATE_NAME as createName,
detail.REMARK as remark
from t_insurance_detail detail
where detail.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
ORDER BY detail.CREATE_TIME DESC
</select>
<select id="getInsuranceExportList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceExportListVO">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.DEPT_NO as deptNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.INSURANCE_PROVINCE_NAME as insuranceProvinceName,
detail.INSURANCE_CITY_NAME as insuranceCityName,
detail.INSURANCE_HANDLE_PROVINCE_NAME as insuranceHandleProvinceName,
detail.INSURANCE_HANDLE_CITY_NAME as insuranceHandleCityName,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.SETTLE_MONTH as settleMonth,
detail.SETTLE_TYPE as settleType,
detail.CREATE_NAME as createName,
detail.REMARK as remark
from t_insurance_detail detail
where detail.DELETE_FLAG = 0 and detail.BUY_HANDLE_STATUS = 1
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
<!-- ***********************减员办理******************************** -->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.DEPT_NO as deptNo,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.CREATE_NAME as createName,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.SETTLE_TYPE as settleType,
detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatus != null">
and detail.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
</if>
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
<select id="getInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select detail.id as id,
detail.ORDER_NO as orderNo,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.BUY_TYPE as buyType,
detail.POST as post,
detail.DEPT_NO as deptNo,
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.CREATE_NAME as createName,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.SETTLE_TYPE as settleType,
detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO like concat('%',replace(replace(#{deptNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatus != null">
and detail.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
</if>
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.insuranceCompanyName != null and param.insuranceCompanyName.trim() != ''">
and detail.INSURANCE_COMPANY_NAME like concat('%',replace(replace(#{param.insuranceCompanyName},'_','\_'),'%','\%'),'%')
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
</mapper> </mapper>
...@@ -54,5 +54,23 @@ ...@@ -54,5 +54,23 @@
and and
DELETE_FLAG = 0 DELETE_FLAG = 0
</select> </select>
<select id="selectInsuranceTypePage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo">
select
a.ID as id,
a.NAME as name ,
b.COMPANY_NAME as insuranceCompanyName,
a.INSURANCE_COMPANY_ID as insuranceCompanyId,
a.RECEIPT_UNIT_NAME as receiptUnitName,
a.BANK_NAME as bankName,
a.BANK_NO as bankNo
from
t_insurance_type a,
t_insurance_company b
where
a.INSURANCE_COMPANY_ID = b.ID
and
a.DELETE_FLAG = 0
</select>
</mapper> </mapper>
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