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 daace52dd..2230990ce 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 @@ -152,7 +152,7 @@ public class RawFoilServiceImpl implements RawFoilService { if (StrUtil.equals(point_location, "1")) map.put("point_location", "0"); JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0); - if (ObjectUtil.isEmpty(jsonIvt_tow)) throw new BadRequestException("库存不足"); + if (ObjectUtil.isEmpty(jsonIvt_tow)) throw new BadRequestException("没有空卷轴"); start_pint_code = jsonIvt_tow.getString("empty_point_code"); } else { start_pint_code = jsonIvt.getString("empty_point_code"); 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 c4cea0946..875677caa 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 @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.modules.logging.annotation.Log; +import org.nl.modules.wql.core.content.HttpContext; import org.nl.wms.pda.st.service.CoolInService; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -33,7 +34,10 @@ public class CoolInController { @Log("半成品入库初始化查询") @ApiOperation("半成品入库初始化查询") public ResponseEntity create(@RequestBody JSONObject whereJson){ - return new ResponseEntity<>(coolInService.coolIOQuery(whereJson),HttpStatus.OK); + HttpContext ctx = new HttpContext("11"); + ctx.setPage((String)(whereJson.get("page"))); + ctx.setRows((String)(whereJson.get("size"))); + return new ResponseEntity<>(coolInService.coolIOQuery(whereJson,ctx),HttpStatus.OK); } @PostMapping("/confirmInstor") 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 index 2561b6860..48cc6c258 100644 --- 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 @@ -43,4 +43,11 @@ public class CoolOutController { public ResponseEntity confirmInstor(@RequestBody JSONObject whereJson){ return new ResponseEntity<>(coolOutService.confirmInstor(whereJson),HttpStatus.OK); } + + @PostMapping("/areaQuery") + @Log("半成品出库区域下拉框查询") + @ApiOperation("半成品出库区域下拉框查询") + public ResponseEntity areaQuery(@RequestBody JSONObject whereJson){ + return new ResponseEntity<>(coolOutService.areaQuery(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 319200ba4..a15d4b181 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 @@ -3,6 +3,7 @@ package org.nl.wms.pda.st.service; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import org.nl.modules.wql.core.content.HttpContext; /** * @description 服务接口 @@ -16,7 +17,7 @@ public interface CoolInService { * @param whereJson / * @return JSONObject / */ - JSONObject coolIOQuery(JSONObject whereJson); + JSONObject coolIOQuery(JSONObject whereJson, HttpContext ctx); /** * 入库确认 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 index 9b582d1f8..078565211 100644 --- 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 @@ -23,4 +23,11 @@ public interface CoolOutService { * @return JSONObject / */ JSONObject confirmInstor(JSONObject whereJson); + + /** + * 区域下拉框查询 + * @param whereJson / + * @return JSONObject / + */ + JSONObject areaQuery(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 e6ca1e0cd..367ad948a 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 @@ -15,6 +15,7 @@ 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.modules.wql.core.content.HttpContext; import org.nl.wms.pda.st.service.CoolInService; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,14 +31,19 @@ import org.springframework.transaction.annotation.Transactional; public class CoolInServiceImpl implements CoolInService { @Override - public JSONObject coolIOQuery(JSONObject whereJson) { + public JSONObject coolIOQuery(JSONObject whereJson, HttpContext ctx) { + String container_name = whereJson.getString("container_name"); + JSONObject map = new JSONObject(); map.put("flag", "1"); - map.put("container_name", whereJson.getString("container_name")); + if (ObjectUtil.isNotEmpty(container_name)) map.put("container_name", "%"+container_name+"%"); + + JSONObject jsonObject = WQL.getWO("PDA_COOLIN").addParamMap(map).pageQuery(ctx, "der.container_name ASC"); JSONArray resultJSONArray = WQL.getWO("PDA_COOLIN").addParamMap(map).process().getResultJSONArray(0); JSONObject jo = new JSONObject(); - jo.put("data", resultJSONArray); + jo.put("data", jsonObject.getJSONArray("content")); + jo.put("size", resultJSONArray.size()); jo.put("message", "查询成功!"); return jo; } @@ -80,6 +86,9 @@ public class CoolInServiceImpl implements CoolInService { jsonCool.put("confirm_optname", currentUsername); jsonCool.put("confirm_time", DateUtil.now()); coolIvtTab.insert(jsonCool);*/ + // 校验母卷号是否已存在 + JSONObject json = coolIvtTab.query("container_name = '" + raw_jo.getString("container_name") + "'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)) throw new BadRequestException("此母卷库存已存在"); // 更新冷却区库存 jsonCoolIvt.put("full_point_status", "02"); 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 index f08c8d7d2..c5d5245c6 100644 --- 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 @@ -26,7 +26,8 @@ import org.springframework.transaction.annotation.Transactional; @Service @RequiredArgsConstructor @Slf4j -public class CoolOutServiceImpl implements CoolOutService { +public class CoolOutServiceImpl + implements CoolOutService { @Override public JSONObject coolIOQuery(JSONObject whereJson) { @@ -66,4 +67,14 @@ public class CoolOutServiceImpl implements CoolOutService { result.put("message", "出库成功!"); return result; } + + @Override + public JSONObject areaQuery(JSONObject whereJson) { + JSONArray resultJSONArray = WQL.getWO("PDA_COOLOUT").addParam("flag","2").process().getResultJSONArray(0); + + JSONObject jo = new JSONObject(); + jo.put("data", resultJSONArray); + jo.put("message", "查询成功!"); + return jo; + } } 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 index ad7906b7d..339e77c1d 100644 --- 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 @@ -41,7 +41,7 @@ ########################################## IF 输入.flag = "1" - QUERY + PAGEQUERY SELECT ( CASE @@ -74,9 +74,9 @@ der.is_delete = '0' OPTION 输入.container_name <> "" - der.container_name = 输入.container_name + der.container_name like 输入.container_name ENDOPTION ENDSELECT - ENDQUERY + ENDPAGEQUERY 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 index dd70ad311..b8ddec0c0 100644 --- 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 @@ -80,3 +80,17 @@ ENDSELECT ENDQUERY ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + value, + label + FROM + sys_dict_detail + WHERE + name = 'product_area' + + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_VIRTUALOUT.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_VIRTUALOUT.wql index d8d2b1a06..8712960f7 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_VIRTUALOUT.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/wql/PDA_VIRTUALOUT.wql @@ -45,6 +45,7 @@ IF 输入.flag = "1" QUERY SELECT + distinct mst.iostorinv_id, mst.bill_code, ( diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/RawfoilworkorderServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/RawfoilworkorderServiceImpl.java index ab1be0c20..c40069095 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/RawfoilworkorderServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/RawfoilworkorderServiceImpl.java @@ -91,10 +91,25 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService { @Override @Transactional(rollbackFor = Exception.class) public void create(RawfoilworkorderDto dto) { + WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); + WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder"); + WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); + + String container_name = dto.getContainer_name(); + JSONObject json = wo.query("container_name = '" + container_name + "' and status <> '09'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(json)) throw new BadRequestException("母卷号已存在"); + Long currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); String now = DateUtil.now(); + JSONObject jsonPoint = pointTab.query("ext_code ='" + dto.getResource_name() + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("点位设备不存在"); + + JSONObject josnMater = materTab.query("material_code ='" + dto.getProduct_name() + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); + if (ObjectUtil.isEmpty(josnMater)) throw new BadRequestException("物料不存在"); + + dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId()); dto.setCreate_id(currentUserId); dto.setCreate_name(nickName); @@ -102,10 +117,13 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService { dto.setUpdate_optname(nickName); dto.setUpdate_time(now); dto.setCreate_time(now); + dto.setIs_delete("0"); + dto.setProduct_area(jsonPoint.getString("product_area")); + dto.setPoint_code(jsonPoint.getString("point_code")); + dto.setStatus("01"); - WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder"); - JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); - wo.insert(json); + JSONObject json1 = JSONObject.parseObject(JSON.toJSONString(dto)); + wo.insert(json1); } @Override @@ -114,17 +132,34 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService { RawfoilworkorderDto entity = this.findById(dto.getWorkorder_id()); if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt"); + WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder"); + WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); + + String container_name = dto.getContainer_name(); + Long currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); - String now = DateUtil.now(); + + JSONObject jsonPoint = pointTab.query("ext_code ='" + dto.getResource_name() + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("点位设备不存在"); + + JSONObject josnMater = materTab.query("material_code ='" + dto.getProduct_name() + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); + if (ObjectUtil.isEmpty(josnMater)) throw new BadRequestException("物料不存在"); + + dto.setUpdate_time(now); dto.setUpdate_optid(currentUserId); dto.setUpdate_optname(nickName); + dto.setProduct_area(jsonPoint.getString("product_area")); + dto.setPoint_code(jsonPoint.getString("point_code")); - WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder"); JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); wo.update(json); + + JSONArray resultJSONArray = wo.query("container_name = '" + container_name + "' and status <> '09'").getResultJSONArray(0); + if (resultJSONArray.size() > 1) throw new BadRequestException("母卷号已存在"); } @Override diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 9e1dfce14..c5337e9a7 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -449,7 +449,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jsonMap.put("flag", "1"); jsonMap.put("material_id", dtl.getString("material_id")); jsonMap.put("sale_order_name", dtl.getString("source_bill_code")); - jsonMap.put("sect_id", RegionTypeEnum.ZC01.getId()); + jsonMap.put("sect_id", ""); JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0); if (ObjectUtil.isEmpty(jsonOneIvt)) throw new BadRequestException("库存不足"); @@ -658,7 +658,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jsonMap.put("flag", "1"); jsonMap.put("material_id", dtl.getString("material_id")); jsonMap.put("sale_order_name", dtl.getString("source_bill_code")); - jsonMap.put("sect_id", RegionTypeEnum.ZC01.getId()); + jsonMap.put("sect_id", ""); JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0); if (ObjectUtil.isEmpty(jsonOneIvt)) throw new BadRequestException("库存不足"); diff --git a/lms/nladmin-ui/src/views/wms/pdm/order/rawfoilworkorder/index.vue b/lms/nladmin-ui/src/views/wms/pdm/order/rawfoilworkorder/index.vue index 6f8827693..c5b60b3cc 100644 --- a/lms/nladmin-ui/src/views/wms/pdm/order/rawfoilworkorder/index.vue +++ b/lms/nladmin-ui/src/views/wms/pdm/order/rawfoilworkorder/index.vue @@ -101,33 +101,96 @@ :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" - width="500px" + width="800px" > - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +