|
|
@ -111,6 +111,9 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
map.put("zxbm",codeEntity.getZxbm()); |
|
|
|
map.put("zxbm",codeEntity.getZxbm()); |
|
|
|
map.put("entId",codeEntity.getEntId()); |
|
|
|
map.put("entId",codeEntity.getEntId()); |
|
|
|
List<CommodityCodeEntity> commodityCodeEntities = commodityMapper.queryProductList(map, null); |
|
|
|
List<CommodityCodeEntity> commodityCodeEntities = commodityMapper.queryProductList(map, null); |
|
|
|
|
|
|
|
if(StringUtils.isBlank(id) && ObjectUtil.isNotEmpty(commodityCodeEntities)){ |
|
|
|
|
|
|
|
return R.error().put(OrderManagementConstant.DATA, "新增物料信息已存在,请检查"); |
|
|
|
|
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(commodityCodeEntities)) { |
|
|
|
if (ObjectUtil.isNotEmpty(commodityCodeEntities)) { |
|
|
|
log.debug("修改操作 id = {}", id); |
|
|
|
log.debug("修改操作 id = {}", id); |
|
|
|
if (StringUtils.isNotEmpty(codeEntity.getSpbm())) { |
|
|
|
if (StringUtils.isNotEmpty(codeEntity.getSpbm())) { |
|
|
@ -123,11 +126,11 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
Long userId = userInfoService.getUser().getUserId(); |
|
|
|
Long userId = userInfoService.getUser().getUserId(); |
|
|
|
|
|
|
|
|
|
|
|
if(commodityCodeModifyLogService.saveCommodityCodeDifferenceBetween2(commodityCodeEntities.get(0), codeEntity, userId) == -1){ |
|
|
|
if(commodityCodeModifyLogService.saveCommodityCodeDifferenceBetween2(commodityCodeEntities.get(0), codeEntity, userId) == -1){ |
|
|
|
R.error().put(OrderManagementConstant.DATA, "数据未进行修改,无需保存"); |
|
|
|
return R.error().put(OrderManagementConstant.DATA, "数据未进行修改,无需保存"); |
|
|
|
} |
|
|
|
} |
|
|
|
codeEntity.setXhfNsrsbh(null); |
|
|
|
codeEntity.setXhfNsrsbh(null); |
|
|
|
if(commodityMapper.updateCommodity(codeEntity, null) <= 0){ |
|
|
|
if(commodityMapper.updateCommodity(codeEntity, null) <= 0){ |
|
|
|
R.error().put(OrderManagementConstant.DATA, "更新物料信息失败,请联系管理员"); |
|
|
|
return R.error().put(OrderManagementConstant.DATA, "更新物料信息失败,请联系管理员"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
@ -144,7 +147,7 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(commodityMapper.insertCommodity(codeEntity) <= 0){ |
|
|
|
if(commodityMapper.insertCommodity(codeEntity) <= 0){ |
|
|
|
R.error().put(OrderManagementConstant.DATA, "新增物料信息失败,请联系管理员"); |
|
|
|
return R.error().put(OrderManagementConstant.DATA, "新增物料信息失败,请联系管理员"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|