严智鑫
2024-05-11 147e949e6ed8bb2c6cd68bd2fcc518405fd38d34
springboot-vue3/src/main/java/com/example/springboot/service/StorageCageService.java
@@ -223,7 +223,7 @@
            homeMapper.DeleteStroageCageByCell(cell);
        } else {
            homeMapper.updateStroageCageByCell(cell, num);
            homeMapper.UpdateStroageCageWidthByCell(cell);
            homeMapper.UpdateStroageCageWidthByCell(cell);//修改笼子宽度
        }
        Map<String, Object> map = new HashMap<>();
        map.put("message", "200");
@@ -250,6 +250,7 @@
        homeMapper.FinishTask(storageTask.getId());// 完成任务
        if (storageTask.getTaskType().equals("0")) {
            UpdateStroageCageByCell(Integer.parseInt(storageTask.getLoadrack()), 1);// 玻璃数量+1
            homeMapper.DeletequeueByGlassid(storageTask.getGlassId());
        } else {
            StorageCage storageCage = homeMapper.SelectStorageByCell(storageTask.getShelfRack());
            if (storageCage.getNumber() > 1) {
@@ -291,11 +292,11 @@
    }
    // 开始任务
    public Result ClaimTasks(String flowcard, Integer state) {
    public Result ClaimTasks(String flowcard, Integer state, Integer line) {
        if (state == 1) {
            homeMapper.ClaimTasks(flowcard, 0);
            homeMapper.ClaimTasks(flowcard, 0,line);
        } else {
            homeMapper.ClaimTasks(flowcard, 1);
            homeMapper.ClaimTasks(flowcard, 1,line);
        }
        Map<String, Object> map = new HashMap<>();
        map.put("message", "200");
@@ -317,8 +318,10 @@
    // 修改测量信息
    public Result UpdateQueue(GlassInfo glassInfo) {
        homeMapper.UpdateQueue(glassInfo.getFlowcard(), glassInfo.getWidth(), glassInfo.getHeight(),
                glassInfo.getGlasstype());
                glassInfo.getGlasstype(),glassInfo.getThickness(),glassInfo.getTier());
        Map<String, Object> map = new HashMap<>();
        PlcParameterObject plcmes=PLCAutoMes.PlcMesObject;
        S7control.getinstance().WriteWord(plcmes.getPlcParameter("MESToGaStatus").getAddress(),(short) 1);
        map.put("message", "200");
        return Result.success(map);
    }
@@ -399,6 +402,7 @@
        System.out.println(RemoveErrorData.size());
        // 处理完成 添加数据库
        int count=1;
        for (Map map : RemoveErrorData) {
            String key = map.get("base").toString() + "_" + map.get("height").toString() + "_"
                       + map.get("thickness").toString() + "_" + map.get("films").toString();
@@ -409,18 +413,23 @@
            Integer glasstype;
            if (TypeData.get(key) == null) {
                glasstype = homeMapper.SelectMaxType();
                if (glasstype==null) {
                    glasstype=1;
                }
            } else {
                glasstype = Integer.valueOf(value);
            }
            //
            homeMapper.AddGlassinfo(map.get("order").toString(), glasstype,
                    Integer.parseInt(map.get("matching").toString()) // 需要计算 配片ID
                    , glasstype+"" // 需要计算 玻璃ID
                    ,map.get("order").toString()+"-"+count+"" // 需要计算 玻璃ID
                    , Integer.parseInt(map.get("tier").toString()), map.get("films").toString(),
                    Double.parseDouble(map.get("base").toString()), Double.parseDouble(map.get("height").toString()),
                    Double.parseDouble(map.get("thickness").toString()),
                    Integer.parseInt(map.get("quantity").toString()),groupby.get(tierkey));// 需要计算总层数
            //订单内总层数
            homeMapper.InsertFlowcard(map.get("order").toString(),OrderFinishedProduct.get(tierkey+"_Sum")); 
            count++;
        }
        Map<String, Object> ResultCode = new HashMap<>();
        ResultCode.put("message", "200");