feature:物料新增重复入库判断

release
gaorl 2 years ago
parent b5f8054077
commit 14f557bbed
  1. 8
      order-management-base-service/src/main/java/com/dxhy/order/baseservice/module/commodity/service/impl/CommodityServiceImpl.java

@ -108,8 +108,10 @@ public class CommodityServiceImpl implements CommodityService {
//判断保存或者修改操作
String id = codeEntity.getId();
Map<String,String> map = new HashMap<>();
CommodityCodeEntity commodityCodeEntity = commodityMapper.queryCommodityById(id, "", shList);
if (ObjectUtil.isNotEmpty(commodityCodeEntity)) {
map.put("zxbm",codeEntity.getZxbm());
map.put("entId",codeEntity.getEntId());
List<CommodityCodeEntity> commodityCodeEntities = commodityMapper.queryProductList(map, null);
if (ObjectUtil.isNotEmpty(commodityCodeEntities)) {
log.debug("修改操作 id = {}", id);
if (StringUtils.isNotEmpty(codeEntity.getSpbm())) {
//已匹配
@ -120,7 +122,7 @@ public class CommodityServiceImpl implements CommodityService {
// 记录修改记录
Long userId = userInfoService.getUser().getUserId();
if(commodityCodeModifyLogService.saveCommodityCodeDifferenceBetween2(commodityCodeEntity, codeEntity, userId) == -1){
if(commodityCodeModifyLogService.saveCommodityCodeDifferenceBetween2(commodityCodeEntities.get(0), codeEntity, userId) == -1){
R.error().put(OrderManagementConstant.DATA, "数据未进行修改,无需保存");
}
if(commodityMapper.updateCommodity(codeEntity, shList) <= 0){

Loading…
Cancel
Save