1、手动生成李赛克文件功能已完成、待联调
2、对接除膜机,调整对应的交互
3、中空两条线新增空闲信号,优先李赛克线优先
4、fixbug:指定工程后增加版图id排序,优先炉号从小到大,版序从小到大
15个文件已修改
2个文件已添加
519 ■■■■ 已修改文件
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowFormulaDetails.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/LisecHollowGlassDetails.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/OrderDTO.java 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassOutRelationInfoMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/templates/hollowGlass.ftl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
@@ -288,7 +288,7 @@
        //是否有正在钢化的玻璃:钢化小片表关联历史任务表,筛选未出笼的玻璃信息
//            获取当前钢化任务未完成出片的玻璃信息
        List<TemperingGlassInfo> unFinishTemperingGlassInfoList = temperingGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>()
                .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW).orderByAsc(TemperingGlassInfo::getTemperingFeedSequence));
                .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW).orderByAsc(TemperingGlassInfo::getTemperingLayoutId).orderByAsc(TemperingGlassInfo::getTemperingFeedSequence));
        if (CollectionUtil.isNotEmpty(unFinishTemperingGlassInfoList)) {
            log.info("有正在出片的钢化任务");
            computeOutGlassInfoByVirtualSlot(unFinishTemperingGlassInfoList, "big_storage_cage_out_one_task", temperingOutTargetPosition, Const.GLASS_STATE_OUT_ING, Const.BIG_STORAGE_BEFORE_OUT);
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/controller/HollowGlassOutRelationInfoController.java
@@ -13,6 +13,7 @@
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
/**
@@ -93,5 +94,11 @@
        return Result.build(200, "修改成功", hollowGlassOutRelationInfoService.dispatchHollowSwitch(flag));
    }
    @ApiOperation("手动生成李赛克文件")
    @PostMapping("/generateHollowLisecFile")
    public Result<String> generateHollowLisecFile(String flowCardId, int cell, int isForce) throws IOException {
        return Result.build(200, "修改成功", hollowGlassOutRelationInfoService.generateHollowLisecFile(flowCardId, cell, isForce));
    }
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/HollowFormulaDetails.java
@@ -34,29 +34,29 @@
     * 分割线
     */
    @ApiModelProperty(value = "间隔板1代码 930专用")
    private Integer frameOne;
    private String frameOne;
    @ApiModelProperty(value = "间隔板2代码 930专用")
    private Integer frameTwo;
    private String frameTwo;
    @ApiModelProperty(value = "间隔板3代码 930专用")
    private Integer frameThree;
    private String frameThree;
    @ApiModelProperty(value = "间隔板4代码 930专用")
    private Integer frameFour;
    private String frameFour;
    @ApiModelProperty(value = "密封嵌入 930专用")
    private Integer sealInsert;
    private String sealInsert;
    @ApiModelProperty(value = "气体1(0无 1有) 930专用")
    private Integer casOne;
    private String casOne;
    @ApiModelProperty(value = "气体2(0无 1有) 930专用")
    private Integer casTwo;
    private String casTwo;
    @ApiModelProperty(value = "气体3(0无 1有) 930专用")
    private Integer casThree;
    private String casThree;
    @ApiModelProperty(value = "气体4(0无 1有) 930专用")
    private Integer casFour;
    private String casFour;
    @ApiModelProperty(value = "间隔框类型(tps胶为05 铝间隔条01) 930专用")
    private Integer intervalFrameType;
    private String intervalFrameType;
    @ApiModelProperty(value = "间隔框宽度 930专用")
    private Integer intervalFrameWidth;
    private String intervalFrameWidth;
    @ApiModelProperty(value = "间隔框高度 930专用")
    private Integer intervalFrameHeight;
    private String intervalFrameHeight;
    /**
     * 创建时间
     */
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/LisecHollowGlassDetails.java
@@ -14,7 +14,7 @@
    //项目数量指数(如果所有记录相同,则为0)    用0填充即可
    private String itemInx = "0";
    //玻璃描述    任意字符填充
    private String descript = "0";
    private String descript = "8-0";
    //玻璃表面类型(0浮动 1软涂层 2图案 3硬涂层)    与玻璃表面类型有关,填0-5之间的常数 用0填充即可
    private String surface = "0";
    //厚度 mm*10
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/entity/dto/OrderDTO.java
New file
@@ -0,0 +1,185 @@
package com.mes.hollow.entity.dto;
import lombok.Data;
import java.util.Date;
/**
 * @Author : zhoush
 * @Date: 2025/1/3 9:36
 * @Description:
 */
@Data
public class OrderDTO {
    /**
     * <订单表>
     */
    private Integer id;
    /**
     * 订单Id
     */
    private String orderId;
    /**
     * 项目名称
     */
    private String project;
    /**
     * 客户Id
     */
    private Long customerId;
    /**
     * 客户名称
     */
    private String customerName;
    /**
     * 订单类型
     */
    private String orderType;
    /**
     * 订单分类
     */
    private String orderClassify;
    /**
     * 商标选项
     */
    private String icon;
    /**
     * 包装方式
     */
    private String packType;
    /**
     * 送货时间
     */
    private Date deliveryDate;
    /**
     * 批次
     */
    private String batch;
    /**
     * 计算方式
     */
    private Integer calculateType;
    /**
     * 销售人员Id
     */
    private String salesmanId;
    /**
     * 销售人
     */
    private String salesman;
    /**
     * 铝条方式
     */
    private String alType;
    /**
     * 金额
     */
    private Double money;
    /**
     * 合同编号
     */
    private String contractId;
    /**
     * 客户批次
     */
    private String customerBatch;
    /**
     * 联系人
     */
    private String contacts;
    /**
     * 联系电话
     */
    private String contactNumber;
    /**
     * 送货地址
     */
    private String deliveryAddress;
    /**
     * 其他金额
     */
    private Double otherMoney;
    /**
     * 其他金额备注
     */
    private String otherMoneyRemarks;
    /**
     * 订单加工备注
     */
    private String processingNote;
    /**
     * 其他备注
     */
    private String otherRemarks;
    /**
     * 面积
     */
    private Double area;
    /**
     * 数量
     */
    private Long quantity;
    /**
     * 周长
     */
    private String perimeter;
    /**
     * 审核人id
     */
    private String verifierId;
    /**
     * 审核人
     */
    private String verifier;
    /**
     * 创建人id
     */
    private String creatorId;
    /**
     * 创建人
     */
    private String creator;
    /**
     * 下单
     */
    private Integer createOrder;
    /**
     * 工艺审核
     */
    private Integer processReview;
    /**
     * 订单审核
     */
    private Integer orderReview;
    /**
     * 生产订单
     */
    private Integer productionOrder;
    /**
     * 流程卡
     */
    private Integer processingCard;
    /**
     * 入库
     * 未入库状态0,未完全入库状态1,完全入库状态2
     */
    private Integer warehousing;
    /**
     * 发货
     */
    private Integer delivery;
    /**
     * 打印次数
     */
    private Integer printingNumber;
    /**
     * 创建日期
     */
    private Date createTime;
    /**
     * 修改时间
     */
    private Date updateTime;
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassOutRelationInfoMapper.java
@@ -2,6 +2,8 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.dto.OrderDTO;
import org.apache.ibatis.annotations.Param;
/**
 * (HollowGlassOutRelationInfo)表数据库访问层
@@ -11,5 +13,6 @@
 */
public interface HollowGlassOutRelationInfoMapper extends BaseMapper<HollowGlassOutRelationInfo> {
    OrderDTO queryOrderByFlowCardId(@Param("flowCardId") String flowCardId);
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
@@ -23,5 +23,7 @@
    List<HollowGlassDetailsDTO> queryFlowCardIdLayerGlassInfo(@Param("flowCardId") String flowCardId, @Param("totalLayer") int totalLayer, @Param("layer") int layer);
    List<LackDetailsDTO> queryLackByFlowCard(String flowCardId);
    int queryLayerByFlowCardId(@Param("flowCardId") String flowCardId);
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassOutRelationInfoService.java
@@ -5,6 +5,7 @@
import com.mes.hollow.entity.request.HollowTaskRequest;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import java.io.IOException;
import java.util.List;
/**
@@ -32,5 +33,7 @@
    Boolean finishTask(String flowCardId, int cell);
    Boolean deleteHollowTaskDetails(String flowCardId, int cell);
    String generateHollowLisecFile(String flowCardId, int cell, int isForce) throws IOException;
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/HollowGlassRelationInfoService.java
@@ -31,7 +31,9 @@
    Map<String, List<FlowCardGlassInfoDTO>> queryHollowAllFlowCard(HollowBigStorageDetailsQueryVO query);
    Map<Integer, List<LackDetailsDTO>>  queryLackByFlowCard(String flowCardId);
    Map<Integer, List<LackDetailsDTO>> queryLackByFlowCard(String flowCardId);
    int queryLayerByFlowCardId(String flowCardId);
//    List<LackDetailsDTO> queryLackByFlowCard(String flowCardId);
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -7,23 +7,34 @@
import com.mes.common.config.Const;
import com.mes.glassinfo.entity.GlassInfo;
import com.mes.glassinfo.service.GlassInfoService;
import com.mes.hollow.controller.HollowBigStorageCageController;
import com.mes.hollow.entity.HollowBigStorageCageDetails;
import com.mes.hollow.entity.HollowFormulaDetails;
import com.mes.hollow.entity.HollowGlassOutRelationInfo;
import com.mes.hollow.entity.HollowGlassRelationInfo;
import com.mes.hollow.entity.dto.*;
import com.mes.hollow.entity.request.HollowTaskRequest;
import com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper;
import com.mes.hollow.service.HollowBigStorageCageDetailsService;
import com.mes.hollow.service.HollowFormulaDetailsService;
import com.mes.hollow.service.HollowGlassOutRelationInfoService;
import com.mes.hollow.service.HollowGlassRelationInfoService;
import com.mes.hollowqueue.entity.HollowGlassQueueInfo;
import com.mes.hollowqueue.service.HollowGlassQueueInfoService;
import com.mes.utils.Blank;
import com.mes.utils.RedisUtil;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.Version;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -42,9 +53,15 @@
    HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService;
    @Resource
    HollowGlassQueueInfoService hollowGlassQueueInfoService;
    @Resource
    HollowFormulaDetailsService hollowFormulaDetailsService;
    @Resource
    HollowGlassRelationInfoService hollowGlassRelationInfoService;
    @Resource
    RedisUtil redisUtil;
    private static final int ID_RATIO = 10;
    @Override
    public HollowGlassOutRelationInfo receiveTask(HollowTaskRequest request) {
@@ -135,6 +152,143 @@
        return Boolean.TRUE;
    }
    @Override
    public String generateHollowLisecFile(String flowCardId, int cell, int isForce) throws IOException {
        List<HollowGlassOutRelationInfo> outRelationList = 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::getFlowCardId, flowCardId)
                .eq(HollowGlassOutRelationInfo::getCell, cell));
        if (CollectionUtil.isEmpty(outRelationList) || outRelationList.size() != 1) {
            return "本条线不存在该流程任务或者同流程卡任务数大于1";
        }
        HollowGlassOutRelationInfo relationInfo = outRelationList.get(0);
        if (relationInfo.getTotalLayer() < 2) {
            return "任务总层数小于2,不生成李赛克文件";
        }
        //获取订单相关信息
        OrderDTO order = baseMapper.queryOrderByFlowCardId(flowCardId);
        if (null == order) {
            return "生成失败,相关订单信息不存在";
        }
        //获取配方相关信息
        HollowFormulaDetails formulaDetails = hollowFormulaDetailsService.getById(relationInfo.getFormulaId());
        if (null == formulaDetails) {
            return "生成失败,相关配方信息不存在";
        }
        //总层数是否与进笼关系表内层数数量相同,层数相同生成继续,不同结束
        int layerCount = hollowGlassRelationInfoService.queryLayerByFlowCardId(flowCardId);
        if (layerCount != relationInfo.getTotalLayer() && isForce == 0) {
            return "生成失败,该流程卡内层数与进笼关系表内层数数量不相同";
        }
        //设置文件的主体内容
        LisecHollowDetails details = new LisecHollowDetails();
        String randomNumber = "" + (int) (Math.random() * 100000 + 100000);
        details.setBcdStart(randomNumber);
        details.setBatchNo(randomNumber);
        details.setOrd(relationInfo.getFlowCardId().substring(2, 9));
        details.setCustNum(order.getCustomerId() + "");
        details.setCustNam(order.getCustomerName());
        details.setProDate((new SimpleDateFormat("dd/MM/yyyy").format(new Date())));
        details.setDelDate(new SimpleDateFormat("dd/MM/yyyy").format(order.getDeliveryDate()));
        //设置文件第一层列表数据
        //暂时生成笼内所有的玻璃信息(已配对和未配对的)
        List<HollowGlassRelationInfo> hollowGlassRelationInfos = hollowGlassRelationInfoService.list(new LambdaQueryWrapper<HollowGlassRelationInfo>()
                .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId).orderByAsc(HollowGlassRelationInfo::getHollowSequence));
        Map<Integer, List<HollowGlassRelationInfo>> listMap = hollowGlassRelationInfos.stream().collect(Collectors.groupingBy(HollowGlassRelationInfo::getHollowSequence));
        //设置间隔板数据共所有配对玻璃使用
        List<LisecHollowFrameDetails> frameList = new ArrayList<>();
        for (int i = 1; i < relationInfo.getTotalLayer(); i++) {
            LisecHollowFrameDetails frameDetails = new LisecHollowFrameDetails();
            frameDetails.setRecType("<FR" + i + ">");
            frameDetails.setType(formulaDetails.getIntervalFrameType());
            frameDetails.setWidth(formulaDetails.getIntervalFrameWidth());
            frameDetails.setHeight(formulaDetails.getIntervalFrameHeight());
            frameList.add(frameDetails);
        }
        List<LisecHollowGlassAndFrameDetails> glassAndFrameList = new ArrayList<>();
        listMap.forEach((e, v) -> {
            LisecHollowGlassAndFrameDetails glassAndFrame = new LisecHollowGlassAndFrameDetails();
            List<LisecHollowGlassDetails> glassList = new ArrayList<>();
            for (int i = 1; i <= v.size(); i++) {
                LisecHollowGlassDetails hollowGlassDetails = new LisecHollowGlassDetails();
                hollowGlassDetails.setRecType("<GL" + i + ">");
                hollowGlassDetails.setThickness((int) (v.get(i - 1).getThickness() * 10) + "");
                hollowGlassDetails.setPaneBcd(randomNumber + "" + (e * ID_RATIO + i));
                glassList.add(hollowGlassDetails);
            }
            glassAndFrame.setGlassList(glassList);
            glassAndFrame.setFrameList(frameList);
            glassAndFrame.setItemNum(e + "");
            glassAndFrame.setIdNum(e + "");
            glassAndFrame.setBarcode(randomNumber.substring(randomNumber.length() - 3));
            glassAndFrame.setWidth((int) (v.get(0).getWidth() * 10) + "");
            glassAndFrame.setHeight((int) (v.get(0).getHeight() * 10) + "");
            glassAndFrame.setGlass1(e * ID_RATIO + 1 + "");
            glassAndFrame.setFrame1(formulaDetails.getFrameOne());
            glassAndFrame.setGasCode1(formulaDetails.getCasOne());
            if (relationInfo.getTotalLayer() == 2) {
                glassAndFrame.setGlass2(e * ID_RATIO + 2 + "");
            } else if (relationInfo.getTotalLayer() == 3) {
                glassAndFrame.setGlass2(e * ID_RATIO + 2 + "");
                glassAndFrame.setFrame2(formulaDetails.getFrameTwo());
                glassAndFrame.setGasCode2(formulaDetails.getCasTwo());
                glassAndFrame.setGlass3(e * ID_RATIO + 3 + "");
            } else if (relationInfo.getTotalLayer() == 4) {
                glassAndFrame.setGlass2(e * ID_RATIO + 2 + "");
                glassAndFrame.setFrame2(formulaDetails.getFrameTwo());
                glassAndFrame.setGasCode2(formulaDetails.getCasTwo());
                glassAndFrame.setGlass3(e * ID_RATIO + 3 + "");
                glassAndFrame.setFrame3(formulaDetails.getFrameThree());
                glassAndFrame.setGasCode3(formulaDetails.getCasThree());
                glassAndFrame.setGlass4(e * ID_RATIO + 4 + "");
            } else {
                glassAndFrame.setGlass2(e * ID_RATIO + 2 + "");
                glassAndFrame.setFrame2(formulaDetails.getFrameTwo());
                glassAndFrame.setGasCode2(formulaDetails.getCasTwo());
                glassAndFrame.setGlass3(e * ID_RATIO + 3 + "");
                glassAndFrame.setFrame3(formulaDetails.getFrameThree());
                glassAndFrame.setGasCode3(formulaDetails.getCasThree());
                glassAndFrame.setGlass4(e * ID_RATIO + 4 + "");
                glassAndFrame.setFrame3(formulaDetails.getFrameFour());
                glassAndFrame.setGasCode4(formulaDetails.getCasFour());
                glassAndFrame.setGlass4(e * ID_RATIO + 5 + "");
            }
            glassAndFrame.setInset(formulaDetails.getSealInsert());
            glassAndFrameList.add(glassAndFrame);
        });
        details.setGlassAndFrameList(glassAndFrameList);
        Configuration cfg = new Configuration(new Version("2.3.29"));
        cfg.setClassForTemplateLoading(HollowBigStorageCageController.class, "/templates/");
        // 创建Calculator实例
        Blank blank = new Blank();
        // 创建数据模型
        Map<String, Object> root = new HashMap<>();
        root.put("blank", blank);
        root.put("details", details);
        // 获取模板
        Template temp = cfg.getTemplate("hollowGlass.ftl");
        // 将生成的文件存入指定路径
        //计算生成李赛克需要的数据给到每个属性
        StringWriter out = new StringWriter();
        File file = new File("D:\\temp", relationInfo.getFlowCardId() + randomNumber.substring(randomNumber.length() - 3) + ".trf");
        try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
            temp.process(root, out);
            writer.write(out.toString());
        } catch (TemplateException | IOException e) {
            e.printStackTrace();
        }
        return "success";
    }
    private HollowGlassOutRelationInfo childrenTask(HollowTaskRequest request, int isForce) {
        GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>().eq(GlassInfo::getFlowCardId, request.getFlowCardId()).last("limit 1"));
@@ -183,6 +337,13 @@
            }
        }
        hollowGlassQueueInfoService.saveBatch(hollowQueues);
        try {
            if (request.getCell() == 930) {
                generateHollowLisecFile(request.getFlowCardId(), 930, isForce);
            }
        } catch (Exception e) {
            log.info("生成李赛克文件时发生异常,流程卡号为{}", request.getFlowCardId());
        }
        return info;
    }
}
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -287,7 +287,12 @@
        Map<Integer, List<LackDetailsDTO>> listMap = lackDetailsList.stream().collect(Collectors.groupingBy(LackDetailsDTO::getLayer));
        return listMap;
    }
//    @Override
    @Override
    public int queryLayerByFlowCardId(String flowCardId) {
        return baseMapper.queryLayerByFlowCardId(flowCardId);
    }
    //    @Override
//    public List<LackDetailsDTO> queryLackByFlowCard(String flowCardId) {
//        List<LackDetailsDTO> lackDetailsList = this.baseMapper.queryLackByFlowCard(flowCardId);
//        return lackDetailsList;
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcHollowRemoveTask.java
@@ -73,12 +73,12 @@
        if (detailsVO.getFilmRemove() == 0) {
            // 10111011
            int sendId = request & 273;
            int sendId = request & 63;
            sendId = sendId + 4;
            wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
        } else {
            // 先将对应的位置为0,获得请求的玻璃数据, 然后将对应位值     110111011
            int sendId = request & 273;
            int sendId = request & 63;
            sendId = sendId + 4 + 64;
            wordlist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "mesControl", sendId));
            ualist.add(opcPlcStorageCageHollowTask.generateReadWriteEntity(cell + "glassTop", detailsVO.getTopRemove()));
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageHollowTask.java
@@ -285,12 +285,11 @@
        }
        //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度
        ReadWriteEntity oneEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outOneRequest");
        ReadWriteEntity twoEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outTwoRequest");
        ReadWriteEntity threeEntity = miloService.readFromOpcUa("DLP2B.DLP2B.outThreeRequest");
        int cell = -1;
        ReadWriteEntity oneEntity = miloService.readFromOpcUa("CMJ1.CMJ1.isFree");
        HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null;
        if ("1".equals(oneEntity.getValue() + "")) {
        int cell = -1;
        //李赛克线需要获取韩江plc的线路空闲状态:10000000第8位为 1表示忙碌 0表示空闲
        if (null != oneEntity.getValue() && "1".equals(oneEntity.getValue() + "")) {
            cell = 930;
            hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                    .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
@@ -298,7 +297,9 @@
                            .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                    );
        }
        if (1 == 1 || null == hollowGlassOutRelationInfo && "1".equals(twoEntity.getValue() + "")) {
        ReadWriteEntity twoEntity = miloService.readFromOpcUa("ZKQ2.ZKQ2.isFree");
        if (null == hollowGlassOutRelationInfo && null != twoEntity.getValue() && Boolean.parseBoolean(twoEntity.getValue() + "")) {
            cell = 931;
            hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                    .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
@@ -306,14 +307,7 @@
                            .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                    );
        }
        if (null == hollowGlassOutRelationInfo && "1".equals(threeEntity.getValue() + "")) {
            cell = 932;
            hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService
                    .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                            .eq(HollowGlassOutRelationInfo::getCell, cell)
                            .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START)
                    );
        }
        if (null != hollowGlassOutRelationInfo) {
            //是否允许中空
            //是否有正在中空的玻璃:中空小片表筛选未出笼的玻璃信息
@@ -337,63 +331,6 @@
                        .eq(HollowGlassOutRelationInfo::getCell, hollowGlassOutRelationInfo.getCell())
                        .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS));
            }
//            if (redisUtil.getCacheObject("hollowSwitch")) {
//                List<HollowGlassOutRelationInfo> HollowGlassOutRelationInfoList = hollowGlassOutRelationInfoService
//                        .list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
//                                .eq(HollowGlassOutRelationInfo::getCell, cell)
//                                .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW));
//                for (HollowGlassOutRelationInfo e : HollowGlassOutRelationInfoList) {
//                    //中空优先:获取理片笼  玻璃小片  破损表 数量   判断笼内版图是否到齐
//                    List<FlowCardGlassInfoDTO> flowCardGlassInfoDTO = hollowBigStorageCageDetailsService.hollowIsAll(e.getFlowCardId(), e.getTotalLayer(), Boolean.TRUE);
//                    if (CollectionUtil.isNotEmpty(flowCardGlassInfoDTO)) {
//                        //玻璃到齐包括已出片的
//                        //到齐,将玻璃小片数据存入中空小片表,逻辑生成出片任务  结束
//                        for (FlowCardGlassInfoDTO item : flowCardGlassInfoDTO) {
//                            List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(item.getFlowCardId(), cell);
//                            int finalCell = cell;
//                            List<HollowGlassQueueInfo> hollowQueues = hollowBigStorageCageDetailsList.stream().map(queue -> {
//                                HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
//                                BeanUtils.copyProperties(queue, queueInfo);
//                                queueInfo.setState(Const.TEMPERING_NEW);
//                                queueInfo.setCell(finalCell);
//                                return queueInfo;
//                            }).collect(Collectors.toList());
//
//                            List<HollowBigStorageCageDetails> hollowBigStorageCageDetailsList = hollowBigStorageCageDetailsService.queryOutGlassList(flowCardId, cell);
//                            int isPairCount = glassInfo.getTotalLayer() * e.getTotalLayer();
//                            List<HollowGlassQueueInfo> hollowQueues = new ArrayList<>();
//                            loop:
//                            for (HollowBigStorageCageDetails queue : hollowBigStorageCageDetailsList) {
//                                HollowGlassQueueInfo queueInfo = new HollowGlassQueueInfo();
//                                BeanUtils.copyProperties(queue, queueInfo);
//                                queueInfo.setState(Const.TEMPERING_NEW);
//                                queueInfo.setCell(cell);
//                                hollowQueues.add(queueInfo);
//                                if (queue.getIsPair() == 1){
//                                    isPairCount -=1;
//                                    if (isPairCount == 0){
//                                        break loop;
//                                    }
//                                }
//                            }
//
//                            if (CollectionUtil.isNotEmpty(hollowQueues)) {
//                                hollowGlassQueueInfoService.saveBatch(hollowQueues);
//                                Integer isPair = hollowQueues.get(0).getIsPair();
//                                hollowOutGlassByIsPair(hollowQueues, cell, isPair, e.getTotalLayer());
//                                //将中空任务状态改为开始
//                                hollowGlassOutRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>()
//                                        .eq(HollowGlassOutRelationInfo::getFlowCardId, e.getFlowCardId())
//                                        .eq(HollowGlassOutRelationInfo::getCell, cell)
//                                        .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START));
//                                Date endDate = new Date();
//                                log.info("大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime());
//                                return;
//                            }
//                        }
//                    }
//                }
//            }
        }
//        redisUtil.setCacheObject("dispatchHollowSwitch",true);
        //是否存在需要内部调度的格子:执行内部调度任务
hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -56,13 +56,13 @@
    @Scheduled(fixedDelay = 1000)
    public void hollowGlassTask() {
        List<HollowGlassOutRelationInfo> taskList = hollowGlassOutRelationInfoService.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START, Const.HOLLOW_FLOW_CARD_PAUSE));
                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START));
        if (CollectionUtil.isEmpty(taskList)) {
            return;
        }
        JSONObject jsonObject = new JSONObject();
        List<String> flowCardIdList = taskList.stream().map(HollowGlassOutRelationInfo::getFlowCardId).collect(Collectors.toList());
        List<HollowGlassQueueInfo> list = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>().in(HollowGlassQueueInfo::getFlowCardId, flowCardIdList));
        List<Long> taskIdList = taskList.stream().map(HollowGlassOutRelationInfo::getId).collect(Collectors.toList());
        List<HollowGlassQueueInfo> list = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>().in(HollowGlassQueueInfo::getRelationId, taskIdList));
        Map<Integer, List<HollowGlassQueueInfo>> listMap = list.stream().collect(Collectors.groupingBy(HollowGlassQueueInfo::getCell));
        jsonObject.append("930", listMap.get(930));
        jsonObject.append("931", listMap.get(931));
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassOutRelationInfoMapper.xml
New file
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper">
    <select id="queryOrderByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDTO">
        select t1.*
        from pp.flow_card t
                 inner join sd.order t1 on t.order_id = t1.order_id
        where t.process_id = #{flowCardId}
        limit 1
    </select>
</mapper>
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -124,4 +124,9 @@
        from relation_length
        group by flow_card_id, layer, films_id, first_length, second_Length, thickness
    </select>
    <select id="queryLayerByFlowCardId" resultType="java.lang.Integer">
        select count(distinct layer)
        from hollow_glass_relation_info
        where flow_card_id = #{flowCardId}
    </select>
</mapper>
hangzhoumesParent/moduleService/howllowGlassModule/src/main/resources/templates/hollowGlass.ftl
@@ -1,12 +1,12 @@
${details.relRecType}|${details.relNumber}|${blank.computeBlank(details.relInfo,40)}
${details.bthRecType}|${blank.computeBlank(details.bathInfo,10)}|${blank.computeBlank(details.bcdStart,6)}|${blank.computeBlank(details.batchNo,8)}
${details.ordRecType}|${blank.computeBlank(details.ord,10)}|${blank.computeBlank(details.custNum,10)}|${blank.computeBlank(details.custNam,40)}|${blank.computeBlank(details.text1,40)}|${blank.computeBlank(details.text2,40)}|${blank.computeBlank(details.text3,40)}|${blank.computeBlank(details.text4,40)}|${blank.computeBlank(details.text5,40)}|${details.proDate}|${details.delDate}|${blank.computeBlank(details.delArea,10)}
${details.bthRecType}|${blank.computeBlank(details.bathInfo,10)}|${blank.computeBlank(details.bcdStart,6)}|${blank.computeZero(details.batchNo,8)}
${details.ordRecType}|${blank.computeZero(details.ord,10)}|${blank.computeBlank(details.custNum,10)}|${blank.computeBlank(details.custNam,40)}|${blank.computeBlank(details.text1,40)}|${blank.computeBlank(details.text2,40)}|${blank.computeBlank(details.text3,40)}|${blank.computeBlank(details.text4,40)}|${blank.computeBlank(details.text5,40)}|${details.proDate}|${details.delDate}|${blank.computeBlank(details.delArea,10)}
<#list details.glassAndFrameList as item>
    ${item.recType}|${blank.computeZero(item.itemNum,5)}|${blank.computeBlank(item.idNum,8)}|${blank.computeZero(item.barcode,4)}|${item.qty}|${blank.computeZero(item.width,6)}|${blank.computeZero(item.height,6)}|${blank.computeBlank(item.glass1,9)}|${blank.computeBlank(item.frame1,9)}|${blank.computeBlank(item.glass2,9)}|${blank.computeBlank(item.frame2,9)}|${blank.computeBlank(item.glass3,9)}|${blank.computeBlank(item.frame3,9)}|${blank.computeBlank(item.glass4,9)}|${blank.computeBlank(item.frame4,9)}|${blank.computeBlank(item.glass5,9)}|${blank.computeZero(item.inset,4)}|${blank.computeZero(item.frameTxt,2)}|${blank.computeZero(item.gasCode1,9)}|${blank.computeZero(item.gasCode2,9)}|${blank.computeZero(item.gasCode3,9)}|${blank.computeZero(item.gasCode4,9)}|${blank.computeZero(item.sealType,9)}|${blank.computeZero(item.frahType,1)}|${blank.computeZero(item.frahHoe,6)}|${blank.computeZero(item.pattDir,1)}|${blank.computeZero(item.dguPane,1)}
    <#list item.glassList as glass>
        ${glass.recType}|${blank.computeZero(glass.itemInx,5)}|${blank.computeBlank(glass.descript,40)}|${blank.computeZero(glass.surface,1)}|${blank.computeZero(glass.thickness,5)}|${blank.computeZero(glass.faceSide,1)}|${blank.computeBlank(glass.ident,10)}|${blank.computeZero(glass.pattDir,1)}|${blank.computeBlank(glass.paneBcd,10)}|${blank.computeZero(glass.prodPane,1)}|${blank.computeZero(glass.prodComp,2)}|${blank.computeZero(glass.gategory,2)}
    </#list>
    <#list item.frameList as frame>
        ${frame.recType}|${blank.computeZero(frame.itemInx,5)}|${blank.computeBlank(frame.descript,40)}|${blank.computeZero(frame.type,2)}|${blank.computeZero(frame.color,2)}|${blank.computeZero(frame.width,5)}|${blank.computeZero(frame.height,5)}|${blank.computeZero(frame.ident,10)}|${blank.computeZero(frame.frameBcd,10)}
        ${frame.recType}|${blank.computeZero(frame.itemInx,5)}|${blank.computeBlank(frame.descript,40)}|${blank.computeZero(frame.type,2)}|${blank.computeZero(frame.color,2)}|${blank.computeZero(frame.width,5)}|${blank.computeZero(frame.height,5)}|${blank.computeBlank(frame.ident,10)}|${blank.computeBlank(frame.frameBcd,10)}
    </#list>
</#list>