From c50686f775664c5a722f4b5ad7afde1e5214b14d Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期二, 05 十一月 2024 19:07:21 +0800 Subject: [PATCH] 最新版本541200007 --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java | 79 ++++++++++++++++++++++++++++++++++----- 1 files changed, 68 insertions(+), 11 deletions(-) diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java index e47c027..9f757c2 100644 --- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java +++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformBooksServiceImpl.java @@ -1,7 +1,5 @@ package com.doumee.service.business.impl; -import cn.emay.sdk.util.StringUtil; -import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; import com.doumee.biz.system.SystemDictDataBiz; import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; @@ -10,15 +8,15 @@ 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.ApproveTemplMapper; -import com.doumee.dao.business.MemberMapper; -import com.doumee.dao.business.PlatformBooksMapper; -import com.doumee.dao.business.PlatformReasonMapper; +import com.doumee.dao.business.*; +import com.doumee.dao.business.dao.SmsEmailMapper; import com.doumee.dao.business.join.ApproveJoinMapper; import com.doumee.dao.business.model.*; import com.doumee.dao.business.vo.ApproveDataVO; -import com.doumee.dao.web.reqeust.ConfirmTaskDTO; + +import com.doumee.dao.system.join.NoticesJoinMapper; import com.doumee.dao.web.reqeust.PlatformBooksApplyDTO; import com.doumee.dao.web.reqeust.PlatformBooksCheckNumDTO; import com.doumee.dao.web.reqeust.RevokeDTO; @@ -28,8 +26,8 @@ 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.business.third.EmayService; import org.apache.commons.lang3.StringUtils; -import org.apache.tomcat.util.bcel.Const; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,10 +51,16 @@ private PlatformBooksMapper platformBooksMapper; @Autowired + private NoticesJoinMapper noticesJoinMapper; + + @Autowired private ApproveTemplMapper approveTemplMapper; @Autowired private PlatformReasonMapper platformReasonMapper; + + @Autowired + private PlatformGroupMapper platformGroupMapper; @Autowired private SystemDictDataBiz systemDictDataBiz; @@ -70,6 +74,17 @@ @Autowired private ApproveJoinMapper approveJoinMapper; + @Autowired + private CarsMapper carsMapper; + + @Autowired + private SmsConfigMapper smsConfigMapper; + + @Autowired + private SmsEmailMapper smsEmailMapper; + + @Autowired + private EmayService emayService; @Override public Integer create(PlatformBooks platformBooks) { @@ -159,10 +174,24 @@ .eq(pageWrap.getModel().getPlateNum() != null, PlatformBooks::getPlateNum, pageWrap.getModel().getPlateNum()) .eq(pageWrap.getModel().getDriverPhone() != null, PlatformBooks::getDriverPhone, pageWrap.getModel().getDriverPhone()) .ge(pageWrap.getModel().getQueryDate() != null, PlatformBooks::getCreateDate, pageWrap.getModel().getQueryDate()) + .ge(pageWrap.getModel().getArriveDateStart() != null, PlatformBooks::getArriveDate, Utils.Date.getStart(pageWrap.getModel().getArriveDateStart())) + .le(pageWrap.getModel().getArriveDateEnd() != null, PlatformBooks::getArriveDate, Utils.Date.getEnd(pageWrap.getModel().getArriveDateEnd())) .orderByDesc(PlatformBooks::getCreateDate) ; - return PageData.from(platformBooksMapper.selectPage(page, queryWrapper)); + PageData<PlatformBooks> pageData = PageData.from(platformBooksMapper.selectPage(page, queryWrapper)); + for (PlatformBooks platformBooks:pageData.getRecords()) { + if(Constants.equalsInteger(platformBooks.getStatus(),Constants.ONE)||Constants.equalsInteger(platformBooks.getStatus(),Constants.ZERO)){ + String auditName = approveService.getApproveUserName(platformBooks.getId(),Constants.approveObjectType.reason); + platformBooks.setAuditName(auditName); + } + } + + return pageData; } + + + + @Override public long count(PlatformBooks platformBooks) { @@ -223,7 +252,21 @@ if(Objects.isNull(platformReason)|| !Constants.equalsInteger(platformReason.getIsdeleted(),Constants.ZERO)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍏ュ洯鍘熷洜淇℃伅寮傚父,璇峰埛鏂伴噸璇�"); } - ApproveTempl approveTempl = approveTemplMapper.selectById(platformReason.getId()); + PlatformGroup platformGroup= platformGroupMapper.selectById(platformReason.getGroupId()); + if(Objects.isNull(platformGroup)){ + throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌缁戝畾鏈堝彴缁勬暟鎹�"); + } + if(!Constants.equalsInteger(platformGroup.getIsdeleted(),Constants.ZERO)){ + throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"缁戝畾鏈堝彴缁勬暟鎹紓甯革紝璇疯仈绯荤鐞嗗憳"); + } + if(!Constants.checkCarNo(platformBooksApplyDTO.getCarCodeFront())){ + throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"璇疯緭鍏ユ纭殑杞︾墝!"); + }; + //鏌ヨ杞﹁締鏄惁涓鸿嚜鏈夎溅 + if(carsMapper.selectCount(new QueryWrapper<Cars>().lambda().eq(Cars::getIsdeleted,Constants.ZERO).eq(Cars::getCode,platformBooksApplyDTO.getCarCodeFront()))>Constants.ZERO){ + throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+platformBooksApplyDTO.getCarCodeFront()+"]灞炰簬鍐呴儴杞﹁締锛屾棤娉曢绾�"); + }; + ApproveTempl approveTempl = approveTemplMapper.selectById(platformReason.getApproveTemplId()); if(Objects.isNull(approveTempl)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏈厤缃鎵规祦,璇疯仈绯荤鐞嗗憳"); } @@ -236,10 +279,11 @@ platformBooks.setIsdeleted(Constants.ZERO); platformBooks.setStatus(Constants.ZERO); platformBooks.setDriverId(platformBooksApplyDTO.getUserId()); + platformBooks.setEditDate(new Date()); platformBooksMapper.insert(platformBooks); //鍒涘缓瀹℃壒娴佷俊鎭� - approveService.createApproveForPlatfrom(platformReason.getApproveTemplId(),platformBooks.getId(),platformBooks.getDriverId()); + approveService.createApproveForPlatfrom(approveTempl.getId(),platformBooks.getId(),platformBooks.getDriverId()); return platformBooks.getId(); } @@ -263,6 +307,10 @@ ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } + //鏌ヨ杞﹁締鏄惁涓鸿嚜鏈夎溅 + if(carsMapper.selectCount(new QueryWrapper<Cars>().lambda().eq(Cars::getIsdeleted,Constants.ZERO).eq(Cars::getCode,platformBooksApplyDTO.getCarCodeFront()))>Constants.ZERO){ + throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"["+platformBooksApplyDTO.getCarCodeFront()+"]灞炰簬鍐呴儴杞﹁締锛屾棤娉曢绾�"); + }; PlatformBooks platformBooks = platformBooksMapper.selectById(platformBooksApplyDTO.getId()); if(Objects.isNull(platformBooks)){ throw new BusinessException(ResponseStatus.DATA_EMPTY); @@ -352,6 +400,15 @@ .eq(Approve::getObjType,Constants.approveObjectType.logisticsCarUse) .eq(Approve::getObjId,revokeDTO.getId()) ); + + //鍙戦�佺煭淇¢�氱煡 + SmsEmailServiceImpl.sendPlatformBookSms(systemDictDataBiz, + emayService,smsEmailMapper,smsConfigMapper,platformBooksMapper,model.getId(), + SmsConstants.platformBookContent.platformBookCancel, + null,null + ); + + } -- Gitblit v1.9.3