|
@@ -69,6 +69,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
@Override
|
|
|
public HttpRespMsg add(GoodsVO goodsVO) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ Integer count = goodsNoMapper.selectCount(new QueryWrapper<GoodsNo>().eq("division_code", goodsVO.getDeptStr()).eq("suffix_code", goodsVO.getGoodStr()).last("limit 1"));
|
|
|
+ if (count > 0) {
|
|
|
+ msg.setError("当前编号组合已存在,请更换编号组合后重试。");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
Goods goods = new Goods();
|
|
|
BeanUtils.copyProperties(goodsVO, goods);
|
|
|
List<GoodsNo> list = new ArrayList<>();
|
|
@@ -77,11 +82,6 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
goods.setCreatorId(goodsVO.getUserId());
|
|
|
goodsMapper.insert(goods);
|
|
|
String mouldNo = goodsVO.getDeptStr() + "-" + goodsVO.getGoodStr();
|
|
|
- Integer count = goodsNoMapper.selectCount(new QueryWrapper<GoodsNo>().eq("division_code", goodsVO.getDeptStr()).eq("suffix_code", goodsVO.getGoodStr()).last("limit 1"));
|
|
|
- if (count > 0) {
|
|
|
- msg.setError("当前编号组合已存在,请更换编号组合后重试。");
|
|
|
- return msg;
|
|
|
- }
|
|
|
if (0 != goodsVO.getNumber()) {
|
|
|
for (int i = 1; i <= goodsVO.getNumber(); i++) {
|
|
|
GoodsNo goodsNo = new GoodsNo();
|