server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/HkInterfaceTestCloudController.java
@@ -5,6 +5,7 @@ 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; @@ -13,12 +14,14 @@ 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; @@ -30,6 +33,10 @@ 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 æ±è¹è¹ @@ -42,7 +49,39 @@ @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 @@ -75,26 +114,32 @@ @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)); } } server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformCloudController.java
@@ -230,7 +230,9 @@ @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("æä½æå"); } server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKConstants.java
@@ -136,6 +136,7 @@ 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","å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½"};//å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ } /** server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/HKTools.java
@@ -603,6 +603,14 @@ */ public static String sensorStatusSearch(String body) { return startDoPostStringArtemis(HKConstants.InterfacePath.sensorStatusSearch,body); } /** * å页æ¥è¯¢è®¾å¤ä¸çæææ¥è¦è®°å½ * @param body * @return */ public static String findDeviceAlarmPage(String body) { return startDoPostStringArtemis(HKConstants.InterfacePath.findDeviceAlarmPage,body); } /** * 询æ¶é²è®¾å¤å表 server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/request/FindDeviceAlarmListRequest.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,21 @@ 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 åé¡µå¤§å° } server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/model/param/respose/FindDeviceAlarmListResponse.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@ 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 æ¥è¦æºæå±è®¾å¤åç§° } server/visits/dmvisit_service/src/main/java/com/doumee/core/haikang/service/HKService.java
@@ -975,6 +975,24 @@ 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 */ server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/Platform.java
@@ -217,6 +217,8 @@ @TableField(exist = false) private BigDecimal useRata; @ApiModelProperty(value = "æå°ä½ä¸æ°æ®") @TableField(exist = false) private PlatformWorkVO platformWorkVO; server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
@@ -35,7 +35,6 @@ @ApiModelProperty(value = "å建æ¶é´") @ExcelColumn(name="å建æ¶é´") private Date createDate; @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") @@ -144,8 +143,10 @@ @ApiModelProperty(value = "å«å·æ¶é´") @ExcelColumn(name="å«å·æ¶é´") private Date callDate; @ApiModelProperty(value = "å«å·äººç¼ç ", example = "1") @ExcelColumn(name="å«å·äººç¼ç ") @@ -286,6 +287,13 @@ @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) @@ -303,6 +311,9 @@ @TableField(exist = false) private String platformName ; @ApiModelProperty(value = "WMS任塿¶é´") @TableField(exist = false) private String ioCreatedate; @ApiModelProperty(value = "离åºä¸åæä½äººåç§°", example = "1") @TableField(exist = false) @@ -356,10 +367,12 @@ 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; server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
@@ -197,7 +197,7 @@ * æå¨ææè½¦è¾ç¦»åº * @param jobOperateDTO */ void powerLevel(JobOperateDTO jobOperateDTO); PlatformJob powerLevel(JobOperateDTO jobOperateDTO); /** * è·åæå°ä¸çä»»å¡ä¿¡æ¯ * @param groupId server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java
@@ -12,10 +12,7 @@ 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; @@ -253,7 +250,12 @@ } if(Constants.equalsInteger(platformDataDTO.getQueryData(),Constants.ONE)){ //æ¥è¯¢ä»å¤©ææç任塿°æ® List<PlatformJob> platformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>().lambda() 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(), @@ -283,15 +285,18 @@ 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()) @@ -327,10 +332,9 @@ 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+" ) ") ) ) ); server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -174,7 +174,8 @@ .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) @@ -202,6 +203,7 @@ .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())) @@ -295,10 +297,6 @@ .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), @@ -324,7 +322,7 @@ &&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")) @@ -549,6 +547,16 @@ }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()); @@ -616,13 +624,16 @@ ){ //æ¥è¯¢åæ¹æéæ°é 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); @@ -916,7 +927,7 @@ 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()+"è¾]"); }; @@ -1115,7 +1126,8 @@ 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(); @@ -1145,7 +1157,7 @@ */ @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); @@ -1163,11 +1175,16 @@ 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; } @@ -1272,6 +1289,7 @@ 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"); } @@ -1299,6 +1317,7 @@ 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")); server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformReasonServiceImpl.java
@@ -107,6 +107,7 @@ public List<PlatformReason> findList(PlatformReason platformReason) { QueryWrapper<PlatformReason> wrapper = new QueryWrapper<>(platformReason); wrapper.eq("isdeleted",Constants.ZERO); wrapper.orderByAsc("SORTNUM"); return platformReasonMapper.selectList(wrapper); } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformServiceImpl.java
@@ -316,6 +316,9 @@ .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()) @@ -328,8 +331,6 @@ 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(), @@ -346,16 +347,13 @@ 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) ); } } server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -1011,6 +1011,7 @@ .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);//æ´æ°ä¸ä¸æ¬¡ä½ä¸ç宿æ¶é´åä½ä¸æ¶é¿