|
|
|
@ -37,6 +37,8 @@ import com.dxhy.order.model.qd.OrderInfoQd; |
|
|
|
|
import com.dxhy.order.model.qd.QdFjys; |
|
|
|
|
import com.dxhy.order.model.sk.sld.SearchSld; |
|
|
|
|
import com.dxhy.order.utils.*; |
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
import com.google.common.collect.Maps; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -508,13 +510,16 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void dealOrderItem(List<OrderItemInfo> orderItemInfo, String xhfNsrsbh, String qdbz, String fpzldm, |
|
|
|
|
public Map<String,String> dealOrderItem(List<OrderItemInfo> orderItemInfo, String xhfNsrsbh, String qdbz, String fpzldm, |
|
|
|
|
String terminal, String idType, String entId) throws OrderReceiveException { |
|
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
|
Map<String, String> hashMap = Maps.newHashMap(); |
|
|
|
|
List<String> shList = new ArrayList<>(); |
|
|
|
|
shList.add(xhfNsrsbh); |
|
|
|
|
StringBuilder errorStr = new StringBuilder(); |
|
|
|
|
List<String> cpyList = Lists.newArrayList(); |
|
|
|
|
for (int i = 0; i < orderItemInfo.size(); i++) { |
|
|
|
|
String cpy = "N"; |
|
|
|
|
String pply = "公司库匹配"; |
|
|
|
|
OrderItemInfo item = orderItemInfo.get(i); |
|
|
|
|
//rowIndex excel导入时为行坐标,其他业务时为明细行在集合中的索引值
|
|
|
|
@ -541,6 +546,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) { |
|
|
|
|
CommodityCodeEntity commodityCodeEntity = (CommodityCodeEntity) r.get(OrderManagementConstant.DATA); |
|
|
|
|
completeCommodityMessageBySpid(item, commodityCodeEntity); |
|
|
|
|
cpy = commodityCodeEntity.getCpy(); |
|
|
|
|
} else { |
|
|
|
|
log.error("{}根据商品id查询商品信息异常:{}", LOGGER_MSG, r.get(OrderManagementConstant.MESSAGE)); |
|
|
|
|
errorStr.append(indexStr) |
|
|
|
@ -605,6 +611,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
spmc = stringBuilder.append("*").append(taxClassCodeEntity.getSpjc()).append("*").append(spmc).toString(); |
|
|
|
|
} |
|
|
|
|
item.setXmmc(spmc); |
|
|
|
|
cpy = taxClassCodeEntity.getCpy(); |
|
|
|
|
}else { |
|
|
|
|
log.debug("{}项目名称:{},智能赋码未匹配到税编",LOGGER_MSG,item.getXmmc()); |
|
|
|
|
/*errorStr.append(indexStr) |
|
|
|
@ -634,6 +641,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
// 判断是否推送了物料的名称、单位、规格型号信息
|
|
|
|
|
//如果项目名称为空,使用底层返回数据进行补全,如果不为空,并且需要补全,则进行补全
|
|
|
|
|
completeCommodityMessageBySpid(item,commodityCodeEntity); |
|
|
|
|
cpy = commodityCodeEntity.getCpy(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else if (StringUtils.isBlank(item.getSpbm())) { |
|
|
|
@ -673,6 +681,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
|
|
|
|
|
CommodityCodeEntity commodityCodeEntity = queryProductList.get(0); |
|
|
|
|
completeCommodityMessageByXmmc(item, commodityCodeEntity); |
|
|
|
|
cpy = commodityCodeEntity.getCpy(); |
|
|
|
|
} else { |
|
|
|
|
//商品编码不为空,需要调用底层商品编码获取简码接口获取数据
|
|
|
|
|
String spbm = item.getSpbm(); |
|
|
|
@ -697,6 +706,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
log.debug("{}物料:{},匹配类型:{}",LOGGER_MSG,item.getZxbm(),pply); |
|
|
|
|
cpyList.add(cpy); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(errorStr.toString())) { |
|
|
|
|
log.error("{}补全商品信息出现错误:{}", LOGGER_MSG, errorStr); |
|
|
|
@ -704,6 +714,13 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
} |
|
|
|
|
long end = System.currentTimeMillis(); |
|
|
|
|
log.debug("{}订单明细信息补全耗时:{}", LOGGER_MSG, end - start); |
|
|
|
|
if(cpyList.size() == orderItemInfo.size()){ |
|
|
|
|
boolean allMatch = cpyList.stream().allMatch(cpy -> cpy.equals("Y")); |
|
|
|
|
if(allMatch){ |
|
|
|
|
hashMap.put("cpy",OrderInfoEnum.QDBZ_CODE_4.getKey()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return hashMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|