feat:开票测试

release
gongquanlin 2 years ago
parent 607fdd33da
commit 877fd28460
  1. 72
      order-management-consumer/src/main/java/com/dxhy/order/consumer/openapi/service/impl/CommonInterfaceServiceImpl.java

@ -539,43 +539,7 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
}
} else {
//根据商品编码判断如何进行补全数据
if (StringUtils.isBlank(item.getSpbm())) {
//商品编码为空,调用接口根据商品名称进行匹配数据
if (StringUtils.isBlank(item.getXmmc())) {
log.error("{}商品名称为空", LOGGER_MSG);
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_SPMC_QUERY_NULL.getMessage())
.append("\r\n");
continue;
}
Map<String, String> map = new HashMap<>(2);
map.put("productName", item.getXmmc());
//自行编码如果不为空的话,根据商品名称和自行编码查询商品信息
if (StringUtils.isNotBlank(item.getZxbm())) {
map.put("zxbm", item.getZxbm());
}
List<CommodityCodeEntity> queryProductList = commodityService.queryProductList(map, shList);
if (ObjectUtil.isEmpty(queryProductList)) {
log.error("{}根据商品名称查询到的商品为空,商品名称:{}", LOGGER_MSG, item.getXmmc());
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_QUERY_NULL.getMessage())
.append("\r\n");
continue;
}
if (queryProductList.size() > 1) {
log.error("{}根据商品名称查询到多个商品信息,商品名称:{}", LOGGER_MSG, item.getXmmc());
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_QUERY_NULL.getMessage())
.append("\r\n");
continue;
}
CommodityCodeEntity commodityCodeEntity = queryProductList.get(0);
completeCommodityMessageByXmmc(item, commodityCodeEntity);
} else if (StringUtils.isNotBlank(item.getZxbm())) {
// 自行编码为mdm的物料编码,通过这个去匹配
// 4.2.1.11
// 先从公司物料库匹配
@ -609,7 +573,43 @@ public class CommonInterfaceServiceImpl implements CommonInterfaceService {
.append("\r\n");
}
} else if (StringUtils.isBlank(item.getSpbm())) {
//商品编码为空,调用接口根据商品名称进行匹配数据
if (StringUtils.isBlank(item.getXmmc())) {
log.error("{}商品名称为空", LOGGER_MSG);
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_SPMC_QUERY_NULL.getMessage())
.append("\r\n");
continue;
}
Map<String, String> map = new HashMap<>(2);
map.put("productName", item.getXmmc());
//自行编码如果不为空的话,根据商品名称和自行编码查询商品信息
if (StringUtils.isNotBlank(item.getZxbm())) {
map.put("zxbm", item.getZxbm());
}
List<CommodityCodeEntity> queryProductList = commodityService.queryProductList(map, shList);
if (ObjectUtil.isEmpty(queryProductList)) {
log.error("{}根据商品名称查询到的商品为空,商品名称:{}", LOGGER_MSG, item.getXmmc());
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_QUERY_NULL.getMessage())
.append("\r\n");
continue;
}
if (queryProductList.size() > 1) {
log.error("{}根据商品名称查询到多个商品信息,商品名称:{}", LOGGER_MSG, item.getXmmc());
errorStr.append(indexStr)
.append(ConfigureConstant.STRING_UNDERLINE)
.append(OrderInfoContentEnum.INVOICE_SPBM_QUERY_NULL.getMessage())
.append("\r\n");
continue;
}
CommodityCodeEntity commodityCodeEntity = queryProductList.get(0);
completeCommodityMessageByXmmc(item, commodityCodeEntity);
} else {
//商品编码不为空,需要调用底层商品编码获取简码接口获取数据
String spbm = item.getSpbm();

Loading…
Cancel
Save