| | |
| | | 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; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |