|
@@ -13,6 +13,7 @@ import net.chenlin.dp.common.openapi4j.exception.OpenAPIException;
|
|
|
import net.chenlin.dp.common.openapi4j.platform.ResultService;
|
|
|
import net.chenlin.dp.common.openapi4j.service.AcceptService;
|
|
|
import net.chenlin.dp.common.openapi4j.service.ConsignmentService;
|
|
|
+import net.chenlin.dp.common.openapi4j.service.UserService;
|
|
|
import net.chenlin.dp.common.openapi4j.util.PropUtil;
|
|
|
import net.chenlin.dp.common.support.orm.db.DynamicDataSource;
|
|
|
import net.chenlin.dp.common.utils.SpringContextUtils;
|
|
@@ -56,6 +57,31 @@ public class SaleOrderService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// String s="\t\n" +
|
|
|
+// "{\n" +
|
|
|
+// "\t\"saleorder\":{\n" +
|
|
|
+// "\t\t\"custcode\":\"0001\",\n" +
|
|
|
+// "\t\t\"deptcode\":\"0521\",\n" +
|
|
|
+// "\t\t\"entry\":[\n" +
|
|
|
+// "\t\t\t{\n" +
|
|
|
+// "\t\t\t\t\"inventorycode\":\"0907\",\n" +
|
|
|
+// "\t\t\t\t\"quantity\":\"15\",\n" +
|
|
|
+// "\t\t\t\t\"quotedprice\":\"200\",\n" +
|
|
|
+// "\t\t\t\t\"money\":\"3000\",\n" +
|
|
|
+// "\t\t\t\t\"irowno\":\"1\",\n" +
|
|
|
+// "\t\t\t\t\"dpredate\":\"2021-10-23\"\n" +
|
|
|
+// "\t\t\t}\n" +
|
|
|
+// "\t\t]\n" +
|
|
|
+// "\t}\n" +
|
|
|
+// "}";
|
|
|
+// JSONObject add = saleOrderService.add(s, getToaccount);
|
|
|
+// HashMap hashMap = JSONObject.parseObject(add.toString(), HashMap.class);
|
|
|
+// Object tradeid = hashMap.get("tradeid");
|
|
|
+// if (!tradeid.equals("")&&tradeid!=null){
|
|
|
+// String result = ResultService.getResult(tradeid.toString());
|
|
|
+// System.out.println(result);
|
|
|
+// }
|
|
|
}catch (Exception e){
|
|
|
throw new OpenAPIException(e.getMessage(), e);
|
|
|
}
|
|
@@ -102,9 +128,9 @@ public class SaleOrderService {
|
|
|
* @return
|
|
|
* @throws OpenAPIException
|
|
|
*/
|
|
|
- public YonyouSaleOrder yonyouGetSaleOrder(String id) throws OpenAPIException {
|
|
|
+ public YonyouSaleOrder yonyouGetSaleOrder(String id,String dataid) throws OpenAPIException {
|
|
|
try {
|
|
|
- JSONObject jsonObject = saleOrderService.get(id, getToaccount);
|
|
|
+ JSONObject jsonObject = saleOrderService.get(id, getToaccount,dataid);
|
|
|
HashMap hashMap = JSONObject.parseObject(jsonObject.toString(), HashMap.class);
|
|
|
if (hashMap.get("errcode").equals("0")){
|
|
|
Object saleorder = hashMap.get("saleorder");
|
|
@@ -123,11 +149,11 @@ public class SaleOrderService {
|
|
|
/**
|
|
|
* 销售订单审核
|
|
|
*/
|
|
|
- public void yonyouShenheSaleOrder(SaleOrderRest saleOrderRest) throws OpenAPIException {
|
|
|
+ public void yonyouShenheSaleOrder(String s) throws OpenAPIException {
|
|
|
Map<String,Object>map=new HashMap<>();
|
|
|
- map.put("saleorder",saleOrderRest);
|
|
|
+ // map.put("saleorder",saleOrderRest);
|
|
|
try {
|
|
|
- String s = JSONObject.toJSONString(map);
|
|
|
+ // String s = JSONObject.toJSONString(map);
|
|
|
JSONObject shenghe = saleOrderService.shenghe(s, getToaccount);
|
|
|
System.out.println(shenghe);
|
|
|
}catch (Exception e){
|
|
@@ -165,7 +191,7 @@ public class SaleOrderService {
|
|
|
* @param map 数据
|
|
|
* @throws ApiException
|
|
|
*/
|
|
|
- public Object createOrder(String processCode, Long agentid, String userid, Long deptid, YonyouSaleOrder so) throws ApiException {
|
|
|
+ public Object createOrder(String processCode, Long agentid, String userid, Long deptid, YonyouSaleOrder so,String data) throws ApiException {
|
|
|
String useridshenh = prop.getProperty("shenhe_userid");
|
|
|
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/processinstance/create");
|
|
|
OapiProcessinstanceCreateRequest req = new OapiProcessinstanceCreateRequest();
|
|
@@ -201,6 +227,7 @@ public class SaleOrderService {
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc2 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
fc2.setName("单据编号");
|
|
|
fc2.setValue(so.getCode());
|
|
|
+ fc2.setExtValue(data);
|
|
|
formComponentValueVoList.add(fc2);
|
|
|
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc3 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
@@ -429,7 +456,19 @@ public class SaleOrderService {
|
|
|
|
|
|
public static void main(String[] args) throws OpenAPIException {
|
|
|
SaleOrderService service=new SaleOrderService();
|
|
|
- List<YonyouSaleOrder>list=new ArrayList<>();
|
|
|
+ UserService service1=new UserService();
|
|
|
+ // service1.login("","","test_yuansh");
|
|
|
+// List<YonyouSaleOrder>list=new ArrayList<>();
|
|
|
+//
|
|
|
+// service.getToaccount();
|
|
|
+// String s="{\n" +
|
|
|
+// "\t\"saleorder\":{\n" +
|
|
|
+// "\t\t\"voucher_code\":\"XSDD210003\",\n" +
|
|
|
+// "\t\t\"user_id\":\"demo\"\n" +
|
|
|
+// "\t}\n" +
|
|
|
+// "}";
|
|
|
+// service.yonyouShenheSaleOrder(s);
|
|
|
+ // service.yonyouAddSaleOrder(list);
|
|
|
|
|
|
//销售订单测试
|
|
|
// YonyouSaleOrder yonyouSaleOrder=new YonyouSaleOrder();
|