From 5751392131854ae1cf85e3ed27867739475ad5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E9=B9=8F=E9=A3=9E?= Date: Mon, 8 Sep 2025 18:32:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OutProduceController.java | 5 +- .../controller/TransferCompanyController.java | 72 +++++------- .../controller/TransferFactoryController.java | 106 ++++++++++-------- .../pojo/document/OutMaterialScanRecord.java | 9 ++ .../nflg/wms/admin/service/SapService.java | 28 ++--- .../admin/service/UserControllerService.java | 2 +- .../resources/template/厂内调拨单.html | 4 +- .../resources/template/生产入库单.html | 2 +- .../template/生产领料出库单.html | 2 +- .../resources/template/生产领料单.html | 2 +- .../resources/template/转储入库单.html | 2 +- .../main/resources/template/转储单.html | 2 +- .../common/pojo/dto/AllocationOrderDTO.java | 9 ++ .../wms/common/pojo/dto/TransferOrderDTO.java | 4 + .../wms/common/pojo/qo/AllocationOrderQO.java | 2 +- .../wms/common/pojo/qo/TransferOrderQO.java | 2 +- .../nflg/wms/common/pojo/qo/Zwm3a10QO.java | 5 + .../pojo/vo/InProduceBackTicketItemVO.java | 5 + .../common/pojo/vo/TransferCompanyItemVO.java | 5 + .../common/pojo/vo/TransferFactoryItemVO.java | 10 ++ .../pojo/vo/TransferFactoryPdaItemVO.java | 5 +- .../common/pojo/vo/TransferFactoryPdaVO.java | 5 + .../pojo/vo/TransferFactoryTicketVO.java | 10 ++ .../wms/common/pojo/vo/TransferFactoryVO.java | 9 ++ .../com/nflg/wms/common/util/PageUtil.java | 10 ++ .../WmsInCostcenterBackTicketMapper.xml | 1 + .../mapper/WmsInProduceBackMapper.xml | 1 + .../WmsInProduceBackTicketItemMapper.xml | 5 +- .../WmsInventoryCheckTaskItemMapper.xml | 1 + .../mapper/WmsInventoryCheckTaskMapper.xml | 1 + .../mapper/WmsNormalPrintOrderMapper.xml | 2 + .../mapper/WmsOutAssistanceMapper.xml | 1 + .../WmsOutAssistanceTicketItemMapper.xml | 1 + .../mapper/WmsOutAssistanceTicketMapper.xml | 1 + .../mapper/WmsOutCostcenterItemMapper.xml | 1 + .../WmsOutCostcenterTicketItemMapper.xml | 1 + .../mapper/WmsOutCostcenterTicketMapper.xml | 1 + .../mapper/WmsOutProduceItemMapper.xml | 1 + .../mapper/WmsOutProduceTicketItemMapper.xml | 1 + .../mapper/WmsOutProduceTicketMapper.xml | 1 + .../resources/mapper/WmsStorageMapper.xml | 1 + .../mapper/WmsTransferFactoryMapper.xml | 4 +- .../WmsTransferFactoryTicketItemMapper.xml | 2 +- .../mapper/WmsTransferFactoryTicketMapper.xml | 7 +- 44 files changed, 217 insertions(+), 134 deletions(-) create mode 100644 nflg-wms-common/src/main/java/com/nflg/wms/common/pojo/vo/TransferFactoryVO.java diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutProduceController.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutProduceController.java index ce03ca23..f09d84e7 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutProduceController.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/OutProduceController.java @@ -439,9 +439,10 @@ public class OutProduceController extends BaseController { Map> dmaps = dtos.stream().collect(Collectors.groupingBy(MaterialQRCodeContentDTO::getKey)); Zwm3a10VO vo = sapService.zwm3A10(new Zwm3a10QO() .setAufnr(order.getAufnr()) + .setType(order.getType() == 0 ? "A" : "B") .setInput1(dmaps.values().stream().map(its -> { - WmsOutProduceItem item = datas.stream().filter(d -> StrUtil.equals(d.getMatnr(), its.get(0).getMaterialNo())).findFirst().get(); - return new Zwm3a10Input1QO() + WmsOutProduceItem item = datas.stream().filter(d -> StrUtil.equals(d.getMatnr(), its.get(0).getMaterialNo())).findFirst().get(); + return new Zwm3a10Input1QO() .setCharg(its.get(0).getBatchNo()) .setRspos(item.getRspos()) .setMatnr(item.getMatnr()) diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferCompanyController.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferCompanyController.java index 18c23100..d3bc90f2 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferCompanyController.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferCompanyController.java @@ -21,10 +21,10 @@ import com.nflg.wms.admin.util.ThymeleafUtil; import com.nflg.wms.common.pojo.ApiResult; import com.nflg.wms.common.pojo.PageData; import com.nflg.wms.common.pojo.dto.AllocationOrderDTO; -import com.nflg.wms.common.pojo.dto.InventoryDTO; import com.nflg.wms.common.pojo.dto.MaterialQRCodeContentDTO; import com.nflg.wms.common.pojo.qo.*; import com.nflg.wms.common.pojo.vo.*; +import com.nflg.wms.common.util.PageUtil; import com.nflg.wms.common.util.UserUtil; import com.nflg.wms.common.util.VUtil; import com.nflg.wms.repository.entity.WmsTransferCompany; @@ -82,33 +82,10 @@ public class TransferCompanyController extends BaseController { * 查询SAP订单数据 */ @PostMapping("searchSAP") - public ApiResult> searchSAP0(@Valid @RequestBody AllocationOrderQO request) { + public ApiResult> searchSAP0(@Valid @RequestBody AllocationOrderQO request) { + List datas = sapService.zwm3a15(request); + return ApiResult.success(PageUtil.Page(datas, request.getPage(), request.getPageSize())); // return ApiResult.success(sapService.zwm3a15(request)); - List vos = new ArrayList<>(); - for (int i = 0, count = RandomUtil.randomInt(3, 30); i < count; i++) { - vos.add(new AllocationOrderDTO() - .setMatnr(RandomUtil.randomNumbers(11)) - .setEbeln(RandomUtil.randomNumbers(10)) - .setEbelp(RandomUtil.randomNumbers(5)) - .setMaktx(RandomUtil.randomString(20)) - .setLgort(RandomUtil.randomNumbers(4)) - .setLgfsb1(RandomUtil.randomNumbers(4)) - .setWamng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) - .setTxz01(RandomUtil.randomString(20)) - .setWerks(RandomUtil.randomNumbers(4)) - .setReswk("1010") - .setLgobe(RandomUtil.randomString(20)) - .setLgpro(RandomUtil.randomString(20)) - .setLgpbe1(RandomUtil.randomString(20)) - .setLgpbe(RandomUtil.randomString(20)) - .setEkgrp(RandomUtil.randomString(10)) - .setMeins(RandomUtil.randomString(2)) - .setLabst(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) - .setSqsl(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("30"))) - .setSqsl2(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("30"))) - ); - } - return ApiResult.success(vos); } /** @@ -134,15 +111,15 @@ public class TransferCompanyController extends BaseController { order.setCreateTime(LocalDateTime.now()); transferCompanyService.save(order); items.forEach(item -> { - //TODO 需要移除 - inventoryService.in(List.of(new InventoryDTO() - .setMaterialNo(item.getMatnr()) - .setWarehouseNo(item.getLgfsb1()) - .setFactoryNo(item.getReswk()) - .setBatchNumber(DateUtil.format(DateUtil.date(), "yyyyMMdd")) - .setNum(item.getNum()) - ) - ); +// //TODO 需要移除 +// inventoryService.in(List.of(new InventoryDTO() +// .setMaterialNo(item.getMatnr()) +// .setWarehouseNo(item.getLgfsb1()) +// .setFactoryNo(item.getReswk()) +// .setBatchNumber(DateUtil.format(DateUtil.date(), "yyyyMMdd")) +// .setNum(item.getNum()) +// ) +// ); BigDecimal max = inventoryService.getNumOne(item.getReswk(), item.getLgfsb1(), item.getMatnr()); VUtil.trueThrowBusinessError(item.getNum().compareTo(max) > 0) .throwMessage("物料" + item.getMatnr() + "的申请数量超出库存限制"); @@ -416,22 +393,25 @@ public class TransferCompanyController extends BaseController { */ @GetMapping("export") public void export(HttpServletResponse response, @Valid @RequestParam @NotNull Long id) throws Exception { -// WmsTransferCompany order = transferCompanyService.getById(id); -// VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("转储单不存在"); -// List list = transferCompanyItemService.getList(id); - WmsTransferCompany order = new WmsTransferCompany(); - order.setNo(NoUtil.getTransferCompanyNo()); - List list = new ArrayList<>(); - for (int i = 0, count = RandomUtil.randomInt(1, 100); i < count; i++) { - list.add(new WmsTransferCompanyItem().setMatnr(RandomUtil.randomNumbers(11)).setMaktx("非金属联件和紧固件等 M6 DIN 982 不锈钢304")); - } + WmsTransferCompany order = transferCompanyService.getById(id); + VUtil.trueThrowBusinessError(Objects.isNull(order)).throwMessage("转储单不存在"); + List list = Convert.toList(TransferCompanyItemVO.class, transferCompanyItemService.getList(id)); +// WmsTransferCompany order = new WmsTransferCompany(); +// order.setNo(NoUtil.getTransferCompanyNo()); +// List list = new ArrayList<>(); +// for (int i = 0, count = RandomUtil.randomInt(1, 100); i < count; i++) { +// list.add(new WmsTransferCompanyItem().setMatnr(RandomUtil.randomNumbers(11)).setMaktx("非金属联件和紧固件等 M6 DIN 982 不锈钢304")); +// } + list.forEach(it -> { + it.setEbeln(order.getEbeln()); + }); Map base = new HashMap<>(); base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd")); base.put("qrcode", QRCodeUtil.generateQRCodeBase64(order.getNo(), 100, 100)); Map variables = new HashMap<>(); variables.put("info", order); variables.put("base", base); - variables.put("pages", PdfPageDTO.create(list, 17, new WmsTransferCompanyItem())); + variables.put("pages", PdfPageDTO.create(list, 17, new TransferCompanyItemVO())); String html = ThymeleafUtil.generator("/template/", "转储单", ".html", variables); PdfGeneratorUtil.generatePdf("转储单" + order.getNo(), html, response); } diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferFactoryController.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferFactoryController.java index c6bef248..0817af8e 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferFactoryController.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/controller/TransferFactoryController.java @@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; import com.nflg.wms.admin.pojo.document.OutMaterialScanRecord; import com.nflg.wms.admin.pojo.dto.PdfPageDTO; @@ -22,6 +21,7 @@ import com.nflg.wms.common.pojo.dto.TransferOrderDTO; import com.nflg.wms.common.pojo.dto.ZWM00MB113DTO; import com.nflg.wms.common.pojo.qo.*; import com.nflg.wms.common.pojo.vo.*; +import com.nflg.wms.common.util.PageUtil; import com.nflg.wms.common.util.UserUtil; import com.nflg.wms.common.util.VUtil; import com.nflg.wms.repository.entity.WmsTransferFactory; @@ -82,31 +82,32 @@ public class TransferFactoryController extends BaseController { * 查询SAP领料订单数据 */ @PostMapping("searchSAP") - public ApiResult> searchSAP0(@Valid @RequestBody TransferOrderQO request) { -// return ApiResult.success(sapService.zwm3a16(request)); - List vos = new ArrayList<>(); - for (int i = 0, count = RandomUtil.randomInt(3, 30); i < count; i++) { - vos.add(new TransferOrderDTO() - .setMatnr(RandomUtil.randomNumbers(11)) - .setWerks(RandomUtil.randomString(4)) - .setLgort(RandomUtil.randomString(4)) - .setMaktx(RandomUtil.randomString(20)) - .setAufnr(RandomUtil.randomNumbers(10)) - .setMenge(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) - .setNum(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) - .setUmlgo(RandomUtil.randomNumbers(10)) - .setBdmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) - .setMeins(RandomUtil.randomString(2)) - .setSgtxt(RandomUtil.randomString(20)) - .setLgpbe(RandomUtil.randomString(4)) - .setBwart(RandomUtil.randomString(4)) - .setBudat(DateUtil.format(DateUtil.date(), "yyyyMMdd")) - .setZeile(RandomUtil.randomNumbers(10)) - .setBdmng1(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("30"))) - .setEnmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) - ); - } - return ApiResult.success(vos); + public ApiResult> searchSAP0(@Valid @RequestBody TransferOrderQO request) { + List datas = sapService.zwm3a16(request); + return ApiResult.success(PageUtil.Page(datas, request.getPage(), request.getPageSize())); +// List vos = new ArrayList<>(); +// for (int i = 0, count = RandomUtil.randomInt(3, 30); i < count; i++) { +// vos.add(new TransferOrderDTO() +// .setMatnr(RandomUtil.randomNumbers(11)) +// .setWerks(RandomUtil.randomString(4)) +// .setLgort(RandomUtil.randomString(4)) +// .setMaktx(RandomUtil.randomString(20)) +// .setAufnr(RandomUtil.randomNumbers(10)) +// .setMenge(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) +// .setNum(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) +// .setUmlgo(RandomUtil.randomNumbers(10)) +// .setBdmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) +// .setMeins(RandomUtil.randomString(2)) +// .setSgtxt(RandomUtil.randomString(20)) +// .setLgpbe(RandomUtil.randomString(4)) +// .setBwart(RandomUtil.randomString(4)) +// .setBudat(DateUtil.format(DateUtil.date(), "yyyyMMdd")) +// .setZeile(RandomUtil.randomNumbers(10)) +// .setBdmng1(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("30"))) +// .setEnmng(RandomUtil.randomBigDecimal(BigDecimal.ZERO, new BigDecimal("100"))) +// ); +// } +// return ApiResult.success(vos); } /** @@ -132,15 +133,15 @@ public class TransferFactoryController extends BaseController { order.setCreateTime(LocalDateTime.now()); transferFactoryService.save(order); items.forEach(item -> { - //TODO 需要移除 - inventoryService.in(List.of(new InventoryDTO() - .setMaterialNo(item.getMatnr()) - .setWarehouseNo(item.getLgort()) - .setFactoryNo(item.getWerks()) - .setBatchNumber(DateUtil.format(DateUtil.date(), "yyyyMMdd")) - .setNum(item.getNum()) - ) - ); +// //TODO 需要移除 +// inventoryService.in(List.of(new InventoryDTO() +// .setMaterialNo(item.getMatnr()) +// .setWarehouseNo(item.getLgort()) +// .setFactoryNo(item.getWerks()) +// .setBatchNumber(DateUtil.format(DateUtil.date(), "yyyyMMdd")) +// .setNum(item.getNum()) +// ) +// ); BigDecimal max = inventoryService.getNumOne(item.getWerks(), item.getLgort(), item.getMatnr()); VUtil.trueThrowBusinessError(item.getNum().compareTo(max) > 0) .throwMessage("物料" + item.getMatnr() + "的申请数量超出库存限制"); @@ -210,6 +211,7 @@ public class TransferFactoryController extends BaseController { .setRsnum(order.getRsnum()) .setMblnr(order.getMblnr()) .setBwart(order.getBwart()) + .setLgort(order.getLgort()) .setItems(datas.stream() .map(item -> new TransferFactoryPdaItemVO() .setMatnr(item.getMatnr()) @@ -217,8 +219,8 @@ public class TransferFactoryController extends BaseController { .setUmlgo(order.getUmlgo()) .setLgort(order.getLgort()) .setNum(item.getLeft()) - .setBinIn(storageService.getBinNos(item.getMatnr(), order.getWerks(), order.getUmlgo())) - .setBinOut(storageService.getBinNos(item.getMatnr(), order.getWerks(), order.getLgort())) + .setBinIn(StrUtil.join("/", storageService.getBinNos(item.getMatnr(), order.getWerks(), order.getUmlgo()))) + .setBinOut(StrUtil.join("/", storageService.getBinNos(item.getMatnr(), order.getWerks(), order.getLgort()))) ).toList() ) ); @@ -271,6 +273,7 @@ public class TransferFactoryController extends BaseController { .setTicketItemId(pti.getId()) .setMaterialNo(materialNo) .setUnit(item.getMeins()) + .setRspos(item.getRspos()) .setContent(qrCode) .setBatchNo(qrCodeContent.getBatchNo()) .setSerialNo(qrCodeContent.getSerialNo()) @@ -313,8 +316,9 @@ public class TransferFactoryController extends BaseController { .setLgort(ticket.getLgort()) .setUmlgo(ticket.getUmlgo()) .setNum(it.getNum()) - .setBinIn(storageService.getBinNos(it.getMatnr(), ticket.getWerks(), ticket.getUmlgo())) - .setBinOut(storageService.getBinNos(it.getMatnr(), ticket.getWerks(), ticket.getLgort()))).toList()) + .setBinIn(StrUtil.join("/", storageService.getBinNos(it.getMatnr(), ticket.getWerks(), ticket.getUmlgo()))) + .setBinOut(StrUtil.join("/", storageService.getBinNos(it.getMatnr(), ticket.getWerks(), ticket.getLgort()))) + ).toList()) ); } @@ -353,29 +357,29 @@ public class TransferFactoryController extends BaseController { .setNum(list.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add)) ).toList() ); + List ticketItems = transferFactoryTicketItemService.getList(ticket.getId()); ZWM00MB113DTO vo = sapService.zwm00_mb113(new ZWM00MB113QO() .setIRsnum(ticket.getRsnum()) .setIUmlgo(ticket.getUmlgo()) - .setT_list1(records.stream().collect(Collectors.groupingBy(OutMaterialScanRecord::getKey)) - .values().stream().map(its -> new ZWM00MB113LIST1QO() - .setRspos(ticket.getRsnum()) - .setMatnr(its.get(0).getMaterialNo()) - .setErfmg(its.stream().map(OutMaterialScanRecord::getNum).reduce(BigDecimal.ZERO, BigDecimal::add)) - .setMeins(its.get(0).getUnit()) + .setT_list1(ticketItems.stream().map(item -> new ZWM00MB113LIST1QO() + .setRspos(item.getRspos()) + .setMatnr(item.getMatnr()) + .setErfmg(item.getNum()) + .setMeins(item.getMeins()) .setWerks(ticket.getWerks()) .setLgort(ticket.getLgort())).toList() ) .setT_list2(records.stream() - .filter(record -> StrUtil.isNotBlank(record.getKey1())) - .collect(Collectors.groupingBy(OutMaterialScanRecord::getKey1)) + .collect(Collectors.groupingBy(OutMaterialScanRecord::getKey6)) .values() .stream() .map(ls -> new ZWM00MB113LIST2QO() - .setRspos(ticket.getRsnum()) + .setRspos(ls.get(0).getRspos()) .setSernr(ls.get(0).getSerialNo()) .setFlag("X") ) - .toList()) + .toList() + ) ); transferFactoryTicketService.lambdaUpdate() .set(WmsTransferFactoryTicket::getMatDoc, vo.getEMblnr()) @@ -446,6 +450,10 @@ public class TransferFactoryController extends BaseController { // for (int i = 0, count = RandomUtil.randomInt(1, 100); i < count; i++) { // list.add(new TransferFactoryItemVO().setMatnr(RandomUtil.randomNumbers(11)).setMaktx("非金属联件和紧固件等 M6 DIN 982 不锈钢304")); // } + list.forEach(it -> { + it.setLgort(order.getLgort()); + it.setUmlgo(order.getUmlgo()); + }); Map base = new HashMap<>(); base.put("date", DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd")); base.put("qrcode", QRCodeUtil.generateQRCodeBase64(order.getNo(), 100, 100)); diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/pojo/document/OutMaterialScanRecord.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/pojo/document/OutMaterialScanRecord.java index 4767af22..e496f4c2 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/pojo/document/OutMaterialScanRecord.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/pojo/document/OutMaterialScanRecord.java @@ -97,6 +97,8 @@ public class OutMaterialScanRecord { */ private String ebelp; + private String rspos; + /** * 扩展字段 */ @@ -146,4 +148,11 @@ public class OutMaterialScanRecord { public String getKey5() { return this.ebelp + "|" + this.serialNo; } + + @Transient + private String key6; + + public String getKey6() { + return this.rspos + "|" + this.serialNo; + } } diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java index e36e68c7..9fe387b6 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/SapService.java @@ -665,6 +665,7 @@ public class SapService { // 构造函数调用所需的输入参数 Map parameters = new HashMap<>(); parameters.put("AUFNR", query.getAufnr()); + parameters.put("I_TYPE", query.getType()); // 将构造好的表数据放入输入参数中 Map>> tables = new HashMap<>(); @@ -979,12 +980,10 @@ public class SapService { VUtil.trueThrowBusinessError(!StrUtil.equals(exportParam.getString("E_TYPE"), "S")) .throwMessage(exportParam.getString("E_MSG")); JCoTable tOut = function.getTableParameterList().getTable("OUTPUT1"); - log.info("SAP返回: {}", tOut); - // 将SAP返回的表数据转换为DTO对象列表 List result = JCoUtil.toBeanList(tOut, TransferOrderDTO.class); - - log.debug("数据:{}", JSONUtil.toJsonStr(result)); + log.debug("数据OUTPUT1:{}", JSONUtil.toJsonStr(result)); + log.info("SAP原始数据OUTPUT1: {}", tOut); return result; } @@ -1092,22 +1091,19 @@ public ZWM00MB113DTO zwm00_mb113(ZWM00MB113QO query) { // 调用 SAP RFC 函数 ZWM00_MB112 JCoFunction function = exec("ZWM00_MB113", parameters, tables); - // 处理返回表 T_RETURN,判断执行是否成功 - JCoTable returnTable = function.getTableParameterList().getTable("T_RETURN"); - VUtil.trueThrowBusinessError(returnTable.getNumRows() <= 0).throwMessage("获取Type信息有误"); - returnTable.setRow(0); - VUtil.trueThrowBusinessError(!StrUtil.equals(returnTable.getString("TYPE"), "S")) - .throwMessage(returnTable.getString("MESSAGE")); - log.info("SAP返回: {}", returnTable); - // 获取导出参数,构造返回结果对象 JCoParameterList exportParam = function.getExportParameterList(); - VUtil.trueThrowBusinessError(Objects.isNull(exportParam)).throwMessage("无法获取到有效的物料凭证信息"); - ZWM00MB113DTO result = new ZWM00MB113DTO() + if (StrUtil.isNotBlank(exportParam.getString("E_MJAHR"))) { + log.info("SAP返回物料凭证信息: MBLNR={}, MJAHR={}", exportParam.getString("E_MBLNR"), exportParam.getString("E_MJAHR")); + return new ZWM00MB113DTO() .setEMjahr(exportParam.getString("E_MJAHR")) .setEMblnr(exportParam.getString("E_MBLNR")); - log.info("SAP返回物料凭证信息: MBLNR={}, MJAHR={}", result.getEMblnr(), result.getEMjahr()); - return result; + } else { + JCoTable returnTable = function.getTableParameterList().getTable("T_RETURN"); + log.info("SAP返回: {}", returnTable); + returnTable.setRow(0); + throw new NflgException(STATE.BusinessError, "SAP错误:" + returnTable.getString("MESSAGE")); + } } /** diff --git a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/UserControllerService.java b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/UserControllerService.java index c63ae9e8..f555fae6 100644 --- a/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/UserControllerService.java +++ b/nflg-wms-admin/src/main/java/com/nflg/wms/admin/service/UserControllerService.java @@ -267,7 +267,7 @@ public class UserControllerService { public void resetPassword(@Valid UserResetPasswordQO request) { User user = uService.getById(request.getId()); VUtil.trueThrowBusinessError(Objects.isNull(user)).throwMessage("用户不存在"); - VUtil.trueThrowBusinessError(PASSWORDENCODER.matches(request.getOldPassword(), user.getPassword())) + VUtil.trueThrowBusinessError(!PASSWORDENCODER.matches(request.getOldPassword(), user.getPassword())) .throwMessage("原密码不正确"); uService.update(new User() .setId(request.getId()) diff --git a/nflg-wms-admin/src/main/resources/template/厂内调拨单.html b/nflg-wms-admin/src/main/resources/template/厂内调拨单.html index af7da536..a1095da4 100644 --- a/nflg-wms-admin/src/main/resources/template/厂内调拨单.html +++ b/nflg-wms-admin/src/main/resources/template/厂内调拨单.html @@ -178,8 +178,8 @@ PC 10.00 10.00 - - + + diff --git a/nflg-wms-admin/src/main/resources/template/生产入库单.html b/nflg-wms-admin/src/main/resources/template/生产入库单.html index 08c584d7..62399231 100644 --- a/nflg-wms-admin/src/main/resources/template/生产入库单.html +++ b/nflg-wms-admin/src/main/resources/template/生产入库单.html @@ -3,7 +3,7 @@ - 成本中心领料单 + 成品/半成品入库单