|
|
|
@ -1805,16 +1805,12 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R updateOrderItem(String orderInfoId,String entId){ |
|
|
|
|
public R updateOrderItem(String orderInfoId,String entId,List<String> itemList){ |
|
|
|
|
//根据订单id查询明细数据
|
|
|
|
|
List<OrderItemInfo> orderItemInfos = orderItemInfoMapper.selectAllByOrderId(Arrays.asList(orderInfoId), null); |
|
|
|
|
List<OrderItemInfo> collect = orderItemInfos.stream().filter(t -> itemList.contains(t.getId())).collect(Collectors.toList()); |
|
|
|
|
List<OrderItemInfo> orderItemInfoList = new ArrayList<>(); |
|
|
|
|
Boolean oilMark = false; |
|
|
|
|
int i = 0; |
|
|
|
|
for (OrderItemInfo orderItemInfo : orderItemInfos) { |
|
|
|
|
// if(StringUtils.isNotBlank(orderItemInfo.getSpbm())){
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
for (OrderItemInfo orderItemInfo : collect) { |
|
|
|
|
CommodityCodeEntity commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbhAndEntId(orderItemInfo.getZxbm(), null, entId); |
|
|
|
|
// 如果公司物料库匹配失败,从集团物料库匹配
|
|
|
|
|
if (commodityCodeEntity == null) { |
|
|
|
@ -1828,19 +1824,22 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
orderItemInfo.setZnfm(ConfigureConstant.STRING_0); |
|
|
|
|
orderItemInfo.setXmsl(null); |
|
|
|
|
orderItemInfo.setXmdj(null); |
|
|
|
|
if(StringUtils.isNotBlank(commodityCodeEntity.getCpy()) && "Y".equals(commodityCodeEntity.getCpy())){ |
|
|
|
|
i++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
orderItemInfoList.add(orderItemInfo); |
|
|
|
|
} |
|
|
|
|
if(orderItemInfoList.size()==i){ |
|
|
|
|
List<String> collect1 = orderItemInfos.stream().filter(t -> StringUtils.isNotBlank(t.getSpbm())).map(t -> t.getSpbm()).collect(Collectors.toList()); |
|
|
|
|
if(collect1.size()==orderItemInfos.size()){ |
|
|
|
|
Map map = new HashMap(2); |
|
|
|
|
map.put("cpy","Y"); |
|
|
|
|
Integer integer = taxClassCodeMapper.countTaxClassCodeBySpbm(collect1, map); |
|
|
|
|
if(orderItemInfoList.size()==integer.intValue()){ |
|
|
|
|
//更新order_info 清单标志为4
|
|
|
|
|
OrderInfo orderInfo = new OrderInfo(); |
|
|
|
|
orderInfo.setId(orderInfoId); |
|
|
|
|
orderInfo.setQdBz("4"); |
|
|
|
|
orderMapper.updateOrderInfoByOrderId(orderInfo,null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(!orderItemInfoList.isEmpty()){ |
|
|
|
|
orderItemInfoMapper.updateOrderItemId(orderItemInfoList); |
|
|
|
|
} |
|
|
|
@ -1939,21 +1938,14 @@ public class OrderInfoServiceImpl implements OrderInfoService { |
|
|
|
|
item.setZzstsgl(commodity.getZzstsgl()); |
|
|
|
|
|
|
|
|
|
//如果项目名称为空,使用底层返回数据进行补全,如果不为空,并且需要补全,则进行补全
|
|
|
|
|
String spmc = item.getXmmc(); |
|
|
|
|
String spmc = ""; |
|
|
|
|
StringBuilder stringBuilder = new StringBuilder(); |
|
|
|
|
if (StringUtils.isBlank(spmc)) { |
|
|
|
|
|
|
|
|
|
if(StrUtil.isNotBlank(commodity.getInvoiceName())){ |
|
|
|
|
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getInvoiceName()).toString(); |
|
|
|
|
}else{ |
|
|
|
|
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getXmmc()).toString(); |
|
|
|
|
} |
|
|
|
|
} else if (StringUtil.checkStr(spmc, commodity.getSpjc())) { |
|
|
|
|
if(StrUtil.isNotBlank(commodity.getInvoiceName())){ |
|
|
|
|
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getInvoiceName()).toString(); |
|
|
|
|
}else { |
|
|
|
|
spmc = stringBuilder.append("*").append(commodity.getSpjc()).append("*").append(commodity.getXmmc()).toString(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.setXmmc(spmc); |
|
|
|
|
|
|
|
|
|
//发票行性质为折扣行,不补全,单价,数量,单位,规格型号
|
|
|
|
|