|
@@ -20,6 +20,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -39,7 +40,7 @@ public class SendPurchaseInResTask extends Executable {
|
|
|
private B2BConfig b2bConfig;
|
|
private B2BConfig b2bConfig;
|
|
|
|
|
|
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(SendProductTask.class);
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(SendProductTask.class);
|
|
|
- private final String prodInUrl = "/erp/purchase/prodInOut/nonPosting";
|
|
|
|
|
|
|
+ private final String prodInResUrl = "/erp/purchase/prodInOut/nonPosting";
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void execute(MessageInfo messageInfo) throws Exception {
|
|
public void execute(MessageInfo messageInfo) throws Exception {
|
|
@@ -56,7 +57,13 @@ public class SendPurchaseInResTask extends Executable {
|
|
|
b2bPurchaseProdInOut.setDetails(b2bPurchaseProdInOutDetailList);
|
|
b2bPurchaseProdInOut.setDetails(b2bPurchaseProdInOutDetailList);
|
|
|
LOGGER.info("ProdIODetailDTOList={}, b2bPurchaseProdInOutDetailList={}", JsonUtils.toJsonString(prodInOutFormDTO.getItems()), JsonUtils.toJsonString(b2bPurchaseProdInOutDetailList));
|
|
LOGGER.info("ProdIODetailDTOList={}, b2bPurchaseProdInOutDetailList={}", JsonUtils.toJsonString(prodInOutFormDTO.getItems()), JsonUtils.toJsonString(b2bPurchaseProdInOutDetailList));
|
|
|
|
|
|
|
|
- boolean success = SendUtil.sendToB2B(b2bConfig.getCommon() + prodInUrl, JsonUtils.toJsonString(b2bPurchaseProdInOut), companyDTO.getAccessKey());
|
|
|
|
|
|
|
+ //添加身份ID
|
|
|
|
|
+ String url = b2bConfig.getCommon() + prodInResUrl + "?access_id=" + companyDTO.getUu();
|
|
|
|
|
+ //将数据改为B2B数据格式
|
|
|
|
|
+ List<PurchaseProdInOut> data = new ArrayList<PurchaseProdInOut>();
|
|
|
|
|
+ data.add(b2bPurchaseProdInOut);
|
|
|
|
|
+
|
|
|
|
|
+ boolean success = SendUtil.sendToB2B(url, JsonUtils.toJsonString(data), companyDTO.getAccessKey());
|
|
|
if (success) {
|
|
if (success) {
|
|
|
LOGGER.info("采购验收单(反过账)上传成功, id={}", messageInfo.getBizId());
|
|
LOGGER.info("采购验收单(反过账)上传成功, id={}", messageInfo.getBizId());
|
|
|
prodInOutApi.updateB2BStatus(Long.parseLong(messageInfo.getBizId()), "已上传");
|
|
prodInOutApi.updateB2BStatus(Long.parseLong(messageInfo.getBizId()), "已上传");
|