| | |
| | | spring: |
| | | profiles: |
| | | active: pro |
| | | active: dev |
| | | application: |
| | | name: system_gateway |
| | | # 安全配置 |
| | |
| | | int currentMonth = Integer.parseInt(sdfMonth.format(currentDate)); |
| | | List<String> list = new ArrayList<>(); |
| | | |
| | | System.out.println("近12个月份:"); |
| | | for (int i = 0; i < month; i++) { |
| | | int tempYear = currentYear; |
| | | int tempMonth = currentMonth - i; |
| | |
| | | |
| | | public class SmsConstants { |
| | | |
| | | |
| | | |
| | | public static final String inventCode ="inventCode" ; |
| | | public static final String visit ="visit" ; |
| | | public static final String visitReport ="visitReport" ; |
| | | public static final String hiddenDanger ="hiddenDanger" ; |
| | | public static final String carUse ="carUse" ; |
| | | public static final String meeting ="meeting" ; |
| | | public static final String platformBook ="platformBook" ; |
| | | public static final String platformJob ="platformJob" ; |
| | | public static final String inventCode ="0" ; |
| | | public static final String visit ="1" ; |
| | | public static final String visitReport ="2" ; |
| | | public static final String hiddenDanger ="3" ; |
| | | public static final String carUse ="4" ; |
| | | public static final String meeting ="5" ; |
| | | public static final String platformBook ="6" ; |
| | | public static final String platformJob ="7" ; |
| | | |
| | | |
| | | /** |
| | |
| | | String carUseBookCancel = "carUseBookCancel"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 物流车预约 |
| | | */ |
| | |
| | | //物流车预约-审批驳回短信通知模板(给申请人) |
| | | String platformBookAuditFail = "platformBookAuditFail"; |
| | | //物流车预约-入园预约取消短信通知模板(给申请人) |
| | | String carUseBookCancel = "carUseBookCancel"; |
| | | String platformBookCancel = "platformBookCancel"; |
| | | } |
| | | |
| | | |
| | |
| | | //物流车作业-运输任务中止提醒(给司机):。 |
| | | String platformJobStopJob = "platformJobStopJob"; |
| | | //物流车预约-叫号入园等待(给司机) |
| | | String platformBookCallIn = "platformBookCallIn"; |
| | | String platformJobCallIn = "platformJobCallIn"; |
| | | //物流车预约-月台叫号(给司机) |
| | | String platformBookSingIn = "platformBookSingIn"; |
| | | String platformJobSingIn = "platformJobSingIn"; |
| | | //物流车预约-月台叫号过号(给司机) |
| | | String platformBookOverNum = "platformBookOverNum"; |
| | | String platformJobOverNum = "platformJobOverNum"; |
| | | //物流车预约-作业开始(给司机) |
| | | String platformBookWorking = "platformBookWorking"; |
| | | String platformJobWorking = "platformJobWorking"; |
| | | //物流车预约-作业完成(给司机) |
| | | String platformBookFinish = "platformBookFinish"; |
| | | String platformJobFinish = "platformJobFinish"; |
| | | //物流车预约-作业异常挂起(给司机) |
| | | String platformBookError = "platformBookError"; |
| | | String platformJobError = "platformJobError"; |
| | | //物流车预约-月台转移(给司机) |
| | | String platformBookMove = "platformBookMove"; |
| | | String platformJobMove = "platformJobMove"; |
| | | //物流车预约-月台停靠超时(给司机) |
| | | String platformBookTimeOut = "platformBookTimeOut"; |
| | | |
| | | String platformJobTimeOut = "platformJobTimeOut"; |
| | | } |
| | | |
| | | |
| | |
| | | spring: |
| | | profiles: |
| | | active: pro |
| | | active: dev |
| | | application: |
| | | name: visitsAdmin |
| | | # 安全配置 |
| | |
| | | @TableField(exist = false) |
| | | private String auditName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "审批信息数据") |
| | | @TableField(exist = false) |
| | | private ApproveDataVO approveDateVO; |
| | |
| | | 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; |
| | |
| | | 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 com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private VisitParkMapper visitParkMapper; |
| | | |
| | | @Autowired |
| | | private SmsConfigMapper smsConfigMapper; |
| | | |
| | | @Autowired |
| | | private SmsEmailMapper smsEmailMapper; |
| | | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | |
| | | @Override |
| | |
| | | this.organizeApproveCopyData(approveTempl,approveCopyList,businessId,approveList); |
| | | } |
| | | approveJoinMapper.insert(approveList); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | 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 |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | .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) |
| | |
| | | .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)) { |
| | |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda().set(Visits::getStatus,Constants.ONE).eq(Visits::getId,visits.getId())); |
| | | } |
| | | } |
| | | |
| | | |
| | | }else if(approveDTO.getObjType().equals(Constants.approveObjectType.cityUseCar)||approveDTO.getObjType().equals( |
| | | Constants.approveObjectType.unCityUseCar)){ |
| | | this.updDriver(approveDTO,approve,false); |
| | |
| | | visits.setEditDate(new Date()); |
| | | visits.setEditor(approveDTO.getLoginUserInfo().getMemberId()); |
| | | //下发访客报备车辆信息 |
| | | |
| | | if(approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ |
| | | if(Constants.equalsInteger(approveDTO.getStatus(),Constants.TWO)&&approveDTO.getObjType().equals(Constants.approveObjectType.visitReporting)){ |
| | | Boolean sendStatus = true; |
| | | //查询当前启用的停车场 |
| | | List<Parks> parksList = parksMapper.selectList(new QueryWrapper<Parks>() |
| | |
| | | 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(),"未查询到入园原因数据"); |
| | |
| | | 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); |
| | | } |
| | |
| | | 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.join.ApproveJoinMapper; |
| | |
| | | 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; |
| | |
| | | @Autowired |
| | | private CarsMapper carsMapper; |
| | | |
| | | @Autowired |
| | | private SmsConfigMapper smsConfigMapper; |
| | | |
| | | @Autowired |
| | | private SmsEmailMapper smsEmailMapper; |
| | | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | @Override |
| | | public Integer create(PlatformBooks platformBooks) { |
| | |
| | | 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.getId()); |
| | | ApproveTempl approveTempl = approveTemplMapper.selectById(platformReason.getApproveTemplId()); |
| | | if(Objects.isNull(approveTempl)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未配置审批流,请联系管理员"); |
| | | } |
| | |
| | | platformBooksMapper.insert(platformBooks); |
| | | |
| | | //创建审批流信息 |
| | | approveService.createApproveForPlatfrom(platformReason.getApproveTemplId(),platformBooks.getId(),platformBooks.getDriverId()); |
| | | approveService.createApproveForPlatfrom(approveTempl.getId(),platformBooks.getId(),platformBooks.getDriverId()); |
| | | return platformBooks.getId(); |
| | | } |
| | | |
| | |
| | | .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 |
| | | ); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | 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.PositionUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.utils.*; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.join.PlatformJobJoinMapper; |
| | | import com.doumee.dao.business.join.PlatformJoinMapper; |
| | |
| | | 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.impl.hksync.HkSyncPushServiceImpl; |
| | | import com.doumee.service.business.third.EmayService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private VisitParkMapper visitParkMapper; |
| | | |
| | | @Autowired |
| | | private SmsConfigMapper smsConfigMapper; |
| | | |
| | | @Autowired |
| | | private SmsEmailMapper smsEmailMapper; |
| | | |
| | | @Autowired |
| | | private EmayService emayService; |
| | | |
| | | @Autowired |
| | | private PlatformBroadcastLogMapper platformBroadcastLogMapper; |
| | | |
| | | @Override |
| | | public Integer create(PlatformJob platformJob) { |
| | |
| | | savePlatformLog(Constants.PlatformJobLogType.IN_WAIT.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.IN_WAIT.getInfo()); |
| | | |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobCallIn,null,null |
| | | ); |
| | | |
| | | return platformJob; |
| | | } |
| | | |
| | |
| | | //存储操作日志 |
| | | savePlatformLog(Constants.PlatformJobLogType.CALLED.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.CALLED.getInfo().replace("{data}",platform.getName())); |
| | | |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobSingIn,platform.getName(),null |
| | | ); |
| | | |
| | | //广播 led通知 |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformBroadcastContent.CALLING.getInfo().replace("{param2}",platform.getName())); |
| | | return platformJob; |
| | | } |
| | | |
| | | |
| | | public void broadcastAndLEed(PlatformJob model,String content){ |
| | | int speed = 13; |
| | | try { |
| | | speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda() |
| | | .eq(PlatformDevice::getPlatformId,model.getPlatformId()) |
| | | .eq(PlatformDevice::getIsdeleted,Constants.ZERO)); |
| | | if(deviceList ==null || deviceList.size() == 0){ |
| | | return; |
| | | } |
| | | content = content.replace("${param}",model.getPlatformName()); |
| | | content = content.replace("${param2}",model.getCarCodeFront()); |
| | | List<String> broadcastList = new ArrayList<>(); |
| | | List<String> ledList = new ArrayList<>(); |
| | | String bNames = ""; |
| | | List<PlatformBroadcastLog> logList = new ArrayList<>(); |
| | | for(PlatformDevice device : deviceList){ |
| | | if(StringUtils.isNotBlank(device.getHkId())){ |
| | | continue; |
| | | } |
| | | if(Constants.equalsInteger(device.getType(),Constants.ZERO)){ |
| | | //如果是LED |
| | | PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1); |
| | | logList.add(log); |
| | | ledList.add(device.getHkId()); |
| | | }else if(Constants.equalsInteger(device.getType(),Constants.ZERO)){ |
| | | //如果是广播点 |
| | | bNames += device.getName()+";"; |
| | | broadcastList.add(device.getHkId()); |
| | | } |
| | | } |
| | | if(broadcastList.size()>0){ |
| | | PlatformBroadcastLog log = HkSyncPushServiceImpl.dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo()); |
| | | logList.add(log); |
| | | } |
| | | if(logList.size()>0){ |
| | | platformBroadcastLogMapper.insert(logList); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //存储操作日志 |
| | | savePlatformLog(Constants.PlatformJobLogType.TRANSFERING.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.TRANSFERING.getInfo().replace("{data}",oldPlatform.getName())); |
| | | |
| | | |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobMove,oldPlatform.getName(),platform.getName() |
| | | ); |
| | | } |
| | | |
| | | |
| | |
| | | //存储操作日志 |
| | | savePlatformLog(Constants.PlatformJobLogType.OVER_NUMBER.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.OVER_NUMBER.getInfo()); |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobOverNum,null,null |
| | | ); |
| | | |
| | | |
| | | return platformJob; |
| | | } |
| | | |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转!"); |
| | | } |
| | | |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | |
| | | PlatformJob oldPlatformJob = new PlatformJob(); |
| | | BeanUtils.copyProperties(platformJob,oldPlatformJob); |
| | | |
| | |
| | | //存储操作日志 |
| | | savePlatformLog(Constants.PlatformJobLogType.EXCEPTION.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.EXCEPTION.getInfo()); |
| | | |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobError,platform.getName(),null |
| | | ); |
| | | } |
| | | |
| | | |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到月台信息"); |
| | | } |
| | | |
| | | |
| | | PlatformJob oldPlatformJob = new PlatformJob(); |
| | | BeanUtils.copyProperties(platformJob,oldPlatformJob); |
| | | if(Objects.isNull(platformJob.getStartDate())){ |
| | |
| | | //存储操作日志 |
| | | savePlatformLog(Constants.PlatformJobLogType.WORKING.getKey(),oldPlatformJob,platformJob, |
| | | Constants.PlatformJobLogType.WORKING.getInfo().replace("{data}",platform.getName())); |
| | | |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null |
| | | ); |
| | | |
| | | return platformJob; |
| | | } |
| | |
| | | ||Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey()) )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,业务状态已流转!"); |
| | | } |
| | | |
| | | |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.isNull(platform)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到月台信息"); |
| | | } |
| | | |
| | | PlatformJob oldPlatformJob = new PlatformJob(); |
| | | BeanUtils.copyProperties(platformJob,oldPlatformJob); |
| | | |
| | |
| | | //TODO 外协车卸货 或者 市公司车卸货 则根据任务情况 |
| | | |
| | | } |
| | | |
| | | //发送短信信息 |
| | | SmsEmailServiceImpl.sendPlatformJobSms(systemDictDataBiz, |
| | | emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(), |
| | | SmsConstants.platformJobContent.platformJobFinish,platform.getName(),null |
| | | ); |
| | | |
| | | //广播 led通知 |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformBroadcastContent.DONE.getInfo()); |
| | | return platformJob; |
| | | } |
| | | |
| | |
| | | savePlatformLog(Constants.PlatformJobLogType.AUTHED_LEAVE.getKey(),oldPlatformJob,platformJob , |
| | | Constants.PlatformJobLogType.AUTHED_LEAVE.getInfo()); |
| | | return platformJob; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | 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.PlatformBooksMapper; |
| | | import com.doumee.dao.business.PlatformJobMapper; |
| | | import com.doumee.dao.business.SmsConfigMapper; |
| | | import com.doumee.dao.business.SmsEmailMapper; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.SmsEmail; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.doumee.service.business.third.EmayService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 短信邮件信息表Service实现 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static void sendBusiness(EmayService emayService ,SmsEmailMapper smsEmailMapper ,List<String> phoneList,String objType,String content,Integer objId){ |
| | | for (String phone:phoneList) { |
| | | boolean result= emayService.sendSingleSms(phone,content); |
| | | if(!result){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信验证码发送失败,请稍后重试!"); |
| | | /** |
| | | * 用车申请 短信通知配置 |
| | | * @param emayService |
| | | * @param smsEmailMapper |
| | | * @param smsConfigMapper |
| | | * @param platformBooksMapper |
| | | * @param objId |
| | | * @param objCode |
| | | * @param msg |
| | | * @param auditUser |
| | | */ |
| | | public static void sendPlatformBookSms(SystemDictDataBiz systemDictDataBiz,EmayService emayService ,SmsEmailMapper smsEmailMapper ,SmsConfigMapper smsConfigMapper, |
| | | PlatformBooksMapper platformBooksMapper,Integer objId,String objCode,String msg,List<String> auditUser){ |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | | //开启短信通知 |
| | | if(Objects.nonNull(smsConfig) || Constants.equalsInteger(smsConfig.getStatus(),Constants.ZERO)){ |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode() + smsConfig.getContent(); |
| | | PlatformBooks platformBooks = platformBooksMapper.selectById(objId); |
| | | if(Objects.nonNull(platformBooks)){ |
| | | if(objCode.equals(SmsConstants.platformBookContent.platformBookAuditSuccess)){ |
| | | //您的【车辆入园申请】已经审批通过,入园时间为{入园时间},请提前30分钟前往现场签到。如计划有变,请及时联系审核人员。 |
| | | content = content.replace("{入园时间}",DateUtil.getDate(platformBooks.getArriveDate(),"yyyy-MM-dd HH:mm")); |
| | | sendBusinessSms(emayService,smsEmailMapper, |
| | | Arrays.asList(platformBooks.getDriverPhone().split(",")),SmsConstants.platformBook,content,platformBooks.getId()); |
| | | }else if(objCode.equals(SmsConstants.platformBookContent.platformBookAuditFail) || objCode.equals(SmsConstants.platformBookContent.platformBookCancel)){ |
| | | //您的【车辆入园申请】已被驳回,驳回原因为:{驳回原因}。如有疑问,请联系审核人员。 |
| | | content = content.replace("{驳回原因}",msg); |
| | | //您的【车辆入园申请】已被取消,取消原因为:{取消原因}。如有疑问,请联系审核人员。 |
| | | content = content.replace("{取消原因}",msg); |
| | | sendBusinessSms(emayService,smsEmailMapper, |
| | | Arrays.asList(platformBooks.getDriverPhone().split(",")),SmsConstants.platformBook,content,platformBooks.getId()); |
| | | }else{ |
| | | //您有一条【车辆入园申请】需要处理,详细信息请前往微信公众号查看。 |
| | | sendBusinessSms(emayService,smsEmailMapper, |
| | | auditUser,SmsConstants.platformBook,content,platformBooks.getId()); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用车申请 短信通知配置 |
| | | * @param emayService |
| | | * @param smsEmailMapper |
| | | * @param smsConfigMapper |
| | | * @param platformJobMapper |
| | | * @param objId |
| | | * @param objCode |
| | | * @param platformName |
| | | */ |
| | | public static void sendPlatformJobSms(SystemDictDataBiz systemDictDataBiz,EmayService emayService , SmsEmailMapper smsEmailMapper , SmsConfigMapper smsConfigMapper, |
| | | PlatformJobMapper platformJobMapper, Integer objId, String objCode, String platformName,String newPlatformName){ |
| | | //platformJobNewJob {车牌号}车主您好,您有一个新的运输任务,详细信息请前往微信公众号查看。 |
| | | //platformJobStopJob {车牌号}车主您好,您的运输任务已被取消,详细信息请前往微信公众号查看。 |
| | | //platformJobCallIn {车牌号}车主您好,请在10分钟内,前往园区等待区等待叫号作业。 |
| | | //platformJobSingIn {车牌号}车主您好,请在10分钟内,前往{月台名称}进行作业。 |
| | | //platformJobOverNum {车牌号}车主您好,您的任务已过号,请重新签到排队等待。 |
| | | //platformJobWorking {车牌号}车主您好,您的车辆已在{月台名称}开始作业,请随时关注作业情况。 |
| | | //platformJobFinish {车牌号}车主您好,您的车辆已在{月台名称}完成作业,请及时驶离月台。 |
| | | //platformJobError {车牌号}车主您好,您在{月台名称}的作业任务已经被异常挂起,请及时关注具体情况。 |
| | | //platformJobMove {车牌号}车主您好,您在{月台名称}的作业任务已经已被转移至{转移后月台名称},请及时关注叫号情况。 |
| | | //platformJobTimeOut {车牌号}车主您好,您在{月台名称}已停靠超时,请尽快驶离以免影响后续作业。 |
| | | try{ |
| | | SmsConfig smsConfig = smsConfigMapper.selectOne(new QueryWrapper<SmsConfig>().lambda().eq(SmsConfig::getCode, |
| | | objCode).last(" limit 1 ")); |
| | | //开启短信通知 |
| | | if(Objects.nonNull(smsConfig) || Constants.equalsInteger(smsConfig.getStatus(),Constants.ZERO)){ |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode() + smsConfig.getContent(); |
| | | PlatformJob platformJob = platformJobMapper.selectById(objId); |
| | | if(Objects.nonNull(platformJob)){ |
| | | content = content.replace("{车牌号}",platformJob.getCarCodeFront()); |
| | | if(StringUtils.isNotBlank(platformName)&&content.indexOf("{月台名称}")>=Constants.ZERO){ |
| | | content = content.replace("{月台名称}",platformName); |
| | | } |
| | | if(StringUtils.isNotBlank(newPlatformName)&&content.indexOf("{转移后月台名称}")>=Constants.ZERO){ |
| | | content = content.replace("{转移后月台名称}",newPlatformName); |
| | | } |
| | | sendBusinessSms(emayService,smsEmailMapper, |
| | | Arrays.asList(platformJob.getDrivierPhone().split(",")),SmsConstants.platformJob,content,platformJob.getId()); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public static void sendBusinessSms(EmayService emayService, SmsEmailMapper smsEmailMapper, List<String> phoneList, String objType, String content, Integer objId){ |
| | | for (String phone:phoneList) { |
| | | SmsEmail smsEmail = new SmsEmail(); |
| | | smsEmail.setIsdeleted(Constants.ZERO); |
| | | smsEmail.setCreateDate(new Date()); |
| | | smsEmail.setStatus(Constants.ONE); |
| | | smsEmail.setType(Constants.ZERO); |
| | | smsEmail.setTitle("业务短信"); |
| | | smsEmail.setPhone(phone); |
| | | smsEmail.setContent(content); |
| | | smsEmail.setObjType(objType); |
| | | smsEmail.setObjId(objId); |
| | | smsEmailMapper.insert(smsEmail); |
| | | emayService.sendSingleSms(phone,content); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | if(broadcastList.size()>0){ |
| | | PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames); |
| | | PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo()); |
| | | logList.add(log); |
| | | } |
| | | if(logList.size()>0){ |
| | | platformBroadcastLogMapper.insert(logList); |
| | | } |
| | | } |
| | | public static PlatformBroadcastLog dealBroadcastBiz(PlatformJob model, List<String> broadcastList,String bNames) { |
| | | |
| | | /** |
| | | * 广播通知 |
| | | * @param model |
| | | * @param broadcastList |
| | | * @param bNames |
| | | * @param content1 |
| | | * @return |
| | | */ |
| | | public static PlatformBroadcastLog dealBroadcastBiz(PlatformJob model, List<String> broadcastList,String bNames , String content1) { |
| | | PlatformBroadcastLog log = new PlatformBroadcastLog(); |
| | | String content1 =Constants.PlatformBroadcastContent.WRONG_IN.getInfo(); |
| | | content1 = content1.replace("${param}",model.getCarCodeFront()); |
| | | |
| | | log.setCreateDate(new Date()); |