Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit
| | |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.haikang.model.param.BaseListPageResponse; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.request.event.acs.EventAcsRequest; |
| | |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventPlatformRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitIccmRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.haikang.model.param.respose.*; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DESUtil; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.service.business.DeviceService; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private DeviceService deviceService; |
| | | |
| | | @ApiOperation("ãæµ·åº·ãæµè¯LEDæ¾ç¤ºå±") |
| | | @PostMapping("/testLedAll") |
| | | @LoginNoRequired |
| | | public ApiResponse<List<Map<String,Object>> > testLedAll(@RequestBody TransparentChannelBodyRequest request, HttpServletResponse response) { |
| | | TransparentChannelHeadRequest head = new TransparentChannelHeadRequest(); |
| | | head.setAbility("cld");//åºå®å¼ |
| | | head.setTreatyType("haixuan_led_net");//åºå®å¼ |
| | | head.setDeviceIndexCode("6a5498e9df924befbb9530e467e5e809"); |
| | | Device p = new Device(); |
| | | p.setType(Constants.TWO); |
| | | p.setIsdeleted(Constants.ZERO); |
| | | List<Device> list = deviceService.findList(p); |
| | | List<Map<String,Object>> dList = new ArrayList<>(); |
| | | String content = request.getParams().getRegions().get(0).getContent(); |
| | | if(list!=null){ |
| | | for(Device d : list){ |
| | | head.setDeviceIndexCode(d.getNo()); |
| | | request.getParams().setIndexCode(d.getNo()); |
| | | request.getParams().getRegions().get(0).setContent( content+"["+d.getName()+"]"); |
| | | BaseResponse res= HKService.transparentchannel(head,request); |
| | | Map<String,Object> dn = new HashMap<>(); |
| | | dn.put("name",d.getName()); |
| | | dn.put("id",d.getNo()); |
| | | dn.put("content",request.getParams().getRegions().get(0).getContent()); |
| | | dn.put("result",res); |
| | | dList.add(dn); |
| | | } |
| | | } |
| | | return ApiResponse.success(dList); |
| | | } |
| | | @ApiOperation("ãæµ·åº·ãæµè¯LEDæ¾ç¤ºå±") |
| | | @PostMapping("/testLed") |
| | | @LoginNoRequired |
| | |
| | | @ApiOperation("ãæµ·åº·ãå页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ") |
| | | @PostMapping("/sensorStatusSearch") |
| | | @LoginNoRequired |
| | | public ApiResponse<BaseResponse> sensorStatusSearch(@RequestBody SensorStatusListRequest param, HttpServletResponse response) { |
| | | public ApiResponse<BaseResponse<BaseListPageResponse<SensorStatusListResponse>>> sensorStatusSearch(@RequestBody SensorStatusListRequest param, HttpServletResponse response) { |
| | | return ApiResponse.success( HKService.sensorStatusSearch(param)); |
| | | } |
| | | @ApiOperation("ãæµ·åº·ãæ¥è¯¢æ¶é²ä¼ æå¨å表") |
| | | @PostMapping("/fireChannelSearch") |
| | | @LoginNoRequired |
| | | public ApiResponse<BaseResponse> fireChannelSearch(@RequestBody FireChannelListRequest param, HttpServletResponse response) { |
| | | public ApiResponse<BaseResponse<BaseListPageResponse<FireChannelListResponse>>> fireChannelSearch(@RequestBody FireChannelListRequest param, HttpServletResponse response) { |
| | | return ApiResponse.success( HKService.fireChannelSearch(param)); |
| | | } |
| | | @ApiOperation("ãæµ·åº·ã海康询æ¶é²è®¾å¤å表") |
| | | @PostMapping("/fireDeviceSearch") |
| | | @LoginNoRequired |
| | | public ApiResponse<BaseResponse> fireDeviceSearch(@RequestBody FireDeviceListRequest param, HttpServletResponse response) { |
| | | public ApiResponse<BaseResponse<BaseListPageResponse<FireDeviceListResponse>> > fireDeviceSearch(@RequestBody FireDeviceListRequest param, HttpServletResponse response) { |
| | | return ApiResponse.success( HKService.fireDeviceSearch(param)); |
| | | } |
| | | @ApiOperation("ãæµ·åº·ãå页æ¥è¯¢æ¶é²è®¾å¤é¨ä»¶ç¶æ") |
| | | @PostMapping("/fireDeviceStatusSearch") |
| | | @LoginNoRequired |
| | | public ApiResponse<BaseResponse> fireDeviceStatusSearch(@RequestBody FireDeviceStatuslListRequest param, HttpServletResponse response) { |
| | | public ApiResponse<BaseResponse<BaseListPageResponse<FireDeviceStatusListResponse>>> fireDeviceStatusSearch(@RequestBody FireDeviceStatuslListRequest param, HttpServletResponse response) { |
| | | return ApiResponse.success( HKService.fireDeviceStatusSearch(param)); |
| | | } |
| | | @ApiOperation("ãæµ·åº·ãå页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½") |
| | | @PostMapping("/findDeviceAlarmPage") |
| | | @LoginNoRequired |
| | | public ApiResponse<BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>> > findDeviceAlarmPage(@RequestBody FindDeviceAlarmListRequest param, HttpServletResponse response) { |
| | | return ApiResponse.success( HKService.findDeviceAlarmPage(param)); |
| | | } |
| | | |
| | | } |
| | |
| | | @PostMapping("/powerLevel") |
| | | public ApiResponse powerLevel (@RequestBody JobOperateDTO jobOperateDTO, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | jobOperateDTO.setLoginUserInfo(getLoginUser(token)); |
| | | platformJobService.powerLevel(jobOperateDTO); |
| | | PlatformJob platformJob = platformJobService.powerLevel(jobOperateDTO); |
| | | //ä¸å离åæé |
| | | platformJobService.sendInPark(platformJob); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | |
| | | String[] nhRegionDataRanking= new String[]{"/api/ecm/v1/energy/regionDataRanking","æ ¹æ®æ¶é´ç»´åº¦è·ååºåç¨éæå"};//1.8.5æ ¹æ®æ¶é´ç»´åº¦è·ååºåç¨éæå |
| | | String[] nhEnergyDistribution= new String[]{"/api/ecm/v1/energy/energyDistribution","æ ¹æ®æ¶é´ç»´åº¦è·åè½èåå¸"};// æ ¹æ®æ¶é´ç»´åº¦è·åè½èåå¸ |
| | | String[] fireDeviceSearch= new String[]{"/api/resource/v1/fireDevice/search","询æ¶é²è®¾å¤å表"};// 1.12.1.1询æ¶é²è®¾å¤å表 |
| | | String[] fireChannelSearch= new String[]{"/api/resource/v1/fireChannel/search","æ¥è¯¢æ¶é²ä¼ æå¨å表"};// æ¥è¯¢æ¶é²ä¼ æå¨å表 |
| | | String[] sensorStatusSearch= new String[]{"/api/fpnms/v2/sensor/status/search","å页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ"};// å页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ |
| | | String[] fireDeviceStatusSearch= new String[]{"/api/fpnms/v2/device/status/search","æ¥è¯¢æ¶é²è®¾å¤é¨ä»¶ç¶æ"};// æ¥è¯¢æ¶é²è®¾å¤é¨ä»¶ç¶æ |
| | | String[] fireChannelSearch= new String[]{"/api/resource/v1/fireChannel/search","æ¥è¯¢æ¶é²ä¼ æå¨å表"};//æ¥è¯¢æ¶é²ä¼ æå¨å表 |
| | | String[] sensorStatusSearch= new String[]{"/api/fpnms/v2/sensor/status/search","å页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ"};//å页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ |
| | | String[] fireDeviceStatusSearch= new String[]{"/api/fpnms/v2/device/status/search","æ¥è¯¢æ¶é²è®¾å¤é¨ä»¶ç¶æ"};//æ¥è¯¢æ¶é²è®¾å¤é¨ä»¶ç¶æ |
| | | String[] findDeviceAlarmPage= new String[]{"/api/v1/alarm/findDeviceAlarmPage","å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½"};//å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ |
| | | } |
| | | |
| | | /** |
| | |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.fireDeviceStatusSearch,body); |
| | | } |
| | | /** |
| | | * å页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ |
| | | * å页æ¥è¯¢æ¶é²ä¼ æå¨é¨ä»¶ç¶æ |
| | | * @param body |
| | | * @return |
| | | */ |
| | |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.sensorStatusSearch,body); |
| | | } |
| | | /** |
| | | * å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ |
| | | * @param body |
| | | * @return |
| | | */ |
| | | public static String findDeviceAlarmPage(String body) { |
| | | return startDoPostStringArtemis(HKConstants.InterfacePath.findDeviceAlarmPage,body); |
| | | } |
| | | /** |
| | | * 询æ¶é²è®¾å¤å表 |
| | | * @param body |
| | | * @return |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.haikang.model.param.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class FindDeviceAlarmListRequest { |
| | | private String deviceIndexCode;// String false æå±è®¾å¤id |
| | | private String resourceIndexCodes ;//String false 设å¤/ä¼ æå¨id |
| | | private String searchName ;//String false åç§°/ç¼å· |
| | | private String alarmTypes ;//String false æ¥è¦ç±»å |
| | | private String resSubTypes ;//String false 设å¤/ä¼ æå¨ç±»å |
| | | private String partNos ;//String false ååº/åè·¯ |
| | | private List<String> subareaNos;// Array false ååºå· ç |
| | | private List<String> loopNos ;//Array false åè·¯å· ç |
| | | private String alarmStartTime;// String false æ¥è¦å¼å§æ¶é´ |
| | | private String alarmEndTime ;//String false æ¥è¦ç»ææ¶é´ |
| | | private int pageNo;// Number true å½å页ç |
| | | private int pageSize;// Number true åé¡µå¤§å° |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.haikang.model.param.respose; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class FindDeviceAlarmListResponse { |
| | | private String id ;//String false æ¥è¦ID |
| | | private String resourceId ;//String false æ¥è¦æºæå±èµæºid |
| | | private String resourceName;// String false æ¥è¦æºèµæºåç§° |
| | | private String resourceCode;// String false æ¥è¦æºèµæºç¼å· |
| | | private Integer alarmType ;//Number false æ¥è¦ç±»å |
| | | private String alarmTypeName;// String false æ¥è¦ç±»ååç§° |
| | | private String equipTypeCode ;//String false 设å¤/ä¼ æå¨ ç±»åç |
| | | private String loopNo ;//String false åè·¯å· |
| | | private String loopName;// String false åè·¯åç§° |
| | | private String subarea;// String false ååºå· |
| | | private String subareaName;// String false ååºåç§° |
| | | private String regionIndexCode ;//String false åºåç¼ç |
| | | private String regionName ;//String false åºååç§° |
| | | private String regionPath ;//String false åºåè·¯å¾ |
| | | private String location ;//String false æ¥è¦æºè¯¦ç»å°å |
| | | private String alarmTime;// String false æ¥è¦æ¶é´ æ¶é´æ ¼å¼yyyy/MM/dd HH:mm:ss |
| | | private String recoverAlarmTime ;//String false æ¥è¦æ¢å¤æ¶é´ æ¶é´æ ¼å¼yyyy/MM/dd HH:mm:ss |
| | | private Integer alarmLevel;// Number false æ¥è¦ç级 |
| | | private String parentResourceId;// String false æ¥è¦æºæå±è®¾å¤id |
| | | private String parentResourceName;// String false æ¥è¦æºæå±è®¾å¤åç§° |
| | | } |
| | |
| | | return null; |
| | | } |
| | | /** |
| | | *å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ |
| | | * @return |
| | | */ |
| | | public static BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>> findDeviceAlarmPage(FindDeviceAlarmListRequest param){ |
| | | log.info("ãæµ·åº·å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ã================å¼å§===="+JSONObject.toJSONString(param)); |
| | | try { |
| | | String res = HKTools.findDeviceAlarmPage(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference<BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>>>(){}; |
| | | BaseResponse<BaseListPageResponse<FindDeviceAlarmListResponse>> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("ãæµ·åº·å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ã================失败====ï¼\n"+ e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | *询æ¶é²è®¾å¤å表 |
| | | * @return |
| | | */ |
| | |
| | | @TableField(exist = false) |
| | | private BigDecimal useRata; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "æå°ä½ä¸æ°æ®") |
| | | @TableField(exist = false) |
| | | private PlatformWorkVO platformWorkVO; |
| | |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | |
| | | |
| | | @ApiModelProperty(value = "å«å·æ¶é´") |
| | | @ExcelColumn(name="å«å·æ¶é´") |
| | | |
| | | private Date callDate; |
| | | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "å«å·äººç¼ç ", example = "1") |
| | | @ExcelColumn(name="å«å·äººç¼ç ") |
| | |
| | | @ExcelColumn(name="ç¡®è®¤ä»»å¡æ¶é´") |
| | | private Date confirmTaskDate; |
| | | |
| | | @ApiModelProperty(value = "ææ°å«å·æ¶é´") |
| | | @TableField(exist = false) |
| | | private Date newCallDate; |
| | | |
| | | @ApiModelProperty(value = "ææ°å¼å§ä½ä¸æ¶é´") |
| | | @TableField(exist = false) |
| | | private Date newStartDate; |
| | | |
| | | @ApiModelProperty(value = "åæ¹æéæ°é", example = "1") |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private String platformName ; |
| | | |
| | | @ApiModelProperty(value = "WMS任塿¶é´") |
| | | @TableField(exist = false) |
| | | private String ioCreatedate; |
| | | |
| | | @ApiModelProperty(value = "离åºä¸åæä½äººåç§°", example = "1") |
| | | @TableField(exist = false) |
| | |
| | | private Integer jobType; |
| | | |
| | | @ApiModelProperty(value = "å¼å§ä½ä¸æ¶é´èµ·") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @TableField(exist = false) |
| | | private Date beginWorkDateStart; |
| | | |
| | | @ApiModelProperty(value = "å¼å§ä½ä¸æ¶é´æ¢") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @TableField(exist = false) |
| | | private Date beginWorkDateEnd; |
| | | |
| | |
| | | * æå¨ææè½¦è¾ç¦»åº |
| | | * @param jobOperateDTO |
| | | */ |
| | | void powerLevel(JobOperateDTO jobOperateDTO); |
| | | PlatformJob powerLevel(JobOperateDTO jobOperateDTO); |
| | | /** |
| | | * è·åæå°ä¸çä»»å¡ä¿¡æ¯ |
| | | * @param groupId |
| | |
| | | import com.doumee.dao.business.PlatformShowParamMapper; |
| | | import com.doumee.dao.business.join.PlatformJobJoinMapper; |
| | | import com.doumee.dao.business.join.PlatformJoinMapper; |
| | | import com.doumee.dao.business.model.Platform; |
| | | import com.doumee.dao.business.model.PlatformGroup; |
| | | import com.doumee.dao.business.model.PlatformJob; |
| | | import com.doumee.dao.business.model.PlatformShowParam; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.reqeust.PlatformDataDTO; |
| | | import com.doumee.dao.web.response.PlatformGroupWorkVO; |
| | | import com.doumee.dao.web.response.PlatformWorkVO; |
| | |
| | | } |
| | | if(Constants.equalsInteger(platformDataDTO.getQueryData(),Constants.ONE)){ |
| | | //æ¥è¯¢ä»å¤©ææç任塿°æ® |
| | | List<PlatformJob> platformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAll(PlatformJob.class) |
| | | .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 ") |
| | | .select(" ( 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 ) as newCallDate ") |
| | | .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) |
| | | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getStatus, |
| | | Constants.PlatformJobStatus.WAIT_CALL.getKey(), |
| | | Constants.PlatformJobStatus.IN_WAIT.getKey(), |
| | |
| | | PlatformWorkVO platformWorkVO = new PlatformWorkVO(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){ |
| | | //è·åæå°ä¸çææä½ä¸æ°æ® |
| | | List<PlatformJob> platformJobs = platformJobList.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platform.getId()) || Constants.equalsInteger(i.getPlatformGroupId(),platform.getGroupId()) |
| | | List<PlatformJob> platformJobs = platformJobList.stream().filter( |
| | | i->Constants.equalsInteger(i.getPlatformId(),platform.getId()) |
| | | || Constants.equalsInteger(i.getPlatformGroupId(),platform.getGroupId()) |
| | | ).collect(Collectors.toList()); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobs)){ |
| | | platformWorkVO.setWorkNum( |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())).collect(Collectors.toList()).size() |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platform.getId()) && Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | platformWorkVO.setCallNum( |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())).collect(Collectors.toList()).size() |
| | | platformJobs.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platform.getId()) && Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())).collect(Collectors.toList()).size() |
| | | ); |
| | | |
| | | platformWorkVO.setWaitNum( |
| | | platformJobs.stream().filter(i-> |
| | | Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()) |
| | |
| | | |
| | | platformGroupWorkVO.setWaitNum(platformJobJoinMapper.selectCount(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getPlatformGroupId,platformGroupId) |
| | | .in(PlatformJob::getStatus, |
| | | Constants.PlatformJobStatus.WAIT_CALL.getKey(), |
| | | Constants.PlatformJobStatus.IN_WAIT.getKey(), |
| | | Constants.PlatformJobStatus.CALLED.getKey() |
| | | .and( i->i.eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey()).or() |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.IN_WAIT.getKey()).or() |
| | | .apply(" ( status = "+Constants.PlatformJobStatus.TRANSFERING.getKey()+" and PLATFORM_GROUP_ID = "+platformGroupId+" ) ") |
| | | ) |
| | | ) |
| | | ); |
| | |
| | | .selectAs(PlatformGroup::getName,PlatformJob::getPlatformGroupName) |
| | | .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate) |
| | | .selectAs(PlatformWmsJob::getCarrierName,PlatformJob::getCarrierName) |
| | | .selectAs(SystemUser::getUsername,PlatformJob::getOutUserName) |
| | | .selectAs(PlatformWmsJob::getIoCreatedate,PlatformJob::getIoCreatedate) |
| | | .selectAs(SystemUser::getRealname,PlatformJob::getOutUserName) |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId) |
| | | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode) |
| | |
| | | .eq(pageWrap.getModel().getSingType() != null, PlatformJob::getSingType, pageWrap.getModel().getSingType()) |
| | | .eq(pageWrap.getModel().getSignDistance() != null, PlatformJob::getSignDistance, pageWrap.getModel().getSignDistance()) |
| | | .eq(pageWrap.getModel().getPlatformNames() != null, PlatformJob::getPlatformNames, pageWrap.getModel().getPlatformNames()) |
| | | .like(pageWrap.getModel().getPlatformName() != null, Platform::getName, pageWrap.getModel().getPlatformName()) |
| | | .eq(pageWrap.getModel().getPlatforms() != null, PlatformJob::getPlatforms, pageWrap.getModel().getPlatforms()) |
| | | .eq(pageWrap.getModel().getPlatformId() != null, PlatformJob::getPlatformId, pageWrap.getModel().getPlatformId()) |
| | | .ge(pageWrap.getModel().getInwaitDate() != null, PlatformJob::getInwaitDate, Utils.Date.getStart(pageWrap.getModel().getInwaitDate())) |
| | |
| | | .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode) |
| | | .eq(pageWrap.getModel().getPlatformGroupId() != null, PlatformJob::getPlatformGroupId, pageWrap.getModel().getPlatformGroupId()) |
| | | .like(pageWrap.getModel().getCarCodeFront() != null, PlatformJob::getCarCodeFront, pageWrap.getModel().getCarCodeFront()) |
| | | // .eq(Objects.nonNull(pageWrap.getModel().getCallType()) |
| | | // &&Constants.equalsInteger(pageWrap.getModel().getCallType(),Constants.ONE), |
| | | // PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey() |
| | | // ) |
| | | |
| | | .apply(Objects.nonNull(pageWrap.getModel().getCallType()) |
| | | &&Constants.equalsInteger(pageWrap.getModel().getCallType(),Constants.ONE), |
| | |
| | | &&Constants.equalsInteger(pageWrap.getModel().getCallType(),Constants.THREE), |
| | | i->i.eq(PlatformJob::getStatus,Constants.PlatformJobStatus.WAIT_CALL.getKey()).or() |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.IN_WAIT.getKey()).or() |
| | | .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()).or() |
| | | // .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey()).or() |
| | | .apply(" ( t.status = "+Constants.PlatformJobStatus.TRANSFERING.getKey()+" and t.PLATFORM_GROUP_ID = "+pageWrap.getModel().getPlatformGroupId()+" ) ") |
| | | ) |
| | | // .like(PlatformJob::getArriveDate,DateUtil.dateTypeToString(new Date(),"yyyy-MM-dd")) |
| | |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"ç¾å°ç±»åé误"); |
| | | } |
| | | //æ¥è¯¢æå°ç»æ°æ® |
| | | PlatformGroup platformGroup = platformGroupMapper.selectById(platformJob.getPlatformGroupId()); |
| | | if(Objects.isNull(platformGroup)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æªæ¥è¯¢å°æå°ç»ä¿¡æ¯"); |
| | | } |
| | | if(System.currentTimeMillis() > DateUtil.getDateByString(DateUtil.getCurrDate() + " " + platformGroup.getEndTime() + ":59" ).getTime() |
| | | || System.currentTimeMillis() < DateUtil.getDateByString(DateUtil.getCurrDate() + " " + platformGroup.getStartTime() + ":00" ).getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æªå¨å·¥ä½æ¶é´["+platformGroup.getStartTime() + "-" + platformGroup.getEndTime() +"]ï¼æ æ³è¿è¡ç¾å°"); |
| | | } |
| | | |
| | | platformJob.setSignDate(new Date()); |
| | | platformJob.setSingType(signInDTO.getSignType()); |
| | | platformJob.setStatus(Constants.PlatformJobStatus.WAIT_CALL.getKey()); |
| | |
| | | ){ |
| | | //æ¥è¯¢åæ¹æéæ°é |
| | | this.queryWaitNum(platformJob); |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.nonNull(platform)){ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | } |
| | | }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){ |
| | | //ä½ä¸æå°ä¿¡æ¯ |
| | | Platform platform = platformJoinMapper.selectById(platformJob.getPlatformId()); |
| | | if(Objects.nonNull(platform)){ |
| | | platformJob.setPlatformName(platform.getName()); |
| | | } |
| | | |
| | | } |
| | | platformJob.dealTime(); |
| | | this.getWorkTime(platformJob); |
| | |
| | | if(platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda() |
| | | .eq(PlatformJob::getPlatformId,platform.getId()) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED.getKey(),Constants.PlatformJobStatus.WORKING.getKey()) |
| | | )>platform.getWorkingNum()){ |
| | | )>=platform.getWorkingNum()){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"è¶
åºæå°å¯åæ¶ä½ä¸æ°é["+platform.getWorkingNum()+"è¾]"); |
| | | }; |
| | | |
| | |
| | | if(Objects.isNull(platformJob)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){ |
| | | if(! (Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey()) |
| | | ||Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey()) )){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对ä¸èµ·,ä¸å¡ç¶æå·²æµè½¬ï¼"); |
| | | } |
| | | PlatformJob oldPlatformJob = new PlatformJob(); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void powerLevel(JobOperateDTO jobOperateDTO){ |
| | | public PlatformJob powerLevel(JobOperateDTO jobOperateDTO){ |
| | | if(Objects.isNull(jobOperateDTO) |
| | | || Objects.isNull(jobOperateDTO.getJobId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | platformJob.setOutHkdate(new Date()); |
| | | platformJob.setStatus(Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()); |
| | | platformJob.setEditDate(new Date()); |
| | | platformJob.setRemark(jobOperateDTO.getRemark()); |
| | | platformJobMapper.updateById(platformJob); |
| | | //å卿使¥å¿ |
| | | savePlatformLog(Constants.PlatformJobLogType.AUTHED_LEAVE.getKey(),oldPlatformJob,platformJob , |
| | | Constants.PlatformJobLogType.AUTHED_LEAVE.getInfo()); |
| | | //TODO ææè½¦è¾ç¦»åºæé |
| | | return platformJob; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | platformLog.setParam2(DateUtil.dateTypeToString(platformLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | | String v = Long.toString((platformLog.getCreateDate().getTime() - DateUtil.StringToDate(lastBeginPlatform.getParam1(),"yyyy-MM-dd HH:mm:ss").getTime() )/ 1000) ; |
| | | platformLog.setParam3(v); |
| | | platformLog.setRemark(platformJobBefor.getPlatformId().toString()); |
| | | }else{ |
| | | platformLog.setParam3("0"); |
| | | } |
| | |
| | | platformLog.setParam2(DateUtil.dateTypeToString(platformLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | | String v = Long.toString((platformJobAfter.getDoneDate().getTime() - DateUtil.StringToDate(lastBeginPlatform.getParam1(),"yyyy-MM-dd HH:mm:ss").getTime()) / 1000) ; |
| | | platformLog.setParam3(v); |
| | | platformLog.setRemark(platformJobBefor.getPlatformId().toString()); |
| | | } |
| | | }else if(Constants.equalsInteger(objType,Constants.PlatformJobLogType.WORKING.getKey())){ |
| | | platformLog.setParam1(DateUtil.dateTypeToString(platformLog.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | |
| | | public List<PlatformReason> findList(PlatformReason platformReason) { |
| | | QueryWrapper<PlatformReason> wrapper = new QueryWrapper<>(platformReason); |
| | | wrapper.eq("isdeleted",Constants.ZERO); |
| | | wrapper.orderByAsc("SORTNUM"); |
| | | return platformReasonMapper.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | .selectAs(PlatformGroup::getName,Platform::getGroupName) |
| | | .select(" (select ifnull(TIMESTAMPDIFF(HOUR, '2023-01-01 '||pg.start_time||':00', '2023-01-01 '||pg.end_time||':00' ),0) from platform_group pg " + |
| | | " where t.group_id = pg.id ) as openTime ") |
| | | .select(" ( select ROUND( ifnull(SUM(pl.PARAM3),0) / 3600 , 2 ) from platform_log pl where pl.OBJ_ID = t.id and pl.remark = t.id " + |
| | | " and pl.CREATE_DATE > '"+Utils.Date.getStart(platform.getQueryDateStart())+"' " + |
| | | "and pl.CREATE_DATE <= '"+Utils.Date.getEnd(platform.getQueryDateEnd())+"' ) as workCountTime ") |
| | | .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId); |
| | | queryWrapper |
| | | .eq(platform.getGroupId() != null, Platform::getGroupId, platform.getGroupId()) |
| | |
| | | List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAll(PlatformJob.class) |
| | | .select(" ( select ROUND( ifnull(SUM(pl.PARAM3),0) / 3600 , 2 ) from platform_log pl where pl.OBJ_ID = t.id " + |
| | | " ) as workTimes ") |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.WORKING.getKey(), |
| | | Constants.PlatformJobStatus.DONE.getKey(), |
| | | Constants.PlatformJobStatus.TRANSFERING.getKey(), |
| | |
| | | for (Platform bean:platformList) { |
| | | List<PlatformJob> beanJobList = platformJobList.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),bean.getId())).collect(Collectors.toList()); |
| | | bean.setStopCount(beanJobList.size()); |
| | | bean.setWorkCountTime( |
| | | beanJobList.stream().map(i->i.getWorkTimes()).reduce(BigDecimal.ZERO,BigDecimal::add) |
| | | ); |
| | | if(Objects.isNull(bean.getOpenTime())||bean.getOpenTime().compareTo(BigDecimal.ZERO)<=0){ |
| | | bean.setUseRata(BigDecimal.ZERO); |
| | | continue; |
| | | } |
| | | BigDecimal sumTime = BigDecimal.valueOf(sumDays).multiply(bean.getOpenTime()); |
| | | bean.setUseRata( |
| | | bean.getWorkCountTime().divide(sumTime,BigDecimal.ROUND_HALF_DOWN,2) |
| | | bean.getWorkCountTime().multiply(new BigDecimal(100)).divide(sumTime,BigDecimal.ROUND_HALF_DOWN,2) |
| | | ); |
| | | } |
| | | } |
| | |
| | | .orderByDesc(PlatformLog::getCreateDate) |
| | | .last(" limit 1")); |
| | | String v = Long.toString(job.getDoneDate().getTime() - lastBeginPlatform.getCreateDate().getTime() / 1000) ; |
| | | lastBeginPlatform.setRemark(job.getPlatformId().toString()); |
| | | lastBeginPlatform.setParam3(v); |
| | | lastBeginPlatform.setParam2(DateUtil.getDate(lastBeginPlatform.getCreateDate(),"yyyy-MM-dd HH:mm:ss")); |
| | | platformLogMapper.updateById(lastBeginPlatform);//æ´æ°ä¸ä¸æ¬¡ä½ä¸ç宿æ¶é´åä½ä¸æ¶é¿ |