From aeb7b230584c680110b00e19dfd702e05c7a4d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 09:14:25 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java index 40f5a74..dbe9c75 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java @@ -95,7 +95,10 @@ public class BaseKnifeServiceImpl implements IBaseKnifeService { hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 /* 实体 */ - hashMap.put("outTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime())); // 出库时间 + String outTime = null; + if (nowWmsOutPlanDetailEntity.getCreateTime() != null) + outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime()); + hashMap.put("outTime", outTime); // 出库时间 hashMapList.add(hashMap); // 注入出库信息对象 From 94a638450247b619a8e86639e7563693988d6239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 10:46:10 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/wm/controller/WmsInTaskController.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java index b37ab90..e5894b2 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmsInTaskController.java @@ -43,13 +43,6 @@ public class WmsInTaskController extends BaseController { @Autowired private IWmStorageAreaService wmStorageAreaService; - @GetMapping("/open/list") - public TableDataInfo openList(WmsInTask wmsInTask) { - startPage(); - List list = wmsInTaskService.selectWmsInTaskList(wmsInTask); - return getDataTable(list); - } - /** * 查询入库任务列表 */ From 96dcda49d3c5442c61f1597f0a14a540eaf4ca98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 10:47:01 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/WmsOutTaskController.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java index 337c1e9..8e391e2 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java @@ -27,13 +27,6 @@ public class WmsOutTaskController extends BaseController { @Autowired private IWmsOutTaskService wmsOutTaskService; - @GetMapping("/open/list") - public TableDataInfo openList(WmsOutTask wmsOutTask) { - startPage(); - List list = wmsOutTaskService.selectWmsOutTaskList(wmsOutTask); - return getDataTable(list); - } - /** * 查询出库任务列表 */ From bbd43879165f7064aa8ac07d331aef572696b87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 11:03:23 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/WmsOutPlanController.java | 12 +++++ .../mes/md/service/IWmsOutPlanService.java | 4 ++ .../service/impl/WmsOutPlanServiceImpl.java | 51 +++++++++++++++++-- 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java index aae38da..a57b9df 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutPlanController.java @@ -7,12 +7,14 @@ import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.enums.BusinessType; import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.mes.md.domain.WmsOutPlan; +import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; import com.ktg.mes.md.service.IWmsOutPlanService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; import java.util.List; /** @@ -27,6 +29,16 @@ public class WmsOutPlanController extends BaseController { @Autowired private IWmsOutPlanService wmsOutPlanService; + /** + * 查询出库计划管理列表 + */ + @GetMapping("/open/list") + public TableDataInfo openList(WmsOutPlanDetailEntity wmsOutPlanDetailEntity) { + startPage(); + List> list = wmsOutPlanService.selectWmsOutPlanDetailEntityList(wmsOutPlanDetailEntity); + return getDataTable(list); + } + /** * 查询出库计划管理列表 */ diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutPlanService.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutPlanService.java index 5aae55f..f0109fa 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutPlanService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutPlanService.java @@ -1,7 +1,9 @@ package com.ktg.mes.md.service; import com.ktg.mes.md.domain.WmsOutPlan; +import com.ktg.mes.md.domain.WmsOutPlanDetailEntity; +import java.util.HashMap; import java.util.List; /** @@ -60,4 +62,6 @@ public interface IWmsOutPlanService { int deleteWmsOutPlanByWmsOutPlanId(Long wmsOutPlanId); boolean runWmsOutPlan(Long[] wmsOutPlanIds); + + List> selectWmsOutPlanDetailEntityList(WmsOutPlanDetailEntity wmsOutPlanDetailEntity); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java index b73ec38..4e33d13 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java @@ -3,10 +3,7 @@ package com.ktg.mes.md.service.impl; import com.ktg.common.utils.DateUtils; import com.ktg.common.utils.StringUtils; import com.ktg.mes.md.domain.*; -import com.ktg.mes.md.mapper.BaseKnifeMapper; -import com.ktg.mes.md.mapper.WmsOutPlanDetailEntityMapper; -import com.ktg.mes.md.mapper.WmsOutPlanMapper; -import com.ktg.mes.md.mapper.WmsOutTaskMapper; +import com.ktg.mes.md.mapper.*; import com.ktg.mes.md.service.IWmsOutPlanService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; +import java.util.HashMap; import java.util.List; /** @@ -37,6 +35,9 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { @Autowired private BaseKnifeMapper baseKnifeMapper; + @Autowired + private WmsBusinessTypeMapper wmsBusinessTypeMapper; + /** * 查询出库计划管理 * @@ -185,6 +186,48 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { return true; } + @Transactional + @Override + public List> selectWmsOutPlanDetailEntityList(WmsOutPlanDetailEntity wmsOutPlanDetailEntity) { + List wmsOutPlanDetailEntityList = wmsOutPlanDetailEntityMapper.selectWmsOutPlanDetailEntityList(wmsOutPlanDetailEntity); + List> hashMapList = new ArrayList<>(); + wmsOutPlanDetailEntityList.forEach(nowWmsOutPlanDetailEntity -> { + // 根据出库实例对象获取出库计划明细 + WmsOutPlanDetail wmsOutPlanDetail = this.wmsOutPlanMapper.selectWmsOutPlanDetailById(nowWmsOutPlanDetailEntity.getWmsOutPlanDetailId()); + + // 根据计划明细获得出库计划 + WmsOutPlan wmsOutPlan = this.wmsOutPlanMapper.selectWmsOutPlanByWmsOutPlanId(wmsOutPlanDetail.getWmsOutPlanId()); + + // 根据出库计划获得出库类型 + WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString()); + + // 设定出库信息数据 + HashMap hashMap = new HashMap<>(); + /* 来自计划 */ + hashMap.put("planCode", wmsOutPlan.getPlanCode()); // 计划编号 + hashMap.put("planStatus", wmsOutPlan.getPlanState()); // 计划状态 + hashMap.put("planType", wmsOutPlan.getPlanType()); // 计划类型 + hashMap.put("useUsername", wmsOutPlan.getRecipientUsername()); // 领用人 + /* 来自出入库计划类型 */ + hashMap.put("planTypeId", wmsBusinessType.getTypeId()); // 出库类型ID + hashMap.put("planTypeCode", wmsBusinessType.getCode()); // 出库类型编码 + hashMap.put("planTypeName", wmsBusinessType.getName()); // 出库类型名称 + /* 来自计划明细 */ + hashMap.put("detailBatchNum", wmsOutPlanDetail.getDetailBatchNum()); // 明细批次 + hashMap.put("wmStorageAreaId", wmsOutPlanDetail.getWmStorageAreaId()); // 库位ID + hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码 + hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 + hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 + /* 实体 */ + String outTime = null; + if (nowWmsOutPlanDetailEntity.getCreateTime() != null) + outTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nowWmsOutPlanDetailEntity.getCreateTime()); + hashMap.put("outTime", outTime); // 出库时间 + hashMapList.add(hashMap); + }); + return hashMapList; + } + /** * 新增出库计划明细信息 * From 2c47efdcb528ab4d7a2cd35cba56c39c3dd5a24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 11:06:25 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=9E=E5=B8=A6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java index 4e33d13..c66f287 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java @@ -201,6 +201,9 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { // 根据出库计划获得出库类型 WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString()); + // 获得台账明细 + BaseKnife baseKnife = baseKnifeMapper.selectBaseKnifeByBaseKnifeId(nowWmsOutPlanDetailEntity.getBaseKnifeId()); + // 设定出库信息数据 HashMap hashMap = new HashMap<>(); /* 来自计划 */ @@ -218,6 +221,10 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码 hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 + /* 来自台账明细 */ + hashMap.put("itemId", baseKnife.getMbbBdMrlId()); // 物料ID + hashMap.put("itemName", baseKnife.getKnifeName()); // 物料名称 + hashMap.put("itemCode", baseKnife.getKnifeCode()); // 物料编码 /* 实体 */ String outTime = null; if (nowWmsOutPlanDetailEntity.getCreateTime() != null) From 7d57efd9e2cd62d76442f1d4ce171d10eba9fd9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 11:10:41 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=A9=E6=96=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/md/service/impl/WmsOutPlanServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java index c66f287..0f44851 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutPlanServiceImpl.java @@ -38,6 +38,9 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { @Autowired private WmsBusinessTypeMapper wmsBusinessTypeMapper; + @Autowired + private MdItemMapper mdItemMapper; + /** * 查询出库计划管理 * @@ -201,8 +204,7 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { // 根据出库计划获得出库类型 WmsBusinessType wmsBusinessType = this.wmsBusinessTypeMapper.selectWmsBusinessTypeByTypeId(wmsOutPlan.getWmsBusinessTypeId().toString()); - // 获得台账明细 - BaseKnife baseKnife = baseKnifeMapper.selectBaseKnifeByBaseKnifeId(nowWmsOutPlanDetailEntity.getBaseKnifeId()); + MdItem mdItem = this.mdItemMapper.selectMdItemById(wmsOutPlanDetail.getMdItemId()); // 设定出库信息数据 HashMap hashMap = new HashMap<>(); @@ -222,9 +224,9 @@ public class WmsOutPlanServiceImpl implements IWmsOutPlanService { hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 /* 来自台账明细 */ - hashMap.put("itemId", baseKnife.getMbbBdMrlId()); // 物料ID - hashMap.put("itemName", baseKnife.getKnifeName()); // 物料名称 - hashMap.put("itemCode", baseKnife.getKnifeCode()); // 物料编码 + hashMap.put("itemId", mdItem.getItemId()); // 物料ID + hashMap.put("itemName", mdItem.getItemName()); // 物料名称 + hashMap.put("itemCode", mdItem.getItemCode()); // 物料编码 /* 实体 */ String outTime = null; if (nowWmsOutPlanDetailEntity.getCreateTime() != null) From e75be5d985de383b86c64b60f9f2926dfc764a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 15:14:51 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wm/controller/WmWarehouseController.java | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmWarehouseController.java b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmWarehouseController.java index ab16366..d621649 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmWarehouseController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/controller/WmWarehouseController.java @@ -1,31 +1,24 @@ package com.ktg.mes.wm.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import com.ktg.common.constant.UserConstants; -import com.ktg.mes.wm.service.IWmStorageAreaService; -import com.ktg.mes.wm.service.IWmStorageLocationService; -import com.ktg.mes.wm.utils.WmBarCodeUtil; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.ktg.common.annotation.Log; +import com.ktg.common.constant.UserConstants; import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.domain.AjaxResult; -import com.ktg.common.enums.BusinessType; -import com.ktg.mes.wm.domain.WmWarehouse; -import com.ktg.mes.wm.service.IWmWarehouseService; -import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.common.core.page.TableDataInfo; +import com.ktg.common.enums.BusinessType; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.mes.wm.domain.WmWarehouse; +import com.ktg.mes.wm.service.IWmStorageAreaService; +import com.ktg.mes.wm.service.IWmStorageLocationService; +import com.ktg.mes.wm.service.IWmWarehouseService; +import com.ktg.mes.wm.utils.WmBarCodeUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 仓库设置Controller @@ -133,9 +126,6 @@ public class WmWarehouseController extends BaseController @DeleteMapping("/{warehouseIds}") public AjaxResult remove(@PathVariable Long[] warehouseIds) { - - //TODO:仓库删除之前的逻辑校验 - for (Long wahouseId: warehouseIds ) { wmStorageLocationService.deleteByWarehouseId(wahouseId); From 491f1ed0a4025b2fe0ea0db77828f4dec8924874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 16:51:49 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ktg/mes/md/controller/MdUnitMeasureController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdUnitMeasureController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdUnitMeasureController.java index 74a75a3..0ad80ac 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdUnitMeasureController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdUnitMeasureController.java @@ -1,6 +1,5 @@ package com.ktg.mes.md.controller; -import com.ktg.mes.md.service.IMdUnitMeasureService; import com.ktg.common.annotation.Log; import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.domain.AjaxResult; @@ -8,6 +7,7 @@ import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.enums.BusinessType; import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.mes.md.domain.MdUnitMeasure; +import com.ktg.mes.md.service.IMdUnitMeasureService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -39,6 +39,9 @@ public class MdUnitMeasureController extends BaseController return getDataTable(list); } + /** + * 查询主列表 + */ @GetMapping("/listprimary") public AjaxResult listPrimary(){ MdUnitMeasure mdUnitMeasure = new MdUnitMeasure(); @@ -47,6 +50,9 @@ public class MdUnitMeasureController extends BaseController return AjaxResult.success(list); } + /** + * 选中全部 + */ @GetMapping("/selectall") public AjaxResult selectAll(){ MdUnitMeasure mdUnitMeasure = new MdUnitMeasure(); From df8fc37da3a25cc67e29edf828909507838c8239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Tue, 5 Nov 2024 16:59:56 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ktg/mes/md/controller/MdItemController.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java index 53c44b2..5f75994 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/MdItemController.java @@ -1,10 +1,5 @@ package com.ktg.mes.md.controller; -import com.ktg.common.utils.poi.ExcelUtil; -import com.ktg.mes.aspect.BarcodeGen; -import com.ktg.mes.md.domain.MdUnitMeasure; -import com.ktg.mes.md.domain.MdVendor; -import com.ktg.mes.md.service.IMdItemService; import com.ktg.common.annotation.Log; import com.ktg.common.constant.UserConstants; import com.ktg.common.core.controller.BaseController; @@ -13,8 +8,12 @@ import com.ktg.common.core.domain.entity.ItemType; import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.enums.BusinessType; import com.ktg.common.utils.StringUtils; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.mes.aspect.BarcodeGen; import com.ktg.mes.md.domain.MdItem; +import com.ktg.mes.md.domain.MdUnitMeasure; import com.ktg.mes.md.service.IItemTypeService; +import com.ktg.mes.md.service.IMdItemService; import com.ktg.mes.md.service.IMdUnitMeasureService; import com.ktg.mes.wm.utils.WmBarCodeUtil; import com.ktg.system.domain.SysOperLog; @@ -26,7 +25,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import javax.validation.constraints.Null; import java.util.*; @RestController @@ -89,6 +87,11 @@ public class MdItemController extends BaseController { return result; } + /** + * 主列表查询 + * + * @return + */ @GetMapping("/open/selectProduct") public List> selectProduct() { MdItem mdItem = new MdItem(); From 73e242a4a107ce3a1266cb14e7eac51b2d7cda7a Mon Sep 17 00:00:00 2001 From: star <2755454208@qq.com> Date: Tue, 5 Nov 2024 17:25:56 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/pom.xml | 16 ++++++++++++++++ ktg-admin/src/test/test.java | 32 ++++++++++++++++++++++++++++++++ ktg-mes/pom.xml | 15 +++++++++++++++ pom.xml | 15 +++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 ktg-admin/src/test/test.java diff --git a/ktg-admin/pom.xml b/ktg-admin/pom.xml index ceeef73..0429d95 100644 --- a/ktg-admin/pom.xml +++ b/ktg-admin/pom.xml @@ -30,6 +30,22 @@ springfox-boot-starter + + + org.springframework.boot + spring-boot-starter-test + 3.3.0 + test + 1 + + + junit + junit + 4.12 + test + + + io.swagger diff --git a/ktg-admin/src/test/test.java b/ktg-admin/src/test/test.java new file mode 100644 index 0000000..e87dbab --- /dev/null +++ b/ktg-admin/src/test/test.java @@ -0,0 +1,32 @@ +import com.ktg.RuoYiApplication; +import com.ktg.mes.qc.domain.InventoryTask; +import com.ktg.mes.qc.service.InventoryTaskService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class) +public class test { + @Autowired + private InventoryTaskService inventoryTaskService; + @Test + public void saveTest(){ + //新建任务对象 + InventoryTask inventoryTaskTest = new InventoryTask(); + inventoryTaskTest.setWmsInventoryCode("TEST001"); + inventoryTaskTest.setUomId("TEST001"); + inventoryTaskTest.setName("测试计划"); + inventoryTaskTest.setPlanPeriod("月"); + inventoryTaskTest.setStartTime("2022-01-01"); + inventoryTaskTest.setFinishTime("2022-12-31"); + inventoryTaskTest.setSuperiorTime("2022-01-01"); + inventoryTaskTest.setBelowTime("2022-12-31"); + inventoryTaskTest.setProductId("TEST001"); + //新增 + int i = inventoryTaskService.insertInventoryTask(inventoryTaskTest); + + } +} diff --git a/ktg-mes/pom.xml b/ktg-mes/pom.xml index 4bfeaee..e861a1b 100644 --- a/ktg-mes/pom.xml +++ b/ktg-mes/pom.xml @@ -21,6 +21,21 @@ jasperreports 6.18.1 + + + org.springframework.boot + spring-boot-starter-test + 3.3.0 + test + + + + junit + junit + 4.12 + test + + net.sf.jasperreports jasperreports-fonts diff --git a/pom.xml b/pom.xml index 85da62e..64b086e 100644 --- a/pom.xml +++ b/pom.xml @@ -122,6 +122,21 @@ ${commons.fileupload.version} + + + + org.springframework.boot + spring-boot-starter-test + 3.3.0 + test + + + + junit + junit + 4.12 + test + org.apache.poi From e61f01764f05f80d45d3d334c7f8e21a95fa00ea Mon Sep 17 00:00:00 2001 From: star <2755454208@qq.com> Date: Tue, 5 Nov 2024 17:52:42 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ktg-admin/pom.xml b/ktg-admin/pom.xml index 0429d95..1f18087 100644 --- a/ktg-admin/pom.xml +++ b/ktg-admin/pom.xml @@ -36,7 +36,7 @@ spring-boot-starter-test 3.3.0 test - 1 + junit From 0a5367ccfba53fc59f43da4216d0fbbe40d6fba9 Mon Sep 17 00:00:00 2001 From: star <2755454208@qq.com> Date: Wed, 6 Nov 2024 09:05:11 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/pom.xml | 28 +++++++++++++++++--- ktg-admin/src/test/InventoryTaskTest.java | 32 +++++++++++++++++++++++ ktg-mes/pom.xml | 14 ---------- pom.xml | 15 ----------- 4 files changed, 57 insertions(+), 32 deletions(-) create mode 100644 ktg-admin/src/test/InventoryTaskTest.java diff --git a/ktg-admin/pom.xml b/ktg-admin/pom.xml index 1f18087..26b1e76 100644 --- a/ktg-admin/pom.xml +++ b/ktg-admin/pom.xml @@ -31,20 +31,42 @@ + org.springframework.boot spring-boot-starter-test - 3.3.0 test - junit junit - 4.12 test + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + + org.apache.tomcat.embed + tomcat-embed-websocket + 8.5.23 + + + + javax.websocket + javax.websocket-api + 1.1 + provided + + + + + diff --git a/ktg-admin/src/test/InventoryTaskTest.java b/ktg-admin/src/test/InventoryTaskTest.java new file mode 100644 index 0000000..a842a87 --- /dev/null +++ b/ktg-admin/src/test/InventoryTaskTest.java @@ -0,0 +1,32 @@ +import com.ktg.RuoYiApplication; +import com.ktg.mes.qc.domain.InventoryTask; +import com.ktg.mes.qc.service.InventoryTaskService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class InventoryTaskTest { + @Autowired + private InventoryTaskService inventoryTaskService; + @Test + public void saveTest(){ + //新建任务对象 + InventoryTask inventoryTaskTest = new InventoryTask(); + inventoryTaskTest.setWmsInventoryCode("TEST001"); + inventoryTaskTest.setUomId("TEST001"); + inventoryTaskTest.setName("测试计划"); + inventoryTaskTest.setPlanPeriod("月"); + inventoryTaskTest.setStartTime("2022-01-01"); + inventoryTaskTest.setFinishTime("2022-12-31"); + inventoryTaskTest.setSuperiorTime("2022-01-01"); + inventoryTaskTest.setBelowTime("2022-12-31"); + inventoryTaskTest.setProductId("TEST001"); + //新增 + int i = inventoryTaskService.insertInventoryTask(inventoryTaskTest); + + } +} diff --git a/ktg-mes/pom.xml b/ktg-mes/pom.xml index e861a1b..86a794b 100644 --- a/ktg-mes/pom.xml +++ b/ktg-mes/pom.xml @@ -21,20 +21,6 @@ jasperreports 6.18.1 - - - org.springframework.boot - spring-boot-starter-test - 3.3.0 - test - - - - junit - junit - 4.12 - test - net.sf.jasperreports diff --git a/pom.xml b/pom.xml index 64b086e..85da62e 100644 --- a/pom.xml +++ b/pom.xml @@ -122,21 +122,6 @@ ${commons.fileupload.version} - - - - org.springframework.boot - spring-boot-starter-test - 3.3.0 - test - - - - junit - junit - 4.12 - test - org.apache.poi From 0710879d79015c2946496c1bdd3289a71f268201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 6 Nov 2024 15:29:27 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=BA=93=E6=88=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/src/test/WmWarehouseUnitTest.java | 77 +++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 ktg-admin/src/test/WmWarehouseUnitTest.java diff --git a/ktg-admin/src/test/WmWarehouseUnitTest.java b/ktg-admin/src/test/WmWarehouseUnitTest.java new file mode 100644 index 0000000..cd0d935 --- /dev/null +++ b/ktg-admin/src/test/WmWarehouseUnitTest.java @@ -0,0 +1,77 @@ +import com.alibaba.fastjson.JSON; +import com.ktg.RuoYiApplication; +import com.ktg.mes.wm.controller.WmWarehouseController; +import com.ktg.mes.wm.domain.WmWarehouse; +import com.ktg.mes.wm.service.IWmWarehouseService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class WmWarehouseUnitTest { + @Autowired + private WmWarehouseController wmWarehouseController = null; + + @Autowired + private IWmWarehouseService wmWarehouseService; + + @Test + public void add() { + WmWarehouse wmWarehouse = new WmWarehouse(); + wmWarehouse.setWarehouseCode("WH999"); + wmWarehouse.setWarehouseName("测试库房999"); + wmWarehouse.setCharge("张三丰"); + wmWarehouse.setRemark("这是一个测试库房999"); + wmWarehouse.setAttr1("7"); + wmWarehouse.setAttr2("刀柄入库"); + wmWarehouse.setAttr3(1L); + wmWarehouseService.insertWmWarehouse(wmWarehouse); + System.out.println("add:" + wmWarehouse.getWarehouseId()); // 222 + } + + @Test + public void list() { + List list = wmWarehouseService.selectWmWarehouseList(new WmWarehouse()); + System.out.println("list:" + JSON.toJSONString(list)); + } + +// @Test TODO E +// public void getTreeList() { +// List list = wmWarehouseService.getTreeList(); +// System.out.println("getTreeList:" + JSON.toJSONString(list)); +// } + + @Test + public void getInfo() { + System.out.println("getInfo:" + JSON.toJSONString(wmWarehouseService.selectWmWarehouseByWarehouseId(222L))); + } + + @Test + public void edit() { + WmWarehouse wmWarehouse = new WmWarehouse(); + wmWarehouse.setWarehouseId(222L); + wmWarehouse.setWarehouseCode("WH999EDIT"); + wmWarehouse.setWarehouseName("测试库房999EDIT"); + wmWarehouse.setCharge("张三丰"); + wmWarehouse.setFrozenFlag("N"); + wmWarehouse.setRemark("这是一个测试库房999EDIT"); + wmWarehouse.setAttr1("7"); + wmWarehouse.setAttr2("刀柄入库"); + wmWarehouse.setAttr3(1L); + wmWarehouse.setAttr4(0L); + int count = wmWarehouseService.updateWmWarehouse(wmWarehouse); + System.out.println("edit:" + count); + } + + @Test + public void remove() { + Long[] ids = {222L}; + int count = wmWarehouseService.deleteWmWarehouseByWarehouseIds(ids); + System.out.println("remove:" + count); + } +} From 682bc52c778ece69c48c7619ea4177ecde69d41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 6 Nov 2024 15:30:59 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/src/test/WmWarehouseUnitTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ktg-admin/src/test/WmWarehouseUnitTest.java b/ktg-admin/src/test/WmWarehouseUnitTest.java index cd0d935..b0c8588 100644 --- a/ktg-admin/src/test/WmWarehouseUnitTest.java +++ b/ktg-admin/src/test/WmWarehouseUnitTest.java @@ -1,6 +1,5 @@ import com.alibaba.fastjson.JSON; import com.ktg.RuoYiApplication; -import com.ktg.mes.wm.controller.WmWarehouseController; import com.ktg.mes.wm.domain.WmWarehouse; import com.ktg.mes.wm.service.IWmWarehouseService; import org.junit.Test; @@ -14,9 +13,6 @@ import java.util.List; @RunWith(SpringRunner.class) @SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class WmWarehouseUnitTest { - @Autowired - private WmWarehouseController wmWarehouseController = null; - @Autowired private IWmWarehouseService wmWarehouseService; From b82c30fc2765f18290f1bcca7f93caaa2ee937f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 6 Nov 2024 16:06:12 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E7=BC=96=E5=86=99=E5=BA=93=E5=8C=BA?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/WmStorageLocationUnitTest.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 ktg-admin/src/test/WmStorageLocationUnitTest.java diff --git a/ktg-admin/src/test/WmStorageLocationUnitTest.java b/ktg-admin/src/test/WmStorageLocationUnitTest.java new file mode 100644 index 0000000..767efc9 --- /dev/null +++ b/ktg-admin/src/test/WmStorageLocationUnitTest.java @@ -0,0 +1,62 @@ +import com.alibaba.fastjson.JSON; +import com.ktg.RuoYiApplication; +import com.ktg.mes.wm.domain.WmStorageLocation; +import com.ktg.mes.wm.service.IWmStorageLocationService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class WmStorageLocationUnitTest { + @Autowired + private IWmStorageLocationService wmStorageLocationService; + + @Test + public void add() { + WmStorageLocation wmStorageLocation = new WmStorageLocation(); + wmStorageLocation.setLocationCode("L061"); + wmStorageLocation.setLocationName("测试库区001"); + wmStorageLocation.setWarehouseId(210L); + wmStorageLocation.setRemark("则是一个测试库区"); + wmStorageLocation.setLocationName("原料仓"); + wmStorageLocationService.insertWmStorageLocation(wmStorageLocation); + System.out.println("add:" + wmStorageLocation.getLocationId()); // 227 + } + + @Test + public void list() { + List list = wmStorageLocationService.selectWmStorageLocationList(new WmStorageLocation()); + System.out.println("list:" + JSON.toJSONString(list)); + } + + @Test + public void getInfo() { + System.out.println("getInfo:" + JSON.toJSONString(wmStorageLocationService.selectWmStorageLocationByLocationId(227L))); + } + + @Test + public void edit() { + WmStorageLocation wmStorageLocation = new WmStorageLocation(); + wmStorageLocation.setRemark("这是一个测试库区"); + wmStorageLocation.setLocationId(227L); + wmStorageLocation.setLocationCode("L061"); + wmStorageLocation.setLocationName("原料仓"); + wmStorageLocation.setWarehouseId(210L); + wmStorageLocation.setAreaFlag("N"); + wmStorageLocation.setFrozenFlag("N"); + int count = wmStorageLocationService.updateWmStorageLocation(wmStorageLocation); + System.out.println("edit:" + count); + } + + @Test + public void remove() { + Long[] ids = {227L}; + int count = wmStorageLocationService.deleteWmStorageLocationByLocationIds(ids); + System.out.println("remove:" + count); + } +} From 7fc5556b570de33774589843da0319fc072ef2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 6 Nov 2024 16:17:26 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E7=BC=96=E5=86=99=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/WmStorageLocationUnitTest.java | 3 + ktg-admin/src/test/WmWarehouseUnitTest.java | 3 + .../src/test/WmsBusinessTypeUnitTest.java | 62 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 ktg-admin/src/test/WmsBusinessTypeUnitTest.java diff --git a/ktg-admin/src/test/WmStorageLocationUnitTest.java b/ktg-admin/src/test/WmStorageLocationUnitTest.java index 767efc9..9f13d83 100644 --- a/ktg-admin/src/test/WmStorageLocationUnitTest.java +++ b/ktg-admin/src/test/WmStorageLocationUnitTest.java @@ -10,6 +10,9 @@ import org.springframework.test.context.junit4.SpringRunner; import java.util.List; +/** + * 库区管理 + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class WmStorageLocationUnitTest { diff --git a/ktg-admin/src/test/WmWarehouseUnitTest.java b/ktg-admin/src/test/WmWarehouseUnitTest.java index b0c8588..3a0dbe5 100644 --- a/ktg-admin/src/test/WmWarehouseUnitTest.java +++ b/ktg-admin/src/test/WmWarehouseUnitTest.java @@ -10,6 +10,9 @@ import org.springframework.test.context.junit4.SpringRunner; import java.util.List; +/** + * 库房管理 + */ @RunWith(SpringRunner.class) @SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class WmWarehouseUnitTest { diff --git a/ktg-admin/src/test/WmsBusinessTypeUnitTest.java b/ktg-admin/src/test/WmsBusinessTypeUnitTest.java new file mode 100644 index 0000000..24690a3 --- /dev/null +++ b/ktg-admin/src/test/WmsBusinessTypeUnitTest.java @@ -0,0 +1,62 @@ +import com.alibaba.fastjson.JSON; +import com.ktg.RuoYiApplication; +import com.ktg.mes.md.domain.WmsBusinessType; +import com.ktg.mes.md.service.IWmsBusinessTypeService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.List; + +/** + * 出入库类型 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class WmsBusinessTypeUnitTest { + @Autowired + private IWmsBusinessTypeService wmsBusinessTypeService; + + @Test + public void add() { + WmsBusinessType wmsBusinessType = new WmsBusinessType(); + wmsBusinessType.setCode("TYPE_UNIT_TEST_01"); + wmsBusinessType.setName("出库单元测试数据01"); + wmsBusinessType.setFlag("2"); + wmsBusinessType.setRemark("出库单元测试数据01"); + wmsBusinessTypeService.insertWmsBusinessType(wmsBusinessType); + System.out.println("add:" + wmsBusinessType.getTypeId()); // 14 + } + + @Test + public void list() { + List list = wmsBusinessTypeService.selectWmsBusinessTypeList(new WmsBusinessType()); + System.out.println("list:" + JSON.toJSONString(list)); + } + + @Test + public void getInfo() { + System.out.println("getInfo:" + JSON.toJSONString(wmsBusinessTypeService.selectWmsBusinessTypeByTypeId("14"))); + } + + @Test + public void edit() { + WmsBusinessType wmsBusinessType = new WmsBusinessType(); + wmsBusinessType.setTypeId("14"); + wmsBusinessType.setCode("TYPE_UNIT_TEST_02"); + wmsBusinessType.setName("出库单元测试数据02"); + wmsBusinessType.setFlag("2"); + wmsBusinessType.setRemark("出库单元测试数据02"); + int count = wmsBusinessTypeService.updateWmsBusinessType(wmsBusinessType); + System.out.println("edit:" + count); + } + + @Test + public void remove() { + String[] ids = {"14"}; + int count = wmsBusinessTypeService.deleteWmsBusinessTypeByTypeIds(ids); + System.out.println("remove:" + count); + } +} From a73a6e96a6c8445adb6be1295140a23a0ba0d97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 6 Nov 2024 17:09:24 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E7=BC=96=E5=86=99=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/src/test/SysDeptUnitTest.java | 97 +++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 ktg-admin/src/test/SysDeptUnitTest.java diff --git a/ktg-admin/src/test/SysDeptUnitTest.java b/ktg-admin/src/test/SysDeptUnitTest.java new file mode 100644 index 0000000..07fe224 --- /dev/null +++ b/ktg-admin/src/test/SysDeptUnitTest.java @@ -0,0 +1,97 @@ +import com.alibaba.fastjson.JSON; +import com.ktg.RuoYiApplication; +import com.ktg.common.core.domain.AjaxResult; +import com.ktg.common.core.domain.entity.SysDept; +import com.ktg.common.utils.StringUtils; +import com.ktg.system.service.ISysDeptService; +import org.apache.commons.lang3.ArrayUtils; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.Iterator; +import java.util.List; + +/** + * 组织机构 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class SysDeptUnitTest { + @Autowired + private ISysDeptService deptService; + + @Test + public void add() { + SysDept sysDept = new SysDept(); + sysDept.setParentId(100L); + sysDept.setDeptName("单元测试机构01"); + sysDept.setDeptCode("UNIT_DEP_001"); + sysDept.setDeptType(4); + sysDept.setOrderNum("1"); + sysDept.setStatus("0"); + deptService.insertDept(sysDept); + System.out.println("add:" + sysDept.getDeptId()); // 119 + } + + @Test + public void list() { + List list = deptService.selectDeptList(new SysDept()); + System.out.println("list:" + JSON.toJSONString(list)); + } + + @Test + public void getInfo() { + System.out.println("getInfo:" + JSON.toJSONString(deptService.selectDeptById(119L))); + } + + @Test + public void edit() { + SysDept sysDept = new SysDept(); + sysDept.setDeptId(119L); + sysDept.setParentId(100L); + sysDept.setAncestors("0,100"); + sysDept.setDeptName("单元测试机构02"); + sysDept.setDeptCode("UNIT_DEP_002"); + sysDept.setDeptType(4); + sysDept.setOrderNum("1"); + int count = deptService.updateDept(sysDept); + System.out.println("edit:" + count); + } + + @Test + public void remove() { + int count = deptService.deleteDeptById(119L); + System.out.println("remove:" + count); + } + + @Test + public void excludeChild() { + List depts = deptService.selectDeptList(new SysDept()); + Iterator it = depts.iterator(); + while (it.hasNext()) { + SysDept d = it.next(); + if (d.getDeptId().intValue() == 100 + || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), 100 + "")) { + it.remove(); + } + } + System.out.println("excludeChild:" + JSON.toJSONString(depts)); + } + + @Test + public void treeselect() { + List depts = deptService.selectDeptList(new SysDept()); + System.out.println("treeselect:" + JSON.toJSONString(depts)); + } + + @Test + public void roleDeptTreeselect() { + List depts = deptService.selectDeptList(new SysDept()); + AjaxResult ajax = AjaxResult.success(); + ajax.put("checkedKeys", deptService.selectDeptListByRoleId(100L)); + System.out.println("roleDeptTreeselect:" + JSON.toJSONString(depts)); + } +} From 39ebdece85d6b5213f7187232f1597aceae0428b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=90=8D=E5=96=9C?= Date: Wed, 6 Nov 2024 17:35:15 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E7=BC=96=E5=86=99=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ktg-admin/src/test/SysUserUnitTest.java | 106 ++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 ktg-admin/src/test/SysUserUnitTest.java diff --git a/ktg-admin/src/test/SysUserUnitTest.java b/ktg-admin/src/test/SysUserUnitTest.java new file mode 100644 index 0000000..bc32b7d --- /dev/null +++ b/ktg-admin/src/test/SysUserUnitTest.java @@ -0,0 +1,106 @@ +import com.alibaba.fastjson.JSON; +import com.ktg.RuoYiApplication; +import com.ktg.common.core.domain.entity.SysRole; +import com.ktg.common.core.domain.entity.SysUser; +import com.ktg.system.service.ISysRoleService; +import com.ktg.system.service.ISysUserService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 用户管理 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = RuoYiApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class SysUserUnitTest { + @Autowired + private ISysUserService userService; + + @Autowired + private ISysRoleService roleService; + + @Test + public void add() { + SysUser sysUser = new SysUser(); + sysUser.setDeptId(118L); + sysUser.setUserName("unittest02"); + sysUser.setNickName("单元测试用户02"); + sysUser.setPassword("123456"); + sysUser.setStatus("0"); + sysUser.setRoleIds(new Long[]{105L}); + userService.insertUser(sysUser); + System.out.println("add:" + sysUser.getUserId()); // 117 + } + + @Test + public void list() { + List list = userService.selectUserList(new SysUser()); + System.out.println("list:" + JSON.toJSONString(list)); + } + + @Test + public void getInfo() { + System.out.println("getInfo:" + JSON.toJSONString(userService.selectUserById(117L))); + } + + @Test + public void edit() { + SysUser sysUser = new SysUser(); + sysUser.setUserId(117L); + sysUser.setUserName("unittest02"); + sysUser.setNickName("单元测试用户03"); + sysUser.setPassword("123456"); + sysUser.setStatus("0"); + sysUser.setRoleIds(new Long[]{105L}); + int count = userService.updateUser(sysUser); + System.out.println("edit:" + count); + } + + @Test + public void remove() { + Long[] ids = {117L}; + int count = userService.deleteUserByIds(ids); + System.out.println("remove:" + count); + } + + @Test + public void resetPwd() { + SysUser sysUser = new SysUser(); + sysUser.setUserId(117L); + sysUser.setPassword("123456"); + int count = userService.resetPwd(sysUser); + System.out.println("resetPwd:" + count); + } + + @Test + public void changeStatus() { + SysUser sysUser = new SysUser(); + sysUser.setUserId(117L); + sysUser.setStatus("1"); + int count = userService.resetPwd(sysUser); + System.out.println("changeStatus:" + count); + } + + @Test + public void authRole() { + HashMap map = new HashMap<>(); + SysUser user = userService.selectUserById(117L); + List roles = roleService.selectRolesByUserId(117L); + map.put("user", user); + map.put("roles", SysUser.isAdmin(117L) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); + System.out.println("authRole:" + JSON.toJSONString(map)); + } + + @Test + public void insertAuthRole() { + userService.insertUserAuth(117L, new Long[]{105L}); + System.out.println("insertAuthRole:OK"); + } +} From 0c6e34b6c39b8596fe62888d9e2f3e704239c4e0 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 09:52:54 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/BaseKnifeController.java | 2 +- ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml | 8 ++++---- ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index 6a243fb..ccf6231 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java @@ -507,7 +507,7 @@ public class BaseKnifeController extends BaseController List bomList; for (BaseTechnologyBom techBom : technologyBomList){ mdItem = mdItemService.selectMdItemByCode(techBom.getKnifeCode()); - count = techBom.getKnifeCount(); + count = techBom.getKnifeCount() - countMap.get(techBom.getKnifeCode()); // 先从台账表找 baseKnifeWrapper.setMbbBdMrlId(mdItem.getItemId()); diff --git a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml index 2aa8d4e..db0ad4f 100644 --- a/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/MdItemMapper.xml @@ -245,10 +245,10 @@ #{remark}, - + #{attr1}, - + #{attr2}, @@ -314,10 +314,10 @@ remark = #{remark}, - + attr1=#{attr1}, - + attr2=#{attr2}, diff --git a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml index f47a689..85e0494 100644 --- a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanMapper.xml @@ -344,13 +344,13 @@ - insert into WMS_OUT_PLAN_DETAIL(WMS_OUT_PLAN_DETAIL_ID, WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, + insert into WMS_OUT_PLAN_DETAIL( WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM, WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) values - (#{item.wmsOutPlanDetailId}, #{item.wmsOutPlanId}, #{item.mdItemId}, #{item.mdItemCode}, #{item.mdItemName}, + ( #{item.wmsOutPlanId}, #{item.mdItemId}, #{item.mdItemCode}, #{item.mdItemName}, #{item.mdItemUnit}, #{item.plannedQuantity}, #{item.realQuantity}, #{item.detailBatchNum}, #{item.wmStorageAreaId}, #{item.wmStorageAreaCode}, #{item.wmStorageAreaName}, #{item.detailState}, #{item.remark}, #{item.attr1}, #{item.attr2}, #{item.attr3}, #{item.attr4}, #{item.createBy}, @@ -360,12 +360,12 @@ - insert into WMS_OUT_PLAN_DETAIL(WMS_OUT_PLAN_DETAIL_ID, WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, + insert into WMS_OUT_PLAN_DETAIL( WMS_OUT_PLAN_ID, MD_ITEM_ID, MD_ITEM_CODE, MD_ITEM_NAME, MD_ITEM_UNIT, PLANNED_QUANTITY, REAL_QUANTITY, DETAIL_BATCH_NUM, WM_STORAGE_AREA_ID, WM_STORAGE_AREA_CODE, WM_STORAGE_AREA_NAME, DETAIL_STATE, REMARK, ATTR1, ATTR2, ATTR3, ATTR4, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME) - values (#{wmsOutPlanDetailId}, #{wmsOutPlanId}, #{mdItemId}, #{mdItemCode}, #{mdItemName}, + values ( #{wmsOutPlanId}, #{mdItemId}, #{mdItemCode}, #{mdItemName}, #{mdItemUnit}, #{plannedQuantity}, #{realQuantity}, #{detailBatchNum}, #{wmStorageAreaId}, #{wmStorageAreaCode}, #{wmStorageAreaName}, #{detailState}, #{remark}, #{attr1}, #{attr2}, #{attr3}, #{attr4}, #{createBy},