|
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import cn.hutool.core.collection.ListUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
import cn.hutool.core.util.RandomUtil; |
|
|
|
|
import cn.hutool.extra.spring.SpringUtil; |
|
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
|
|
|
|
import com.dxhy.order.baseservice.config.BaseServiceConfig; |
|
|
|
|
import com.dxhy.order.baseservice.module.base.model.DrawerInfoEntity; |
|
|
|
@ -505,6 +506,12 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
@Override |
|
|
|
|
public void dealOrderItem(List<OrderItemInfo> orderItemInfo, String xhfNsrsbh, String qdbz, String fpzldm, |
|
|
|
|
String terminal, String idType) throws OrderReceiveException { |
|
|
|
|
dealOrderItem(orderItemInfo, xhfNsrsbh, qdbz, fpzldm, terminal, idType, null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void dealOrderItem(List<OrderItemInfo> orderItemInfo, String xhfNsrsbh, String qdbz, String fpzldm, |
|
|
|
|
String terminal, String idType, String entId) throws OrderReceiveException { |
|
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
|
List<String> shList = new ArrayList<>(); |
|
|
|
|
shList.add(xhfNsrsbh); |
|
|
|
@ -524,7 +531,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
* 2.1 商品编码不为空,使用商品编码补全 |
|
|
|
|
* 2.2 商品编码为空,项目名称不为空,使用商品名称补全 |
|
|
|
|
*/ |
|
|
|
|
item.setZnfm("0"); |
|
|
|
|
item.setZnfm("1"); |
|
|
|
|
if (StringUtils.isNotBlank(item.getSpId())) { |
|
|
|
|
R r = commodityService.queryCommodityById(item.getSpId(), shList); |
|
|
|
|
if (ConfigureConstant.STRING_0000.equals(r.get(OrderManagementConstant.CODE))) { |
|
|
|
@ -543,7 +550,14 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
// 自行编码为mdm的物料编码,通过这个去匹配
|
|
|
|
|
// 4.2.1.11
|
|
|
|
|
// 先从公司物料库匹配
|
|
|
|
|
CommodityCodeEntity commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbh(item.getZxbm(), xhfNsrsbh); |
|
|
|
|
CommodityCodeEntity commodityCodeEntity = null; |
|
|
|
|
if (StringUtils.isNotEmpty(entId)) { |
|
|
|
|
commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbhAndEntId(item.getZxbm(), xhfNsrsbh, entId); |
|
|
|
|
} else { |
|
|
|
|
commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbh(item.getZxbm(), xhfNsrsbh); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 如果公司物料库匹配失败,从集团物料库匹配
|
|
|
|
|
if (commodityCodeEntity == null) { |
|
|
|
|
// 如果匹配不到,则去集团物料库匹配
|
|
|
|
|
commodityCodeEntity = commodityCodeMapper.queryCommodityCodeByZxbmAndXhfNsrsbh(item.getZxbm(), "-1"); |
|
|
|
@ -559,7 +573,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
item.setSpbm(taxClassCodeEntity.getSpbm()); |
|
|
|
|
// item.setYhzcbs(taxClassCodeEntity.getYhzcmc()); // TODO 优惠政策
|
|
|
|
|
item.setZzstsgl(taxClassCodeEntity.getZzstsgl()); |
|
|
|
|
item.setZnfm("1"); // 配置为智能赋码
|
|
|
|
|
item.setZnfm("0"); // 配置为智能赋码
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -571,6 +585,10 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService { |
|
|
|
|
.append(ConfigureConstant.STRING_UNDERLINE) |
|
|
|
|
.append(OrderInfoContentEnum.INVOICE_SPBM_QUERY_NULL.getMessage()) |
|
|
|
|
.append("\r\n"); |
|
|
|
|
} else { |
|
|
|
|
// 如果找到记录,进行赋值匹配
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else if (StringUtils.isBlank(item.getSpbm())) { |
|
|
|
|