|
|
|
@ -28,6 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
@ -130,7 +131,8 @@ public class BusinessOrderController {
|
|
|
|
|
private CwsettlementController cwsettlementController;
|
|
|
|
|
@Autowired
|
|
|
|
|
private CwsettlementService cwsettlementService;
|
|
|
|
|
|
|
|
|
|
@Value("${config.yunguaninterfaceurl}")
|
|
|
|
|
private String yunguaninterfaceurl;
|
|
|
|
|
/**
|
|
|
|
|
* 列表
|
|
|
|
|
*
|
|
|
|
@ -635,55 +637,55 @@ public class BusinessOrderController {
|
|
|
|
|
}else if(StringUtils.isNotEmpty(entity.getBusinessType()) && entity.getBusinessType().equals("2") && entity.getDeliveryType().equals("2")){
|
|
|
|
|
entity.setStatus("4");//销售单直送审核通过后状态改为待出库
|
|
|
|
|
}
|
|
|
|
|
// if (entity.getBusinessType().equals("1")) {
|
|
|
|
|
// YunguanPurchaseOrderModel purchaseOrder = businessOrderService.queryPurchaseOrderByYunGuanInfo(id);
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(purchaseOrder)) {
|
|
|
|
|
// JSONObject purchaseCode = HttpUtil.httpRequest("http://172.16.1.50:8020/fggj/pur/ordHead", "POST", JsonUtil.getObjectToString(purchaseOrder));
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(purchaseCode)){
|
|
|
|
|
// if (purchaseCode.get("code").equals("200")) {
|
|
|
|
|
// List<YunguanPurchaseOrderProductModel> purchaseOrderProduct = businessOrderService.queryPurchaseOrderProductByYunGuanInfo(id);
|
|
|
|
|
// JSONObject purchaseProductCode = HttpUtil.httpRequest("http://172.16.1.50:8020/fggj/pur/ordLine", "POST", JsonUtil.getObjectToString(purchaseOrderProduct));
|
|
|
|
|
// if(ObjectUtil.isNotEmpty(purchaseCode)){
|
|
|
|
|
// entity.setErpMark(purchaseProductCode.get("code").toString());
|
|
|
|
|
// entity.setErpMassage(purchaseProductCode.get("errmsg").toString());
|
|
|
|
|
// }else{
|
|
|
|
|
// entity.setErpMark("N");
|
|
|
|
|
// entity.setErpMassage("ESB返回为空");
|
|
|
|
|
// }
|
|
|
|
|
// }else {
|
|
|
|
|
// entity.setErpMark(purchaseCode.get("code").toString());
|
|
|
|
|
// entity.setErpMassage(purchaseCode.get("errmsg").toString());
|
|
|
|
|
// }
|
|
|
|
|
// }else {
|
|
|
|
|
// entity.setErpMark("N");
|
|
|
|
|
// entity.setErpMassage("ESB返回为空");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }else if (entity.getBusinessType().equals("2")){
|
|
|
|
|
// YunguanSaleOrderModel saleOrder = businessOrderService.querySaleOrderByYunGuanInfo(id);
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(saleOrder)){
|
|
|
|
|
// JSONObject saleCode = HttpUtil.httpRequest("http://172.16.1.50:8020/fggj/sal/ordHead", "POST", JsonUtil.getObjectToString(saleOrder));
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(saleCode)) {
|
|
|
|
|
// if (saleCode.get("code").equals("200")) {
|
|
|
|
|
// List<YunguanSaleOrderProductModel> saleOrderProduct = businessOrderService.querySaleOrderProductByYunGuanInfo(id);
|
|
|
|
|
// JSONObject saleProductCode = HttpUtil.httpRequest("http://172.16.1.50:8020/fggj/sal/ordLine", "POST", JsonUtil.getObjectToString(saleOrderProduct));
|
|
|
|
|
// if (ObjectUtil.isNotEmpty(saleProductCode)){
|
|
|
|
|
// entity.setErpMark(saleCode.get("code").toString());
|
|
|
|
|
// entity.setErpMassage(saleCode.get("errmsg").toString());
|
|
|
|
|
// }else{
|
|
|
|
|
// entity.setErpMark("N");
|
|
|
|
|
// entity.setErpMassage("ESB返回为空");
|
|
|
|
|
// }
|
|
|
|
|
// }else{
|
|
|
|
|
// entity.setErpMark(saleCode.get("code").toString());
|
|
|
|
|
// entity.setErpMassage(saleCode.get("errmsg").toString());
|
|
|
|
|
// }
|
|
|
|
|
// }else {
|
|
|
|
|
// entity.setErpMark("N");
|
|
|
|
|
// entity.setErpMassage("ESB返回为空");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (entity.getBusinessType().equals("1")) {
|
|
|
|
|
YunguanPurchaseOrderModel purchaseOrder = businessOrderService.queryPurchaseOrderByYunGuanInfo(id);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(purchaseOrder)) {
|
|
|
|
|
JSONObject purchaseCode = HttpUtil.httpRequest(yunguaninterfaceurl+"/fggj/pur/ordHead", "POST", JsonUtil.getObjectToString(purchaseOrder));
|
|
|
|
|
if (ObjectUtil.isNotEmpty(purchaseCode)){
|
|
|
|
|
if (purchaseCode.get("code").equals("200")) {
|
|
|
|
|
List<YunguanPurchaseOrderProductModel> purchaseOrderProduct = businessOrderService.queryPurchaseOrderProductByYunGuanInfo(id);
|
|
|
|
|
JSONObject purchaseProductCode = HttpUtil.httpRequest(yunguaninterfaceurl+"/fggj/pur/ordLine", "POST", JsonUtil.getObjectToString(purchaseOrderProduct));
|
|
|
|
|
if(ObjectUtil.isNotEmpty(purchaseCode)){
|
|
|
|
|
entity.setErpMark(purchaseProductCode.get("code").toString());
|
|
|
|
|
entity.setErpMassage(purchaseProductCode.get("errmsg").toString());
|
|
|
|
|
}else{
|
|
|
|
|
entity.setErpMark("N");
|
|
|
|
|
entity.setErpMassage("ESB返回为空");
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
entity.setErpMark(purchaseCode.get("code").toString());
|
|
|
|
|
entity.setErpMassage(purchaseCode.get("errmsg").toString());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
entity.setErpMark("N");
|
|
|
|
|
entity.setErpMassage("ESB返回为空");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else if (entity.getBusinessType().equals("2")){
|
|
|
|
|
YunguanSaleOrderModel saleOrder = businessOrderService.querySaleOrderByYunGuanInfo(id);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(saleOrder)){
|
|
|
|
|
JSONObject saleCode = HttpUtil.httpRequest(yunguaninterfaceurl+"/fggj/sal/ordHead", "POST", JsonUtil.getObjectToString(saleOrder));
|
|
|
|
|
if (ObjectUtil.isNotEmpty(saleCode)) {
|
|
|
|
|
if (saleCode.get("code").equals("200")) {
|
|
|
|
|
List<YunguanSaleOrderProductModel> saleOrderProduct = businessOrderService.querySaleOrderProductByYunGuanInfo(id);
|
|
|
|
|
JSONObject saleProductCode = HttpUtil.httpRequest(yunguaninterfaceurl+"/fggj/sal/ordLine", "POST", JsonUtil.getObjectToString(saleOrderProduct));
|
|
|
|
|
if (ObjectUtil.isNotEmpty(saleProductCode)){
|
|
|
|
|
entity.setErpMark(saleCode.get("code").toString());
|
|
|
|
|
entity.setErpMassage(saleCode.get("errmsg").toString());
|
|
|
|
|
}else{
|
|
|
|
|
entity.setErpMark("N");
|
|
|
|
|
entity.setErpMassage("ESB返回为空");
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
entity.setErpMark(saleCode.get("code").toString());
|
|
|
|
|
entity.setErpMassage(saleCode.get("errmsg").toString());
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
entity.setErpMark("N");
|
|
|
|
|
entity.setErpMassage("ESB返回为空");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
businessOrderService.saveOrUpdate(entity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|