|
@@ -2,11 +2,16 @@ package net.chenlin.dp.modules.api.controller;
|
|
|
|
|
|
import com.taobao.api.ApiException;
|
|
|
import net.chenlin.dp.common.openapi4j.exception.OpenAPIException;
|
|
|
+import net.chenlin.dp.common.support.orm.db.DynamicDataSource;
|
|
|
import net.chenlin.dp.modules.api.service.PurchaseOrderService;
|
|
|
import net.chenlin.dp.modules.api.vo.SaleOrderRest;
|
|
|
import net.chenlin.dp.modules.api.vo.YonyouPurchaseOrder;
|
|
|
import net.chenlin.dp.modules.api.vo.YonyouSaleOrder;
|
|
|
+import net.chenlin.dp.modules.sys.service.SysUserService;
|
|
|
+import net.chenlin.dp.modules.sys.service.impl.SysUserServiceImpl;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -15,7 +20,7 @@ public class PurchaseOrderController {
|
|
|
|
|
|
private PurchaseOrderService purchaseOrderService=new PurchaseOrderService();
|
|
|
private DingdingOpenInterface dingdingOpenInterface=new DingdingOpenInterface();
|
|
|
-
|
|
|
+ private SysUserService sysUserService=new SysUserServiceImpl();
|
|
|
|
|
|
/**
|
|
|
* 获取U8采购订单创建钉钉采购订单审批实列
|
|
@@ -47,23 +52,21 @@ public class PurchaseOrderController {
|
|
|
List<String> orderIdList = dingdingOpenInterface.getOrderIdList("PROC-971173C9-46DF-4FA8-BEBB-94D3477ADB97");
|
|
|
if (orderIdList!=null&&!orderIdList.equals("")){
|
|
|
for (String id:orderIdList){
|
|
|
- SaleOrderRest saleOrderRest=new SaleOrderRest();
|
|
|
Map<String, Object> orderDetails = dingdingOpenInterface.getOrderDetails(id);
|
|
|
Map<String, Object> map = DingdingOpenInterface.tableToMap(orderDetails);
|
|
|
- saleOrderRest.setUser_id("");
|
|
|
Object code = map.get("单据编号");
|
|
|
- saleOrderRest.setVoucher_code(code.toString());
|
|
|
Object result = orderDetails.get("result");
|
|
|
if (!result.equals("")&&result!=null){
|
|
|
if (result.equals("agree")){
|
|
|
- saleOrderRest.setAgree("1");
|
|
|
- }if (result.equals("refuse")){
|
|
|
- saleOrderRest.setAgree("0");
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
|
|
|
+ String format = df.format(new Date());
|
|
|
+ DynamicDataSource.setDataSource("slave-data-source");
|
|
|
+ sysUserService.Purchaseshenhe("XSDD210930005",format,format,"1","demo");
|
|
|
+ DynamicDataSource.setDataSource("");
|
|
|
}
|
|
|
- purchaseOrderService.yonyouShenhePurchaseOrder(saleOrderRest);
|
|
|
}
|
|
|
|
|
|
- System.out.println(code+"-"+result);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|