Commit 631a829f00df3c446dca1f8a8a9f82a5c55cc684
1 parent
787cce09
✨ feat(mes): 添加客户英文名称及出库单查询功能
新增客户英文名称字段,优化客户信息展示。实现按客户编号查询销售出库单列表的功能,提升用户体验。
Showing
10 changed files
with
49 additions
and
1 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/md/client/vo/MesMdClientPageReqVO.java
| @@ -21,6 +21,9 @@ public class MesMdClientPageReqVO extends PageParam { | @@ -21,6 +21,9 @@ public class MesMdClientPageReqVO extends PageParam { | ||
| 21 | @Schema(description = "客户简称", example = "比亚迪") | 21 | @Schema(description = "客户简称", example = "比亚迪") |
| 22 | private String nickname; | 22 | private String nickname; |
| 23 | 23 | ||
| 24 | + @Schema(description = "客户英文名称", example = "BYD") | ||
| 25 | + private String englishName; | ||
| 26 | + | ||
| 24 | @Schema(description = "客户类型", example = "1") | 27 | @Schema(description = "客户类型", example = "1") |
| 25 | private Integer type; | 28 | private Integer type; |
| 26 | 29 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/pendinginspect/MesQcPendingInspectController.java
| @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.GetMapping; | @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.GetMapping; | ||
| 28 | import org.springframework.web.bind.annotation.RequestMapping; | 28 | import org.springframework.web.bind.annotation.RequestMapping; |
| 29 | import org.springframework.web.bind.annotation.RestController; | 29 | import org.springframework.web.bind.annotation.RestController; |
| 30 | 30 | ||
| 31 | +import java.util.List; | ||
| 31 | import java.util.Map; | 32 | import java.util.Map; |
| 32 | 33 | ||
| 33 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 34 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| @@ -68,7 +69,7 @@ public class MesQcPendingInspectController { | @@ -68,7 +69,7 @@ public class MesQcPendingInspectController { | ||
| 68 | 69 | ||
| 69 | // ==================== 拼接 VO ==================== | 70 | // ==================== 拼接 VO ==================== |
| 70 | 71 | ||
| 71 | - private void buildPendingInspectRespVOList(java.util.List<MesQcPendingInspectRespVO> list) { | 72 | + private void buildPendingInspectRespVOList(List<MesQcPendingInspectRespVO> list) { |
| 72 | if (CollUtil.isEmpty(list)) { | 73 | if (CollUtil.isEmpty(list)) { |
| 73 | return; | 74 | return; |
| 74 | } | 75 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/productsales/vo/line/MesWmProductSalesLinePageReqVO.java
| @@ -6,6 +6,8 @@ import lombok.Data; | @@ -6,6 +6,8 @@ import lombok.Data; | ||
| 6 | import lombok.EqualsAndHashCode; | 6 | import lombok.EqualsAndHashCode; |
| 7 | import lombok.ToString; | 7 | import lombok.ToString; |
| 8 | 8 | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 9 | @Schema(description = "管理后台 - MES 销售出库单行分页 Request VO") | 11 | @Schema(description = "管理后台 - MES 销售出库单行分页 Request VO") |
| 10 | @Data | 12 | @Data |
| 11 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| @@ -15,4 +17,10 @@ public class MesWmProductSalesLinePageReqVO extends PageParam { | @@ -15,4 +17,10 @@ public class MesWmProductSalesLinePageReqVO extends PageParam { | ||
| 15 | @Schema(description = "出库单ID", example = "1") | 17 | @Schema(description = "出库单ID", example = "1") |
| 16 | private Long salesId; | 18 | private Long salesId; |
| 17 | 19 | ||
| 20 | + @Schema(description = "客户编号", example = "1") | ||
| 21 | + private Long clientId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "出库单编号列表(内部使用,客户过滤时自动填充)", hidden = true) | ||
| 24 | + private List<Long> salesIds; | ||
| 25 | + | ||
| 18 | } | 26 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/md/client/MesMdClientMapper.java
| @@ -22,6 +22,7 @@ public interface MesMdClientMapper extends BaseMapperX<MesMdClientDO> { | @@ -22,6 +22,7 @@ public interface MesMdClientMapper extends BaseMapperX<MesMdClientDO> { | ||
| 22 | .eqIfPresent(MesMdClientDO::getCode, reqVO.getCode()) | 22 | .eqIfPresent(MesMdClientDO::getCode, reqVO.getCode()) |
| 23 | .likeIfPresent(MesMdClientDO::getName, reqVO.getName()) | 23 | .likeIfPresent(MesMdClientDO::getName, reqVO.getName()) |
| 24 | .likeIfPresent(MesMdClientDO::getNickname, reqVO.getNickname()) | 24 | .likeIfPresent(MesMdClientDO::getNickname, reqVO.getNickname()) |
| 25 | + .likeIfPresent(MesMdClientDO::getEnglishName, reqVO.getEnglishName()) | ||
| 25 | .eqIfPresent(MesMdClientDO::getType, reqVO.getType()) | 26 | .eqIfPresent(MesMdClientDO::getType, reqVO.getType()) |
| 26 | .eqIfPresent(MesMdClientDO::getStatus, reqVO.getStatus()) | 27 | .eqIfPresent(MesMdClientDO::getStatus, reqVO.getStatus()) |
| 27 | .orderByDesc(MesMdClientDO::getId)); | 28 | .orderByDesc(MesMdClientDO::getId)); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/productsales/MesWmProductSalesLineMapper.java
| @@ -26,6 +26,7 @@ public interface MesWmProductSalesLineMapper extends BaseMapperX<MesWmProductSal | @@ -26,6 +26,7 @@ public interface MesWmProductSalesLineMapper extends BaseMapperX<MesWmProductSal | ||
| 26 | cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.line.MesWmProductSalesLinePageReqVO reqVO) { | 26 | cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.line.MesWmProductSalesLinePageReqVO reqVO) { |
| 27 | return selectPage(reqVO, new cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX<MesWmProductSalesLineDO>() | 27 | return selectPage(reqVO, new cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX<MesWmProductSalesLineDO>() |
| 28 | .eqIfPresent(MesWmProductSalesLineDO::getSalesId, reqVO.getSalesId()) | 28 | .eqIfPresent(MesWmProductSalesLineDO::getSalesId, reqVO.getSalesId()) |
| 29 | + .inIfPresent(MesWmProductSalesLineDO::getSalesId, reqVO.getSalesIds()) | ||
| 29 | .orderByDesc(MesWmProductSalesLineDO::getId)); | 30 | .orderByDesc(MesWmProductSalesLineDO::getId)); |
| 30 | } | 31 | } |
| 31 | 32 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/productsales/MesWmProductSalesMapper.java
| @@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProd | @@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProd | ||
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesDO; | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesDO; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 10 | /** | 12 | /** |
| 11 | * MES 销售出库单 Mapper | 13 | * MES 销售出库单 Mapper |
| 12 | * | 14 | * |
| @@ -29,4 +31,8 @@ public interface MesWmProductSalesMapper extends BaseMapperX<MesWmProductSalesDO | @@ -29,4 +31,8 @@ public interface MesWmProductSalesMapper extends BaseMapperX<MesWmProductSalesDO | ||
| 29 | return selectOne(MesWmProductSalesDO::getCode, code); | 31 | return selectOne(MesWmProductSalesDO::getCode, code); |
| 30 | } | 32 | } |
| 31 | 33 | ||
| 34 | + default List<MesWmProductSalesDO> selectListByClientId(Long clientId) { | ||
| 35 | + return selectList(MesWmProductSalesDO::getClientId, clientId); | ||
| 36 | + } | ||
| 37 | + | ||
| 32 | } | 38 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/md/autocode/MesMdAutoCodeRuleCodeEnum.java
| @@ -14,6 +14,7 @@ public enum MesMdAutoCodeRuleCodeEnum { | @@ -14,6 +14,7 @@ public enum MesMdAutoCodeRuleCodeEnum { | ||
| 14 | 14 | ||
| 15 | MD_ITEM_CODE("MD_ITEM_CODE", "物料编码"), | 15 | MD_ITEM_CODE("MD_ITEM_CODE", "物料编码"), |
| 16 | MD_VENDOR_CODE("MD_VENDOR_CODE", "供应商编码"), | 16 | MD_VENDOR_CODE("MD_VENDOR_CODE", "供应商编码"), |
| 17 | + MD_CLIENT_CODE("MD_CLIENT_CODE", "客户编码"), | ||
| 17 | WM_SN_CODE("WM_SN_CODE", "SN 码"), | 18 | WM_SN_CODE("WM_SN_CODE", "SN 码"), |
| 18 | WM_PACKAGE_CODE("WM_PACKAGE_CODE", "装箱单编码"), | 19 | WM_PACKAGE_CODE("WM_PACKAGE_CODE", "装箱单编码"), |
| 19 | WM_BATCH_CODE("WM_BATCH_CODE", "批次编码"), | 20 | WM_BATCH_CODE("WM_BATCH_CODE", "批次编码"), |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesLineServiceImpl.java
| 1 | package cn.iocoder.yudao.module.mes.service.wm.productsales; | 1 | package cn.iocoder.yudao.module.mes.service.wm.productsales; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 3 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 4 | +import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.line.MesWmProductSalesLinePageReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.line.MesWmProductSalesLinePageReqVO; |
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.line.MesWmProductSalesLineSaveReqVO; | 7 | import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.line.MesWmProductSalesLineSaveReqVO; |
| 8 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesDO; | ||
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesLineDO; | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesLineDO; |
| 8 | import cn.iocoder.yudao.module.mes.dal.mysql.wm.productsales.MesWmProductSalesLineMapper; | 10 | import cn.iocoder.yudao.module.mes.dal.mysql.wm.productsales.MesWmProductSalesLineMapper; |
| 9 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcCheckResultEnum; | 11 | import cn.iocoder.yudao.module.mes.enums.qc.MesQcCheckResultEnum; |
| @@ -20,6 +22,7 @@ import java.util.List; | @@ -20,6 +22,7 @@ import java.util.List; | ||
| 20 | import java.util.Objects; | 22 | import java.util.Objects; |
| 21 | 23 | ||
| 22 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 24 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 25 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; | ||
| 23 | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.WM_PRODUCT_SALES_LINE_NOT_EXISTS; | 26 | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.WM_PRODUCT_SALES_LINE_NOT_EXISTS; |
| 24 | 27 | ||
| 25 | /** | 28 | /** |
| @@ -95,6 +98,15 @@ public class MesWmProductSalesLineServiceImpl implements MesWmProductSalesLineSe | @@ -95,6 +98,15 @@ public class MesWmProductSalesLineServiceImpl implements MesWmProductSalesLineSe | ||
| 95 | @Override | 98 | @Override |
| 96 | public cn.iocoder.yudao.framework.common.pojo.PageResult<MesWmProductSalesLineDO> getProductSalesLinePage( | 99 | public cn.iocoder.yudao.framework.common.pojo.PageResult<MesWmProductSalesLineDO> getProductSalesLinePage( |
| 97 | MesWmProductSalesLinePageReqVO pageReqVO) { | 100 | MesWmProductSalesLinePageReqVO pageReqVO) { |
| 101 | + // 如果传了 clientId,先查出该客户的所有出库单 ID,设置到 salesIds | ||
| 102 | + if (pageReqVO.getSalesId() == null && pageReqVO.getClientId() != null) { | ||
| 103 | + List<MesWmProductSalesDO> salesList = productSalesService.getProductSalesListByClientId(pageReqVO.getClientId()); | ||
| 104 | + if (CollUtil.isEmpty(salesList)) { | ||
| 105 | + return cn.iocoder.yudao.framework.common.pojo.PageResult.empty(); | ||
| 106 | + } | ||
| 107 | + pageReqVO.setSalesIds(convertList(salesList, MesWmProductSalesDO::getId)); | ||
| 108 | + } | ||
| 109 | + // 查询分页 | ||
| 98 | return productSalesLineMapper.selectPage(pageReqVO); | 110 | return productSalesLineMapper.selectPage(pageReqVO); |
| 99 | } | 111 | } |
| 100 | 112 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesService.java
| @@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProd | @@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.mes.controller.admin.wm.productsales.vo.MesWmProd | ||
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesDO; | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productsales.MesWmProductSalesDO; |
| 8 | import jakarta.validation.Valid; | 8 | import jakarta.validation.Valid; |
| 9 | 9 | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 10 | /** | 12 | /** |
| 11 | * MES 销售出库单 Service 接口 | 13 | * MES 销售出库单 Service 接口 |
| 12 | * | 14 | * |
| @@ -106,4 +108,12 @@ public interface MesWmProductSalesService { | @@ -106,4 +108,12 @@ public interface MesWmProductSalesService { | ||
| 106 | */ | 108 | */ |
| 107 | void confirmProductSales(Long id); | 109 | void confirmProductSales(Long id); |
| 108 | 110 | ||
| 111 | + /** | ||
| 112 | + * 按客户编号获得销售出库单列表 | ||
| 113 | + * | ||
| 114 | + * @param clientId 客户编号 | ||
| 115 | + * @return 出库单列表 | ||
| 116 | + */ | ||
| 117 | + List<MesWmProductSalesDO> getProductSalesListByClientId(Long clientId); | ||
| 118 | + | ||
| 109 | } | 119 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesServiceImpl.java
| @@ -236,6 +236,11 @@ public class MesWmProductSalesServiceImpl implements MesWmProductSalesService { | @@ -236,6 +236,11 @@ public class MesWmProductSalesServiceImpl implements MesWmProductSalesService { | ||
| 236 | .setId(id).setStatus(MesWmProductSalesStatusEnum.APPROVING.getStatus())); | 236 | .setId(id).setStatus(MesWmProductSalesStatusEnum.APPROVING.getStatus())); |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | + @Override | ||
| 240 | + public List<MesWmProductSalesDO> getProductSalesListByClientId(Long clientId) { | ||
| 241 | + return productSalesMapper.selectListByClientId(clientId); | ||
| 242 | + } | ||
| 243 | + | ||
| 239 | private MesWmProductSalesDO validateProductSalesExists(Long id) { | 244 | private MesWmProductSalesDO validateProductSalesExists(Long id) { |
| 240 | MesWmProductSalesDO sales = productSalesMapper.selectById(id); | 245 | MesWmProductSalesDO sales = productSalesMapper.selectById(id); |
| 241 | if (sales == null) { | 246 | if (sales == null) { |