|
|
|
@ -119,7 +119,7 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
return R.error().put(OrderManagementConstant.DATA, "新增物料信息已存在,请检查"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
codeEntity.setDataSource(CommodityCodeEnum.DATA_SOURCE_1.getKey()); |
|
|
|
|
if (count > 0 && ObjectUtil.isNotEmpty(commodityCodeEntities)) { |
|
|
|
|
log.debug("修改操作 id = {}", id); |
|
|
|
|
if (StringUtils.isNotEmpty(codeEntity.getSpbm())) { |
|
|
|
@ -134,13 +134,13 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
} |
|
|
|
|
codeEntity.setXhfNsrsbh(null);//不更新税号
|
|
|
|
|
codeEntity.setModifyTime(new Date()); |
|
|
|
|
codeEntity.setCreateTime(null); |
|
|
|
|
codeEntity.setUserId(null); |
|
|
|
|
codeEntity.setModifyUserId(userId.toString()); |
|
|
|
|
if(commodityMapper.updateCommodity(codeEntity, null) <= 0){ |
|
|
|
|
return R.error().put(OrderManagementConstant.DATA, "更新物料信息失败,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
codeEntity.setDataSource(CommodityCodeEnum.DATA_SOURCE_1.getKey()); |
|
|
|
|
codeEntity.setCreateTime(new Date()); |
|
|
|
|
codeEntity.setUserId(userId.toString()); |
|
|
|
|
codeEntity.setMatchingState(TaxClassCodeEnum.MATCHING_STATE_1.getKey()); |
|
|
|
@ -626,6 +626,10 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
map.put("zxbm",zxbm); |
|
|
|
|
map.put("entId",receiveSpxxReq.getEntId()); |
|
|
|
|
|
|
|
|
|
if(StringUtils.isBlank(receiveSpxxReq.getEntId())){ |
|
|
|
|
log.debug("公司代码为空不允许保存物料信息"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
log.debug("{}校验名称是否存在 参数:{}", LOGGER_MSG, map); |
|
|
|
|
List<CommodityCodeEntity> commodityCodeEntityList = commodityMapper.queryProductList(map, null); |
|
|
|
|
TaxClassCodeEntity taxClassCodeEntity = taxClassCodeService.queryTaxClassCodeFromCache(receiveSpxxReq.getSpbm()); |
|
|
|
@ -646,9 +650,12 @@ public class CommodityServiceImpl implements CommodityService { |
|
|
|
|
log.debug("添加成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
}else if(commodityCodeEntityList.size() == 1){ |
|
|
|
|
// 简称、商品编码、规格型号、单位、优惠政策标识、零税率标识
|
|
|
|
|
//todo 优先级
|
|
|
|
|
if(Arrays.asList("1,2,6,8".split(",")).contains(commodityCodeEntityList.get(0).getDataSource())){ |
|
|
|
|
log.info("当前物料优先级较低,不进行更新高级物料"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
commodityCodeEntity.setModifyTime(new Date()); |
|
|
|
|
commodityCodeEntity.setModifyUserId(userInfoService.getUser() != null && userInfoService.getUser().getUserId() != null ? userInfoService.getUser().getUserId().toString():""); |
|
|
|
|
if (commodityCodeEntity != null){ |
|
|
|
|