From 585c15a803bd573d5154af25ef702c2ba83790b6 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Mon, 7 Jul 2025 10:27:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?demand:=20=20=E6=89=B9=E9=87=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=89=B9=E6=AC=A1=E6=8B=BC=E6=8E=A5=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=20committer:=20heyu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/emis/EmisTmsSiteBatchController.java | 52 ++++++++++++++----- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTmsSiteBatchController.java b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTmsSiteBatchController.java index 9d66007b6..dc8048f11 100644 --- a/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTmsSiteBatchController.java +++ b/emis-biz-web/src/main/java/com/xdadan/erp/web/emis/EmisTmsSiteBatchController.java @@ -234,10 +234,36 @@ public class EmisTmsSiteBatchController extends EmisBaseController } SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); for (EmisTmsSiteBatch batch : batchList) { + // 先查询数据库中的完整数据 + EmisTmsSiteBatch dbBatch = emisTmsSiteBatchService.selectEmisTmsSiteBatchById(batch.getId()); + if (dbBatch == null) { + return AjaxResult.error("批次ID " + batch.getId() + " 不存在"); + } + + // 使用前端传来的值更新数据库中的值 + if (batch.getTransType() != null) { + dbBatch.setTransType(batch.getTransType()); + } + if (batch.getStartSiteCode() != null) { + dbBatch.setStartSiteCode(batch.getStartSiteCode()); + } + if (batch.getSupplierCode() != null) { + dbBatch.setSupplierCode(batch.getSupplierCode()); + } + if (batch.getNextSiteCode() != null) { + dbBatch.setNextSiteCode(batch.getNextSiteCode()); + } + if (batch.getEtd() != null) { + dbBatch.setEtd(batch.getEtd()); + } + if (batch.getCarNo() != null) { + dbBatch.setCarNo(batch.getCarNo()); + } + // 运输方式首字母 String prefix = "E"; - if (batch.getTransType() != null) { - switch (batch.getTransType()) { + if (dbBatch.getTransType() != null) { + switch (dbBatch.getTransType()) { case "1": prefix = "E"; break; @@ -260,9 +286,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController } // 起始网点三字码 String startSiteCode3 = ""; - if (batch.getStartSiteCode() != null) { + if (dbBatch.getStartSiteCode() != null) { EmisSite startSite = new EmisSite(); - startSite.setSiteCode(batch.getStartSiteCode()); + startSite.setSiteCode(dbBatch.getStartSiteCode()); List startSites = emisSiteService.selectEmisSiteList(startSite); if (!CollectionUtils.isEmpty(startSites)) { startSiteCode3 = startSites.get(0).getSizeCode3(); @@ -270,9 +296,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController } // 供应商英文名 String supplierNameEn = ""; - if (batch.getSupplierCode() != null) { + if (dbBatch.getSupplierCode() != null) { EmisSupplier supplier = new EmisSupplier(); - supplier.setCode(batch.getSupplierCode()); + supplier.setCode(dbBatch.getSupplierCode()); List suppliers = emisSupplierService.selectEmisSupplierList(supplier); if (!CollectionUtils.isEmpty(suppliers)) { supplierNameEn = suppliers.get(0).getNameEn(); @@ -280,9 +306,9 @@ public class EmisTmsSiteBatchController extends EmisBaseController } // 下一网点三字码 String nextSiteCode3 = ""; - if (batch.getNextSiteCode() != null) { + if (dbBatch.getNextSiteCode() != null) { EmisSite nextSite = new EmisSite(); - nextSite.setSiteCode(batch.getNextSiteCode()); + nextSite.setSiteCode(dbBatch.getNextSiteCode()); List nextSites = emisSiteService.selectEmisSiteList(nextSite); if (!CollectionUtils.isEmpty(nextSites)) { nextSiteCode3 = nextSites.get(0).getSizeCode3(); @@ -290,15 +316,15 @@ public class EmisTmsSiteBatchController extends EmisBaseController } // etd日期 String etdStr = ""; - if (batch.getEtd() != null) { - etdStr = sdf.format(batch.getEtd()); + if (dbBatch.getEtd() != null) { + etdStr = sdf.format(dbBatch.getEtd()); } // 车牌号 - String carNo = batch.getCarNo() == null ? "" : batch.getCarNo(); + String carNo = dbBatch.getCarNo() == null ? "" : dbBatch.getCarNo(); // 拼接batchName String batchName = prefix + startSiteCode3 + supplierNameEn + nextSiteCode3 + etdStr + carNo; - batch.setBatchName(batchName); - emisTmsSiteBatchService.updateEmisTmsSiteBatch(batch); + dbBatch.setBatchName(batchName); + emisTmsSiteBatchService.updateEmisTmsSiteBatch(dbBatch); } return AjaxResult.success("批量修改成功"); } From 34d5e9a7c48aba07e8d7efe469ed2aaa0d883880 Mon Sep 17 00:00:00 2001 From: aike <17730485278@139.com> Date: Mon, 7 Jul 2025 11:04:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?demand:=20=20TMS=E7=B3=BB=E7=BB=9F=20-=20?= =?UTF-8?q?=E8=BF=90=E8=BE=93=E7=AE=A1=E7=90=86=20-=20=E8=B4=A7=E7=89=A9?= =?UTF-8?q?=E7=BB=84=E6=89=B9=E6=AC=A1=20-=20=E6=8C=89=E7=85=A7=20?= =?UTF-8?q?=E6=88=90=E6=9C=AC=20=E5=B7=B2=E5=BD=95=E5=85=A5=20=E6=9C=AA?= =?UTF-8?q?=E5=BD=95=E5=85=A5=20=E6=97=A0=E6=B3=95=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=B0=E6=9C=AA=E5=BD=95=E5=85=A5=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=20=E6=98=BE=E7=A4=BA=20=E6=97=A0=E6=95=B0=E6=8D=AE=20committer?= =?UTF-8?q?:=20heyu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/EmisTmsSiteBatchMapper.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml b/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml index 30a136cdb..a34468616 100644 --- a/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisTmsSiteBatchMapper.xml @@ -190,7 +190,8 @@ and update_time = #{updateTime} and create_site=#{createSite} and update_site=#{updateSite} - and bl_entering=#{blEntering} + and bl_entering=#{blEntering} + and bl_entering='0' and ( batch_no like concat('%', #{searchValue},'%') or batch_name like concat('%', #{searchValue},'%') or car_no like concat('%', #{searchValue},'%') ) @@ -265,7 +266,8 @@ and update_time = #{updateTime} and create_site=#{createSite} and update_site=#{updateSite} - and bl_entering=#{blEntering} + and bl_entering=#{blEntering} + and bl_entering='0' and ( batch_no like concat('%', #{searchValue},'%') or batch_name like concat('%', #{searchValue},'%') or car_no like concat('%', #{searchValue},'%') )