From ba5ffa8d8996f040860b67859c7453f4e0d7e4d1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 22 一月 2024 09:49:59 +0800
Subject: [PATCH] 调整
---
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java | 87 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 78 insertions(+), 9 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 8940095..fd91573 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
@@ -68,6 +68,60 @@
@Override
@Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer back(InsuranceApply insuranceApply) {
+ if(insuranceApply.getId() == null ||StringUtils.isBlank(insuranceApply.getCheckInfo())){
+ 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);
+ }
+ if(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+ }
+ LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+ InsuranceApply update = new InsuranceApply();
+ update.setEditDate(new Date());
+ update.setEditor(user.getId());
+ update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey());
+ update.setCheckDate(update.getEditDate());
+ update.setCheckInfo(insuranceApply.getCheckInfo());
+ update.setCheckUserId(user.getId());
+ update.setId(model.getId());
+ insuranceApplyMapper.updateById(update);
+
+ return null;
+
+ }
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer uploadBaoxiandan(InsuranceApply insuranceApply) {
+ return null;
+
+ }
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer refuseBackApply(InsuranceApply insuranceApply) {
+ return null;
+
+ }
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer uploadToubaodan(InsuranceApply insuranceApply) {
+ return null;
+
+ }
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public Integer check(InsuranceApply insuranceApply) {
+ return null;
+
+ }
+
+
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
public Integer create(InsuranceApply insuranceApply) {
if (Objects.isNull(insuranceApply)
|| Objects.isNull(insuranceApply.getSolutionId())
@@ -143,7 +197,7 @@
}
applyDetail.setIdcardNo(member.getIdcardNo());
applyDetail.setSex(member.getSex());
- applyDetail.setFee(this.countDetailFee(solutions,insuranceApply.getApplyEndTime(),insuranceApply.getApplyStartTime()));
+ applyDetail.setFee(Constants.countDetailFee(solutions,insuranceApply.getApplyEndTime(),insuranceApply.getApplyStartTime()));
//楠岃瘉娲鹃仯鍗曚綅淇℃伅鏄惁瀛樺湪
if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){
throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"銆�"+applyDetail.getMemberName()+"銆戝憳宸ユ淳閬e崟浣嶆湭鏌ヨ鍒帮紒");
@@ -176,14 +230,14 @@
- public BigDecimal countDetailFee(Solutions solutions ,Date startDate,Date endDate){
- //鏌ヨ淇濋櫓瀹為檯鍛ㄦ湡
- Integer cycle = DateUtil.calculateBetween(endDate,startDate,solutions.getDataType());
- if(cycle==-1){
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏃ユ湡淇℃伅閿欒!");
- }
- return solutions.getPrice().multiply(new BigDecimal(cycle));
- }
+// public BigDecimal countDetailFee(Solutions solutions ,Date startDate,Date endDate){
+// //鏌ヨ淇濋櫓瀹為檯鍛ㄦ湡
+// Integer cycle = DateUtil.calculateBetween(endDate,startDate,solutions.getDataType());
+// if(cycle==-1){
+// throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏃ユ湡淇℃伅閿欒!");
+// }
+// return solutions.getPrice().multiply(new BigDecimal(cycle));
+// }
// public static void main(String[] args) {
// Date date1 = DateUtil.StringToDate("2023-03-01 00:00:00");
@@ -319,6 +373,21 @@
insuranceApply.setInsureNum(applyDetailMapper.selectCount(new QueryWrapper<ApplyDetail>().lambda().eq(ApplyDetail::getApplyId,insuranceApply.getId())
.eq(ApplyDetail::getIsdeleted,Constants.ZERO)));
+ //璁剧疆鍦ㄤ繚鏃堕暱锛堝ぉ鏁帮級
+ if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
+ //濡傛灉褰撳墠鏃堕棿澶т簬缁撴潫鏃ユ湡 鍒欎娇鐢ㄧ粨鏉熸棩鏈熷姣斿紑濮嬫棩鏈�
+ if(DateUtil.compareDate(new Date(),insuranceApply.getEndTime())>=Constants.ZERO){
+ insuranceApply.setServiceDays(DateUtil.daysBetweenDates(insuranceApply.getEndTime(),insuranceApply.getStartTime()));
+ }else if(DateUtil.compareDate(insuranceApply.getStartTime(),new Date())>=Constants.ZERO){
+ //鏈紑濮�
+ insuranceApply.setServiceDays(Constants.ZERO);
+ }else{
+ insuranceApply.setServiceDays(DateUtil.daysBetweenDates(new Date(),insuranceApply.getStartTime()));
+ }
+ }
+
+
+
//鏌ヨ鎿嶄綔璁板綍
List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class,
new MPJLambdaWrapper<ApplyLog>()
--
Gitblit v1.9.3