From 9ae0e3d68b255dd6df31ea55d9b6eda1a61708dd Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期三, 15 一月 2025 10:13:17 +0800
Subject: [PATCH] 1、测试类报错删除 2、修改opc配置

---
 hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java |  302 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 282 insertions(+), 20 deletions(-)

diff --git a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
index f695563..5099eb5 100644
--- a/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
+++ b/hangzhoumesParent/moduleService/howllowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -1,25 +1,39 @@
 package com.mes.hollow.service.impl;
 
+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.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.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.List;
+import java.io.*;
+import java.text.SimpleDateFormat;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -38,59 +52,307 @@
     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(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) {
+        log.info("鏌ョ湅璇ユ祦绋嬪崱鏄惁鐢辨鍦ㄦ墽琛岀殑浠诲姟锛屾祦绋嬪崱锛歿}", flowCardId);
+        int taskCount = this.count(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));
+        if (taskCount == 0 || taskCount > 1) {
+            log.info("璇ユ祦绋嬪崱涓嶅瓨鍦ㄤ换鍔℃垨鑰呮湁姝e湪鎵ц涓紝鏃犳硶鍐嶆鎵ц");
+            return Boolean.FALSE;
+        }
+        //鏇存柊浠诲姟鐘舵�佷负寮�濮�
+        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;
+    }
+
+    @Override
+    public String generateHollowLisecFile(String flowCardId, int cell, int isForce, int isOut) 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(4, 9) + (int) (Math.random() * 1000 + 1000));
+        details.setCustNum(order.getCustomerId() + "");
+        details.setCustNam("");
+        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));
+        List<HollowBigStorageCageDetails> hollowGlassRelationInfos = hollowBigStorageCageDetailsService.queryPairGlassList(flowCardId, relationInfo.getTotalLayer(), relationInfo.getTotalPairQuantity(), isOut);
+        Map<Integer, List<HollowBigStorageCageDetails>> listMap = hollowGlassRelationInfos.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getHollowSequence));
+
+        //璁剧疆闂撮殧鏉挎暟鎹叡鎵�鏈夐厤瀵圭幓鐠冧娇鐢�
+        List<LisecHollowGlassAndFrameDetails> glassAndFrameList = new ArrayList<>();
+        listMap.forEach((e, v) -> {
+            LisecHollowGlassAndFrameDetails glassAndFrame = new LisecHollowGlassAndFrameDetails();
+            List<LisecHollowGlassDetails> glassList = new ArrayList<>();
+            List<LisecHollowFrameDetails> frameList = new ArrayList<>();
+            for (int i = 1; i <= v.size(); i++) {
+                LisecHollowGlassDetails hollowGlassDetails = new LisecHollowGlassDetails();
+                HollowBigStorageCageDetails glassInfo = v.get(i - 1);
+                hollowGlassDetails.setRecType("<GL" + i + ">");
+                hollowGlassDetails.setThickness((int) (glassInfo.getThickness() * 10) + "");
+                hollowGlassDetails.setDescript(formulaDetails.getIntervalFrameWidthOne() + "-" + (int) (glassInfo.getThickness() * 10));
+                hollowGlassDetails.setPaneBcd(randomNumber + "" + (e * ID_RATIO + i));
+                glassList.add(hollowGlassDetails);
+            }
+            glassAndFrame.setGlassList(glassList);
+
+            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());
+            frameList.add(new LisecHollowFrameDetails("<FR1>", formulaDetails.getIntervalFrameTypeOne(), formulaDetails.getIntervalFrameWidthOne(), formulaDetails.getIntervalFrameHeightOne()));
+            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());
+                frameList.add(new LisecHollowFrameDetails("<FR2>", formulaDetails.getIntervalFrameTypeTwo(), formulaDetails.getIntervalFrameWidthTwo(), formulaDetails.getIntervalFrameHeightTwo()));
+                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());
+                frameList.add(new LisecHollowFrameDetails("<FR2>", formulaDetails.getIntervalFrameTypeTwo(), formulaDetails.getIntervalFrameWidthTwo(), formulaDetails.getIntervalFrameHeightTwo()));
+                glassAndFrame.setGasCode2(formulaDetails.getCasTwo());
+                glassAndFrame.setGlass3(e * ID_RATIO + 3 + "");
+                glassAndFrame.setFrame3(formulaDetails.getFrameThree());
+                frameList.add(new LisecHollowFrameDetails("<FR3>", formulaDetails.getIntervalFrameTypeThree(), formulaDetails.getIntervalFrameWidthThree(), formulaDetails.getIntervalFrameHeightThree()));
+                glassAndFrame.setGasCode3(formulaDetails.getCasThree());
+                glassAndFrame.setGlass4(e * ID_RATIO + 4 + "");
+            } else {
+                glassAndFrame.setGlass2(e * ID_RATIO + 2 + "");
+                glassAndFrame.setFrame2(formulaDetails.getFrameTwo());
+                frameList.add(new LisecHollowFrameDetails("<FR2>", formulaDetails.getIntervalFrameTypeTwo(), formulaDetails.getIntervalFrameWidthTwo(), formulaDetails.getIntervalFrameHeightTwo()));
+                glassAndFrame.setGasCode2(formulaDetails.getCasTwo());
+                glassAndFrame.setGlass3(e * ID_RATIO + 3 + "");
+                glassAndFrame.setFrame3(formulaDetails.getFrameThree());
+                frameList.add(new LisecHollowFrameDetails("<FR3>", formulaDetails.getIntervalFrameTypeThree(), formulaDetails.getIntervalFrameWidthThree(), formulaDetails.getIntervalFrameHeightThree()));
+                glassAndFrame.setGasCode3(formulaDetails.getCasThree());
+                glassAndFrame.setGlass4(e * ID_RATIO + 4 + "");
+                glassAndFrame.setFrame3(formulaDetails.getFrameFour());
+                frameList.add(new LisecHollowFrameDetails("<FR4>", formulaDetails.getIntervalFrameTypeFour(), formulaDetails.getIntervalFrameWidthFour(), formulaDetails.getIntervalFrameHeightFour()));
+                glassAndFrame.setGasCode4(formulaDetails.getCasFour());
+                glassAndFrame.setGlass4(e * ID_RATIO + 5 + "");
+            }
+            glassAndFrame.setInset(formulaDetails.getSealInsert());
+            glassAndFrame.setFrameList(frameList);
+            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(System.getProperty("user.dir") + "/lisec", 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(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;
         }
-        info.setFlowCardId(flowCardId);
-        info.setCell(cell);
+        List<HollowGlassOutRelationInfo> outRelationInfos = this.list(new LambdaQueryWrapper<HollowGlassOutRelationInfo>()
+                .eq(HollowGlassOutRelationInfo::getFlowCardId, request.getFlowCardId())
+                .in(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_NEW, Const.HOLLOW_FLOW_CARD_START, Const.HOLLOW_FLOW_CARD_PAUSE));
+        if (CollectionUtil.isNotEmpty(outRelationInfos)) {
+            log.info("褰撳墠娴佺▼鍗℃湁鏈畬鎴愮殑浠诲姟");
+            return null;
+        }
+        //淇濆瓨浠诲姟鍏崇郴涓昏〃
+        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());
+        info.setFormulaId(request.getFormulaId());
+        this.save(info);
+        // 鏌ヨ鍑洪渶瑕佸嚭鐜荤拑鐨勯槦鍒�
+        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);
+        try {
+            if (request.getCell() == 930) {
+                generateHollowLisecFile(request.getFlowCardId(), 930, isForce, 0);
+            }
+        } catch (Exception e) {
+            log.info("鐢熸垚鏉庤禌鍏嬫枃浠舵椂鍙戠敓寮傚父锛屾祦绋嬪崱鍙蜂负{}", request.getFlowCardId());
+        }
         return info;
     }
 }

--
Gitblit v1.8.0