From e1c072109e62f4adcb53af0d2c69b896b9159059 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 29 五月 2025 18:21:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1
---
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java | 107 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 81 insertions(+), 26 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
index e136e8b..906ff97 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -19,6 +19,7 @@
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.ApplyPowerVO;
import com.doumee.dao.business.vo.CountCyclePriceVO;
+import com.doumee.dao.business.vo.dataBoard.InsuranceDataVO;
import com.doumee.dao.system.SystemUserMapper;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.InsuranceApplyService;
@@ -35,6 +36,8 @@
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -62,7 +65,6 @@
private SmsEmailService smsEmailService;
@Autowired
private ApplyChangeJoinMapper applyChangeMapper;
-
@Autowired
private SystemDictDataBiz systemDictDataBiz;
@Autowired
@@ -71,25 +73,20 @@
private CompanyMapper companyMapper;
@Autowired
private MemberInsuranceJoinMapper memberInsuranceJoinMapper;
-
@Autowired
private ApplyDetailMapper applyDetailMapper;
@Autowired
private ApplyDetailJoinMapper applyDetailJoinMapper;
-
@Autowired
private ApplyLogMapper applyLogMapper;
@Autowired
private SignService signService;
@Autowired
private MultifileMapper multifileMapper;
-
@Autowired
private ApplyLogJoinMapper applyLogJoinMapper;
-
@Autowired
private SolutionsMapper solutionsMapper;
-
@Autowired
private MemberMapper memberMapper;
@Autowired
@@ -104,7 +101,6 @@
private DuWorkTypeJoinMapper duWorkTypeJoinMapper;
@Autowired
private SolutionWorktypeJoinMapper solutionWorktypeJoinMapper;
-
@Autowired
private NoticesMapper noticesMapper;
@Autowired
@@ -119,7 +115,8 @@
private SystemUserMapper systemUserMapper;
@Autowired
private CompanyDepartmentMapper companyDepartmentMapper;
-
+ @Autowired
+ private InsuranceMapper insuranceMapper;
@Override
@Transactional(rollbackFor = {Exception.class,BusinessException.class})
@@ -150,7 +147,6 @@
}
update.setStatus(Constants.InsuranceApplyStatus.WTB_RETURN.getKey());
}
-
update.setEditDate(new Date());
update.setEditor(user.getId());
update.setCheckDate(update.getEditDate());
@@ -158,7 +154,6 @@
update.setCheckUserId(user.getId());
update.setId(model.getId());
insuranceApplyMapper.updateById(update);
-
//瀛樺偍寰呭姙淇℃伅
Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.INSURANCE_APPLY;
//鍒犻櫎鍏朵粬寰呭姙
@@ -168,8 +163,6 @@
Notices notices = new Notices(noticeObjectType,Constants.ONE,insuranceApply.getId(),solutions.getName(),
model.getCompanyId(), Constants.NoticeType.FOUR);
noticesMapper.insert(notices);
-
-
Constants.ApplyLogType applyLogType = Constants.ApplyLogType.PLATFORM_RETURN;
String info =applyLogType.getInfo();
info = info.replace("${param}", update.getCheckInfo());
@@ -223,7 +216,6 @@
||StringUtils.isBlank( insuranceApply.getBaoxiandanFile() .getName())){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
-
InsuranceApply model = insuranceApplyMapper.selectById(insuranceApply.getId());
if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
@@ -338,7 +330,7 @@
);
}
- memberInsuranceJoinMapper.insertBatchSomeColumn(memberInsuranceList);
+ memberInsuranceJoinMapper.insert(memberInsuranceList);
}
this.updateApplyCurrentFee(insuranceApply.getId(),null);
@@ -513,7 +505,7 @@
if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
}
- Company company = user.getCompany();
+ Company company = user.getShowCompany();
if(debugModel){
company = companyMapper.selectById(model.getCompanyId());
}
@@ -2375,8 +2367,13 @@
+
+ private static Logger logger = LoggerFactory.getLogger(InsuranceApplyServiceImpl.class);
+
public void dealApplyDetailData(InsuranceApply insuranceApply,Solutions solutions,List<ApplyDetail> applyDetailList,
LoginUserInfo loginUserInfo,CountCyclePriceVO countCyclePriceVO,Boolean checkNewData){
+ Long start = System.currentTimeMillis();
+ logger.error("澶勭悊淇濆崟鏁版嵁寮�濮嬫椂闂�:=========================>"+start);
//2024骞�11鏈�6鏃�15:01:34 鍔犲叆 鏂规閰嶇疆浜嗘湁娲鹃仯鍗曚綅 鎵嶄細鍘婚獙璇佹淳閬e崟浣嶆暟鎹�
List<DuSolution> duSolutionList = new ArrayList<>();
List<DuWorktype> duWorktypeList = new ArrayList<>();
@@ -2455,10 +2452,12 @@
this.checkMemberSolution(solutions.getParentId(),member.getIdcardNo(),member.getName(),insuranceApply.getStartTime(),insuranceApply.getEndTime(),insuranceApply.getId());
}
if(CollectionUtils.isNotEmpty(addMemberList)){
- memberJoinMapper.insertBatchSomeColumn(addMemberList);
+ memberJoinMapper.insert(addMemberList);
}
memberList.addAll(addMemberList);
for (int i = 0; i < applyDetailList.size(); i++) {
+ Long singlStart = System.currentTimeMillis();
+ logger.error("澶勭悊淇濆崟鍗曟潯鏁版嵁寮�濮嬫椂闂�:=========================>"+singlStart);
ApplyDetail applyDetail = applyDetailList.get(i);
if(Objects.isNull(applyDetail)
||StringUtils.isBlank(applyDetail.getIdcardNo())
@@ -2535,12 +2534,12 @@
.collect(Collectors.toList()).size()<=Constants.ZERO){
throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"銆�"+applyDetail.getMemberName()+applyDetail.getIdcardNo()+"銆戝憳宸ュ伐绉嶄俊鎭湭鏌ヨ鍒帮紒");
}
-// if(duWorktypeList.stream().filter(d->d.getWorkTypeId().equals(applyDetail.getWorktypeId()))
-// .collect(Collectors.toList()).size()<=Constants.ZERO){
-// throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"銆�"+applyDetail.getMemberName()+applyDetail.getIdcardNo()+"銆戝憳宸ュ伐绉嶄俊鎭湭鏌ヨ鍒帮紒");
-// }
+ Long singlEnd = System.currentTimeMillis();
+ logger.error("澶勭悊淇濆崟鍗曟潯鏁版嵁缁撴潫鏃堕棿:=========================>"+singlEnd+";鑰楁椂锛�====銆�"+(singlStart-singlEnd));
}
- applyDetailJoinMapper.insertBatchSomeColumn(applyDetailList);
+ Long end = System.currentTimeMillis();
+ logger.error("澶勭悊鍗曟暟鎹粨鏉熸椂闂�:=========================>"+end +";鑰楁椂锛�====銆�"+(end-start));
+ applyDetailJoinMapper.insert(applyDetailList);
}
}
@@ -2592,7 +2591,7 @@
};
}
- public static void checkStaticMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime,
+ public static void checkStaticMemberSolution(Integer solutionId,Integer memberId,String memberIdCard,String memberName,Date startTime,
Date endTime,ApplyDetailJoinMapper applyDetailJoinMapper){
List<ApplyDetail> applyDetailList = new ArrayList<ApplyDetail>();
try {
@@ -2604,7 +2603,7 @@
.leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId)
.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
- .eq(ApplyDetail::getIdcardNo,idCode)
+ .eq(ApplyDetail::getIdcardNo,memberIdCard)
.eq(Solutions::getBaseId,solutionId)
.eq(ApplyDetail::getIsdeleted,Constants.ZERO)
.notIn(InsuranceApply::getStatus
@@ -2622,6 +2621,7 @@
}
if(applyDetailList.size() >Constants.ZERO){
String companyName = applyDetailList.get(Constants.ZERO).getCompanyName();
+ String idCode = applyDetailList.get(Constants.ZERO).getIdcardNo();
if(StringUtils.isNotBlank(companyName)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇ュ憳宸ャ��"+memberName+" "+idCode+"銆戝凡鍦ㄣ��"+companyName+"銆戝瓨鍦ㄤ繚闄�,璇疯仈绯诲鏈嶇‘璁�");
}else{
@@ -3493,7 +3493,7 @@
if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
}
- Company company = user.getCompany();
+ Company company = user.getShowCompany();
if(debugModel){
company = companyMapper.selectById(model.getCompanyId());
}
@@ -3578,7 +3578,7 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔绛剧珷鎿嶄綔锛�");
}
LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
- Company company = user.getCompany();
+ Company company = user.getShowCompany();
if(debugModel){
company = companyMapper.selectById(model.getCompanyId());
}
@@ -3659,7 +3659,7 @@
if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_TOUBAOING.getKey())){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
}
- Company company = user.getCompany();
+ Company company = user.getShowCompany();
if(debugModel){
company = companyMapper.selectById(model.getCompanyId());
}
@@ -3766,6 +3766,61 @@
return applyPowerVO;
}
+// @Override
+// public InsuranceDataVO getInsuranceDataVO(){
+// InsuranceDataVO insuranceDataVO = new InsuranceDataVO();
+// insuranceDataVO.setInsuranceTotal(Constants.ZERO);
+// insuranceDataVO.setInsuranceAddTotal(Constants.ZERO);
+// insuranceDataVO.setInsuranceApplyTotal(Constants.ZERO);
+// insuranceDataVO.setInsuranceApplyAddTotal(Constants.ZERO);
+// insuranceDataVO.setInsuranceUserTotal(Constants.ZERO);
+// insuranceDataVO.setInsuranceUserAddTotal(Constants.ZERO);
+// insuranceDataVO.setTotalAddFee(BigDecimal.ZERO);
+// insuranceDataVO.setTotalFee(BigDecimal.ZERO);
+// //鏈湀鏃ユ湡
+// String monthData = DateUtil.DateToStr(new Date(),"yyyy-MM");
+// //淇濋櫓鍏徃鏁伴噺
+// List<Insurance> insuranceList = insuranceMapper.selectList(new QueryWrapper<Insurance>().lambda().eq(Insurance::getIsdeleted,Constants.ZERO).eq(Insurance::getStatus,Constants.ZERO));
+// if(CollectionUtils.isNotEmpty(insuranceList)){
+// insuranceDataVO.setInsuranceTotal(insuranceList.size());
+// insuranceDataVO.setInsuranceAddTotal(insuranceList.stream().filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM").equals(monthData)).collect(Collectors.toList()).size());
+// }
+//
+// //淇濆崟鏁伴噺
+// List<InsuranceApply> insuranceApplyList = insuranceApplyMapper.selectList(new QueryWrapper<InsuranceApply>()
+// .lambda().eq(InsuranceApply::getIsdeleted,Constants.ZERO).in(InsuranceApply::getStatus,
+// Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())
+// );
+// if(CollectionUtils.isNotEmpty(insuranceApplyList)){
+// insuranceDataVO.setInsuranceApplyTotal(insuranceApplyList.size());
+// insuranceDataVO.setInsuranceApplyAddTotal(insuranceApplyList.stream().filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM").equals(monthData)).collect(Collectors.toList()).size());
+// }
+//
+// //鍦ㄤ繚浜烘暟
+// List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class,new MPJLambdaWrapper<ApplyDetail>().selectAll(ApplyDetail.class)
+// .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId)
+// .eq(InsuranceApply::getIsdeleted,Constants.ZERO).in(InsuranceApply::getStatus,
+// Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())
+// .eq(ApplyDetail::getIsdeleted,Constants.ZERO)
+// .apply(" ( t.START_TIME >= now() and t.END_TIME <= now() ) ")
+// );
+// if(CollectionUtils.isNotEmpty(applyDetailList)){
+// insuranceDataVO.setInsuranceUserTotal(applyDetailList.size());
+// insuranceDataVO.setInsuranceUserAddTotal(
+// applyDetailList.stream().filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM")
+// .equals(monthData)).collect(Collectors.toList()).size());
+//
+// insuranceDataVO.setTotalFee(applyDetailList.stream().map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add));
+// insuranceDataVO.setTotalAddFee(applyDetailList.stream()
+// .filter(i->Objects.nonNull(i.getCreateDate())&&DateUtil.DateToStr(i.getCreateDate(),"yyyy-MM")
+// .equals(monthData)).map(i->i.getFee()).reduce(BigDecimal.ZERO,BigDecimal::add));
+// }
+//
+// return insuranceDataVO;
+// }
+
+
+
}
--
Gitblit v1.9.3