From f2972aa8de54d8763bfa3fcc9d72962f82d20009 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 11 十月 2024 14:49:19 +0800
Subject: [PATCH] 代码初始化
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/ApproveServiceImpl.java | 336 +++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 287 insertions(+), 49 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/ApproveServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/ApproveServiceImpl.java
index 4742664..ad2249f 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/ApproveServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/ApproveServiceImpl.java
@@ -4,10 +4,16 @@
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
+import com.doumee.core.haikang.model.HKConstants;
+import com.doumee.core.haikang.model.param.BaseResponse;
+import com.doumee.core.haikang.model.param.request.ParkReservationAddRequest;
+import com.doumee.core.haikang.model.param.respose.ParkReservationAddResponse;
+import com.doumee.core.haikang.service.HKService;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
+import com.doumee.core.utils.SmsConstants;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dao.CompanyMapper;
@@ -27,16 +33,14 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.doumee.service.system.NoticesService;
+import com.doumee.service.business.third.EmayService;
import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
-import org.apache.xpath.operations.Bool;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -95,7 +99,29 @@
private PlatformJobMapper platformJobMapper;
@Autowired
private PlatformLogMapper platformLogMapper;
+ @Autowired
+ private PlatformReasonMapper platformReasonMapper;
+ @Autowired
+ private PlatformGroupMapper platformGroupMapper;
+
+ @Autowired
+ private ParksMapper parksMapper;
+
+ @Autowired
+ private ParkBookMapper parkBookMapper;
+
+ @Autowired
+ private VisitParkMapper visitParkMapper;
+
+ @Autowired
+ private SmsConfigMapper smsConfigMapper;
+
+ @Autowired
+ private SmsEmailMapper smsEmailMapper;
+
+ @Autowired
+ private EmayService emayService;
@Override
@@ -325,6 +351,7 @@
internalHomeVO.setNoticeCopyNum(
noticesList.stream().filter(i->Constants.equalsInteger(i.getUserId(),noticesDTO.getMemberId())
&&Constants.equalsInteger(i.getSendacopy(),Constants.ONE)
+ &&Constants.equalsInteger(i.getReaded(),Constants.ZERO)
).count()
);
}
@@ -388,6 +415,51 @@
}
+ @Override
+ @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+ public void createApproveForPlatfrom(Integer tempId,Integer businessId,Integer createMemberId){
+ //鏌ヨ澶勭悊妯℃澘
+ ApproveTempl approveTempl = approveTemplMapper.selectById(tempId);
+ if(Objects.isNull(approveTempl)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌瀹℃壒娴侀厤缃ā鏉�");
+ }
+ //鏌ヨ閰嶇疆娴佺▼
+ List<ApproveParam> approveParamAllList = approveParamMapper.selectList(new QueryWrapper<ApproveParam>()
+ .lambda().eq(ApproveParam::getIsdeleted,Constants.ZERO)
+ .eq(ApproveParam::getTemplId,approveTempl.getId())
+ .orderByAsc(ApproveParam::getType)
+ .orderByAsc(ApproveParam::getLevel)
+ );
+ if(Objects.isNull(approveParamAllList)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈厤缃鎵规祦绋�");
+ }
+ //瀹℃壒閰嶇疆
+ List<ApproveParam> approveParamList = approveParamAllList.stream().filter(i->i.getType().equals(Constants.ZERO)).collect(Collectors.toList());
+ if(Objects.isNull(approveParamList)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈厤缃鎵规祦绋�");
+ }
+ List<ApproveParam> approveCopyList = approveParamAllList.stream().filter(i->i.getType().equals(Constants.ONE)).collect(Collectors.toList());
+
+ Member createMember = memberMapper.selectById(createMemberId);
+ if(Objects.isNull(createMember)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鐢宠浜虹粍缁囦俊鎭紓甯�");
+ }
+ List<Approve> approveList = new ArrayList<>();
+
+ this.organizeApproveData(approveTempl,approveParamList,createMember,businessId,approveList);
+
+ if(CollectionUtils.isEmpty(approveList)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀹℃壒娴侀厤缃敊璇�");
+ }
+
+ //澶勭悊鎶勯�佹暟鎹�
+ if(CollectionUtils.isNotEmpty(approveCopyList)){
+ this.organizeApproveCopyData(approveTempl,approveCopyList,businessId,approveList);
+ }
+ approveJoinMapper.insert(approveList);
+ }
+
+
/**
* 缁勭粐瀹℃壒娴佹暟鎹�
* @param approveTempl
@@ -429,7 +501,7 @@
List<String> memberNameList =memberList.stream().map(m->m.getName()).collect(Collectors.toList());
String memberNames = String.join(",",memberNameList);
Integer noticeType = Constants.approveTypeToNoticeType(approveTempl.getType());
- String title = "銆愯瀹㈢敵璇枫�戠敵璇蜂汉 - ";
+ String title = "[璁垮鐢宠]鐢宠浜�-";
Map<String,Object> jsonMap = new HashMap<>();
for (int j = 0; j < memberList.size(); j++) {
Member member = memberList.get(j);
@@ -491,8 +563,8 @@
approve.setTemplatId(approveTempl.getId());
approve.setChekorId(memberId);
approve.setStatus(i==0?Constants.ONE:Constants.ZERO);
- approve.setStatusInfo(i==0?"瀹℃壒涓�":"寰呭鎵�");
- approve.setTitle("瀹℃壒浜�");
+ approve.setStatusInfo(i==0?"瀹℃壒涓�":"澶勭悊涓�");
+ approve.setTitle(StringUtils.isBlank(approveParam.getRemark())?"瀹℃壒涓�":approveParam.getRemark());
approve.setIsEndCheck((i+1) == approveParamList.size()?Constants.ONE:Constants.ZERO);
approve.setObjId(businessId);
approve.setLevel(i+1);
@@ -502,6 +574,19 @@
approve.setAddrParam(approveParam.getAddrParam());
approve.setType(Constants.ZERO);
approveList.add(approve);
+
+ if(Constants.equalsInteger(approve.getStatus(),Constants.ONE)){
+ //鍙戦�佺煭淇¢�氱煡
+ if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.reason)){
+ //鐗╂祦杞﹂绾�
+ SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz,
+ emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,businessId,
+ SmsConstants.platformBookContent.platformBookWaitAudit,
+ null,null
+ );
+ }
+ }
+
}
}
}
@@ -528,7 +613,7 @@
if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.visit)){
title = title + visits.getName();
}else{
- title = "銆愯瀹㈡姤澶囥�戠敵璇蜂汉 - " + visits.getName();
+ title = "[璁垮鎶ュ]鐢宠浜�-" + visits.getName();
}
jsonMap.put("name", "璁块棶浜�:" + visits.getCompanyName() + " - " + visits.getReceptMemberName());
jsonMap.put("sTime", "鍏ュ洯鏃堕棿:" + DateUtil.DateToStr(visits.getStarttime() , "yyyy-MM-dd HH:mm"));
@@ -549,14 +634,23 @@
if(Objects.isNull(carUseBook)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏈煡璇㈠埌涓氬姟鏁版嵁淇℃伅");
}
- title = "銆愮敤杞︾敵璇枫�戠敵璇蜂汉 - " + carUseBook.getMemberName();
+ title = "[鐢ㄨ溅鐢宠]鐢宠浜�-" + carUseBook.getMemberName();
jsonMap.put("name", "鐢宠浜�:" + carUseBook.getCompanyName() + " - " + carUseBook.getMemberName());
jsonMap.put("sTime", "寮�濮嬫椂闂�:" + DateUtil.DateToStr(carUseBook.getStartTime() , "yyyy-MM-dd HH:mm"));
jsonMap.put("eTime", "缁撴潫鏃堕棿:" + DateUtil.DateToStr(carUseBook.getEndTime() , "yyyy-MM-dd HH:mm"));
jsonMap.put("usrNum", StringUtils.isBlank(carUseBook.getMemberIds())?"涔樿溅浜烘暟: 0浜�": "涔樿溅浜烘暟: " +carUseBook.getMemberIds().split(",").length +"浜�");
jsonMap.put("mdd", StringUtils.isBlank(carUseBook.getAddr())?"鐩殑鍦�: - ": "鐩殑鍦�:" +carUseBook.getAddr());
- }else {
- throw new BusinessException(ResponseStatus.NOT_ALLOWED);
+ }else if(Constants.equalsInteger(noticeType,Constants.noticesObjectType.reason)){
+ //鐗╂祦杞﹂绾�
+ PlatformBooks platformBooks = platformBooksMapper.selectById(businessId);
+ if(Objects.isNull(platformBooks)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏈煡璇㈠埌涓氬姟鏁版嵁淇℃伅");
+ }
+ title = "[鐗╂祦杞﹀叆鍥绾鐢宠浜�-" + platformBooks.getDriverName();
+ jsonMap.put("inType", "鍏ュ簱绫诲瀷锛�"+(Constants.equalsInteger(platformBooks.getInType(),Constants.ZERO)?"鏁存墭鐩�":"浠剁儫"));
+ jsonMap.put("totalNum", "鎬昏繍杈撻噺锛�"+platformBooks.getTotalNum()+"涓囨敮");
+ jsonMap.put("arriveDate", "鍒板満鏃堕棿锛�" + DateUtil.DateToStr(platformBooks.getArriveDate() , "yyyy-MM-dd HH:mm"));
+ jsonMap.put("carNum", "杞︾墝鐓э細"+platformBooks.getCarCodeFront());
}
return title;
}
@@ -744,7 +838,7 @@
private List<Approve> getLevelInfoFromList(Approve level,List<Approve> approveGroupList) {
List<Approve> list = new ArrayList<>();
if(Constants.equalsInteger(level.getApproveType(),Constants.TWO)){
- level.setApproveType(Constants.ZERO);
+ level.setApproveType(Constants.TWO);
//濡傛灉鏄崟浜哄鎵�
list.add(level);
return list;
@@ -771,11 +865,17 @@
waitModel.setType(Constants.ZERO);
waitModel.setTitle(StringUtils.defaultString(level.getTitle(),"瀹℃壒浜�"));
waitModel.setStatus(Constants.equalsInteger(waitList.get(Constants.ZERO).getStatus(),Constants.ONE)?Constants.ONE:Constants.ZERO);
- waitModel.setStatusInfo("澶勭悊涓�");
- if(Constants.equalsInteger(level.getStatus(),Constants.approveStatus.auditIng)
- ||Constants.equalsInteger(level.getStatus(),Constants.approveStatus.pass)){
- waitModel.setMemberName(waitList.size() +"浜轰細绛�");
+ if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.wait)){
+ waitModel.setStatusInfo("寰呭鐞�");
+ }else if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.auditIng)){
+ waitModel.setStatusInfo("澶勭悊涓�");
}
+
+ waitModel.setMemberName(waitList.size() +"浜轰細绛�");
+// if(Constants.equalsInteger(level.getStatus(),Constants.approveStatus.auditIng)
+// ||Constants.equalsInteger(level.getStatus(),Constants.approveStatus.pass)){
+// waitModel.setMemberName(waitList.size() +"浜轰細绛�");
+// }
if(CollectionUtils.isNotEmpty(waitList)){
waitModel.setCreateDate(waitList.get(Constants.ZERO).getCreateDate());
}
@@ -790,15 +890,18 @@
}else {
if((waitList.size()> 0 || otherPassList.size()>0)){
Approve waitModel = new Approve();
- waitModel.setApproveType(Constants.ONE);
+ waitModel.setApproveType(Constants.ZERO);
if(Constants.equalsInteger(level.getStatus(),Constants.approveStatus.pass)){
- waitModel.setStatus(Constants.approveStatus.pass);
+ waitModel.setStatus(level.getStatus());
waitModel.setType(Constants.ONE);
- waitModel.setTitle("瀹℃壒浜猴紙鎶勯�佹垨绛惧鎵逛汉锛�");
+ waitModel.setCheckDate(level.getCheckDate());
+ waitModel.setTitle(StringUtils.defaultString(level.getTitle(),"瀹℃壒浜�"));
}else{
+ waitModel.setStatus(level.getStatus());
waitModel.setType(Constants.ZERO);
- waitModel.setStatusInfo(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"瀹℃壒浜�"):"鎶勯�佹垨绛惧鎵逛汉");
- waitModel.setStatus(passList.size()>0?Constants.ONE:Constants.ZERO);
+ //waitModel.setStatusInfo(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"瀹℃壒浜�"):"鎶勯�佹垨绛惧鎵逛汉");
+ waitModel.setTitle(passList.size()<=0?StringUtils.defaultString(level.getTitle(),"瀹℃壒浜�"):"鎶勯�佹垨绛惧鎵逛汉");
+
}
List<Approve> approveList = new ArrayList<>();
approveList.addAll(waitList);
@@ -812,7 +915,11 @@
if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.pass)){
waitModel.setMemberName("宸叉妱閫�"+ approveList.size() +"浜�");
}else if(Constants.equalsInteger(waitModel.getStatus(),Constants.approveStatus.wait)){
- waitModel.setMemberName("澶勭悊涓�");
+ waitModel.setMemberName(waitList.size() +"浜烘垨绛�");
+ waitModel.setStatusInfo("寰呭鐞�");
+ }else{
+ waitModel.setMemberName(waitList.size() +"浜烘垨绛�");
+ waitModel.setStatusInfo("澶勭悊涓�");
}
waitModel.setApproveList(approveList);
list.add(waitModel);
@@ -992,6 +1099,23 @@
return Constants.ZERO;
}
+ @Override
+ public String getApproveUserName(Integer businessId,Integer businessType){
+ List<Approve> approveList = approveJoinMapper.selectJoinList(Approve.class,new MPJLambdaWrapper<Approve>()
+ .selectAll(Approve.class)
+ .selectAs(Member::getName,Approve::getMemberName)
+ .leftJoin(Member.class,Member::getId,Approve::getChekorId)
+ .eq(Approve::getObjId,businessId)
+ .eq(Approve::getObjType,businessType)
+ .eq(Approve::getType,Constants.ZERO)
+ .eq(Approve::getStatus,Constants.approveStatus.auditIng)
+ );
+ if(CollectionUtils.isNotEmpty(approveList)){
+ List<String> names = approveList.stream().map(m->m.getMemberName()).collect(Collectors.toList());
+ return String.join(",",names);
+ }
+ return null;
+ }
@@ -1088,7 +1212,7 @@
noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda()
.set(Notices::getEditDate,new Date())
.set(Notices::getParam4,approveDTO.getLoginUserInfo().getMemberId())
- .set(Notices::getInfo,"瀹℃壒鏈�氳繃")
+ .set(Notices::getInfo,"宸叉嫆缁�")
.set(Notices::getReaded,Constants.ONE)
.set(Notices::getParam2,Constants.TWO)
.set(Notices::getStatus,Constants.ONE)
@@ -1101,7 +1225,7 @@
.set(Notices::getSendacopy,Constants.ONE)
.set(Notices::getStatus,Constants.ONE)
.set(Notices::getParam2,Constants.TWO)
- .set(Notices::getInfo,"瀹℃壒鏈�氳繃")
+ .set(Notices::getInfo,"宸叉嫆缁�")
.eq(Notices::getObjId,notices.getObjId())
.eq(Notices::getObjType,notices.getObjType())
.eq(Notices::getReaded,Constants.ZERO)
@@ -1133,6 +1257,17 @@
.in(Approve::getId,approveList.stream().map(m->m.getId()).collect(Collectors.toList())));
}
/**寮�鍚笅涓�绾у埆鐨勬暟鎹负寰呭鏍�**/
+
+ List<Approve> waitAuditList = approveJoinMapper.selectJoinList(Approve.class,
+ new MPJLambdaWrapper<Approve>()
+ .selectAll(Approve.class)
+ .selectAs(Member::getPhone,Approve::getMemberPhone)
+ .leftJoin(Member.class,Member::getId,Approve::getChekorId)
+ .eq(Approve::getStatus,Constants.approveStatus.wait)
+ .eq(Approve::getObjId,approve.getObjId())
+ .eq(Approve::getObjType,approve.getObjType())
+ .eq(Approve::getLevel,(approve.getLevel()+1)));
+
approveJoinMapper.update(null,new UpdateWrapper<Approve>()
.lambda()
.set(Approve::getStatus,Constants.approveStatus.auditIng)
@@ -1143,6 +1278,21 @@
.eq(Approve::getObjType,approve.getObjType())
.eq(Approve::getLevel,(approve.getLevel()+1))
);
+ //鍙戦�佺煭淇¢�氱煡 涓嬬骇瀹℃壒浜�
+
+
+ List<String> memberPhone = waitAuditList.stream().filter(i->StringUtils.isNotBlank(i.getMemberPhone())).map(i->i.getMemberPhone()).collect(Collectors.toList());
+ if(approveDTO.getObjType().equals(Constants.approveObjectType.reason)){
+ SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz,
+ emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,approveDTO.getObjId(),
+ SmsConstants.platformBookContent.platformBookWaitAudit,
+ approveDTO.getCheckInfo(),memberPhone
+ );
+ }
+
+
+
+
if(approveDTO.getObjType().equals(Constants.approveObjectType.unConstructionVisit)
||approveDTO.getObjType().equals(Constants.approveObjectType.constructionVisit)
||approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)) {
@@ -1150,12 +1300,8 @@
if(Objects.nonNull(visits)){
if(Constants.equalsInteger(visits.getStatus(),Constants.ZERO)){
visitsMapper.update(null,new UpdateWrapper<Visits>().lambda().set(Visits::getStatus,Constants.ONE).eq(Visits::getId,visits.getId()));
- }else{
- throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌涓氬姟鏁版嵁瀵硅薄!璇峰埛鏂伴噸璇�");
}
}
-
-
}else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals(
Constants.approveObjectType.unCityUseCar)){
this.updDriver(approveDTO,approve,false);
@@ -1213,6 +1359,7 @@
.set(Notices::getEditDate,new Date())
.set(Notices::getReaded,Constants.ONE)
.set(Notices::getStatus,Constants.ONE)
+ .set(Notices::getInfo,Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?"宸查�氳繃":"宸叉嫆缁�")
.set(dealBusinessBean,Notices::getParam2,Constants.ONE)
.set(Notices::getParam4,approveDTO.getLoginUserInfo().getMemberId())
.eq(Notices::getId,notices.getId())
@@ -1254,14 +1401,14 @@
String info = "";
List<String> memberNameList = Arrays.asList(memberNames.split(","));
if(Constants.equalsInteger(memberNameList.size(),Constants.ONE)){
- info = "寰� "+memberNameList.get(0)+" 澶勭悊涓�";
+ info = "寰�"+memberNameList.get(0)+"澶勭悊涓�";
}else{
- info = "寰� "+memberNameList.get(0)+" 绛�"+memberNameList.size()+"浜哄鐞嗕腑";
+ info = "寰�"+memberNameList.get(0)+"绛�"+memberNameList.size()+"浜哄鐞嗕腑";
}
//鏇存柊璇ヤ笟鍔℃暟鎹殑鎵�鏈夎褰曚俊鎭�
noticesJoinMapper.update(null,new UpdateWrapper<Notices>().lambda()
.set(!dealBusinessBean,Notices::getInfo,info)
- .set(dealBusinessBean,Notices::getInfo,"瀹℃壒閫氳繃")
+ .set(dealBusinessBean,Notices::getInfo,"宸查�氳繃")
.set(Notices::getParam5,memberNames)
.eq(Notices::getObjId,notices.getObjId())
.eq(Notices::getObjType,notices.getObjType()));
@@ -1277,7 +1424,7 @@
copyNotices.setEditDate(new Date());
copyNotices.setParam2("2");
copyNotices.setParam3("");
- copyNotices.setInfo("瀹℃壒閫氳繃");
+ copyNotices.setInfo("宸查�氳繃");
copyNotices.setUserId(copyApprove.getChekorId());
copyNotices.setStatus(Constants.ZERO);
copyNotices.setSendacopy(Constants.ONE);
@@ -1320,14 +1467,16 @@
notices.setParam5(memberNames);
notices.setRemark(nextDealApprove.getMemberName());
if(Constants.equalsInteger(memberNameList.size(),Constants.ONE)){
- notices.setInfo("寰� "+memberNameList.get(0)+" 澶勭悊涓�");
+ notices.setInfo("寰�"+memberNameList.get(0)+"澶勭悊涓�");
}else{
- notices.setInfo("寰� "+memberNameList.get(0)+" 绛�"+memberNameList.size()+"浜哄鐞嗕腑");
+ notices.setInfo("寰�"+memberNameList.get(0)+"绛�"+memberNameList.size()+"浜哄鐞嗕腑");
}
noticesJoinMapper.insert(newNotices);
}
return memberNames;
}
+
+
public void dealBusinessData(ApproveDTO approveDTO,Approve approve){
if(approveDTO.getObjType().equals(Constants.approveObjectType.unConstructionVisit)
@@ -1341,11 +1490,69 @@
visits.setStatus(approveDTO.getStatus());
visits.setEditDate(new Date());
visits.setEditor(approveDTO.getLoginUserInfo().getMemberId());
+ //涓嬪彂璁垮鎶ュ杞﹁締淇℃伅
+ if(Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)&&approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){
+ Boolean sendStatus = true;
+ //鏌ヨ褰撳墠鍚敤鐨勫仠杞﹀満
+ List<Parks> parksList = parksMapper.selectList(new QueryWrapper<Parks>()
+ .lambda()
+ .isNotNull(Parks::getHkId)
+ .eq(Parks::getIsdeleted,Constants.ZERO));
+ List<VisitPark> parkBookList = new ArrayList<>();
+ if(CollectionUtils.isNotEmpty(parksList)){
+ for (Parks parks:parksList) {
+ VisitPark visitPark = new VisitPark();
+ visitPark.setIsdeleted(Constants.ZERO);
+ visitPark.setCreateDate(new Date());
+ visitPark.setVisitApplyId(visits.getId().toString());
+ visitPark.setCarCode(visits.getCarNos());
+ visitPark.setParkId(parks.getId().toString());
+ visitPark.setStartTime(visits.getStarttime());
+ visitPark.setEndTime(visits.getEndtime());
+ visitPark.setParkHkId(parks.getHkId());
+ visitPark.setObjType(Constants.ZERO);
+
+ ParkReservationAddRequest request = new ParkReservationAddRequest();
+ request.setPlateNo(visitPark.getCarCode());
+ request.setParkSyscode(visitPark.getParkHkId());
+ request.setPhoneNo(visits.getPhone());
+ request.setOwner(visits.getName());
+ request.setAllowTimes(Constants.ONE+"");
+ request.setIsCharge(Constants.ONE+"");
+ request.setStartTime(Objects.isNull(visitPark.getStartTime())?DateUtil.getISO8601Timestamp2(new Date()):DateUtil.getISO8601Timestamp2(visitPark.getStartTime()));
+ request.setEndTime(Objects.isNull(visitPark.getEndTime())?"2999-12-31T00:00:00+08:00":DateUtil.getISO8601Timestamp2(visitPark.getEndTime()));
+ BaseResponse response = HKService.parkReservationAddition(request);
+
+ visitPark.setHkDate(new Date());
+ if(response!=null
+ && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
+ ParkReservationAddResponse parkReservationAddResponse = (ParkReservationAddResponse) response.getData();
+ visitPark.setHkId(parkReservationAddResponse.getReserveOrderNo());
+ visitPark.setHkStatus(Constants.ONE);
+ visitPark.setRemark("鍖呮湡鎴愬姛");
+ }else{
+ visitPark.setHkStatus(Constants.TWO);
+ visitPark.setRemark("鍖呮湡澶辫触~");
+ //涓嬪彂澶辫触 鏍囪涓讳笟鍔$姸鎬佷负涓嬪彂澶辫触
+ sendStatus = false;
+ }
+ parkBookList.add(visitPark);
+
+ }
+ visitParkMapper.insert(parkBookList);
+ }
+ if(sendStatus){
+ visits.setStatus(Constants.VisitStatus.xfSuccess);
+ }else{
+ visits.setStatus(Constants.VisitStatus.xfFail);
+ }
+ }
+
visitsMapper.updateById(visits);
}else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals(
Constants.approveObjectType.unCityUseCar)){
this.updDriver(approveDTO,approve,true);
- }else if(approveDTO.getObjType().equals(Constants.approveObjectType.logisticsCarUse)){
+ }else if(approveDTO.getObjType().equals(Constants.approveObjectType.reason)){
//鐗╂祦杞﹂绾�
PlatformBooks platformBooks = platformBooksMapper.selectById(approveDTO.getObjId());
if(Objects.isNull(platformBooks)){
@@ -1354,21 +1561,52 @@
platformBooks.setStatus(approveDTO.getStatus());
platformBooks.setEditDate(new Date());
platformBooks.setEditor(approveDTO.getLoginUserInfo().getMemberId());
+ if(Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)){
+ PlatformReason platformReason = platformReasonMapper.selectById(platformBooks.getReasonId());
+ if(Objects.isNull(platformReason)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鍏ュ洯鍘熷洜鏁版嵁");
+ }
+ PlatformGroup platformGroup = platformGroupMapper.selectById(platformReason.getGroupId());
+ if(Objects.isNull(platformGroup)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鍏ュ洯鍘熷洜閰嶇疆鏈堝彴缁勬暟鎹�");
+ }
- //鐢熸垚浠诲姟璁板綍
- PlatformJob platformJob = platformBooks.toPlatformJob();
- platformJobMapper.insert(platformJob);
- platformBooks.setJobId(platformJob.getId());
- platformBooksMapper.updateById(platformBooks);
- //鐢熸垚浠诲姟鎿嶄綔璁板綍
- PlatformLog platformLog = new PlatformLog();
- platformLog.setCreateDate(new Date());
- platformLog.setJobId(platformJob.getId());
- platformLog.setIsdeleted(Constants.ZERO);
- platformLog.setObjType(Constants.ZERO);
- platformLog.setObjId(platformJob.getId().toString());
- platformLog.setAfterContent(JSONObject.toJSONString(platformJob));
- platformLogMapper.insert(platformLog);
+ //鐢熸垚浠诲姟璁板綍
+ PlatformJob platformJob = platformBooks.toPlatformJob();
+ platformJob.setId(null);
+ platformJob.setPlatformGroupId(platformReason.getGroupId().intValue());
+ if(Constants.equalsInteger(platformGroup.getType(),Constants.ZERO)){
+ platformJob.setType(Constants.platformJobType.wxcxh);
+ }else if(Constants.equalsInteger(platformGroup.getType(),Constants.ONE)){
+ platformJob.setType(Constants.platformJobType.wxczh);
+ }else{
+ platformJob.setType(Constants.platformJobType.sgscxh);
+ }
+ platformJob.setStatus(Constants.PlatformJobStatus.WART_SIGN_IN.getKey());
+ platformJobMapper.insert(platformJob);
+ platformBooks.setJobId(platformJob.getId());
+ platformBooksMapper.updateById(platformBooks);
+ //鐢熸垚浠诲姟鎿嶄綔璁板綍
+ PlatformLog platformLog = new PlatformLog();
+ platformLog.setCreateDate(new Date());
+ platformLog.setJobId(platformJob.getId());
+ platformLog.setIsdeleted(Constants.ZERO);
+ platformLog.setParam4(platformJob.getCarCodeFront());
+ platformLog.setContent(Constants.PlatformJobLogType.CREATE.getInfo());
+ platformLog.setObjType(Constants.PlatformJobLogType.CREATE.getKey());
+ platformLog.setObjId(platformJob.getId().toString());
+ platformLog.setAfterContent(JSONObject.toJSONString(platformJob));
+ platformLogMapper.insert(platformLog);
+ }
+ //鍙戦�佺煭淇¢�氱煡
+ SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz,
+ emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,platformBooks.getId(),
+ Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)?SmsConstants.platformBookContent.platformBookAuditSuccess:
+ SmsConstants.platformBookContent.platformBookAuditFail,
+ approveDTO.getCheckInfo(),null
+ );
+
+ //TODO 鍙戦�佸井淇″叕浼楀彿娑堟伅
}else{
throw new BusinessException(ResponseStatus.BAD_REQUEST);
--
Gitblit v1.9.3