|
|
@@ -1,12 +1,12 @@
|
|
|
package com.malk.jiuyousimu.service.Impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
-import com.malk.jiuyousimu.entity.basic.*;
|
|
|
-
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.kingdee.bos.webapi.entity.RepoRet;
|
|
|
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
|
|
+import com.malk.jiuyousimu.entity.basic.*;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.malk.jiuyousimu.entity.payment.PaymentDetail;
|
|
|
import com.malk.jiuyousimu.entity.payment.PaymentMain;
|
|
|
import com.malk.jiuyousimu.entity.reimbursement.CostDetail;
|
|
|
@@ -482,11 +482,14 @@ public class DocumentServiceImpl implements DocumentService {
|
|
|
paymentDetail.setFEntryTaxRate(UtilMap.getDouble(jsonObject, "value"));
|
|
|
break;
|
|
|
case "税额":
|
|
|
- paymentDetail.setFNoTaxAmountFor_D(UtilMap.getDouble(jsonObject, "value"));
|
|
|
+ paymentDetail.setFTAXAMOUNTFOR_D(UtilMap.getDouble(jsonObject, "value"));
|
|
|
break;
|
|
|
- case "金额(非税)":
|
|
|
+ case "小计":
|
|
|
paymentDetail.setFALLAMOUNTFOR_D(UtilMap.getDouble(jsonObject, "value"));
|
|
|
break;
|
|
|
+ case "金额(非税)":
|
|
|
+ paymentDetail.setFNoTaxAmountFor_D(UtilMap.getDouble(jsonObject, "value"));
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
paymentDetails.add(paymentDetail);
|
|
|
@@ -514,7 +517,7 @@ public class DocumentServiceImpl implements DocumentService {
|
|
|
JSONObject field = rowValues.getJSONObject(i);
|
|
|
String label = field.getString("label");
|
|
|
if ("供应商编号".equals(label)) {
|
|
|
- paymentMain.setFSUPPLIERID(new FNumber(field.getString("value")));
|
|
|
+ paymentMain.setFSUPPLIERID(new FNumber(field.getString("value")));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -522,59 +525,59 @@ public class DocumentServiceImpl implements DocumentService {
|
|
|
mainData.put(name, e.get("value"));
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
- Save save = new Save();
|
|
|
-
|
|
|
- paymentMain.setFBUSINESSTYPE("FY");
|
|
|
- paymentMain.setFBillTypeID(new BillTypeID("YFD02_SYS"));
|
|
|
- paymentMain.setFDATE(LocalDate.parse(UtilMap.getString(mainData,"业务日期").substring(0,10)));
|
|
|
- paymentMain.setFENDDATE_H(LocalDate.parse(UtilMap.getString(mainData,"付款到期日").substring(0,10)));
|
|
|
- paymentMain.setFDOCUMENTSTATUS("A");//单据状态为创建
|
|
|
- paymentMain.setFCURRENCYID(new FNumber(UtilMap.getString(ALL_ENUM,UtilMap.getString(mainData,"币别"))));
|
|
|
- paymentMain.setFPAYORGID(new FNumber(UtilMap.getString(ALL_ENUM,UtilMap.getString(mainData,"所属公司主体"))));
|
|
|
- paymentMain.setFSETTLEORGID(new FNumber(UtilMap.getString(ALL_ENUM,UtilMap.getString(mainData,"所属公司主体"))));
|
|
|
- paymentMain.setFPURCHASEDEPTID(new FNumber(userDeptId));
|
|
|
- paymentMain.setFAP_Remark(UtilMap.getString(mainData,"备注"));
|
|
|
+ });
|
|
|
+ Save save = new Save();
|
|
|
+
|
|
|
+ paymentMain.setFBUSINESSTYPE("FY");
|
|
|
+ paymentMain.setFBillTypeID(new BillTypeID("YFD02_SYS"));
|
|
|
+ paymentMain.setFDATE(LocalDate.parse(UtilMap.getString(mainData,"业务日期").substring(0,10)));
|
|
|
+ paymentMain.setFENDDATE_H(LocalDate.parse(UtilMap.getString(mainData,"付款到期日").substring(0,10)));
|
|
|
+ paymentMain.setFDOCUMENTSTATUS("A");//单据状态为创建
|
|
|
+ paymentMain.setFCURRENCYID(new FNumber(UtilMap.getString(ALL_ENUM,UtilMap.getString(mainData,"币别"))));
|
|
|
+ paymentMain.setFPAYORGID(new FNumber(UtilMap.getString(ALL_ENUM,UtilMap.getString(mainData,"选择支付主体"))));
|
|
|
+ paymentMain.setFSETTLEORGID(new FNumber(UtilMap.getString(ALL_ENUM,UtilMap.getString(mainData,"选择支付主体"))));
|
|
|
+ paymentMain.setFPURCHASEDEPTID(new FNumber(userDeptId));
|
|
|
+ paymentMain.setFAP_Remark(UtilMap.getString(mainData,"备注"));
|
|
|
// paymentMain.setFPURCHASERID(new FNumber());
|
|
|
- paymentMain.setFEntityDetail(paymentDetails);
|
|
|
-
|
|
|
- save.setModel(paymentMain);
|
|
|
- System.out.println(save);
|
|
|
-
|
|
|
- try{
|
|
|
- K3CloudApi client = new K3CloudApi(kingDeeService.initIden());
|
|
|
- //业务对象标识
|
|
|
- String formId = "AP_Payable";
|
|
|
- //调用接口
|
|
|
- String resultJson = client.save(formId,JSONObject.toJSONString(save));
|
|
|
- //用于记录结果
|
|
|
- Gson gson = new Gson();
|
|
|
- //对返回结果进行解析和校验
|
|
|
- RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class);
|
|
|
-
|
|
|
- if (kingDeeService.isTrue(repoRet)){
|
|
|
- String id = repoRet.getResult().getId();
|
|
|
-
|
|
|
- Submit submit = new Submit();
|
|
|
- submit.setIds(id);
|
|
|
- //提交
|
|
|
- String resultJson2 = client.submit(formId, JSONObject.toJSONString(submit));
|
|
|
- RepoRet repoRet2 = gson.fromJson(resultJson2, RepoRet.class);
|
|
|
- kingDeeService.isTrue(repoRet2);
|
|
|
-
|
|
|
- if (kingDeeService.isTrue(repoRet2)){
|
|
|
- Audit audit = new Audit();
|
|
|
- audit.setIds(id);
|
|
|
- //审核
|
|
|
- String resultJson3 = client.audit(formId,JSONObject.toJSONString(audit));
|
|
|
- RepoRet repoRet3 = gson.fromJson(resultJson3, RepoRet.class);
|
|
|
- kingDeeService.isTrue(repoRet3);
|
|
|
- }
|
|
|
+ paymentMain.setFEntityDetail(paymentDetails);
|
|
|
+
|
|
|
+ save.setModel(paymentMain);
|
|
|
+ System.out.println(save);
|
|
|
+
|
|
|
+ try{
|
|
|
+ K3CloudApi client = new K3CloudApi(kingDeeService.initIden());
|
|
|
+ //业务对象标识
|
|
|
+ String formId = "AP_Payable";
|
|
|
+ //调用接口
|
|
|
+ String resultJson = client.save(formId,JSONObject.toJSONString(save));
|
|
|
+ //用于记录结果
|
|
|
+ Gson gson = new Gson();
|
|
|
+ //对返回结果进行解析和校验
|
|
|
+ RepoRet repoRet = gson.fromJson(resultJson, RepoRet.class);
|
|
|
+
|
|
|
+ if (kingDeeService.isTrue(repoRet)){
|
|
|
+ String id = repoRet.getResult().getId();
|
|
|
+
|
|
|
+ Submit submit = new Submit();
|
|
|
+ submit.setIds(id);
|
|
|
+ //提交
|
|
|
+ String resultJson2 = client.submit(formId, JSONObject.toJSONString(submit));
|
|
|
+ RepoRet repoRet2 = gson.fromJson(resultJson2, RepoRet.class);
|
|
|
+ kingDeeService.isTrue(repoRet2);
|
|
|
+
|
|
|
+ if (kingDeeService.isTrue(repoRet2)){
|
|
|
+ Audit audit = new Audit();
|
|
|
+ audit.setIds(id);
|
|
|
+ //审核
|
|
|
+ String resultJson3 = client.audit(formId,JSONObject.toJSONString(audit));
|
|
|
+ RepoRet repoRet3 = gson.fromJson(resultJson3, RepoRet.class);
|
|
|
+ kingDeeService.isTrue(repoRet3);
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- McR.errorUnknown(e.getMessage());
|
|
|
}
|
|
|
-
|
|
|
- return McR.success();
|
|
|
+ } catch (Exception e) {
|
|
|
+ McR.errorUnknown(e.getMessage());
|
|
|
}
|
|
|
+
|
|
|
+ return McR.success();
|
|
|
}
|
|
|
+}
|