Commit 0ecdbe6d authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!167
parents 6812a8a7 c7aaead1
......@@ -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);
}
......@@ -3054,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());
......@@ -3130,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, "导入成功");
}
/**
* 变更所属项目
*
......@@ -3934,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();
......@@ -4129,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);
......@@ -4523,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