From bac0685a12fef298b50583cec50abc480cce3f10 Mon Sep 17 00:00:00 2001 From: x_z Date: Sun, 26 Jun 2022 16:13:55 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E5=8D=95=E6=8D=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E4=BB=93=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=202.=E5=A7=94=E6=89=98=E9=AA=8C=E6=94=B6=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=B7=BB=E5=8A=A0=E5=88=86=E4=BB=93=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/EntrustReceController.java | 8 ++-- .../controller/inout/WareHouseController.java | 8 ++-- .../api/admin/dao/basic/EntrustReceDao.java | 4 +- .../dao/inventory/InvSubWarehouseDao.java | 8 ++++ ...eRespose.java => EntrustReceResponse.java} | 39 ++++++++++++++++++- .../service/basic/EntrustReceService.java | 4 +- .../basic/impl/EntrustReceServiceImpl.java | 20 ++++++++-- .../mybatis/mapper/basic/EntrustReceDao.xml | 2 +- .../mapper/inventory/InvSubWarehouseDao.xml | 5 +++ 9 files changed, 82 insertions(+), 16 deletions(-) rename api-admin/src/main/java/com/glxp/api/admin/res/basic/{EntrustReceRespose.java => EntrustReceResponse.java} (57%) diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/EntrustReceController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/EntrustReceController.java index acb9adde..1e69ea85 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/basic/EntrustReceController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/basic/EntrustReceController.java @@ -9,7 +9,7 @@ import com.glxp.api.admin.req.basic.BasicEntrustRecRequest; import com.glxp.api.admin.req.inout.DeleteRequest; import com.glxp.api.admin.req.receipt.BussinessTypeFilterRequest; import com.glxp.api.admin.res.PageSimpleResponse; -import com.glxp.api.admin.res.basic.EntrustReceRespose; +import com.glxp.api.admin.res.basic.EntrustReceResponse; import com.glxp.api.admin.service.auth.CustomerService; import com.glxp.api.admin.service.basic.BussinessTypeService; import com.glxp.api.admin.service.basic.EntrustReceService; @@ -37,10 +37,10 @@ public class EntrustReceController { @GetMapping("/spms/entrust/rece/filter") public BaseResponse getEntrustRece(BasicEntrustRecRequest basicExportStatusRequest) { - List entrustReceEntities = entrustReceService.filterJoinEntrustRec(basicExportStatusRequest); - PageInfo pageInfo; + List entrustReceEntities = entrustReceService.filterJoinEntrustRec(basicExportStatusRequest); + PageInfo pageInfo; pageInfo = new PageInfo<>(entrustReceEntities); - PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); + PageSimpleResponse pageSimpleResponse = new PageSimpleResponse<>(); pageSimpleResponse.setTotal(pageInfo.getTotal()); pageSimpleResponse.setList(entrustReceEntities); return ResultVOUtils.success(pageSimpleResponse); diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java index f9ff807a..7d1f5f97 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/inout/WareHouseController.java @@ -53,8 +53,6 @@ import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; @@ -270,9 +268,13 @@ public class WareHouseController { @AuthRuleAnnotation("") @GetMapping("warehouse/inout/submitOrderWeb") public BaseResponse submitOrderWeb(AddOrderRequest orderEntity) { + if (null != orderEntity) { + if (StrUtil.isBlank(orderEntity.getInvWarehouseCode())) { + return ResultVOUtils.error(500, "分仓未选择"); + } + } orderService.updateOrderStatus(orderEntity.getOrderId(), ConstantStatus.ORDER_STATUS_PROCESS); return saveOrderWeb(orderEntity); -// return ResultVOUtils.success(); } @AuthRuleAnnotation("") diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java index 247624e1..94123d4f 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/basic/EntrustReceDao.java @@ -3,7 +3,7 @@ package com.glxp.api.admin.dao.basic; import com.glxp.api.admin.entity.basic.DlEntrustReceEntity; import com.glxp.api.admin.entity.basic.EntrustReceEntity; import com.glxp.api.admin.req.basic.BasicEntrustRecRequest; -import com.glxp.api.admin.res.basic.EntrustReceRespose; +import com.glxp.api.admin.res.basic.EntrustReceResponse; import org.apache.ibatis.annotations.Mapper; import java.util.List; @@ -17,7 +17,7 @@ public interface EntrustReceDao { List downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); - List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); + List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); diff --git a/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java b/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java index 0bf29465..8049e11a 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java +++ b/api-admin/src/main/java/com/glxp/api/admin/dao/inventory/InvSubWarehouseDao.java @@ -35,4 +35,12 @@ public interface InvSubWarehouseDao { * @return */ int countByParentIdAndName(@Param("parentId") String parentId, @Param("name") String name); + + /** + * 根据编码查询名称 + * + * @param code + * @return + */ + String selectNameByCode(@Param("code") String code); } diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java b/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceResponse.java similarity index 57% rename from api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java rename to api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceResponse.java index 8170b6b5..ad5ce51d 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceRespose.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/basic/EntrustReceResponse.java @@ -5,7 +5,7 @@ import lombok.Data; import java.util.Date; @Data -public class EntrustReceRespose { +public class EntrustReceResponse { private Integer id; private String action; private String entrustInv; @@ -16,11 +16,48 @@ public class EntrustReceRespose { private String remark; private boolean finishRece; private String curName; + private String entrustName; + + /** + * 委托验收人 + */ private String employeeName; + + /** + * 分库名称 + */ private String entrustInvName; + + /** + * 当前仓库编码 + */ private String curInv; + + /** + * 当前仓库名称 + */ private String curInvName; + + /** + * 委托分库编码 + */ private String entrustSubInv; + + /** + * 当前分库编码 + */ private String invWarehouseCode; + + /** + * 当前分库名称 + */ + private String invWarehouseName; + + /** + * 委托分库名称 + */ + private String entrustSubInvName; + + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/EntrustReceService.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/EntrustReceService.java index 46bbcdae..8509ae37 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/EntrustReceService.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/EntrustReceService.java @@ -4,7 +4,7 @@ package com.glxp.api.admin.service.basic; import com.glxp.api.admin.entity.basic.DlEntrustReceEntity; import com.glxp.api.admin.entity.basic.EntrustReceEntity; import com.glxp.api.admin.req.basic.BasicEntrustRecRequest; -import com.glxp.api.admin.res.basic.EntrustReceRespose; +import com.glxp.api.admin.res.basic.EntrustReceResponse; import java.util.List; @@ -16,7 +16,7 @@ public interface EntrustReceService { List downloadEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); - List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); + List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest); boolean insertEntrustRec(EntrustReceEntity ioOrderStatusEntity); diff --git a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/EntrustReceServiceImpl.java b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/EntrustReceServiceImpl.java index 90fae389..5c1c31c7 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/EntrustReceServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/api/admin/service/basic/impl/EntrustReceServiceImpl.java @@ -3,10 +3,11 @@ package com.glxp.api.admin.service.basic.impl; import cn.hutool.core.collection.CollUtil; import com.github.pagehelper.PageHelper; import com.glxp.api.admin.dao.basic.EntrustReceDao; +import com.glxp.api.admin.dao.inventory.InvSubWarehouseDao; import com.glxp.api.admin.entity.basic.DlEntrustReceEntity; import com.glxp.api.admin.entity.basic.EntrustReceEntity; import com.glxp.api.admin.req.basic.BasicEntrustRecRequest; -import com.glxp.api.admin.res.basic.EntrustReceRespose; +import com.glxp.api.admin.res.basic.EntrustReceResponse; import com.glxp.api.admin.service.basic.EntrustReceService; import org.springframework.stereotype.Service; @@ -19,6 +20,8 @@ public class EntrustReceServiceImpl implements EntrustReceService { @Resource EntrustReceDao entrustReceDao; + @Resource + private InvSubWarehouseDao invSubWarehouseDao; @Override public EntrustReceEntity findById(Integer id) { @@ -57,7 +60,7 @@ public class EntrustReceServiceImpl implements EntrustReceService { } @Override - public List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) { + public List filterJoinEntrustRec(BasicEntrustRecRequest basicEntrustRecRequest) { if (basicEntrustRecRequest == null) { return Collections.emptyList(); @@ -66,7 +69,18 @@ public class EntrustReceServiceImpl implements EntrustReceService { int offset = (basicEntrustRecRequest.getPage() - 1) * basicEntrustRecRequest.getLimit(); PageHelper.offsetPage(offset, basicEntrustRecRequest.getLimit()); } - return entrustReceDao.filterJoinEntrustRec(basicEntrustRecRequest); + List entrustReceResponses = entrustReceDao.filterJoinEntrustRec(basicEntrustRecRequest); + if (CollUtil.isNotEmpty(entrustReceResponses)) { + //查询当前分库名称和委托验收分库名称 + entrustReceResponses.forEach(entrustReceResponse -> { + String invWarehouseName = invSubWarehouseDao.selectNameByCode(entrustReceResponse.getInvWarehouseCode());//查询当前分库名称 + entrustReceResponse.setInvWarehouseName(invWarehouseName); + + String entrustSubInvName = invSubWarehouseDao.selectNameByCode(entrustReceResponse.getEntrustSubInv()); + entrustReceResponse.setEntrustSubInvName(entrustSubInvName); + }); + } + return entrustReceResponses; } @Override diff --git a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml index 3d058a00..b9dc040a 100644 --- a/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml +++ b/api-admin/src/main/resources/mybatis/mapper/basic/EntrustReceDao.xml @@ -65,7 +65,7 @@ + \ No newline at end of file