Commit 1379396cad06edd057fbdd86958ecabb5113a32a
1 parent
113c1ddd
feat:校验是否重复
Showing
4 changed files
with
36 additions
and
0 deletions
src/main/java/com/order/erp/controller/OrderController.java
@@ -143,5 +143,18 @@ public class OrderController { | @@ -143,5 +143,18 @@ public class OrderController { | ||
143 | } | 143 | } |
144 | return ServerResult.success(orderBaseInfoMapper.queryProjectNoAndInnerNoDto(dto.getInnerNo() == null ? Boolean.TRUE : Boolean.FALSE, dto)); | 144 | return ServerResult.success(orderBaseInfoMapper.queryProjectNoAndInnerNoDto(dto.getInnerNo() == null ? Boolean.TRUE : Boolean.FALSE, dto)); |
145 | } | 145 | } |
146 | + | ||
147 | + /** | ||
148 | + * 校验是否重复 | ||
149 | + * | ||
150 | + * @param orderBaseInfoQueryVO 查询条件 | ||
151 | + * @return 查询结果 | ||
152 | + */ | ||
153 | + @PostMapping("/check") | ||
154 | + @ApiOperation("校验是否重复") | ||
155 | + @AnonymousAccess | ||
156 | + public ServerResult check(@RequestBody OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | ||
157 | + return orderBaseInfoService.check(orderBaseInfoQueryVO); | ||
158 | + } | ||
146 | } | 159 | } |
147 | 160 |
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoQueryVO.java
@@ -66,6 +66,11 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { | @@ -66,6 +66,11 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { | ||
66 | private List<String> customerCode; | 66 | private List<String> customerCode; |
67 | 67 | ||
68 | /** | 68 | /** |
69 | + * 客户STYLE# | ||
70 | + */ | ||
71 | + private String customerStyle; | ||
72 | + | ||
73 | + /** | ||
69 | * 内部编号 | 74 | * 内部编号 |
70 | */ | 75 | */ |
71 | private List<String> innerNo; | 76 | private List<String> innerNo; |
src/main/java/com/order/erp/service/order/OrderBaseInfoService.java
@@ -56,6 +56,13 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { | @@ -56,6 +56,13 @@ public interface OrderBaseInfoService extends IService<OrderBaseInfoDO> { | ||
56 | ServerResult listByPage(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | 56 | ServerResult listByPage(OrderBaseInfoQueryVO orderBaseInfoQueryVO); |
57 | 57 | ||
58 | /** | 58 | /** |
59 | + * 校验是否重复 | ||
60 | + * @param orderBaseInfoQueryVO | ||
61 | + * @return | ||
62 | + */ | ||
63 | + ServerResult check(OrderBaseInfoQueryVO orderBaseInfoQueryVO); | ||
64 | + | ||
65 | + /** | ||
59 | * @param response | 66 | * @param response |
60 | * @param orderBaseInfoQueryVO | 67 | * @param orderBaseInfoQueryVO |
61 | * @return | 68 | * @return |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -140,6 +140,17 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -140,6 +140,17 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
140 | } | 140 | } |
141 | 141 | ||
142 | @Override | 142 | @Override |
143 | + public ServerResult check(OrderBaseInfoQueryVO orderBaseInfoQueryVO) { | ||
144 | + List<OrderBaseInfoDO> orderBaseInfoDOS = list(new LambdaQueryWrapper<OrderBaseInfoDO>() | ||
145 | + .eq(OrderBaseInfoDO::getInnerNo,orderBaseInfoQueryVO.getInnerNo()) | ||
146 | + .eq(OrderBaseInfoDO::getCustomerStyle,orderBaseInfoQueryVO.getCustomerStyle())); | ||
147 | + if (CollectionUtils.isNotEmpty(orderBaseInfoDOS)) { | ||
148 | + throw new BusinessException("款式重复,是否继续"); | ||
149 | + } | ||
150 | + return ServerResult.success(); | ||
151 | + } | ||
152 | + | ||
153 | + @Override | ||
143 | public ServerResult listByPage(OrderBaseInfoQueryVO queryVO) { | 154 | public ServerResult listByPage(OrderBaseInfoQueryVO queryVO) { |
144 | LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = buildQueryByParam(queryVO); | 155 | LambdaQueryWrapper<OrderBaseInfoDO> queryWrapper = buildQueryByParam(queryVO); |
145 | Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | 156 | Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); |