| | |
| | | |
| | | public enum PlatformWarnEvent { |
| | | STOP_TIMEOUT(0, "停靠超时","${carCode}月台停靠超时" ), |
| | | STOP_ERROR(1, "停靠错误","${carCode}月台停靠错误" ); |
| | | STOP_ERROR(1, "停靠错误","${carCode}月台停靠错误" ), |
| | | WORK_TIMEOUT(2, "作业超时","${carCode}作业超时" ); |
| | | |
| | | // 成员变量 |
| | | private int key; |
| | |
| | | WORKING(3, "作业中","${param} ${param2} 作业中" ), |
| | | WRONG_IN(4, "错误停靠","${param} ${param2} 当前车辆错误停靠,请尽快驶离" ), |
| | | TIMEOUT_IN(5, "超时停靠","${param} ${param2} 当前车辆超时停靠,请尽快驶离" ), |
| | | TIMEOUT_WORK(6, "作业超时","${param} ${param2} 当前车辆作业超时" ), |
| | | ; |
| | | |
| | | // 成员变量 |
| | |
| | | 2. 作业完成:皖A12345作业完成,请尽快驶离 |
| | | 3. 错误停靠:皖A12345月台停靠错误,请尽快驶离 |
| | | 4. 超时停靠:皖A12345月台停靠超时,请尽快驶离请尽快驶离 |
| | | 5. 作业超时:皖A12345月台停靠超时,请尽快驶离请尽快驶离 |
| | | */ |
| | | public enum PlatformBroadcastContent { |
| | | CALLING(1, "叫号中","${param}请前往${param2}等待作业"), |
| | | DONE(2, "作业完成","${param}作业完成,请尽快驶离" ), |
| | | WRONG_IN(3, "错误停靠","${param}月台停靠错误,请尽快驶离" ), |
| | | TIMEOUT_IN(4, "超时停靠","${param}月台停靠超时,请尽快驶离请尽快驶离" ), |
| | | TIMEOUT_WORK(5, "作业超时","${param}作业超时" ), |
| | | ; |
| | | |
| | | // 成员变量 |
| | |
| | | @ApiOperation("【访客系统】定时更新微信公众号accesstoken") |
| | | @GetMapping("/timer/wxtoken/updateWxAccessToken") |
| | | ApiResponse updateWxAccessToken(); |
| | | @ApiOperation("月台任务超时报警") |
| | | @GetMapping("/timer/platformJob/platformJobTimeOut") |
| | | ApiResponse platformJobTimeOut(); |
| | | @ApiOperation("月台任务自动过号") |
| | | @GetMapping("/timer/platformJob/timeOutCallIn") |
| | | ApiResponse timeOutCallIn(); |
| | | |
| | | @ApiOperation("【数字化月台】月台作业报警业务") |
| | | @GetMapping("/timer/platformJob/platformJobTimer") |
| | | ApiResponse platformJobTimer(); |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private PlatformJobService platformJobService; |
| | | |
| | | @ApiOperation("超时报警数据") |
| | | @GetMapping("/platformJobTimeOut") |
| | | public ApiResponse platformJobTimeOut() { |
| | | @ApiOperation("月台作业报警业务") |
| | | @GetMapping("/platformJobTimer") |
| | | public ApiResponse platformJobTimer() { |
| | | platformJobService.timeOutReport(); |
| | | return ApiResponse.success("超时报警数据"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("超时自动过号") |
| | | @GetMapping("/timeOutCallIn") |
| | | public ApiResponse timeOutCallIn() { |
| | | platformJobService.timeOutCallIn(); |
| | | return ApiResponse.success("自动过号"); |
| | | platformJobService.timeOutWork(); |
| | | return ApiResponse.success("月台作业报警业务"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation("批量禁启用") |
| | | @GetMapping("/updateStatus/batch") |
| | | @CloudRequiredPermission("business:smsconfig:update") |
| | | public ApiResponse updateStatusBatch(@RequestParam String ids,@RequestParam Integer status) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | smsConfigService.updateStatusByIdInBatch(idList,status); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("根据ID修改") |
| | | @PostMapping("/updateById") |
| | | @CloudRequiredPermission("business:smsconfig:update") |
| | |
| | | return ApiResponse.success(platformJobService.getLargeScreenData()); |
| | | } |
| | | |
| | | @LoginNoRequired |
| | | @ApiOperation("月台任务测试定时方法") |
| | | @GetMapping("/testTimer") |
| | | public ApiResponse testTimer(Integer type) { |
| | | if(Constants.equalsInteger(type ,1)){ |
| | | platformJobService.timeOutWork(); |
| | | }else if(Constants.equalsInteger(type ,2)){ |
| | | platformJobService.timeOutCallIn(); |
| | | }else if(Constants.equalsInteger(type ,3)){ |
| | | platformJobService.timeOutReport(); |
| | | } |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String queryStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "多状态查询 多个以,分割") |
| | | @TableField(exist = false) |
| | | private String queryStatusForPower; |
| | | |
| | | |
| | | @ApiModelProperty(value = "作业类型查询 多个以,分割") |
| | | @TableField(exist = false) |
| | | private String queryType; |
| | |
| | | package com.doumee.dao.business.vo; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.dao.business.model.Approve; |
| | | import com.doumee.dao.business.model.Platform; |
| | | import com.doumee.dao.business.model.PlatformWmsDetail; |
| | |
| | | @ApiModelProperty(value = "收货地") |
| | | private String address; |
| | | |
| | | @ApiModelProperty(value = "0未完成 1已完成 2已取消", example = "1") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "上锁状态:0=未上锁;1=已上锁;") |
| | | private Integer lockStatus; |
| | | |
| | |
| | | */ |
| | | void timeOutCallIn(); |
| | | |
| | | /** |
| | | * 作业超时 |
| | | */ |
| | | void timeOutWork(); |
| | | |
| | | } |
| | |
| | | */ |
| | | void updateById(SmsConfig smsConfig); |
| | | |
| | | void updateStatusByIdInBatch(List<Integer> ids,Integer status); |
| | | |
| | | /** |
| | | * 批量主键更新 |
| | | * |
| | |
| | | } |
| | | model.setSpeed(speed); |
| | | } |
| | | PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getNo(),device.getName(),model.getContent(),model.getSpeed(),1); |
| | | PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(0,device.getNo(),device.getName(),model.getContent(),model.getSpeed(),1); |
| | | platformBroadcastLogMapper.insert(log); |
| | | if(log.getHkStatus() == null || !Constants.equalsInteger(log.getHkStatus(), Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,屏幕内容设置失败"+(log!=null?log.getHkInfo():"")); |
| | |
| | | .eq(pageWrap.getModel().getPlatformGroupId() != null, PlatformJob::getPlatformGroupId, pageWrap.getModel().getPlatformGroupId()) |
| | | |
| | | .apply(pageWrap.getModel().getQueryStatus() != null, " find_in_set(t.`STATUS`,'"+pageWrap.getModel().getQueryStatus()+"')") |
| | | .apply(pageWrap.getModel().getQueryStatusForPower() != null, " find_in_set(t.`STATUS`,'"+pageWrap.getModel().getQueryStatusForPower()+"')") |
| | | .apply(pageWrap.getModel().getQueryType() != null, " find_in_set(t.TYPE,'"+pageWrap.getModel().getQueryType()+"')") |
| | | .ge(pageWrap.getModel().getBeginWorkDateStart() != null, PlatformJob::getStartDate, Utils.Date.getStart(pageWrap.getModel().getBeginWorkDateStart())) |
| | | .le(pageWrap.getModel().getBeginWorkDateEnd() != null, PlatformJob::getStartDate, Utils.Date.getEnd(pageWrap.getModel().getBeginWorkDateEnd())) |
| | |
| | | if(Constants.equalsInteger(device.getType(),Constants.ZERO)&&sendLed){ |
| | | log.error("调起led------------------------------------------------------------------------------------------"); |
| | | //如果是LED |
| | | PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getHkNo(),device.getName(),ledContent,speed,1); |
| | | PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(model.getId(),device.getHkNo(),device.getName(),ledContent,speed,1); |
| | | logList.add(log); |
| | | ledList.add(device.getHkId()); |
| | | }else if(Constants.equalsInteger(device.getType(),Constants.TWO)&&sendBroadcast){ |
| | |
| | | SmsConstants.platformJobContent.platformJobMove,oldPlatform.getName(),platform.getName() |
| | | ); |
| | | |
| | | this.broadcastAndLEed(platformJob,null, |
| | | StringUtils.isBlank(oldPlatform.getRemark())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getRemark() |
| | | platformJob.setPlatformName(platform.getName()); |
| | | this.broadcastAndLEed(platformJob, StringUtils.isBlank(oldPlatform.getRemark())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getLedContent(), |
| | | null |
| | | ); |
| | | |
| | | } |
| | |
| | | if (Objects.isNull(platformJob.getWorkNum()) || Objects.isNull(platformJob.getWorkRate())) { |
| | | platformDataListResponse.setFinishTime(null); |
| | | } else { |
| | | Integer workMinute = platformJob.getWorkNum().multiply(new BigDecimal(60)).divide(platformJob.getWorkRate()).intValue(); |
| | | Integer workMinute = platformJob.getWorkNum().multiply(new BigDecimal(60)).divide(platformJob.getWorkRate(),0,BigDecimal.ROUND_HALF_UP).intValue(); |
| | | Date overDate = DateUtil.getXMinuteAfterDate(platformJob.getNewStartDate(), workMinute); |
| | | platformDataListResponse.setFinishTime(overDate); |
| | | } |
| | |
| | | if(Objects.isNull(platformJob.getWorkNum()) || Objects.isNull(platformJob.getWorkRate())){ |
| | | platformJob.setOptTime(0L); |
| | | }else{ |
| | | Integer workMinute = platformJob.getWorkNum().multiply(new BigDecimal(60)).divide(platformJob.getWorkRate()).intValue(); |
| | | Integer workMinute = platformJob.getWorkNum().multiply(new BigDecimal(60)).divide(platformJob.getWorkRate(),0,BigDecimal.ROUND_HALF_UP).intValue(); |
| | | Date overDate = DateUtil.getXMinuteAfterDate(platformJob.getNewStartDate(),workMinute); |
| | | platformJob.setOptTime(overDate.getTime()); |
| | | } |
| | | }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())){ |
| | | platformJob.setOptTime(DateUtil.getXMinuteAfterDate(platformJob.getCallDate(),platformJob.getWorktimeOutAlarmTime()).getTime()); |
| | | platformJob.setOptTime(DateUtil.getXMinuteAfterDate(platformJob.getNewCallDate(),platformJob.getWorktimeOutAlarmTime()).getTime()); |
| | | } |
| | | } |
| | | largeScreenDataVO.setAllList(platformJobList); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 作业完成超时 |
| | | */ |
| | | @Override |
| | | public void timeOutReport(){ |
| | | //查询超时数据 |
| | |
| | | .selectAs(Platform::getName,PlatformJob::getPlatformName) |
| | | .select(" ( now() > DATE_ADD(t.DONE_DATE ,INTERVAL t1.STAY_TIMEOUT_ALARM_TIME MINUTE) ) as isTimeOut ") |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE,Constants.PlatformJobStatus.AUTHED_LEAVE) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()) |
| | | .eq(PlatformJob::getInOut,Constants.ONE) |
| | | .isNotNull(PlatformJob::getDoneDate) |
| | | ); |
| | |
| | | List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAll(PlatformJob.class) |
| | | .selectAs(Platform::getName,PlatformJob::getPlatformName) |
| | | .select(" ( now() > DATE_ADD(t.CALL_DATE ,INTERVAL t2.WAIT_CALL_TIME MINUTE) ) as isTimeOut ") |
| | | .select(" ( now() > DATE_ADD( ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 4 order by pl.CREATE_DATE desc limit 1 ) ,INTERVAL t2.WAIT_CALL_TIME MINUTE) ) as isTimeOut ") |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()) |
| | | .isNotNull(PlatformJob::getCallDate) |
| | | ); |
| | | //如果超时 处理数据 并发送led与广播 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 作业超时 |
| | | */ |
| | | @Override |
| | | public void timeOutWork(){ |
| | | //查询超时数据 |
| | | List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAll(PlatformJob.class) |
| | | .selectAs(Platform::getName,PlatformJob::getPlatformName) |
| | | .selectAs(Platform::getWorkRate, PlatformJob::getWorkRate) |
| | | .selectAs(Platform::getWorkTimeoutAlarmTime, PlatformJob::getWorktimeOutAlarmTime) |
| | | .select(" case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end workNum ") |
| | | .select(" ( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = 5 order by pl.CREATE_DATE desc limit 1 ) as newStartDate ") |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey()) |
| | | .eq(PlatformJob::getInOut,Constants.ONE) |
| | | ); |
| | | //如果超时 处理数据 并发送led与广播 |
| | | for (PlatformJob platformJob:platformJobList) { |
| | | |
| | | Integer workMinute = platformJob.getWorkNum().multiply(new BigDecimal(60)).divide(platformJob.getWorkRate(),0,BigDecimal.ROUND_HALF_UP).intValue(); |
| | | Date overDate = DateUtil.getXMinuteAfterDate(platformJob.getNewStartDate(),workMinute + platformJob.getWorktimeOutAlarmTime()); |
| | | if(overDate.getTime() < System.currentTimeMillis() ){ |
| | | //广播 led通知 |
| | | this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.TIMEOUT_WORK.getInfo(), |
| | | Constants.PlatformBroadcastContent.TIMEOUT_WORK.getInfo()); |
| | | |
| | | SavePlatformWarnEventDTO savePlatformWarnEventDTO = new SavePlatformWarnEventDTO(); |
| | | savePlatformWarnEventDTO.setPlatformJobId(platformJob.getId()); |
| | | savePlatformWarnEventDTO.setPlatformId(platformJob.getPlatformId()); |
| | | savePlatformWarnEventDTO.setCarCode(platformJob.getCarCodeFront()); |
| | | savePlatformWarnEventDTO.setEventType(Constants.PlatformWarnEvent.WORK_TIMEOUT.getKey()); |
| | | platformWarnEventService.savePlatformWarnEvent(savePlatformWarnEventDTO); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | wmsJobContractVO.setLockStatus( |
| | | wmsJobContractVO.getPlatformWmsDetailList().get(Constants.ZERO).getLockStatus() |
| | | ); |
| | | wmsJobContractVO.setStatus( |
| | | wmsJobContractVO.getPlatformWmsDetailList().get(Constants.ZERO).getStatus() |
| | | ); |
| | | } |
| | | wmsJobContractVOList.add(wmsJobContractVO); |
| | | } |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 短信业务配置Service实现 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateStatusByIdInBatch(List<Integer> ids,Integer status) { |
| | | if (CollectionUtils.isEmpty(ids) || Objects.isNull(status)) { |
| | | return; |
| | | } |
| | | smsConfigMapper.update(new UpdateWrapper<SmsConfig>() |
| | | .set("status",status) |
| | | .in("id",ids) |
| | | ); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<SmsConfig> smsConfigs) { |
| | | if (CollectionUtils.isEmpty(smsConfigs)) { |
| | | return; |
| | |
| | | } |
| | | if(Constants.equalsInteger(device.getType(),Constants.ZERO)){ |
| | | //如果是LED |
| | | PlatformBroadcastLog log = dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1); |
| | | PlatformBroadcastLog log = dealLedContentBiz(model.getId(),device.getHkNo(),device.getName(),content,speed,1); |
| | | logList.add(log); |
| | | ledList.add(device.getHkId()); |
| | | }else if(Constants.equalsInteger(device.getType(),Constants.TWO)){ |
| | |
| | | public static PlatformBroadcastLog dealBroadcastBiz(PlatformJob model, List<String> broadcastList,String bNames , String content1) { |
| | | PlatformBroadcastLog log = new PlatformBroadcastLog(); |
| | | content1 = content1.replace("${param}",model.getCarCodeFront()); |
| | | |
| | | log.setObjId(model.getId().toString()); |
| | | log.setCreateDate(new Date()); |
| | | log.setBizType(Constants.ONE); |
| | | log.setHkDate(new Date()); |
| | |
| | | log.setHkInfo("请求成功"); |
| | | log.setHkStatus(Constants.TWO); |
| | | } |
| | | log.setDeviceType(Constants.ONE); |
| | | log.setDeviceType(Constants.ZERO); |
| | | log.setName("发送广播播报内容"); |
| | | return log; |
| | | } |
| | | |
| | | public static PlatformBroadcastLog dealLedContentBiz(String hkNo,String hkName, String content,int speed,int color) { |
| | | public static PlatformBroadcastLog dealLedContentBiz(Integer platformId,String hkNo,String hkName, String content,int speed,int color) { |
| | | PlatformBroadcastLog log = new PlatformBroadcastLog(); |
| | | log.setCreateDate(new Date()); |
| | | log.setBizType(Constants.ONE); |
| | |
| | | log.setRemark(hkName); |
| | | log.setInfo(content); |
| | | log.setNum(Constants.ONE); |
| | | log.setObjId(platformId.toString()); |
| | | |
| | | TransparentChannelBodyRequest body = new TransparentChannelBodyRequest(); |
| | | TransparentChannelHeadRequest head = new TransparentChannelHeadRequest(); |