rk
8 小时以前 931e45f5f78494c7af4cab75053da49b57f22fbe
定时自动叫号 与 WMS获取车辆是否在园接口开发
已修改7个文件
108 ■■■■ 文件已修改
server/doc/月台自动加号数据库变动脚本.md 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_service/src/main/java/com/doumee/core/utils/Constants.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/java/com/doumee/api/PlatformJobController.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformJobCloudController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/doc/ÔĄ̂×Ô¶¯¼ÓºÅÊý¾Ý¿â±ä¶¯½Å±¾.md
@@ -9,8 +9,7 @@
ALTER TABLE `antaiwuliu`.`platform`
ADD COLUMN `TYPE` int NULL COMMENT '类型  0整托盘 1散件' AFTER `LED_CONTENT`,
ADD COLUMN `CALL_READY_NUM` varchar(100) NULL COMMENT '同时准备作业数量' AFTER `TYPE`;
ADD COLUMN `CALL_READY_NUM` int NULL COMMENT '同时准备作业数量' AFTER `TYPE`;
ALTER TABLE `antaiwuliu`.`platform_job`
ADD COLUMN `TAG_VIRTUAL` int NULL COMMENT '是否更换月台组 0否 1是' AFTER `ORIGIN`,
@@ -21,4 +20,6 @@
ADD COLUMN `URGE_USER` int NULL DEFAULT NULL COMMENT '加急人员编码' AFTER `URGE_TIME`;
update platform_group set IS_VIRTUAL=0;
update platform_job  set CALL_WAY=0 where CALL_DATE is not null;
update platform_job  set CALL_WAY=0 where CALL_DATE is not null;
INSERT INTO  `system_dict_data`(  `DICT_ID`, `CODE`, `LABEL`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`, `REMARK`) VALUES (  1, '02', 'IN_REPERTOTY_CODE', 1, 0, 0, '2023-04-03 10:23:54', NULL, '2024-04-30 11:04:25', 0, '自动叫号发货地编号');
server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -490,6 +490,7 @@
    public static final String COFFEE_BEAN_TASK ="COFFEE_BEAN_TASK";
    public static final String IN_REPERTOTY_CODE ="IN_REPERTOTY_CODE";
    public static final String HOME_IMAGE ="HOME_IMAGE";
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java
@@ -100,5 +100,11 @@
    @PostMapping("/timer/platformJob/sendUnFinishNotice")
    ApiResponse sendUnFinishNotice();
    @ApiOperation("【数字化月台】月台自动叫号入园")
    @PostMapping("/timer/platformJob/autoCallInParkCar")
    ApiResponse autoCallInParkCar();
    @ApiOperation("【数字化月台】月台自动叫号")
    @PostMapping("/timer/platformJob/autoPlatformCallCar")
    ApiResponse autoPlatformCallCar();
}
server/visits/admin_timer/src/main/java/com/doumee/api/PlatformJobController.java
@@ -1,6 +1,7 @@
package com.doumee.api;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.service.business.third.WmsService;
import com.doumee.service.business.third.model.ApiResponse;
import com.doumee.service.business.PlatformJobService;
import io.swagger.annotations.Api;
@@ -23,6 +24,9 @@
    @Autowired
    private PlatformJobService platformJobService;
    @Autowired
    private WmsService wmsService;
    @ApiOperation("月台停靠超时报警业务")
@@ -66,4 +70,22 @@
        return ApiResponse.success("月台今日作业外完成通知定时");
    }
    @ApiOperation("月台自动叫号")
    @PostMapping("/autoPlatformCallCar")
    public ApiResponse autoPlatformCallCar() {
        platformJobService.autoPlatformCallCar(wmsService);
        return ApiResponse.success("月台自动叫号");
    }
    @ApiOperation("月台自动叫号入园")
    @PostMapping("/autoCallInParkCar")
    public ApiResponse autoCallInParkCar() {
        platformJobService.autoCallInParkCar(wmsService);
        return ApiResponse.success("月台自动叫号入园");
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformJobCloudController.java
@@ -163,6 +163,7 @@
        platformJobService.dealJobFinish(list,getLoginUser(token));
        return ApiResponse.success("操作成功");
    }
    @ApiOperation("更换月台分组")
    @PostMapping("/changPlatformGroup")
    @CloudRequiredPermission("business:platformjob:update")
@@ -171,4 +172,23 @@
        return ApiResponse.success("操作成功");
    }
    @LoginNoRequired
    @ApiOperation("测试自动叫号")
    @PostMapping("/testAutoCallCar")
    public ApiResponse  testAutoCallCar (@RequestHeader(Constants.HEADER_USER_TOKEN) String token){
        platformJobService.autoPlatformCallCar(wmsService);
        return ApiResponse.success("操作成功");
    }
    @LoginNoRequired
    @ApiOperation("测试自动叫号入园")
    @PostMapping("/testAutoCallInPark")
    public ApiResponse  testAutoCallInPark (@RequestHeader(Constants.HEADER_USER_TOKEN) String token){
        platformJobService.autoCallInParkCar(wmsService);
        return ApiResponse.success("操作成功");
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
@@ -1,5 +1,6 @@
package com.doumee.service.business;
import com.doumee.service.business.third.WmsService;
import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.service.business.third.model.PageData;
import com.doumee.service.business.third.model.PageWrap;
@@ -267,4 +268,8 @@
    PlatformJob restoreWork(JobOperateDTO jobOperateDTO);
    void changPlatformGroup(PlatformJob param, LoginUserInfo loginUser);
    void autoPlatformCallCar(WmsService wmsService);
    void autoCallInParkCar(WmsService wmsService);
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -12,6 +12,7 @@
import com.doumee.core.haikang.model.param.respose.ParkReservationAddResponse;
import com.doumee.core.haikang.service.HKService;
import com.doumee.dao.business.dao.UserActionMapper;
import com.doumee.dao.system.model.SystemDictData;
import com.doumee.service.business.third.WmsService;
import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.service.business.third.model.PageData;
@@ -985,7 +986,7 @@
        BeanUtils.copyProperties(platformJob,oldPlatformJob);
        platformJob.setPlatformId(platform.getId());
        platformJob.setInwaitDate(new Date());
        platformJob.setInwaitUserId(jobOperateDTO.getLoginUserInfo().getId());
        platformJob.setInwaitUserId(Objects.isNull(jobOperateDTO.getLoginUserInfo())?null:jobOperateDTO.getLoginUserInfo().getId());
        platformJob.setStatus(Constants.PlatformJobStatus.IN_WAIT.getKey());
        platformJob.setEditDate(new Date());
        platformJobMapper.updateById(platformJob);
@@ -1226,7 +1227,7 @@
        BeanUtils.copyProperties(platformJob,oldPlatformJob);
        platformJob.setCallDate(Objects.isNull(platformJob.getCallDate())?new Date():null);
        platformJob.setCallUserId(jobOperateDTO.getLoginUserInfo().getId());
        platformJob.setCallUserId(Objects.isNull(jobOperateDTO.getLoginUserInfo())?null:jobOperateDTO.getLoginUserInfo().getId());
        platformJob.setStatus(Constants.PlatformJobStatus.CALLED.getKey());
        platformJob.setPlatformId(jobOperateDTO.getPlatformId());
        //判断是否需要填充进去
@@ -2578,12 +2579,13 @@
    @Override
    public void autoPlatformCallCar(WmsService wmsService){
        //查询当前开启的月台数据
        List<PlatformGroup> allPlatformGroup = platformGroupMapper.selectList(new QueryWrapper<PlatformGroup>().lambda().eq(PlatformGroup::getStatus,Constants.ZERO)
                .eq(PlatformGroup::getIsdeleted,Constants.ZERO).eq(PlatformGroup::getAutoCall,Constants.ONE)
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(allPlatformGroup)){
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(allPlatformGroup)){
            return;
        }
        //过滤当前时间段不在时间内的月台组  AUTO_CALL_END_TIME AUTO_CALL_START_TIME
@@ -2593,7 +2595,7 @@
                && Integer.valueOf(i.getAutoCallStartTime().replaceAll(":","")) < nowHm
                && Integer.valueOf(i.getAutoCallEndTime().replaceAll(":","")) > nowHm
        ).collect(Collectors.toList());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(autoCallGroup)){
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(autoCallGroup)){
            return;
        }
        //查询所有月台
@@ -2601,7 +2603,8 @@
                .lambda()
                .eq(Platform::getIsdeleted,Constants.ZERO)
                .eq(Platform::getStatus,Constants.ZERO)
                .in(Platform::getId,autoCallGroup.stream().map(i->i.getId()).collect(Collectors.toList()))
                .isNotNull(Platform::getWorkingNum)
                .in(Platform::getGroupId,autoCallGroup.stream().map(i->i.getId()).collect(Collectors.toList()))
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(platformList)){
            return;
@@ -2645,11 +2648,11 @@
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .eq(PlatformJob::getPlatformGroupId, platformGroup.getId())
                        .apply(" ( " +
                                " ( t.`STATUS` = "+Constants.PlatformJobStatus.WAIT_CALL.getKey()+" and t.PLATFORM_GROUP_ID = "+platformGroup.getId()+"  )" +
                                " (  `STATUS` = "+Constants.PlatformJobStatus.WAIT_CALL.getKey()+" and PLATFORM_GROUP_ID = "+platformGroup.getId()+"  )" +
                                " or  " +
                                " (t.`STATUS` = "+Constants.PlatformJobStatus.IN_WAIT.getKey()+" and and t.PLATFORM_ID = "+platform.getId()+" )  " +
                                " ( `STATUS` = "+Constants.PlatformJobStatus.IN_WAIT.getKey()+" and  PLATFORM_ID = "+platform.getId()+" )  " +
                                " or " +
                                "  (t.`STATUS` = "+Constants.PlatformJobStatus.TRANSFERING.getKey()+" and t.PLATFORM_ID = "+platform.getId()+" )  " +
                                "  ( `STATUS` = "+Constants.PlatformJobStatus.TRANSFERING.getKey()+" and PLATFORM_ID = "+platform.getId()+" )  " +
                                ") "
                        )
                        //排序方式 æœˆå°ä½œä¸šç±»åž‹ ï¼ˆè½¬ç§»ä¸­ >叫号入园)>  åŠ æ€¥ >  ç­¾åˆ°æ—¶é—´
@@ -2660,8 +2663,12 @@
                }
                for (int i = 0; i < workingNum - workNum ; i++) {
                    PlatformJob platformJob  = this.getAutoCallJob(platformJobList,platform,isDefaul,platformGroup);
                    if(Objects.isNull(platformJob)){
                        continue;
                    }
                    JobOperateDTO jobOperateDTO = new JobOperateDTO();
                    jobOperateDTO.setJobId(platformJob.getId());
                    jobOperateDTO.setPlatformId(platform.getId());
                    PlatformJob callPlatformJob = this.platformCallNumber(jobOperateDTO);
                    platformJobList = platformJobList.stream().filter(j->!Constants.equalsInteger(j.getId(),platformJob.getId())).collect(Collectors.toList());
                    try{
@@ -2683,12 +2690,13 @@
    @Override
    public void autoCallInParkCar(WmsService wmsService){
        //查询当前开启的月台数据
        List<PlatformGroup> allPlatformGroup = platformGroupMapper.selectList(new QueryWrapper<PlatformGroup>().lambda().eq(PlatformGroup::getStatus,Constants.ZERO)
                .eq(PlatformGroup::getIsdeleted,Constants.ZERO).eq(PlatformGroup::getAutoCall,Constants.ONE)
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(allPlatformGroup)){
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(allPlatformGroup)){
            return;
        }
        //过滤当前时间段不在时间内的月台组  AUTO_CALL_END_TIME  AUTO_CALL_START_TIME
@@ -2698,7 +2706,7 @@
                        && Integer.valueOf(i.getAutoCallStartTime().replaceAll(":","")) < nowHm
                        && Integer.valueOf(i.getAutoCallEndTime().replaceAll(":","")) > nowHm
        ).collect(Collectors.toList());
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(autoCallGroup)){
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(autoCallGroup)){
            return;
        }
        //查询所有月台
@@ -2706,7 +2714,8 @@
                .lambda()
                .eq(Platform::getIsdeleted,Constants.ZERO)
                .eq(Platform::getStatus,Constants.ZERO)
                .in(Platform::getId,autoCallGroup.stream().map(i->i.getId()).collect(Collectors.toList()))
                .isNotNull(Platform::getCallReadyNum)
                .in(Platform::getGroupId,autoCallGroup.stream().map(i->i.getId()).collect(Collectors.toList()))
        );
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(platformList)){
            return;
@@ -2746,7 +2755,7 @@
                        .lambda()
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .eq(PlatformJob::getPlatformGroupId, platformGroup.getId())
                        .apply("  t.`STATUS` = "+Constants.PlatformJobStatus.WAIT_CALL.getKey()+" and t.PLATFORM_GROUP_ID = "+platformGroup.getId()+" ) ")
                        .apply(" ( `STATUS` = "+Constants.PlatformJobStatus.WAIT_CALL.getKey()+" and PLATFORM_GROUP_ID = "+platformGroup.getId()+" ) ")
                        //排序方式 æœˆå°ä½œä¸šç±»åž‹ ï¼ˆå¼‚常挂起>叫号入园)>  åŠ æ€¥ >  ç­¾åˆ°æ—¶é—´
                        .orderByDesc(PlatformJob::getStatus,PlatformJob::getUrgeTime)
                        .orderByAsc(PlatformJob::getSignDate));
@@ -2861,9 +2870,17 @@
                    if(Objects.isNull(platformWmsJob)){
                        continue;
                    }
                    //TODO æš‚无入库的数据
                    if(platformWmsJob.getCarrierName().equals("1") && Constants.equalsInteger(platform.getType(),Constants.ONE)){
                        return platformJob;
                    SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.IN_REPERTOTY_CODE);
                    if(Objects.nonNull(systemDictData)){
                        //判断放置位置
                        if(platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda().eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)
                                .eq(PlatformWmsDetail::getWmsJobId,platformWmsJob.getId())
                                .apply(" find_in_set(IN_REPERTOTY_CODE ,'"+systemDictData.getCode()+"')")
                                .eq(PlatformWmsDetail::getInRepertotyCode,"")
                                .isNotNull(PlatformWmsDetail::getInRepertotyCode)
                        ) > Constants.ZERO && Constants.equalsInteger(platform.getType(),Constants.ONE)){
                            return platformJob;
                        }
                    }
                    if(Constants.equalsInteger(platform.getType(),Constants.ZERO)){
                        return platformJob;