|
|
|
@ -1809,9 +1809,9 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
List<OrderItemInfo> orderItemInfos = orderItemInfoMapper.selectAllByOrderId(Arrays.asList(orderInfoId), null); |
|
|
|
|
List<OrderItemInfo> orderItemInfoList = new ArrayList<>(); |
|
|
|
|
for (OrderItemInfo orderItemInfo : orderItemInfos) { |
|
|
|
|
if(StringUtils.isNotBlank(orderItemInfo.getSpbm())){ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// if(StringUtils.isNotBlank(orderItemInfo.getSpbm())){
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
CommodityCodeEntity commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbhAndEntId(orderItemInfo.getZxbm(), null, entId); |
|
|
|
|
// 如果公司物料库匹配失败,从集团物料库匹配
|
|
|
|
|
if (commodityCodeEntity == null) { |
|
|
|
@ -1822,7 +1822,7 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
|
|
|
|
|
if(commodityCodeEntity != null){ |
|
|
|
|
completeCommodityMessageBySpid(orderItemInfo, commodityCodeEntity); |
|
|
|
|
orderItemInfo.setZnfm(ConfigureConstant.STRING_1); |
|
|
|
|
orderItemInfo.setZnfm(ConfigureConstant.STRING_0); |
|
|
|
|
orderItemInfo.setXmsl(null); |
|
|
|
|
orderItemInfo.setXmdj(null); |
|
|
|
|
} |
|
|
|
@ -1836,14 +1836,7 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
|
|
|
|
|
private void completeCommodityMessageBySpid(OrderItemInfo item, CommodityCodeEntity commodity) { |
|
|
|
|
//商品编码
|
|
|
|
|
if (StringUtils.isBlank(item.getSpbm()) && StringUtils.isNotBlank(commodity.getSpbm())) { |
|
|
|
|
item.setSpbm(commodity.getSpbm()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//自行编码
|
|
|
|
|
if (StringUtils.isBlank(item.getZxbm()) && StringUtils.isNotBlank(commodity.getZxbm())) { |
|
|
|
|
item.setZxbm(commodity.getZxbm()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//优惠政策标识
|
|
|
|
|
if (StringUtils.isBlank(item.getYhzcbs()) && StringUtils.isNotBlank(commodity.getYhzcbs())) { |
|
|
|
@ -1853,14 +1846,11 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//零税率标识
|
|
|
|
|
if (StringUtils.isBlank(item.getLslbs()) && StringUtils.isNotBlank(commodity.getLslbs())) { |
|
|
|
|
item.setLslbs(commodity.getLslbs()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//增值税特殊管理
|
|
|
|
|
if (StringUtils.isBlank(item.getZzstsgl()) && StringUtils.isNotBlank(commodity.getZzstsgl())) { |
|
|
|
|
item.setZzstsgl(commodity.getZzstsgl()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果项目名称为空,使用底层返回数据进行补全,如果不为空,并且需要补全,则进行补全
|
|
|
|
|
String spmc = item.getXmmc(); |
|
|
|
@ -1879,40 +1869,22 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
//发票行性质为折扣行,不补全,单价,数量,单位,规格型号
|
|
|
|
|
if (!OrderInfoEnum.FPHXZ_CODE_1.getKey().equals(item.getFphxz())) { |
|
|
|
|
//规格型号
|
|
|
|
|
if (StringUtils.isBlank(item.getGgxh()) && StringUtils.isNotBlank(commodity.getGgxh())) { |
|
|
|
|
if (StringUtils.isNotBlank(commodity.getGgxh())) { |
|
|
|
|
item.setGgxh(commodity.getGgxh()); |
|
|
|
|
} |
|
|
|
|
//单位
|
|
|
|
|
if (StringUtils.isBlank(item.getXmdw()) && StringUtils.isNotBlank(commodity.getXmdw())) { |
|
|
|
|
if (StringUtils.isNotBlank(commodity.getXmdw())) { |
|
|
|
|
item.setXmdw(commodity.getXmdw()); |
|
|
|
|
} |
|
|
|
|
//商品数量
|
|
|
|
|
if (StringUtils.isBlank(item.getXmsl())) { |
|
|
|
|
item.setXmsl(""); |
|
|
|
|
} |
|
|
|
|
//单价
|
|
|
|
|
if (StringUtils.isBlank(item.getXmdj()) && StringUtils.isNotBlank(commodity.getXmdj())) { |
|
|
|
|
item.setXmdj(commodity.getXmdj()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//含税标志
|
|
|
|
|
if (StringUtils.isBlank(item.getHsbz()) && StringUtils.isNotBlank(commodity.getHsbz())) { |
|
|
|
|
item.setHsbz(commodity.getHsbz()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果税率为空使用查询到的税率否则使用原税率
|
|
|
|
|
if (StringUtils.isBlank(item.getSl()) && StringUtils.isNotBlank(commodity.getSl())) { |
|
|
|
|
item.setSl(CommonUtils.formatSl(commodity.getSl())); |
|
|
|
|
} |
|
|
|
|
if(StringUtils.isBlank(item.getTswl()) && StringUtils.isNotBlank(commodity.getTswl())){ |
|
|
|
|
if(StringUtils.isNotBlank(commodity.getTswl())){ |
|
|
|
|
item.setTswl(commodity.getTswl()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//税额
|
|
|
|
|
if (StringUtils.isBlank(item.getSe())) { |
|
|
|
|
item.setSe(""); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private PageKySlRsp getDefaultKySlList(OrderInfoEnum orderInfoEnum){ |
|
|
|
|