ZengTao
2024-08-06 ca6e546a02c7c168263ba057ea51369ba44eb3cc
Merge branch 'master' of http://bore.pub:10439/r/HangZhouMes
7个文件已修改
1个文件已添加
120 ■■■■■ 已修改文件
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/controller/DownGlassInfoController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/entity/DownGlassInfo.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/entity/request/DownGlassInfoRequest.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/DownGlassInfoService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -161,6 +161,7 @@
    public static final List<Integer> G06_WORK_STATION = Arrays.asList(1, 2, 3);
    public static final List<Integer> G11_WORK_STATION = Arrays.asList(4, 5, 6);
    public static final int G13_WORK_STATION = 7;
    public static final List<Integer> WORK_STATION_ALL = Arrays.asList(1, 2, 3, 4, 5, 6, 7);
    /**
     * 启用 1
hangzhoumesParent/moduleService/CacheGlassModule/src/main/resources/application.yml
@@ -18,11 +18,11 @@
    secondLength: 2500
  min:
    one: #第一条磨边线的最小尺寸信息
      firstLength: 600
      secondLength: 350
      firstLength: 500
      secondLength: 400
    two: #第二条磨边线的最小尺寸信息
      firstLength: 400
      secondLength: 300
      secondLength: 400
  sequence:
    order: false
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/controller/DownGlassInfoController.java
@@ -1,5 +1,10 @@
package com.mes.downglassinfo.controller;
import com.mes.downglassinfo.entity.request.DownGlassInfoRequest;
import com.mes.downglassinfo.service.DownGlassInfoService;
import com.mes.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -7,5 +12,12 @@
@RequestMapping("/downGlassInfo")
public class DownGlassInfoController {
    @Autowired
    DownGlassInfoService downGlassInfoService;
    @RequestMapping("/selectDownGlassInfo")
    public Result<String> setDownGlassInfoRequest(@RequestBody DownGlassInfoRequest request) {
        return Result.success(downGlassInfoService.setDownGlassInfoRequest(request));
    }
}
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/entity/DownGlassInfo.java
@@ -7,6 +7,7 @@
import org.springframework.stereotype.Component;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
@@ -79,5 +80,10 @@
     */
    private String glassId;
    /**
     * 创建时间
     */
    private Date gmtCreate;
}
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/entity/request/DownGlassInfoRequest.java
New file
@@ -0,0 +1,48 @@
package com.mes.downglassinfo.entity.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 * <p>
 *
 * </p>
 *
 * @author zhoush
 * @since 2024-03-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class DownGlassInfoRequest implements Serializable {
    /**
     * 工位id
     */
    private Integer workStationId;
    /**
     * 工程id
     */
    private String engineerId;
    /**
     * 开始时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date beginDate;
    /**
     * 结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;
}
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/DownGlassInfoService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.downglassinfo.entity.DownGlassInfo;
import com.mes.downglassinfo.entity.request.DownGlassInfoRequest;
import com.mes.downworkstation.entity.dto.DownGlassInfoDTO;
import java.util.List;
@@ -40,4 +41,6 @@
     * @return
     */
    boolean generateOutGlassTask(String glassId);
    String setDownGlassInfoRequest(DownGlassInfoRequest request);
}
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downglassinfo/service/impl/DownGlassInfoServiceImpl.java
@@ -5,7 +5,9 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.common.config.Const;
import com.mes.common.utils.RedisUtil;
import com.mes.downglassinfo.entity.DownGlassInfo;
import com.mes.downglassinfo.entity.request.DownGlassInfoRequest;
import com.mes.downglassinfo.mapper.DownGlassInfoMapper;
import com.mes.downglassinfo.service.DownGlassInfoService;
import com.mes.downstorage.entity.DownStorageCageDetails;
@@ -27,6 +29,9 @@
    @Autowired
    DownStorageCageDetailsService downStorageCageDetailsService;
    @Autowired
    RedisUtil redisUtil;
    /**
     * 根据流程卡号查询最大序号
@@ -82,4 +87,14 @@
        BeanUtils.copyProperties(details, glassInfo);
        return downLoadCacheGlassTask.initDownGlassTask(glassInfo, details.getSlot(), Const.G13_WORK_STATION, 2);
    }
    @Override
    public String setDownGlassInfoRequest(DownGlassInfoRequest request) {
        if (request == null) {
            redisUtil.deleteObject("downGlassRequest");
        } else {
            redisUtil.setCacheObject("downGlassRequest", request);
        }
        return "success";
    }
}
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -2,13 +2,18 @@
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mes.common.config.Const;
import com.mes.common.utils.RedisUtil;
import com.mes.downglassinfo.entity.DownGlassInfo;
import com.mes.downglassinfo.entity.request.DownGlassInfoRequest;
import com.mes.downglassinfo.service.DownGlassInfoService;
import com.mes.downstorage.service.DownStorageCageService;
import com.mes.downworkstation.entity.DownWorkstation;
import com.mes.downworkstation.service.DownWorkstationService;
import com.mes.tools.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -28,6 +33,9 @@
    private DownStorageCageService downStorageCageService;
    @Autowired
    private DownGlassInfoService downGlassInfoService;
    @Autowired
    private RedisUtil redisUtil;
    @Scheduled(fixedDelay = 2000)
    public void sendDownWorkstations() {
@@ -101,13 +109,26 @@
    @Scheduled(fixedDelay = 2000)
    public void sendDownGlassInfo() {
        DownGlassInfoRequest request = redisUtil.getCacheObject("downGlassRequest");
        if (null == request) {
            request = new DownGlassInfoRequest();
        }
        log.info("发送当前正在执行工程已落架的玻璃信息");
        List<DownGlassInfo> downGlassInfos = downGlassInfoService.list(new LambdaQueryWrapper<DownGlassInfo>()
                .inSql(DownGlassInfo::getEngineerId, "select engineer_id from engineering where state = 1"));
        LambdaQueryWrapper<DownGlassInfo> wrapper = new LambdaQueryWrapper<DownGlassInfo>()
                .between(null != request.getBeginDate(), DownGlassInfo::getGmtCreate, request.getBeginDate(), request.getEndDate())
                .eq(StringUtils.isNotBlank(request.getEngineerId()), DownGlassInfo::getEngineerId, request.getEngineerId());
        if (null == request.getWorkStationId() || 0 == request.getWorkStationId()) {
            wrapper.in(DownGlassInfo::getWorkStationId, Const.WORK_STATION_ALL);
        } else {
            wrapper.eq(DownGlassInfo::getWorkStationId, request.getWorkStationId());
        }
        List<DownGlassInfo> downGlassInfos = downGlassInfoService.list(wrapper);
        Map<Integer, List<DownGlassInfo>> listMap = downGlassInfos.stream().collect(Collectors.groupingBy(DownGlassInfo::getWorkStationId));
        List<Object> engineerIdListTemp = downGlassInfoService.listObjs(new QueryWrapper<DownGlassInfo>().select("distinct engineer_id"));
        List<String> engineerIdList = engineerIdListTemp.stream().map(String::valueOf).collect(Collectors.toList());
        JSONObject jsonObject4 = new JSONObject();
        List<Map<String, Object>> list = downStorageCageService.selectDownStorageCages();
        jsonObject4.append("sendDownGlass", listMap);
        jsonObject4.append("downGlassInfos", listMap);
        jsonObject4.append("engineerIdList", engineerIdList);
        ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
        if (sendwServer4 != null) {
            for (WebSocketServer webserver : sendwServer4) {