From 64fcfe9c2272317dcea4d42aa817da50f9b3d6dd Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 23 May 2023 20:20:12 +0800 Subject: [PATCH 1/7] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thrsys/impl/ThrDeptServiceImpl.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java index e01d38dbc..07d4e8c7f 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java @@ -137,6 +137,7 @@ public class ThrDeptServiceImpl extends ServiceImpl i if (baseResponse.getCode() == 20000) { List responseList = baseResponse.getData().getList(); List list = new ArrayList<>(); + List warehouseList = new ArrayList<>(); for (UdiwmsWarehouseDetail response : responseList) { ThrDeptEntity thrDeptEntity = new ThrDeptEntity(); thrDeptEntity.setPid(0); @@ -148,25 +149,21 @@ public class ThrDeptServiceImpl extends ServiceImpl i thrDeptEntity.setUpdateTime(new Date()); list.add(thrDeptEntity); - List subWarehouseList = response.getSubWarehouses(); - if (CollUtil.isNotEmpty(subWarehouseList)) { - for (UdiwmsWarehouseDetail.SubWarehouse subWarehouse : subWarehouseList) { - ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); - thrInvWarehouseEntity.setCode(subWarehouse.getCode()); - thrInvWarehouseEntity.setName(subWarehouse.getName()); - thrInvWarehouseEntity.setRemark(subWarehouse.getRemark()); - thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); - thrInvWarehouseEntity.setParentId(response.getCode()); - thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + ""); - thrInvWarehouseEntity.setUpdateTime(new Date()); - thrInvWarehouseDao.insertThrInvWarehouse(thrInvWarehouseEntity); - } - } + ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); + thrInvWarehouseEntity.setCode(response.getCode()); + thrInvWarehouseEntity.setName(response.getName()); + thrInvWarehouseEntity.setRemark(response.getRemark()); + thrInvWarehouseEntity.setThirdSysFk(thirdSysFk); + thrInvWarehouseEntity.setParentId(response.getCode()); + thrInvWarehouseEntity.setId(IdUtil.getSnowflake(6, 1).nextId() + ""); + thrInvWarehouseEntity.setUpdateTime(new Date()); + warehouseList.add(thrInvWarehouseEntity); } //插入数据 thrDeptDao.insertInvWarehouses(list); + thrInvWarehouseDao.insertThrInvWarehouses(warehouseList); if (list.size() >= limit) { page++; } else { From 6e6b56085c16d1dd36669c44a2f80cd37b8679a3 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 23 May 2023 20:21:39 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/inv/InvInnerOrderPrintController.java | 12 ++++++------ .../api/service/inout/impl/IoOrderServiceImpl.java | 1 + .../api/service/thrsys/impl/ThrDeptServiceImpl.java | 2 -- src/main/java/com/glxp/api/util/FileUtils.java | 12 ++++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java index f535f1de4..761fde551 100644 --- a/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java +++ b/src/main/java/com/glxp/api/controller/inv/InvInnerOrderPrintController.java @@ -188,7 +188,7 @@ public class InvInnerOrderPrintController { } else { Map data = new HashMap(); data.put("data", printEntities); - JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, data, filePath + "/pdf/template/" + FileUtils.getLastFileName(systemPDFTemplateEntity.getPath()), "pdf"); } @@ -231,7 +231,7 @@ public class InvInnerOrderPrintController { @RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) throws Exception { //查询模板文件是否存在 - SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId()+""); + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getLabelId() + ""); if (null == sysPdfTemplateRelevanceStatemenEntity) { return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); } @@ -249,7 +249,7 @@ public class InvInnerOrderPrintController { @RequestBody InnerOrderQRCodeTextPDFTemplateRequest stockQRCodeTextPDFTemplateRequest, HttpServletRequest request, HttpServletResponse response) throws Exception { - SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId()+""); + SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(stockQRCodeTextPDFTemplateRequest.getLabelId() + ""); if (sysPdfTemplateRelevanceStatemenEntity == null) return ResultVOUtils.error(500, "未找到单据模板模块设置,请检查"); SystemPDFTemplateEntity systemPDFTemplateEntity = @@ -281,10 +281,10 @@ public class InvInnerOrderPrintController { } } - Map map=new HashMap<>(); - map.put("data",printEntities); + Map map = new HashMap<>(); + map.put("data", printEntities); String param = JSON.toJSONString(map); - JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); + JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + FileUtils.getLastFileName(systemPDFTemplateEntity.getPath()), "pdf"); String orderId = ""; for (InnerOrderPrintResponse InnerOrderPrintResponse : mStockPrintEntities) { diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java index f3a13da72..dc579d6dc 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoOrderServiceImpl.java @@ -167,6 +167,7 @@ public class IoOrderServiceImpl implements IoOrderService { orderEntity.setRelKey(UUID.fastUUID().toString(true)); } orderEntity.setExportStatus(0); //上传状态:未上传 + orderEntity.setInCodeStatus(0); return orderDao.insert(orderEntity); } diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java index e01d38dbc..14ed4b4ec 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java @@ -162,8 +162,6 @@ public class ThrDeptServiceImpl extends ServiceImpl i thrInvWarehouseDao.insertThrInvWarehouse(thrInvWarehouseEntity); } } - - } //插入数据 thrDeptDao.insertInvWarehouses(list); diff --git a/src/main/java/com/glxp/api/util/FileUtils.java b/src/main/java/com/glxp/api/util/FileUtils.java index f9cdcf094..8bf1cd6b5 100644 --- a/src/main/java/com/glxp/api/util/FileUtils.java +++ b/src/main/java/com/glxp/api/util/FileUtils.java @@ -1,5 +1,7 @@ package com.glxp.api.util; +import cn.hutool.core.util.StrUtil; + import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.File; @@ -529,6 +531,16 @@ public class FileUtils { } } + public static String getLastFileName(String fileName) { + String fileNameNow = fileName.substring(fileName.lastIndexOf("/") + 1); + if (StrUtil.isEmpty(fileNameNow)) + return fileName; + else + return fileNameNow; + + } + + /** * 得到相对路径。 * 文件名不是目录名的子节点时返回文件名。 From 8096c1933e74b9152d1d76e840448d668ee9a3e7 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 23 May 2023 20:40:11 +0800 Subject: [PATCH 3/7] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mybatis/mapper/thrsys/ThrInvWarehouseDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrInvWarehouseDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrInvWarehouseDao.xml index 2fa1e303b..2b0f0b502 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrInvWarehouseDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrInvWarehouseDao.xml @@ -101,7 +101,7 @@ replace INTO thr_inv_warehouse (id, code, `name`, parentId, remark, thirdSysFk,updateTime) VALUES - ( #{item.id}, #{item.code}, From 1f3ba38e2213f25c80e1e5cc8e80c72db21559ae Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 23 May 2023 20:52:04 +0800 Subject: [PATCH 4/7] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java | 2 +- .../com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java | 5 ++--- src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java b/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java index 5a1df27ed..06411a3f2 100644 --- a/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java @@ -18,7 +18,7 @@ public interface ThrDeptDao extends BaseMapperPlus thrDeptEntities); + boolean insertDeptList(@Param("thrDeptEntities") List thrDeptEntities); boolean updateThrInvWarehouse(ThrDeptEntity thrDeptEntity); diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java index 07d4e8c7f..55f13d1cf 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java @@ -1,6 +1,5 @@ package com.glxp.api.service.thrsys.impl; -import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -85,7 +84,7 @@ public class ThrDeptServiceImpl extends ServiceImpl i @Override public boolean insertInvWarehouses(List thrDeptEntities) { - return thrDeptDao.insertInvWarehouses(thrDeptEntities); + return thrDeptDao.insertDeptList(thrDeptEntities); } @Override @@ -162,7 +161,7 @@ public class ThrDeptServiceImpl extends ServiceImpl i } //插入数据 - thrDeptDao.insertInvWarehouses(list); + thrDeptDao.insertDeptList(list); thrInvWarehouseDao.insertThrInvWarehouses(warehouseList); if (list.size() >= limit) { page++; diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml index ef296c2e9..76bef351b 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml @@ -174,7 +174,7 @@ - + replace into thr_dept (pid, code, `name`, advanceType, isDefault, status, updateTime, remark, `level`, pcode, thirdSysFk) From 1496bb4bda197db8f6e796f835cdc545e9f964ff Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 23 May 2023 20:54:21 +0800 Subject: [PATCH 5/7] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D--=E6=94=B9=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/controller/thrsys/ThrDeptController.java | 2 +- src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java | 4 ++-- .../com/glxp/api/service/thrsys/ThrDeptService.java | 4 ++-- .../api/service/thrsys/impl/ThrDeptServiceImpl.java | 10 +++++----- .../resources/mybatis/mapper/thrsys/ThrDeptDao.xml | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java b/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java index 843519757..760e55759 100644 --- a/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java +++ b/src/main/java/com/glxp/api/controller/thrsys/ThrDeptController.java @@ -80,7 +80,7 @@ public class ThrDeptController { } thrDeptEntity.setUpdateTime(new Date()); thrDeptEntity.setId(IdUtil.getSnowflakeNextId()); - boolean b = thrDeptService.insertInvWarehouse(thrDeptEntity); + boolean b = thrDeptService.insertThrDept(thrDeptEntity); if (!b) { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); } diff --git a/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java b/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java index 06411a3f2..4c934c099 100644 --- a/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java +++ b/src/main/java/com/glxp/api/dao/thrsys/ThrDeptDao.java @@ -16,9 +16,9 @@ public interface ThrDeptDao extends BaseMapperPlus filterThrGroupInvWarehouse(FilterThrDeptRequest filterThrDeptRequest); - boolean insertThrInvWarehouse(ThrDeptEntity thrDeptEntity); + boolean insertThrDept(ThrDeptEntity thrDeptEntity); - boolean insertDeptList(@Param("thrDeptEntities") List thrDeptEntities); + boolean insertThrDeptList(@Param("thrDeptEntities") List thrDeptEntities); boolean updateThrInvWarehouse(ThrDeptEntity thrDeptEntity); diff --git a/src/main/java/com/glxp/api/service/thrsys/ThrDeptService.java b/src/main/java/com/glxp/api/service/thrsys/ThrDeptService.java index 55fbd0f27..5d1acc449 100644 --- a/src/main/java/com/glxp/api/service/thrsys/ThrDeptService.java +++ b/src/main/java/com/glxp/api/service/thrsys/ThrDeptService.java @@ -20,9 +20,9 @@ public interface ThrDeptService extends IService { List filterGroupInvWarehouse(FilterThrDeptRequest filterThrDeptRequest); - boolean insertInvWarehouse(ThrDeptEntity thrDeptEntity); + boolean insertThrDept(ThrDeptEntity thrDeptEntity); - boolean insertInvWarehouses(List thrDeptEntities); + boolean insertThrDeptList(List thrDeptEntities); boolean updateInvWarehouse(ThrDeptEntity thrDeptEntity); diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java index 55f13d1cf..6d892a2b3 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java @@ -78,13 +78,13 @@ public class ThrDeptServiceImpl extends ServiceImpl i } @Override - public boolean insertInvWarehouse(ThrDeptEntity thrDeptEntity) { - return thrDeptDao.insertThrInvWarehouse(thrDeptEntity); + public boolean insertThrDept(ThrDeptEntity thrDeptEntity) { + return thrDeptDao.insertThrDept(thrDeptEntity); } @Override - public boolean insertInvWarehouses(List thrDeptEntities) { - return thrDeptDao.insertDeptList(thrDeptEntities); + public boolean insertThrDeptList(List thrDeptEntities) { + return thrDeptDao.insertThrDeptList(thrDeptEntities); } @Override @@ -161,7 +161,7 @@ public class ThrDeptServiceImpl extends ServiceImpl i } //插入数据 - thrDeptDao.insertDeptList(list); + thrDeptDao.insertThrDeptList(list); thrInvWarehouseDao.insertThrInvWarehouses(warehouseList); if (list.size() >= limit) { page++; diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml index 76bef351b..7c65aef9f 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml @@ -79,7 +79,7 @@ - replace INTO thr_dept @@ -174,7 +174,7 @@ - + replace into thr_dept (pid, code, `name`, advanceType, isDefault, status, updateTime, remark, `level`, pcode, thirdSysFk) From e3fdd85986f4cd5194e483f131103a82cff614ad Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 23 May 2023 21:11:46 +0800 Subject: [PATCH 6/7] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/mapper/thrsys/ThrDeptDao.xml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml index 7c65aef9f..eddcacaed 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml @@ -99,20 +99,20 @@ ) - - replace INTO thr_dept - (pid, code, name, advanceType, isDefault, - status, updateTime, remark, thirdSysFk) - VALUES - - ( - #{item.pid}, #{item.code}, - #{item.name}, #{item.advanceType}, #{item.isDefault}, - #{item.status}, #{item.updateTime}, - #{item.remark}, #{item.thirdSysFk}) - - + + + + + + + + + + + + + + DELETE From 21b81c5e40fd3c25f04f7bf3234584ebdf0b54ed Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Tue, 23 May 2023 21:12:47 +0800 Subject: [PATCH 7/7] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java | 1 + src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java index 6d892a2b3..6a0d2d4d3 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrDeptServiceImpl.java @@ -146,6 +146,7 @@ public class ThrDeptServiceImpl extends ServiceImpl i thrDeptEntity.setAdvanceType(false); //默认是仓库 thrDeptEntity.setStatus(1);//默认启用 thrDeptEntity.setUpdateTime(new Date()); + thrDeptEntity.setId(IdUtil.getSnowflake(6, 1).nextId()); list.add(thrDeptEntity); ThrInvWarehouseEntity thrInvWarehouseEntity = new ThrInvWarehouseEntity(); diff --git a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml index eddcacaed..911e382bc 100644 --- a/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml +++ b/src/main/resources/mybatis/mapper/thrsys/ThrDeptDao.xml @@ -175,12 +175,13 @@ - replace into thr_dept (pid, code, `name`, advanceType, isDefault, status, updateTime, remark, `level`, + replace into thr_dept (id,pid, code, `name`, advanceType, isDefault, status, updateTime, remark, `level`, pcode, thirdSysFk) values - (#{item.pid}, + (#{item.id}, + #{item.pid}, #{item.code}, #{item.name}, #{item.advanceType},