1、卧式理片玻璃替换仅替换版图信息
2、指定钢化、指定工程fixbug:膜系字段修改为filmsId
3、移除大理片笼向前端推送钢化历史任务数据
4、中空领取任务界面接口改造:新增开始/暂停/结束任务按钮,流程卡列表、预览任务、删除任务接口
5、领取/强制任务接口改造:新增除膜信息、李赛克文件需要的数据信息
12个文件已修改
5个文件已添加
520 ■■■■ 已修改文件
hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/resources/mapper/TemperingGlassInfoMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/OpcNGTemperingTask.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationTaskDetails.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/request/HollowTaskRequest.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationTaskDetailsMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationTaskDetailsService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java 132 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationTaskDetailsServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/temperingglass/entity/TemperingGlassInfo.java
@@ -52,12 +52,6 @@
    private double thickness;
    /**
     * 膜系
     */
    @ApiModelProperty(value = "膜系", position = 9)
    private String filmsid;
    /**
     * 钢化是否接受横放
     */
    @ApiModelProperty(value = "钢化是否接受横放", position = 10)
hangzhoumesParent/common/servicebase/src/main/resources/mapper/TemperingGlassInfoMapper.xml
@@ -2,12 +2,12 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mes.temperingglass.mapper.TemperingGlassInfoMapper">
    <insert id="saveBatch">
        INSERT INTO tempering_glass_info (glass_id, flow_card_id, glass_type, width, height, thickness, filmsid,
        INSERT INTO tempering_glass_info (glass_id, flow_card_id, glass_type, width, height, thickness, films_id,
        ishorizontal, tempering_layout_id,
        tempering_feed_sequence, x_coordinate, y_coordinate, angle, state, slot, engineer_id, deleted) VALUES
        <foreach collection="list" item="item" separator=",">
            (#{item.glassId}, #{item.flowCardId}, #{item.glassType}, #{item.width}, #{item.height}, #{item.thickness},
            #{item.filmsid},#{item.ishorizontal},
            #{item.filmsId},#{item.ishorizontal},
            #{item.temperingLayoutId}, #{item.temperingFeedSequence}, #{item.xCoordinate}, #{item.yCoordinate},
            #{item.angle}, #{item.state}, #{item.slot}, #{item.engineerId}, 0)
        </foreach>
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassTask.java
@@ -492,7 +492,7 @@
                .orderByDesc(EdgStorageDeviceTaskHistory::getCreateTime).last("limit 1"));
        //如果任务类型为1,3,将切割完成的玻璃自动报工
        if (Const.GLASS_CACHE_TYPE_IN_ALL.contains(taskHistory.getTaskType())) {
            damageService.autoSubmitReport(taskHistory.getGlassIdIn(), taskHistory.getDeviceId(),"切割","进卧理",1);
            damageService.autoSubmitReport(taskHistory.getGlassIdIn(), taskHistory.getDeviceId(), "切割", "进卧理", 1);
        }
        updateCellRemainWidth(cell, device, taskHistory);
        edgStorageDeviceTaskHistoryService.update(new LambdaUpdateWrapper<EdgStorageDeviceTaskHistory>()
@@ -535,26 +535,43 @@
                .last("Limit 1");
        GlassInfo swapGlassInfo = glassInfoService.getOne(queryWrapper);
        if (swapGlassInfo != null && !glassInfo.getGlassId().equals(swapGlassInfo.getGlassId())) {
            //待替换的玻璃信息
            Integer ishorizontal = glassInfo.getIshorizontal();
            Integer temperingLayoutId = glassInfo.getTemperingLayoutId();
            Integer temperingFeedSequence = glassInfo.getTemperingFeedSequence();
            Integer xCoordinate = glassInfo.getXCoordinate();
            Integer yCoordinate = glassInfo.getYCoordinate();
            double angle = glassInfo.getAngle();
            Integer ruleId = glassInfo.getRuleId();
            //替换后的玻璃信息
            Integer swapIshorizontal = swapGlassInfo.getIshorizontal();
            Integer swapTemperingLayoutId = swapGlassInfo.getTemperingLayoutId();
            Integer swapTemperingFeedSequence = swapGlassInfo.getTemperingFeedSequence();
            Integer swapXCoordinate = swapGlassInfo.getXCoordinate();
            Integer swapYCoordinate = swapGlassInfo.getYCoordinate();
            double swapAngle = swapGlassInfo.getAngle();
            Integer swapRuleId = swapGlassInfo.getRuleId();
            //替换玻璃信息
            glassInfo.setIshorizontal(swapIshorizontal);
            glassInfo.setTemperingLayoutId(swapTemperingLayoutId);
            glassInfo.setTemperingFeedSequence(swapTemperingFeedSequence);
            glassInfo.setXCoordinate(swapXCoordinate);
            glassInfo.setYCoordinate(swapYCoordinate);
            glassInfo.setAngle(swapAngle);
            glassInfo.setRuleId(swapRuleId);
            int patternSequence = glassInfo.getPatternSequence();
            int xAxis = glassInfo.getXAxis();
            int yAxis = glassInfo.getYAxis();
            String swapGlassId = swapGlassInfo.getGlassId();
            int swapPatternSequence = swapGlassInfo.getPatternSequence();
            int swapXAxis = swapGlassInfo.getXAxis();
            int swapYAxis = swapGlassInfo.getYAxis();
            swapGlassInfo.setGlassId(glassId);
            swapGlassInfo.setPatternSequence(patternSequence);
            swapGlassInfo.setXAxis(xAxis);
            swapGlassInfo.setYAxis(yAxis);
            glassInfo.setGlassId(swapGlassId);
            glassInfo.setPatternSequence(swapPatternSequence);
            glassInfo.setXAxis(swapXAxis);
            glassInfo.setYAxis(swapYAxis);
            swapGlassInfo.setIshorizontal(ishorizontal);
            swapGlassInfo.setTemperingLayoutId(temperingLayoutId);
            swapGlassInfo.setTemperingFeedSequence(temperingFeedSequence);
            swapGlassInfo.setXCoordinate(xCoordinate);
            swapGlassInfo.setYCoordinate(yCoordinate);
            swapGlassInfo.setAngle(angle);
            swapGlassInfo.setRuleId(ruleId);
            log.info("将玻璃{}和玻璃{},信息互换(原片序号及坐标除外),进玻璃 {}", glassInfo, swapGlassInfo, swapGlassInfo);
            glassInfoService.updateById(swapGlassInfo);
            glassInfoService.updateById(glassInfo);
            return swapGlassId;
            return swapGlassInfo.getGlassId();
        }
        return "";
    }
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/bigstorage/service/impl/BigStorageCageDetailsServiceImpl.java
@@ -397,9 +397,9 @@
        if (temperingGlassInfoList.size() == 0) {
            List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
                    .selectAll(GlassInfo.class)
                    .select("-1 as state")
                    .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
                    .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" +
                            ",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," +
                            "t.angle,t1.slot,t.engineer_id")
                    .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
                    .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId)
                    .eq(GlassInfo::getEngineerId, engineerId)
@@ -446,7 +446,7 @@
        return this.list(new LambdaQueryWrapper<BigStorageCageDetails>()
                .eq(BigStorageCageDetails::getEngineerId, bigStorageQueryVO.getEngineerId())
                .eq(BigStorageCageDetails::getTemperingLayoutId, bigStorageQueryVO.getTemperingLayoutId())
                .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL));
                .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL).orderByAsc(BigStorageCageDetails::getTemperingFeedSequence));
    }
    @Override
@@ -469,9 +469,9 @@
        if (temperingGlassInfoList.size() == 0) {
            List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
                    .selectAll(GlassInfo.class)
                    .select("-1 as state")
                    .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
                    .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" +
                            ",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," +
                            "t.angle,t1.slot,t.engineer_id")
                    .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
                    .eq(GlassInfo::getEngineerId, engineerId)
                    .ne(GlassInfo::getTemperingLayoutId, 0)
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -172,7 +172,7 @@
            //查询使用数据源1查询数据
            queryDataSource1();
            //查询使用数据源2查询数据
            queryDataSource2();
//            queryDataSource2();
            ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage");
            if (sendwServer != null) {
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -318,9 +318,9 @@
                for (TemperingLayoutDTO item : temperingLayoutDTOList) {
//                    if (item.getEngineerId().equals(redisUtil.getCacheObject("temperingengineerId"))) {
                    List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class)
                            .selectAll(GlassInfo.class)
                            .select("-1 as state")
                            .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot)
                            .select("-1 as state,t.filmsid as films_id,t.glass_id,t.flow_card_id,t.glass_type,t.width,t.height" +
                                    ",t.thickness,t.ishorizontal,t.tempering_layout_id,t.tempering_feed_sequence,t.x_coordinate,t.y_coordinate," +
                                    "t.angle,t1.slot,t.engineer_id")
                            .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId)
                            .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN)
                            .eq(GlassInfo::getTemperingLayoutId, item.getTemperingLayoutId())
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/OpcNGTemperingTask.java
@@ -17,7 +17,6 @@
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
@@ -108,7 +107,7 @@
        }
        List<TemperingGlassInfo> glassList = temperingAgoService.selectGlassInfoById(temperingid);
        if (glassList != null && glassList.size() > 0) {
            int glasstype = GetGlassType(glassList.get(0).getFilmsid());//膜系
            int glasstype = GetGlassType(glassList.get(0).getFilmsId());//膜系
            int process = 0;//钢化类型
            int thiness = (int) glassList.get(0).getThickness();//厚度
            String engineerId = glassList.get(0).getEngineerId();
hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java
@@ -19,7 +19,6 @@
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Comparator;
@@ -100,7 +99,7 @@
                .sorted(Comparator.comparing(TemperingGlassInfo::getTemperingFeedSequence)).collect(Collectors.toList());
        //按照膜系获取玻璃材质
        SysDictData glassTypeSysDictData = sysDictDataService.getOne(new QueryWrapper<SysDictData>()
                .eq(StringUtils.isNotBlank(temperingGlassList.get(0).getFilmsid()), "dict_label", temperingGlassList.get(0).getFilmsid()));
                .eq(StringUtils.isNotBlank(temperingGlassList.get(0).getFilmsId()), "dict_label", temperingGlassList.get(0).getFilmsId()));
        double sumArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).sum();
        double maxArea = temperingGlassList.stream().mapToDouble(e -> e.getWidth() * e.getHeight()).max().orElse(0.0);
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
@@ -2,7 +2,9 @@
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.request.HollowTaskRequest;
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import com.mes.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
@@ -10,6 +12,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
 * (HollowGlassOutRelationInfo)表控制层
@@ -26,20 +29,19 @@
    @ApiOperation("领取任务")
    @PostMapping("/receiveTask")
    public Result<HollowGlassOutRelationInfo> receiveTask(String flowCardId, int cell, int totalPairQuantity) {
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.receiveTask(flowCardId, cell, totalPairQuantity);
    public Result<HollowGlassOutRelationInfo> receiveTask(HollowTaskRequest request) {
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.receiveTask(request);
        if (null == hollowGlassOutRelationInfo) {
            return Result.error(500, "有正在执行的任务,请先确保任务完成后,再次领取任务");
        } else {
            return Result.success(hollowGlassOutRelationInfo);
        }
    }
    @ApiOperation("强制出片")
    @PostMapping("/forceOutGlass")
    public Result<HollowGlassOutRelationInfo> forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.forceOutGlass(flowCardId, cell, totalPairQuantity);
    public Result<HollowGlassOutRelationInfo> forceOutGlass(HollowTaskRequest request) {
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService.forceOutGlass(request);
        if (null == hollowGlassOutRelationInfo) {
            return Result.error(500, "有正在执行的任务,请先确保任务完成后,再次强制执行任务");
        } else {
@@ -47,6 +49,42 @@
        }
    }
    @ApiOperation("流程卡任务列表")
    @PostMapping("/hollowTaskList")
    public Result<List<String>> hollowTaskList(int cell) {
        return Result.build(200, "流程卡任务列表查询成功", hollowGlassOutRelationInfoService.hollowTaskList(cell));
    }
    @ApiOperation("预览指定任务信息")
    @PostMapping("/appointHollowTaskDetails")
    public Result<List<HollowGlassQueueInfo>> appointHollowTaskDetails(String flowCardId, int cell) {
        return Result.build(200, "预览指定任务信息成功", hollowGlassOutRelationInfoService.appointHollowTaskDetails(flowCardId, cell));
    }
    @ApiOperation("删除指定任务信息")
    @PostMapping("/deleteHollowTaskDetails")
    public Result<Boolean> deleteHollowTaskDetails(String flowCardId, int cell) {
        return Result.build(200, "预览指定任务信息成功", hollowGlassOutRelationInfoService.deleteHollowTaskDetails(flowCardId, cell));
    }
    @ApiOperation("开始任务")
    @PostMapping("/startTask")
    public Result<Boolean> startTask(String flowCardId, int cell) {
        return Result.build(200, "开始任务成功", hollowGlassOutRelationInfoService.startTask(flowCardId, cell));
    }
    @ApiOperation("暂停任务")
    @PostMapping("/pauseTask")
    public Result<Boolean> pauseTask(String flowCardId, int cell) {
        return Result.build(200, "暂停任务成功", hollowGlassOutRelationInfoService.pauseTask(flowCardId, cell));
    }
    @ApiOperation("结束任务")
    @PostMapping("/finishTask")
    public Result<Boolean> finishTask(String flowCardId, int cell) {
        return Result.build(200, "结束任务成功", hollowGlassOutRelationInfoService.finishTask(flowCardId, cell));
    }
    @ApiOperation("是否调度开关")
    @PostMapping("/dispatchHollowSwitch")
    public Result<Boolean> dispatchHollowSwitch(Boolean flag) {
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowGlassOutRelationTaskDetails.java
New file
@@ -0,0 +1,113 @@
package com.mes.hollow.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.util.Date;
/**
 * (HollowGlassOutRelationTaskDetails)表实体类
 *
 * @author makejava
 * @since 2024-12-26 22:57:45
 */
@Data
public class HollowGlassOutRelationTaskDetails {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private Long relationId;
    /**
     * 流程卡
     */
    private String flowCardId;
    /**
     * 路线:930(李赛克,界面需要输入相关数据) 931
     */
    private Integer cell;
    /**
     * 配对数量
     */
    private Integer totalPairQuantity;
    /**
     * 除膜方式
     */
    private Integer filmRemove;
    /**
     * 上侧除膜量
     */
    private Integer topRemove;
    /**
     * 下侧除膜量
     */
    private Integer bottomRemove;
    /**
     * 左侧除膜量
     */
    private Integer leftRemove;
    /**
     * 右侧除膜量
     */
    private Integer rightRemove;
    /**
     * 间隔板1代码
     */
    private Integer frameOne;
    /**
     * 间隔板2代码
     */
    private Integer frameTwo;
    /**
     * 间隔板3代码
     */
    private Integer frameThree;
    /**
     * 间隔板4代码
     */
    private Integer frameFour;
    /**
     * 密封嵌入(mm)
     */
    private Integer sealInsert;
    /**
     * 气体1(0无 1有)
     */
    private Integer casOne;
    /**
     * 气体2(0无 1有)
     */
    private Integer casTwo;
    /**
     * 气体3(0无 1有)
     */
    private Integer casThree;
    /**
     * 气体4(0无 1有)
     */
    private Integer casFour;
    /**
     * 间隔框类型(tps胶为05 铝间隔条01)
     */
    private Integer intervalFrameType;
    /**
     * 间隔框宽度(mm)
     */
    private Integer intervalFrameWidth;
    /**
     * 间隔框高度(mm)
     */
    private Integer intervalFrameHeight;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/request/HollowTaskRequest.java
New file
@@ -0,0 +1,64 @@
package com.mes.hollow.entity.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @Author : zhoush
 * @Date: 2024/12/26 20:40
 * @Description:
 */
@ApiModel(description = "中空任务信息表")
@Data
public class HollowTaskRequest {
    @ApiModelProperty(value = "流程卡")
    private String flowCardId;
    @ApiModelProperty(value = "路线:930(李赛克,界面需要输入相关数据) 931")
    private int cell;
    @ApiModelProperty(value = "配对数量 930 931")
    private int totalPairQuantity;
    @ApiModelProperty(value = "除膜方式 930 931")
    private Integer filmRemove;
    @ApiModelProperty(value = "上侧除膜量 930 931")
    private Integer topRemove;
    @ApiModelProperty(value = "下侧除膜量 930 931")
    private Integer bottomRemove;
    @ApiModelProperty(value = "左侧除膜量 930 931")
    private Integer leftRemove;
    @ApiModelProperty(value = "右侧除膜量 930 931")
    private Integer rightRemove;
    /**
     * 分割线
     */
    @ApiModelProperty(value = "间隔板1代码 930专用")
    private Integer frameOne;
    @ApiModelProperty(value = "间隔板2代码 930专用")
    private Integer frameTwo;
    @ApiModelProperty(value = "间隔板3代码 930专用")
    private Integer frameThree;
    @ApiModelProperty(value = "间隔板4代码 930专用")
    private Integer frameFour;
    @ApiModelProperty(value = "密封嵌入 930专用")
    private Integer sealInsert;
    @ApiModelProperty(value = "气体1(0无 1有) 930专用")
    private Integer casOne;
    @ApiModelProperty(value = "气体2(0无 1有) 930专用")
    private Integer casTwo;
    @ApiModelProperty(value = "气体3(0无 1有) 930专用")
    private Integer casThree;
    @ApiModelProperty(value = "气体4(0无 1有) 930专用")
    private Integer casFour;
    @ApiModelProperty(value = "间隔框类型(tps胶为05 铝间隔条01) 930专用")
    private Integer intervalFrameType;
    @ApiModelProperty(value = "间隔框宽度 930专用")
    private Integer intervalFrameWidth;
    @ApiModelProperty(value = "间隔框高度 930专用")
    private Integer intervalFrameHeight;
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationTaskDetailsMapper.java
New file
@@ -0,0 +1,15 @@
package com.mes.hollow.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.hollow.entity.HollowGlassOutRelationTaskDetails;
/**
 * (HollowGlassOutRelationTaskDetails)表数据库访问层
 *
 * @author makejava
 * @since 2024-12-26 22:48:36
 */
public interface HollowGlassOutRelationTaskDetailsMapper extends BaseMapper<HollowGlassOutRelationTaskDetails> {
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -2,6 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.request.HollowTaskRequest;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import java.util.List;
/**
 * (HollowGlassOutRelationInfo)表服务接口
@@ -11,10 +15,22 @@
 */
public interface HollowGlassOutRelationInfoService extends IService<HollowGlassOutRelationInfo> {
    HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity);
    HollowGlassOutRelationInfo receiveTask(HollowTaskRequest request);
    HollowGlassOutRelationInfo forceOutGlass(String flowCardId, int cell, int totalPairQuantity);
    HollowGlassOutRelationInfo forceOutGlass(HollowTaskRequest request);
    Boolean dispatchHollowSwitch(Boolean flag);
    List<String> hollowTaskList(int cell);
    List<HollowGlassQueueInfo> appointHollowTaskDetails(String flowCardId, int cell);
    Boolean startTask(String flowCardId, int cell);
    Boolean pauseTask(String flowCardId, int cell);
    Boolean finishTask(String flowCardId, int cell);
    Boolean deleteHollowTaskDetails(String flowCardId, int cell);
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationTaskDetailsService.java
New file
@@ -0,0 +1,15 @@
package com.mes.hollow.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mes.hollow.entity.HollowGlassOutRelationTaskDetails;
/**
 * (HollowGlassOutRelationTaskDetails)表服务接口
 *
 * @author makejava
 * @since 2024-12-26 22:48:38
 */
public interface HollowGlassOutRelationTaskDetailsService extends IService<HollowGlassOutRelationTaskDetails> {
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -2,15 +2,19 @@
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.common.config.Const;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.HollowGlassOutRelationTaskDetails;
import com.mes.hollow.entity.request.HollowTaskRequest;
import com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper;
import com.mes.hollow.service.HollowBigStorageCageDetailsService;
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollow.service.HollowGlassOutRelationTaskDetailsService;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
import com.mes.utils.RedisUtil;
@@ -40,66 +44,152 @@
    HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
    @Resource
    HollowGlassQueueInfoService hollowGlassQueueInfoService;
    @Resource
    HollowGlassOutRelationTaskDetailsService hollowGlassOutRelationTaskDetailsService;
    @Resource
    RedisUtil redisUtil;
    @Override
    public HollowGlassOutRelationInfo receiveTask(String flowCardId, int cell, int totalPairQuantity) {
        return childrenTask(flowCardId,cell,totalPairQuantity,0);
    public HollowGlassOutRelationInfo receiveTask(HollowTaskRequest request) {
        return childrenTask(request, 0);
    }
    @Override
    public HollowGlassOutRelationInfo forceOutGlass(String flowCardId, int cell, int totalPairQuantity) {
        return childrenTask(flowCardId,cell,totalPairQuantity,1);
    public HollowGlassOutRelationInfo forceOutGlass(HollowTaskRequest request) {
        return childrenTask(request, 1);
    }
    @Override
    public Boolean dispatchHollowSwitch(Boolean flag) {
        redisUtil.setCacheObject("dispatchHollowSwitch", flag);
        return  redisUtil.getCacheObject("dispatchHollowSwitch");
        return redisUtil.getCacheObject("dispatchHollowSwitch");
    }
    @Override
    public List<String> hollowTaskList(int cell) {
        //查询任务表中本条线所有未完成的任务信息
        List<HollowGlassOutRelationInfo> list = this.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW, Const.HOLLOW_FLOW_CARD_START, Const.HOLLOW_FLOW_CARD_PAUSE)
                .eq(HollowGlassOutRelationInfo::getCell, cell));
        if (CollectionUtil.isNotEmpty(list)) {
            return list.stream().map(HollowGlassOutRelationInfo::getFlowCardId).collect(Collectors.toList());
        }
        return new ArrayList<String>();
    }
    @Override
    public List<HollowGlassQueueInfo> appointHollowTaskDetails(String flowCardId, int cell) {
        //按照流程卡及路线,查找对应的任务信息
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = this.getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW, Const.HOLLOW_FLOW_CARD_START, Const.HOLLOW_FLOW_CARD_PAUSE)
                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassOutRelationInfo::getCell, cell).last("limit 1"));
        if (null == hollowGlassOutRelationInfo) {
            return new ArrayList<HollowGlassQueueInfo>();
        }
        //按照任务id查询对列表中的队列信息
        return hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>()
                .eq(HollowGlassQueueInfo::getRelationId, hollowGlassOutRelationInfo.getId()));
    }
    @Override
    public Boolean startTask(String flowCardId, int cell) {
        //更新任务状态为开始
        return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
                .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassOutRelationInfo::getCell, cell));
    }
    @Override
    public Boolean pauseTask(String flowCardId, int cell) {
//        更新任务状态为暂停
        return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
                .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_PAUSE)
                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassOutRelationInfo::getCell, cell));
    }
    @Override
    public Boolean finishTask(String flowCardId, int cell) {
        //清空队列表中未完成的玻璃信息
        hollowGlassQueueInfoService.remove(new LambdaQueryWrapper<HollowGlassQueueInfo>()
                .in(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)
                .eq(HollowGlassQueueInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassQueueInfo::getCell, cell));
        //更新任务状态未已完成
        return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
                .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS)
                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassOutRelationInfo::getCell, cell));
    }
    @Override
    public Boolean deleteHollowTaskDetails(String flowCardId, int cell) {
        //按照流程卡及路线,查找对应的任务信息
        this.remove(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW, Const.HOLLOW_FLOW_CARD_START, Const.HOLLOW_FLOW_CARD_PAUSE)
                .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassOutRelationInfo::getCell, cell));
        hollowGlassQueueInfoService.remove(new LambdaQueryWrapper<HollowGlassQueueInfo>()
                .in(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW)
                .eq(HollowGlassQueueInfo::getFlowCardId, flowCardId)
                .eq(HollowGlassQueueInfo::getCell, cell));
        return Boolean.TRUE;
    }
    private HollowGlassOutRelationInfo childrenTask(String flowCardId, int cell, int totalPairQuantity,int isForce) {
        GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, flowCardId).last("limit 1"));
    private HollowGlassOutRelationInfo childrenTask(HollowTaskRequest request, int isForce) {
        GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, request.getFlowCardId()).last("limit 1"));
        HollowGlassOutRelationInfo info = new HollowGlassOutRelationInfo();
        if (null == glassInfo) {
            log.info("该流程卡信息系统未找到");
            return info;
        }
        List<HollowGlassOutRelationInfo> outRelationInfos = this.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>().eq(HollowGlassOutRelationInfo::getCell, cell)
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START));
        if (CollectionUtil.isNotEmpty(outRelationInfos)){
        List<HollowGlassOutRelationInfo> outRelationInfos = this.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .eq(HollowGlassOutRelationInfo::getCell, request.getCell())
                .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START));
        if (CollectionUtil.isNotEmpty(outRelationInfos)) {
            log.info("有正在执行的任务");
            return null;
        }
        info.setFlowCardId(flowCardId);
        info.setCell(cell);
        //保存任务关系主表
        info.setFlowCardId(request.getFlowCardId());
        info.setCell(request.getCell());
        info.setIsForce(isForce);
        info.setTotalLayer(glassInfo.getTotalLayer());
        info.setState(Const.HOLLOW_FLOW_CARD_START);
        info.setTotalPairQuantity(totalPairQuantity);
        List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(flowCardId, cell);
        int isPairCount = glassInfo.getTotalLayer() * totalPairQuantity;
        info.setState(Const.HOLLOW_FLOW_CARD_NEW);
        info.setTotalPairQuantity(request.getTotalPairQuantity());
        this.save(info);
        //保存任务详情表
        HollowGlassOutRelationTaskDetails taskDetails = new HollowGlassOutRelationTaskDetails();
        BeanUtils.copyProperties(request, taskDetails);
        taskDetails.setRelationId(info.getId());
        hollowGlassOutRelationTaskDetailsService.save(taskDetails);
        // 查询出需要出玻璃的队列
        List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService
                .queryOutGlassList(request.getFlowCardId(), request.getCell());
        int isPairCount = glassInfo.getTotalLayer() * request.getTotalPairQuantity();
        List<HollowGlassQueueInfo> hollowQueues = new ArrayList<>();
        loop:
        for (HollowBigStorageCageDetails queue : hollowBigStorageCageDetailsList) {
            HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
            BeanUtils.copyProperties(queue, queueInfo);
            queueInfo.setRelationId(info.getId());
            queueInfo.setState(Const.TEMPERING_NEW);
            queueInfo.setCell(cell);
            queueInfo.setCell(request.getCell());
            queueInfo.setCreateTime(new Date());
            queueInfo.setUpdateTime(new Date());
            hollowQueues.add(queueInfo);
            if (queue.getIsPair() == 1){
                isPairCount -=1;
                if (isPairCount == 0){
            if (queue.getIsPair() == 1) {
                isPairCount -= 1;
                if (isPairCount == 0) {
                    break loop;
                }
            }
        }
        hollowGlassQueueInfoService.saveBatch(hollowQueues);
        this.save(info);
        return info;
    }
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationTaskDetailsServiceImpl.java
New file
@@ -0,0 +1,19 @@
package com.mes.hollow.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mes.hollow.entity.HollowGlassOutRelationTaskDetails;
import com.mes.hollow.mapper.HollowGlassOutRelationTaskDetailsMapper;
import com.mes.hollow.service.HollowGlassOutRelationTaskDetailsService;
import org.springframework.stereotype.Service;
/**
 * (HollowGlassOutRelationTaskDetails)表服务实现类
 *
 * @author makejava
 * @since 2024-12-26 22:48:38
 */
@Service
public class HollowGlassOutRelationTaskDetailsServiceImpl extends ServiceImpl<HollowGlassOutRelationTaskDetailsMapper, HollowGlassOutRelationTaskDetails> implements HollowGlassOutRelationTaskDetailsService {
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollowqueue/entity/HollowGlassQueueInfo.java
@@ -20,6 +20,11 @@
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * /*大理片笼详情表id
     */
    private Long relationId;
    /**
     * /*设备id
     */