Commit 1bac909d authored by hongguangwu's avatar hongguangwu

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

parents 1863ccc3 0ecdbe6d
......@@ -479,7 +479,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "根据身份证查询所有的商险列表", description = "根据身份证查询所有的商险列表")
@GetMapping("/getInsuranceListByIdCard")
public R<IPage<InsuranceListByIdCardVo>> getInsuranceListByIdCard(Page page, String idCard) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard));
public R<IPage<InsuranceListByIdCardVo>> getInsuranceListByIdCard(Page page, String idCard,String deptNo) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard,deptNo));
}
}
......@@ -186,7 +186,7 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
* @date 2022-08-01
* @return
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard);
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard, @Param("deptNo")String deptNo);
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
......
......@@ -330,6 +330,6 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param
* @return {@link R}
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard);
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard,String deptNo);
}
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Sets;
import com.yifu.cloud.plus.v1.check.entity.TCheckIdCard;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ProjectSetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.SetInfoVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainListVo;
......@@ -533,7 +534,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -542,7 +543,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}*/
}
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_START_PARSE_ERROR);
......@@ -705,7 +706,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -714,7 +715,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}*/
}
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId())
......@@ -1427,7 +1428,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -1438,7 +1439,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}*/
}
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
......@@ -1785,7 +1786,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -1796,7 +1797,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}*/
}
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
......@@ -2143,7 +2144,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getReplaceEmpName());
checkIdCard.setIdCard(param.getReplaceEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -2154,7 +2155,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}*/
}
if (param.getEmpName().equals(param.getReplaceEmpName()) && param.getEmpIdcardNo().equals(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_INFO_SAME);
......@@ -3053,75 +3054,45 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//初始化线程池
ThreadPoolExecutor threadPool = new ThreadPoolExecutor(10, 10, 100, TimeUnit.SECONDS, new LinkedBlockingQueue<>(10));
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(settleMonthCheckList)){
if (!Common.isNotEmpty(settleMonthCheckList)) {
return R.failed(InsurancesConstants.SETTLE_MONTH_CHANGE_LIST_IS_EMPTY);
}
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList,user);
Map<String, List<SettleMonthChangeCheckParam>> map = settleMonthChangeCheck(settleMonthCheckList, user);
//todo 生成EKP通知,通知ekp变更结算月份
List<TInsuranceOperate> operateList = new ArrayList<>(16);
List<SettleMonthChangeCheckParam> successList = map.get("successList");
List<SettleMonthChangeCheckParam> errorList = map.get("errorList");
if(CollectionUtils.isNotEmpty(successList)){
List<SettleMonthChangeCheckParam> ekpList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)) {
for (SettleMonthChangeCheckParam settleMonthChangeCheckParam : successList) {
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, settleMonthChangeCheckParam.getId())
.set(TInsuranceDetail::getSettleMonth, settleMonthChangeCheckParam.getSettleMonth())
.set(TInsuranceDetail::getUpdateBy, user.getId())
.set(TInsuranceDetail::getUpdateTime, LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(settleMonthChangeCheckParam.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
tInsuranceOperateService.save(insuranceOperate);
TInsuranceDetail byId = getById(settleMonthChangeCheckParam.getId());
String defaultSettleId = byId.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId)) {
TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
if (settle.getIsActualPush() == CommonConstants.ONE_INT || settle.getIsEstimatePush() == CommonConstants.ONE_INT) {
ekpList.add(settleMonthChangeCheckParam);
}
}
}
//先更新本地状态再集中推送至EKP
//当前保单结算信息不为空且已推送的情况下,推送EKP进行变更
List<EKPInteractiveParam> deptDetail = getDeptDetail(successList);
threadPool.execute(() -> {
threadPool.execute(()->{
List<EKPInteractiveParam> deptDetail = getDeptDetail(ekpList);
for (EKPInteractiveParam ekpInteractiveParam : deptDetail) {
String settleMonth = ekpInteractiveParam.getSettleMonth();
TInsuranceDetail byId = getById(ekpInteractiveParam.getId());
String defaultSettleId = byId.getDefaultSettleId();
if(StringUtils.isNotBlank(defaultSettleId)){
TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
Integer isActualPush = settle.getIsActualPush();
Integer isEstimatePush = settle.getIsEstimatePush();
if(isEstimatePush == CommonConstants.ONE_INT || isActualPush == CommonConstants.ONE_INT){
BeanCopyUtils.copyProperties(byId,ekpInteractiveParam);
ekpInteractiveParam.setSettleMonth(settleMonth);
String body = EKPUtil.sendToEKP(ekpInteractiveParam);
if (!StringUtils.isBlank(body)){
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
tInsuranceOperateService.save(insuranceOperate);
}else{
for (SettleMonthChangeCheckParam success: successList ){
if(success.getId().equals(ekpInteractiveParam.getId())){
success.setErrorMessage("更新EKP结算月份失败");
errorList.add(success);
}
}
}
}else{
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId());
insuranceOperate.setCreateName(user.getNickname());
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
tInsuranceOperateService.save(insuranceOperate);
}
}else{
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail ::getId,ekpInteractiveParam.getId())
.set(TInsuranceDetail :: getSettleMonth,ekpInteractiveParam.getSettleMonth())
.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now());
update(updateWrapper);
String body = EKPUtil.sendToEKP(ekpInteractiveParam);
if (!StringUtils.isBlank(body)) {
TInsuranceOperate insuranceOperate = new TInsuranceOperate();
insuranceOperate.setInsuranceDetailId(ekpInteractiveParam.getId());
insuranceOperate.setCreateBy(user.getId());
......@@ -3129,14 +3100,19 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceOperate.setCreateTime(LocalDateTime.now());
insuranceOperate.setOperateDesc(InsurancesConstants.MONTH_CHANGE);
tInsuranceOperateService.save(insuranceOperate);
} else {
for (SettleMonthChangeCheckParam success : successList) {
if (success.getId().equals(ekpInteractiveParam.getId())) {
success.setErrorMessage("更新EKP结算月份失败");
errorList.add(success);
}
}
}
}
}
});
}
return R.ok(errorList,"导入成功");
return R.ok(errorList, "导入成功");
}
/**
* 变更所属项目
*
......@@ -3933,7 +3909,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String,List<SettleMonthChangeCheckParam>> map = new HashMap<>(16);
List<SettleMonthChangeCheckParam> errorList = new ArrayList<>();
List<SettleMonthChangeCheckParam> successList = new ArrayList<>();
List<EKPInteractiveParam> ekpList = new ArrayList<>();
for (SettleMonthChangeCheckParam param : settleMonthCheckList) {
//员工姓名
String empName = param.getEmpName();
......@@ -4128,10 +4103,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param.setId(insuranceDetail.getId());
EKPInteractiveParam ekpInteractiveParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(insuranceDetail,ekpInteractiveParam);
ekpInteractiveParam.setSettleMonth(settleMonth);
ekpList.add(ekpInteractiveParam);
successList.add(param);
}
map.put("errorList",errorList);
......@@ -4522,8 +4493,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
public IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard) {
IPage<InsuranceListByIdCardVo> insuranceListByIdCard = baseMapper.getInsuranceListByIdCard(page, idCard);
public IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard,String deptNo) {
IPage<InsuranceListByIdCardVo> insuranceListByIdCard = baseMapper.getInsuranceListByIdCard(page, idCard,deptNo);
List<InsuranceListByIdCardVo> records = insuranceListByIdCard.getRecords();
if (CollectionUtils.isNotEmpty(records)){
for (InsuranceListByIdCardVo record : records) {
......
......@@ -888,6 +888,7 @@
<where>
1=1
AND EMP_IDCARD_NO = #{idCard}
and DEPT_NO = #{deptNo}
</where>
ORDER BY CREATE_TIME desc
</select>
......
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