k94314517
2024-10-11 f2972aa8de54d8763bfa3fcc9d72962f82d20009
代码初始化
已添加1个文件
已修改10个文件
200 ■■■■■ 文件已修改
server/system_gateway/src/main/resources/application-dev.yml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/admin_timer/src/main/java/com/doumee/api/PlatformJobController.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformCloudController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/PdaPlatformController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/WmsJobContractVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/system_gateway/src/main/resources/application-dev.yml
@@ -1,9 +1,12 @@
spring:
  # æ•°æ®æºé…ç½®
  datasource:
    url: jdbc:mysql://sh-cdb-aiskr3vy.sql.tencentcdb.com:62443/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: doumee
    password: rtjgfEr@&0c0m
#    url: jdbc:mysql://sh-cdb-aiskr3vy.sql.tencentcdb.com:62443/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
#    username: doumee
#    password: rtjgfEr@&0c0m
    url: jdbc:mysql://10.50.250.253:3306/antaiwuliu?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
    username: root
    password: Atwl@2024
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
server/system_timer/src/main/java/com/doumee/jobs/fegin/VisitServiceFegin.java
@@ -66,7 +66,13 @@
    ApiResponse syncVistAppointData() ;
    @ApiOperation("【访客系统】定时更新微信公众号accesstoken")
    @GetMapping("/timer/wxtoken/updateWxAccessToken")
    public ApiResponse updateWxAccessToken();
    ApiResponse updateWxAccessToken();
    @ApiOperation("月台任务超时报警")
    @GetMapping("/timer/platformJob/platformJobTimeOut")
    ApiResponse platformJobTimeOut();
    @ApiOperation("月台任务自动过号")
    @GetMapping("/timer/platformJob/timeOutCallIn")
    ApiResponse timeOutCallIn();
}
server/visits/admin_timer/src/main/java/com/doumee/api/PlatformJobController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,54 @@
package com.doumee.api;
import com.alibaba.fastjson.JSONObject;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.HttpsUtil;
import com.doumee.core.wx.WXConstant;
import com.doumee.dao.system.model.SystemDictData;
import com.doumee.service.business.PlatformJobService;
import com.doumee.service.system.SystemDictDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.mgt.DefaultSecurityManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Objects;
/**
 * @author æ±Ÿè¹„蹄
 * @date 2023/11/30 15:33
 */
@Api(tags = "月台作业定时")
@RestController
@RequestMapping("/timer/platformJob")
public class PlatformJobController extends BaseController {
    @Autowired
    private PlatformJobService platformJobService;
    @ApiOperation("超时报警数据")
    @GetMapping("/platformJobTimeOut")
    public ApiResponse platformJobTimeOut() {
        platformJobService.timeOutReport();
        return ApiResponse.success("超时报警数据");
    }
    @ApiOperation("超时自动过号")
    @GetMapping("/timeOutCallIn")
    public ApiResponse timeOutCallIn() {
        platformJobService.timeOutCallIn();
        return ApiResponse.success("自动过号");
    }
}
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformCloudController.java
@@ -19,8 +19,10 @@
import com.doumee.service.business.PlatformJobService;
import com.doumee.service.business.PlatformService;
import com.doumee.service.business.PlatformShowParamService;
import com.doumee.service.business.third.WmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -47,6 +49,10 @@
    @Autowired
    private PlatformShowParamService platformShowParamService;
    @Autowired
    private WmsService wmsService;
    @PreventRepeat
    @ApiOperation("新建")
@@ -185,6 +191,11 @@
        if(Constants.equalsInteger(oldPlatformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey())){
            platformJobService.sendInPark(platformJob);
        }
        if(!Constants.equalsInteger(platformJob.getType(),Constants.FOUR)
                && StringUtils.isNotBlank(platformJob.getBillCode())){
            //通知WMS绑定月台信息
            wmsService.orderPlatformBind(platformJob);
        }
        return ApiResponse.success("操作成功");
    }
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/web/PdaPlatformController.java
@@ -15,11 +15,13 @@
import com.doumee.dao.web.response.LineUpVO;
import com.doumee.dao.web.response.PlatformWorkVO;
import com.doumee.service.business.*;
import com.doumee.service.business.third.WmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -58,6 +60,9 @@
    @Autowired
    private PlatformWmsJobService platformWmsJobService;
    @Autowired
    private WmsService wmsService;
    @ApiOperation("获取月台组信息")
    @PostMapping("/getPlatformGroupList")
@@ -126,6 +131,11 @@
        if(Constants.equalsInteger(oldPlatformJob.getStatus(),Constants.PlatformJobStatus.WAIT_CALL.getKey())){
            platformJobService.sendInPark(platformJob);
        }
        if(!Constants.equalsInteger(platformJob.getType(),Constants.FOUR)
                && StringUtils.isNotBlank(platformJob.getBillCode())){
            //通知WMS绑定月台信息
            wmsService.orderPlatformBind(platformJob);
        }
        return ApiResponse.success("操作成功");
    }
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
@@ -318,6 +318,9 @@
    @TableField(exist = false)
    private String platformName ;
    @ApiModelProperty(value = "是否超时:0=是;1=否", example = "1")
    @TableField(exist = false)
    private Integer isTimeOut;
    @ApiModelProperty(value = "作业量" ,hidden = true)
    @TableField(exist = false)
@@ -422,6 +425,11 @@
    @TableField(exist = false)
    private Integer  lockStatus;
    @ApiModelProperty(value = "等待叫号时间(分)")
    @TableField(exist = false)
    private Integer worktimeOutAlarmTime;
    public void dealTime(){
        if(Constants.equalsInteger(this.getStatus(),Constants.PlatformJobStatus.WAIT_CONFIRM.getKey())
                || Constants.equalsInteger(this.getStatus(),Constants.PlatformJobStatus.WART_SIGN_IN.getKey())
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/vo/WmsJobContractVO.java
@@ -23,6 +23,9 @@
    @ApiModelProperty(value = "收货地")
    private String address;
    @ApiModelProperty(value = "上锁状态:0=未上锁;1=已上锁;")
    private Integer lockStatus;
    @ApiModelProperty(value = "明细信息")
    private List<PlatformWmsDetail> platformWmsDetailList;
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
@@ -216,7 +216,6 @@
     */
    PlatformWorkVO getPlatformWorkVOById(Integer platformId);
    PlatformOrderNumByDateResponse orderNumByDate(PlatformOrderNumByDateRequest param);
    List<PlatformDataListResponse> platformWorkingDataList(PlatformDataListRequest param);
@@ -229,5 +228,14 @@
    LargeScreenDataVO getLargeScreenData();
    /**
     * è¶…时报警
     */
    void timeOutReport();
    /**
     * è‡ªåŠ¨è¿‡å·
     */
    void timeOutCallIn();
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java
@@ -255,8 +255,10 @@
                            .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)
                            .selectAs(PlatformBooks::getId,PlatformJob::getBookId)
                            .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                            .leftJoin(PlatformWmsJob.class,PlatformWmsJob::getCarryBillCode,PlatformJob::getBillCode)
                            .leftJoin(PlatformBooks.class,PlatformBooks::getJobId,PlatformJob::getId)
                            .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                            .apply(" ( t1.isdeleted = 0 or t.PLATFORM_ID is null  ) ")
                            .in(PlatformJob::getStatus,
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -32,7 +32,9 @@
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.impl.thrid.WmsServiceImpl;
import com.doumee.service.business.third.EmayService;
import com.doumee.service.business.third.WmsService;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -107,6 +109,8 @@
    @Autowired
    private PlatformBroadcastLogMapper platformBroadcastLogMapper;
    @Autowired
    private PlatformWarnEventServiceImpl platformWarnEventService;
    @Override
    public Integer create(PlatformJob platformJob) {
@@ -1024,6 +1028,8 @@
        }
        platformJob.setEditDate(new Date());
        platformJobMapper.updateById(platformJob);
        //存储操作日志
        savePlatformLog(Constants.PlatformJobLogType.CALLED.getKey(),oldPlatformJob,platformJob,
                Constants.PlatformJobLogType.CALLED.getInfo().replace("{data}",platform.getName()));
@@ -1039,6 +1045,8 @@
        this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.CALLING.getInfo(),
                Constants.PlatformBroadcastContent.CALLING.getInfo()
        );
        platformJob.setPlatformWmsCode(platform.getCode());
        return platformJob;
    }
@@ -1053,7 +1061,8 @@
        log.error("查询LED与广播数据------------------------------------------------------------------------------------------");
        List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
                .eq(PlatformDevice::getPlatformId,model.getPlatformId())
                .eq(PlatformDevice::getIsdeleted,Constants.ZERO));
                .eq(PlatformDevice::getIsdeleted,Constants.ZERO)
        );
        if(deviceList ==null || deviceList.size() == 0){
            return;
        }
@@ -1160,6 +1169,11 @@
                emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(),
                SmsConstants.platformJobContent.platformJobMove,oldPlatform.getName(),platform.getName()
        );
        this.broadcastAndLEed(platformJob,null,
                StringUtils.isBlank(oldPlatform.getRemark())?Constants.PlatformLedContent.IDEL_CONTNET.getName():oldPlatform.getRemark()
        );
    }
@@ -1310,7 +1324,6 @@
        ||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)){
@@ -1888,10 +1901,13 @@
                .selectAll(PlatformJob.class)
                .selectAs(Platform::getWorkRate,PlatformJob::getWorkRate)
                .selectAs(Platform::getName,PlatformJob::getPlatformName)
                .selectAs(PlatformGroup::getWaitCallTime,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  ")
                .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  ")
                .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId)
                .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                .in(PlatformJob::getStatus,
                        Constants.PlatformJobStatus.WAIT_CALL.getKey(),
                        Constants.PlatformJobStatus.WORKING.getKey(),
@@ -1915,8 +1931,7 @@
                        platformJob.setOptTime(overDate.getTime());
                    }
                }else if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())){
                    //计算已叫号时间
                    platformJob.dealTime();
                    platformJob.setOptTime(DateUtil.getXMinuteAfterDate(platformJob.getCallDate(),platformJob.getWorktimeOutAlarmTime()).getTime());
                }
            }
            largeScreenDataVO.setAllList(platformJobList);
@@ -1927,9 +1942,64 @@
        return largeScreenDataVO;
    }
    @Override
    public void timeOutReport(){
        //查询超时数据
       List<PlatformJob> platformJobList =  platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>()
                .selectAll(PlatformJob.class)
                .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)
                .eq(PlatformJob::getInOut,Constants.ONE)
                .isNotNull(PlatformJob::getDoneDate)
        );
       //如果超时 å¤„理数据 å¹¶å‘送led与广播
        for (PlatformJob platformJob:platformJobList) {
            if(Constants.equalsInteger(platformJob.getIsTimeOut(),Constants.ONE)){
                //广播 led通知
                this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.TIMEOUT_IN.getInfo(),
                        Constants.PlatformBroadcastContent.TIMEOUT_IN.getInfo());
                //更新状态
                platformJobJoinMapper.update(new UpdateWrapper<PlatformJob>().lambda().set(PlatformJob::getInOut,Constants.ZERO).eq(PlatformJob::getId,platformJob.getId()));
                SavePlatformWarnEventDTO savePlatformWarnEventDTO = new SavePlatformWarnEventDTO();
                savePlatformWarnEventDTO.setPlatformJobId(platformJob.getId());
                savePlatformWarnEventDTO.setPlatformId(platformJob.getPlatformId());
                savePlatformWarnEventDTO.setCarCode(platformJob.getCarCodeFront());
                savePlatformWarnEventDTO.setEventType(Constants.PlatformWarnEvent.STOP_TIMEOUT.getKey());
                platformWarnEventService.savePlatformWarnEvent(savePlatformWarnEventDTO);
            }
        }
    }
    /**
     * è‡ªåŠ¨è¿‡å· è‡ªåŠ¨æ›´æ–°è‡³ä»£ç­¾åˆ°çŠ¶æ€
     */
    @Override
    public void timeOutCallIn(){
        //查询超时数据
        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   ")
                .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
                .leftJoin(PlatformGroup.class,PlatformGroup::getId,Platform::getGroupId)
                .eq(PlatformJob::getStatus,Constants.PlatformJobStatus.CALLED)
                .isNotNull(PlatformJob::getCallDate)
        );
        //如果超时 å¤„理数据 å¹¶å‘送led与广播
        for (PlatformJob platformJob:platformJobList) {
            JobOperateDTO jobOperateDTO = new JobOperateDTO();
            jobOperateDTO.setJobId(platformJob.getId());
            this.platformOverNumber(jobOperateDTO);
            this.cancelInPark(platformJob);
        }
    }
}
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformWmsJobServiceImpl.java
@@ -108,6 +108,11 @@
                wmsJobContractVO.setPlatformWmsDetailList(
                        platformWmsDetailList.stream().filter(i->i.getIocode().equals(ioCode)).collect(Collectors.toList())
                );
                if(Objects.isNull(wmsJobContractVO.getLockStatus())&& com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(wmsJobContractVO.getPlatformWmsDetailList())){
                    wmsJobContractVO.setLockStatus(
                            wmsJobContractVO.getPlatformWmsDetailList().get(Constants.ZERO).getLockStatus()
                    );
                }
                wmsJobContractVOList.add(wmsJobContractVO);
            }