From db76b45884564e9d0a02cacb4d3b14570307a3eb Mon Sep 17 00:00:00 2001 From: liuxy Date: Fri, 28 Oct 2022 16:24:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mps/service/impl/RawFoilServiceImpl.java | 2 - .../nl/wms/pda/st/rest/CoolInController.java | 13 +- .../nl/wms/pda/st/rest/CoolOutController.java | 46 +++++ .../pda/st/rest/ProductionOutController.java | 46 +++++ .../nl/wms/pda/st/service/CoolInService.java | 15 +- .../nl/wms/pda/st/service/CoolOutService.java | 26 +++ .../pda/st/service/ProductionOutService.java | 26 +++ .../st/service/impl/CoolInServiceImpl.java | 80 ++++++++- .../st/service/impl/CoolOutServiceImpl.java | 69 ++++++++ .../impl/ProductionOutServiceImpl.java | 159 ++++++++++++++++++ .../java/org/nl/wms/pda/st/wql/PDA_COOLIN.wql | 82 +++++++++ .../org/nl/wms/pda/st/wql/PDA_COOLOUT.wql | 82 +++++++++ .../nl/wms/pda/st/wql/PDA_PRODUVTIONOUT.wql | 130 ++++++++++++++ .../org/nl/wms/sch/tasks/CallEmpReelTask.java | 5 +- 14 files changed, 767 insertions(+), 14 deletions(-) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolOutController.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/ProductionOutController.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolOutService.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/ProductionOutService.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolOutServiceImpl.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductionOutServiceImpl.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLIN.wql create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLOUT.wql create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_PRODUVTIONOUT.wql diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java index c5f14f329..b108daed5 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/mps/service/impl/RawFoilServiceImpl.java @@ -317,8 +317,6 @@ public class RawFoilServiceImpl implements RawFoilService { JSONObject jsonCool = coolTab.query("mfg_order_name = '" + raw_jo.getString("mfg_order_name") + "'").uniqueResult(0); - if (!StrUtil.equals(jsonCool.getString("status"), "04")) throw new BadRequestException("工单不为下卷完成"); - jsonCool.put("status", "09"); jsonCool.put("realend_time", DateUtil.now()); jsonCool.put("finish_type", "02"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolInController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolInController.java index 0ee1c4af3..c4cea0946 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolInController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolInController.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** -* @author geng by +* @author liuxy * @date 2022-05-25 **/ @RestController @@ -30,10 +30,17 @@ public class CoolInController { private final CoolInService coolInService; @PostMapping("/coolIOQuery") - @Log("新增生产设备") - @ApiOperation("新增生产设备") + @Log("半成品入库初始化查询") + @ApiOperation("半成品入库初始化查询") public ResponseEntity create(@RequestBody JSONObject whereJson){ return new ResponseEntity<>(coolInService.coolIOQuery(whereJson),HttpStatus.OK); } + @PostMapping("/confirmInstor") + @Log("确认入库") + @ApiOperation("确认入库") + public ResponseEntity confirmInstor(@RequestBody JSONObject whereJson){ + return new ResponseEntity<>(coolInService.confirmInstor(whereJson),HttpStatus.OK); + } + } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolOutController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolOutController.java new file mode 100644 index 000000000..2561b6860 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/CoolOutController.java @@ -0,0 +1,46 @@ + +package org.nl.wms.pda.st.rest; + + +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.annotation.Log; +import org.nl.wms.pda.st.service.CoolInService; +import org.nl.wms.pda.st.service.CoolOutService; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** +* @author liuxy +* @date 2022-05-25 +**/ +@RestController +@RequiredArgsConstructor +@Api(tags = "半成品出库") +@RequestMapping("/api/pda/coolOut") +@Slf4j +public class CoolOutController { + + private final CoolOutService coolOutService; + + @PostMapping("/coolIOQuery") + @Log("半成品出库初始化查询") + @ApiOperation("半成品出库初始化查询") + public ResponseEntity coolIOQuery(@RequestBody JSONObject whereJson){ + return new ResponseEntity<>(coolOutService.coolIOQuery(whereJson),HttpStatus.OK); + } + + @PostMapping("/confirmInstor") + @Log("出库确认") + @ApiOperation("出库确认") + public ResponseEntity confirmInstor(@RequestBody JSONObject whereJson){ + return new ResponseEntity<>(coolOutService.confirmInstor(whereJson),HttpStatus.OK); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/ProductionOutController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/ProductionOutController.java new file mode 100644 index 000000000..83dadaa74 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/rest/ProductionOutController.java @@ -0,0 +1,46 @@ + +package org.nl.wms.pda.st.rest; + + +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.annotation.Log; +import org.nl.wms.pda.st.service.CoolInService; +import org.nl.wms.pda.st.service.ProductionOutService; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** +* @author liuxy +* @date 2022-05-25 +**/ +@RestController +@RequiredArgsConstructor +@Api(tags = "出库确认") +@RequestMapping("/api/pda/st") +@Slf4j +public class ProductionOutController { + + private final ProductionOutService productionOutService; + + @PostMapping("/ivtQuery") + @Log("出库初始化查询") + @ApiOperation("出库初始化查询") + public ResponseEntity ivtQuery(@RequestBody JSONObject whereJson){ + return new ResponseEntity<>(productionOutService.ivtQuery(whereJson),HttpStatus.OK); + } + + @PostMapping("/outConfirm") + @Log("出库确认") + @ApiOperation("出库确认") + public ResponseEntity outConfirm(@RequestBody JSONObject whereJson){ + return new ResponseEntity<>(productionOutService.outConfirm(whereJson),HttpStatus.OK); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolInService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolInService.java index ed783c8d4..319200ba4 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolInService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolInService.java @@ -6,15 +6,22 @@ import com.alibaba.fastjson.JSONObject; /** * @description 服务接口 -* @author geng by +* @author liuxy * @date 2022-05-25 **/ public interface CoolInService { /** - * + * 半成品入库 * @param whereJson / - * @return JSONArray / + * @return JSONObject / */ - JSONArray coolIOQuery(JSONObject whereJson); + JSONObject coolIOQuery(JSONObject whereJson); + + /** + * 入库确认 + * @param whereJson / + * @return JSONObject / + */ + JSONObject confirmInstor(JSONObject whereJson); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolOutService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolOutService.java new file mode 100644 index 000000000..9b582d1f8 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/CoolOutService.java @@ -0,0 +1,26 @@ + +package org.nl.wms.pda.st.service; + +import com.alibaba.fastjson.JSONObject; + +/** +* @description 服务接口 +* @author liuxy +* @date 2022-05-25 +**/ +public interface CoolOutService { + + /** + * 初始查询 + * @param whereJson / + * @return JSONObject / + */ + JSONObject coolIOQuery(JSONObject whereJson); + + /** + * 出库确认 + * @param whereJson / + * @return JSONObject / + */ + JSONObject confirmInstor(JSONObject whereJson); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/ProductionOutService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/ProductionOutService.java new file mode 100644 index 000000000..790874bf1 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/ProductionOutService.java @@ -0,0 +1,26 @@ + +package org.nl.wms.pda.st.service; + +import com.alibaba.fastjson.JSONObject; + +/** +* @description 服务接口 +* @author liuxy +* @date 2022-05-25 +**/ +public interface ProductionOutService { + + /** + * 出库初始化查询 + * @param whereJson / + * @return JSONObject / + */ + JSONObject ivtQuery(JSONObject whereJson); + + /** + * 出库确认 + * @param whereJson / + * @return JSONObject / + */ + JSONObject outConfirm(JSONObject whereJson); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolInServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolInServiceImpl.java index 31dcfeecc..e6ca1e0cd 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolInServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolInServiceImpl.java @@ -2,15 +2,25 @@ package org.nl.wms.pda.st.service.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.util.CodeUtil; +import org.nl.modules.wql.WQL; +import org.nl.modules.wql.core.bean.WQLObject; import org.nl.wms.pda.st.service.CoolInService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; /** - * @author geng by + * @author liuxy * @description 服务实现 * @date 2022-05-25 **/ @@ -19,10 +29,72 @@ import org.springframework.stereotype.Service; @Slf4j public class CoolInServiceImpl implements CoolInService { + @Override + public JSONObject coolIOQuery(JSONObject whereJson) { + JSONObject map = new JSONObject(); + map.put("flag", "1"); + map.put("container_name", whereJson.getString("container_name")); + JSONArray resultJSONArray = WQL.getWO("PDA_COOLIN").addParamMap(map).process().getResultJSONArray(0); + + JSONObject jo = new JSONObject(); + jo.put("data", resultJSONArray); + jo.put("message", "查询成功!"); + return jo; + } @Override - public JSONArray coolIOQuery(JSONObject whereJson) { - - return null; + @Transactional(rollbackFor = Exception.class) + public JSONObject confirmInstor(JSONObject whereJson) { + + WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表 + + Long currentUserId = SecurityUtils.getCurrentUserId(); + String currentUsername = SecurityUtils.getCurrentUsername(); + + JSONObject raw_jo = whereJson.getJSONObject("raw_jo"); + String point_code = whereJson.getString("point_code"); // 终点点位 + String is_bake = whereJson.getString("is_bake"); // 是否烘烤完成 + + // 查询终点在冷却区是否存在 + JSONObject jsonCoolIvt = coolIvtTab.query("point_code = '" + point_code + "' and full_point_status = '01' and is_used = '1'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("此点位不存在或被占用"+point_code); + + /* // 插入冷却区出入库单据 + JSONObject jsonCool = new JSONObject(); + jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1,1).nextId()); + jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE")); + jsonCool.put("io_type", "0"); + jsonCool.put("material_id", ""); + jsonCool.put("pcsn", ""); + jsonCool.put("bill_status", "50"); + jsonCool.put("start_point_code", raw_jo.getString("resource_name")); + jsonCool.put("end_point_code", point_code); + jsonCool.put("create_mode", "03"); + jsonCool.put("create_id", currentUserId); + jsonCool.put("create_name", currentUsername); + jsonCool.put("create_time", DateUtil.now()); + jsonCool.put("update_optid", currentUserId); + jsonCool.put("update_optname", currentUsername); + jsonCool.put("update_time", DateUtil.now()); + jsonCool.put("confirm_optid", currentUserId); + jsonCool.put("confirm_optname", currentUsername); + jsonCool.put("confirm_time", DateUtil.now()); + coolIvtTab.insert(jsonCool);*/ + + // 更新冷却区库存 + jsonCoolIvt.put("full_point_status", "02"); + if (StrUtil.equals(is_bake, "0")) jsonCoolIvt.put("cool_ivt_status", "01"); + if (StrUtil.equals(is_bake, "1")) jsonCoolIvt.put("cool_ivt_status", "03"); + jsonCoolIvt.put("container_name", raw_jo.getString("container_name")); + jsonCoolIvt.put("workorder_id", raw_jo.getString("workorder_id")); + jsonCoolIvt.put("instorage_time", DateUtil.now()); + jsonCoolIvt.put("update_optid", currentUserId); + jsonCoolIvt.put("create_name", currentUsername); + jsonCoolIvt.put("update_time", DateUtil.now()); + coolIvtTab.update(jsonCoolIvt); + + JSONObject result = new JSONObject(); + result.put("message", "入库成功!"); + return result; } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolOutServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolOutServiceImpl.java new file mode 100644 index 000000000..f08c8d7d2 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/CoolOutServiceImpl.java @@ -0,0 +1,69 @@ + +package org.nl.wms.pda.st.service.impl; + + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.wql.WQL; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.wms.pda.st.service.CoolInService; +import org.nl.wms.pda.st.service.CoolOutService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * @author liuxy + * @description 服务实现 + * @date 2022-05-25 + **/ +@Service +@RequiredArgsConstructor +@Slf4j +public class CoolOutServiceImpl implements CoolOutService { + + @Override + public JSONObject coolIOQuery(JSONObject whereJson) { + JSONObject map = new JSONObject(); + map.put("flag", "1"); + map.put("container_name", whereJson.getString("container_name")); + map.put("product_area", whereJson.getString("product_area")); + JSONArray resultJSONArray = WQL.getWO("PDA_COOLOUT").addParamMap(map).process().getResultJSONArray(0); + + JSONObject jo = new JSONObject(); + jo.put("data", resultJSONArray); + jo.put("message", "查询成功!"); + return jo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public JSONObject confirmInstor(JSONObject whereJson) { + + WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表 + String point_code = whereJson.getString("point_code"); // 出库点位 + + // 查询终点在冷却区是否存在 + JSONObject jsonCoolIvt = coolIvtTab.query("point_code = '" + point_code + "' and full_point_status = '02' and is_used = '1'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("此点位不存在或是空位"+point_code); + + // 更新点位状态 + jsonCoolIvt.put("full_point_status", "01"); + jsonCoolIvt.put("cool_ivt_status", "01"); + jsonCoolIvt.put("container_name", ""); + jsonCoolIvt.put("workorder_id", ""); + jsonCoolIvt.put("ivt_qty", 0); + jsonCoolIvt.put("instorage_time", ""); + coolIvtTab.update(jsonCoolIvt); + + JSONObject result = new JSONObject(); + result.put("message", "出库成功!"); + return result; + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductionOutServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductionOutServiceImpl.java new file mode 100644 index 000000000..8886f4730 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/ProductionOutServiceImpl.java @@ -0,0 +1,159 @@ + +package org.nl.wms.pda.st.service.impl; + + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.common.utils.SecurityUtils; +import org.nl.modules.system.util.CodeUtil; +import org.nl.modules.wql.WQL; +import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.wms.pda.st.service.CoolInService; +import org.nl.wms.pda.st.service.ProductionOutService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * @author liuxy + * @description 服务实现 + * @date 2022-05-25 + **/ +@Service +@RequiredArgsConstructor +@Slf4j +public class ProductionOutServiceImpl implements ProductionOutService { + + @Override + public JSONObject ivtQuery(JSONObject whereJson) { + /* option + * 0-生产区查询 + * 1-虚拟区查询 + */ + String option = whereJson.getString("option"); + + JSONObject map = new JSONObject(); + if (StrUtil.equals(option, "0")) map.put("flag", "1"); + if (StrUtil.equals(option, "1")) map.put("flag", "2"); + map.put("box_no", whereJson.getString("box_no")); + map.put("point_code", whereJson.getString("point_code")); + JSONArray resultJSONArray = WQL.getWO("PDA_PRODUVTIONOUT").addParamMap(map).process().getResultJSONArray(0); + + for (int i = 0; i < resultJSONArray.size(); i++) { + JSONObject jsonObject = resultJSONArray.getJSONObject(i); + String isRePrintPackageBoxLabel = jsonObject.getString("isRePrintPackageBoxLabel"); + String isUnPackBox = jsonObject.getString("isUnPackBox"); + + if (StrUtil.equals(isRePrintPackageBoxLabel, "1") || StrUtil.equals(isUnPackBox, "1")) { + jsonObject.put("colro_flag", "1"); + } else { + jsonObject.put("colro_flag", "0"); + } + } + + JSONObject jo = new JSONObject(); + jo.put("data", resultJSONArray); + jo.put("message", "查询成功!"); + return jo; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public JSONObject outConfirm(JSONObject whereJson) { + /* option + * 0-生产区确认 + * 1-虚拟区确认 + */ + + WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表 + WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt"); // 仓位库存表 + WQLObject subTab = WQLObject.getWQLObject("PDM_BI_SubPackageRelation"); // 子卷包装关系表 + WQLObject ioMstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库单主表 + WQLObject ioDtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库单明细表 + WQLObject ioDidsTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDis"); // 出入库单分配表 + + String option = whereJson.getString("option"); + JSONObject box_no = whereJson.getJSONObject("box_no"); + + Long deptId = SecurityUtils.getDeptId(); + Long currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + JSONObject jsonSub = subTab.query("package_box_SN = '" + box_no + "'").uniqueResult(0); + + JSONObject jsonPoint = pointTab.query("vehicle_code = '" + box_no + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); + if (StrUtil.equals(option, "0")) { + /* + * 0 - 生产区确认 + * a.解锁出库点位、清除木箱号 + */ + jsonPoint.put("point_status", "00"); + jsonPoint.put("lock_type", "1"); + jsonPoint.put("vehicle_code", ""); + jsonPoint.put("vehicle_type", ""); + jsonPoint.put("vehicle_qty", 0); + pointTab.update(jsonPoint); + } else { + /* + * 1 - 虚拟区确认 + * a.生成出库单主表、明细表、分配表并确认 + * b.更新库存 + * c.更新点位 + */ + + JSONObject jsonIvt = ivtTab.query("pcsn = '" + jsonSub.getString("container_name") + "'").uniqueResult(0); + + // 生成出库单主表 + JSONObject jsonMst = new JSONObject(); + jsonMst.put("iostorinv_id", IdUtil.getSnowflake(1,1).nextId()); + jsonMst.put("bill_code", CodeUtil.getNewCode("IO_CODE")); + jsonMst.put("io_type", "1"); + jsonMst.put("buss_type", ""); + jsonMst.put("bill_type", ""); + jsonMst.put("biz_date", DateUtil.today()); + jsonMst.put("detail_count", 1); + jsonMst.put("bill_status", "99"); + jsonMst.put("create_mode", "02"); + jsonMst.put("input_optid", currentUserId); + jsonMst.put("input_optname", nickName); + jsonMst.put("input_time", now); + jsonMst.put("update_optid", currentUserId); + jsonMst.put("update_optname", nickName); + jsonMst.put("update_time", now); + jsonMst.put("dis_optid", currentUserId); + jsonMst.put("dis_optname", nickName); + jsonMst.put("dis_time", now); + jsonMst.put("confirm_optid", currentUserId); + jsonMst.put("confirm_optname", nickName); + jsonMst.put("confirm_time", now); + jsonMst.put("sysdeptid", deptId); + jsonMst.put("syscompanyid", deptId); + ioMstTab.insert(jsonMst); + + // 生成出库单明细表 + JSONObject jsonDtl = new JSONObject(); + jsonDtl.put("iostorinvdtl_id", IdUtil.getSnowflake(1,1).nextId()); + jsonDtl.put("iostorinv_id", jsonMst.getString("iostorinv_id")); + jsonDtl.put("seq_no", 1); +// jsonDtl.put("material_id", ""); + jsonDtl.put("pcsn", jsonSub.getString("container_name")); + jsonDtl.put("box_no", box_no); + jsonDtl.put("bill_status", "99"); + jsonDtl.put("qty_unit_id", 1); + jsonDtl.put("qty_unit_name", "KG"); + jsonDtl.put("plan_qty", jsonIvt.getDoubleValue("ivt_qty")); + jsonDtl.put("real_qty", jsonIvt.getDoubleValue("ivt_qty")); + + } + + + return null; + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLIN.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLIN.wql new file mode 100644 index 000000000..ad7906b7d --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLIN.wql @@ -0,0 +1,82 @@ +[交易说明] + 交易名: 半成品入库 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.point_code TYPEAS s_string + 输入.container_name TYPEAS s_string + + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + ( + CASE + der.STATUS + WHEN '01' THEN '开始' + WHEN '02' THEN '空轴搬出' + WHEN '03' THEN '确认下卷' + WHEN '04' THEN '下卷完成' + WHEN '09' THEN '结束' + END + ) AS status_name, + der.mfg_order_name AS mfg_order_name, + der.container_name AS container_name, + ivt.point_code, + der.product_name AS pcsn, + der.theory_height AS theory_height, + der.realstart_time AS realstart_time, + der.realend_time AS realend_time, + der.productin_qty AS productin_qty, + der.agvno AS agvno, + der.product_area AS product_area, + der.update_time AS update_time, + ivt.point_location, + ivt.product_area, + der.workorder_id + FROM + PDM_BI_RawFoilWorkOrder der + LEFT JOIN st_ivt_sbpointivt ivt ON ivt.ext_code = der.resource_name + WHERE + der.is_delete = '0' + + OPTION 输入.container_name <> "" + der.container_name = 输入.container_name + ENDOPTION + + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLOUT.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLOUT.wql new file mode 100644 index 000000000..eba824f3c --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_COOLOUT.wql @@ -0,0 +1,82 @@ +[交易说明] + 交易名: 半成品出库 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.product_area TYPEAS s_string + 输入.container_name TYPEAS s_string + + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + coolIvt.full_point_code AS point_code, + coolIvt.container_name AS container_name, + der.product_name AS product_name, + der.productin_qty AS productin_qty, + hotDtl1.confirm_time AS in_time, + hotDtl2.confirm_time AS out_time, + ( + CASE + coolIvt.cool_ivt_status + WHEN '03' THEN '是' + ELSE '否' + END + ) AS is_bake + FROM + ST_IVT_CoolPointIvt coolIvt + LEFT JOIN PDM_BI_RawFoilWorkOrder der ON der.container_name = der.container_name + LEFT JOIN ST_IVT_HotRegionIOMst hotMst ON hotMst.container_name = coolIvt.container_name + LEFT JOIN ( + SELECT * FROM ST_IVT_HotRegionIODtl WHERE 1=1 ORDER BY confirm_time ASC LIMIT 1 + ) AS hotDtl1 ON hotMst.iostorinv_id = hotDtl1.iostorinv_id + LEFT JOIN ( + SELECT * FROM ST_IVT_HotRegionIODtl WHERE 1=1 ORDER BY confirm_time DESC LIMIT 1 + ) AS hotDtl2 ON hotMst.iostorinv_id = hotDtl1.iostorinv_id + WHERE + coolIvt.full_point_status = '02' + + OPTION 输入.container_name <> "" + coolIvt.container_name = 输入.container_name + ENDOPTION + + OPTION 输入.product_area <> "" + coolIvt.product_area = 输入.product_area + ENDOPTION + + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_PRODUVTIONOUT.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_PRODUVTIONOUT.wql new file mode 100644 index 000000000..3490ae602 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_PRODUVTIONOUT.wql @@ -0,0 +1,130 @@ +[交易说明] + 交易名: 成品出库 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.point_code TYPEAS s_string + 输入.box_no TYPEAS s_string + + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + sub.package_box_SN AS package_box_SN, + sub.container_name AS container_name, + sub.product_name AS product_name, + sub.product_description AS product_description, + sub.net_weight AS net_weight, + ( + CASE + sub.isRePrintPackageBoxLabel + WHEN '1' THEN '是' + WHEN '0' THEN '否' + END + ) AS change_out, + ( + CASE + sub.isUnPackBox + WHEN '1' THEN '是' + WHEN '0' THEN '否' + END + ) AS change_in, + + sub.isRePrintPackageBoxLabel, + sub.isUnPackBox, + point.point_code + FROM + PDM_BI_SubPackageRelation sub + LEFT JOIN sch_base_point point ON sub.package_box_SN = point.vehicle_code + WHERE + 1=1 + + OPTION 输入.box_no <> "" + point.vehicle_code = 输入.box_no + ENDOPTION + + OPTION 输入.point_code <> "" + point.point_code = 输入.point_code + ENDOPTION + + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + sub.package_box_SN AS package_box_SN, + sub.container_name AS container_name, + sub.product_name AS product_name, + sub.product_description AS product_description, + sub.net_weight AS net_weight, + ( + CASE + sub.isRePrintPackageBoxLabel + WHEN '1' THEN '是' + WHEN '0' THEN '否' + END + ) AS change_out, + ( + CASE + sub.isUnPackBox + WHEN '1' THEN '是' + WHEN '0' THEN '否' + END + ) AS change_in, + + sub.isRePrintPackageBoxLabel, + sub.isUnPackBox, + attr.struct_code AS point_code + FROM + PDM_BI_SubPackageRelation sub + LEFT JOIN ST_IVT_StructIvt ivt ON sub.container_name = ivt.pcsn + LEFT JOIN ST_IVT_StructAttr attr ON attr.struct_id = ivt.struct_id + WHERE + 1=1 + + OPTION 输入.box_no <> "" + attr.storagevehicle_code = 输入.box_no + ENDOPTION + + OPTION 输入.point_code <> "" + attr.struct_code = 输入.point_code + ENDOPTION + + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java index 0ed3e5743..2d41c5b11 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/CallEmpReelTask.java @@ -116,9 +116,12 @@ public class CallEmpReelTask extends AbstractAcsTask { JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0); if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2); - // 更新冷却库存状态 + // 更新工单状态为完成 JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0); + jsonRaw.put("status", "09"); + rawTab.update(jsonRaw); + // 更新冷却库存状态 jsonIvt2.put("full_point_status", "02"); jsonIvt2.put("instorage_time", DateUtil.now()); jsonIvt2.put("container_name", jsonRaw.getString("container_name"));