diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java
index ee5ee3a1..ac2aaef4 100644
--- a/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java
+++ b/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java
@@ -34,49 +34,67 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService {
}
public static void main(String[] args) {
- java.lang.String str = "{\"data\":{\"enablestate\":\"2\",\"user_password\":\"Hzya@1314\",\"gender\":\"12312\",\"user_name\":\"测试用户\",\"modify_time\":1719305835000,\"document_rule_num\":112,\"pk_org\":{\"org_mnecode\":\"1\",\"modify_time\":1718866279000,\"document_rule_num\":4,\"add_status\":\"0\",\"org_address\":\"1\",\"delete_status\":\"1\",\"org_innercode\":\"1\",\"id\":\"f7a8cee35fce4aa8ab266b3c7f125d7d\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"org_name\":\"开发部\",\"sorts\":4,\"document_rule\":\"ZZ-2024-06-20-00004\",\"create_user_id\":\"1\",\"create_time\":1718864103000,\"company_id\":\"Y\",\"org_memo\":\"1\",\"update_status\":\"0\",\"sts\":\"Y\",\"org_tel\":\"1\",\"org_id\":\"Y\",\"org_ncindustry\":\"1\",\"org_fatherorg\":\"c4913dde8da142bab4206fc084269382\",\"org_code\":\"003\",\"org_principal\":\"1\",\"org_countryzone\":\"1\"},\"add_status\":\"0\",\"pwdlevelcode\":\"\",\"user_type\":\"1\",\"user_code\":\"17633965916\",\"delete_status\":\"1\",\"id\":\"d99fe4e1c211450a960f7a1057da0d2c\",\"data_status\":\"F\",\"modify_user_id\":\"1\",\"sorts\":346,\"document_rule\":\"YH-2024-06-25-00112\",\"create_user_id\":\"1\",\"create_time\":1719305229000,\"company_id\":\"Y\",\"user_code_q\":\"KP003\",\"format\":\"ZH-CN\",\"mobile\":\"123123\",\"identityverifycode\":\"静态密码验证\",\"islocked\":\"N\",\"update_status\":\"0\",\"base_doc_type\":\"0\",\"sts\":\"Y\",\"login_name\":\"123123\",\"pwdparam\":\"2024-06-17\",\"org_id\":\"Y\",\"abledate\":\"2024-06-17 00:00:00\",\"isca\":\"Y\",\"contentlang\":\"ZH\"},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"100\\\",\\\"index\\\":0,\\\"description\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNR\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7127798c-b731-453a-b3ac-cfe9033eeace\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"required\\\":true,\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA87rrNREgMNeOEOwlvM2iqqEfshDadRHziDSB2PbRnoMqSv1nGr3XBlZuseNj5HmxDEkLhOdfyw0yjzoz3wK7XhFpeN4Iyf7NT7hps5jAQMEpnul9Qwmj5qUr/eK5SaO9H8n7sh9BvCdrX9oRUh+U2/ceA3O+y/MUHk5DRvSadc8FhpqbOaNBbAzPnyYAwpVUPvaJ90jcGN1ZG99HR1GEzC+Cn9s6vgt7dYL6ysMs36bSP47xraDSxpfr0CLwa6JV/9KjLIeqL1ZaMtK0CJ1zJGCBA6O6kgxeE9Ul7q2lSS6mPAEJ78izaTYsrjhLpKT+eTtFBOLFbiCrbLp8tVE5kwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":1,\\\"description\\\":\\\"OA\\\",\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"7f965281-df0f-4d2f-b005-07e061fcde49\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"required\\\":true,\\\"example\\\":\\\"OA\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"length\\\":\\\"50\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"cbc0e105-17c0-4385-8863-8903303edc1f\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"index\\\":0,\\\"id\\\":\\\"beeedbc6-24c2-4093-9a5e-20fced9fb1b4\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
+ java.lang.String str = "{\"data\":{\"year\":\"2024\",\"prepared\":\"demo\",\"modify_time\":1730863191000,\"num\":\"13\",\"gl_detail\":[{\"create_user_id\":\"1\",\"amount\":\"5000\",\"formmain_id\":\"9da5a28900084951913df0d233427178\",\"create_time\":1730863191000,\"company_id\":\"0\",\"globalcreditamount\":\"0\",\"modify_time\":1730863191000,\"localcreditamount\":\"0\",\"localdebitamount\":\"5000\",\"explanation\":\"演示分录1\",\"globaldebitamount\":\"5000\",\"detail_id\":\"1\",\"groupdebitamount\":\"5000\",\"sts\":\"Y\",\"currtype_code\":\"CNY\",\"org_id\":\"0\",\"busidate\":\"2024-11-05\",\"groupcreditamount\":\"0\",\"detailindex\":\"1\",\"account_code\":\"100210\",\"id\":\"0eb6d3d5f12944e1bcbb00883cc4f13e\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":1},{\"create_user_id\":\"1\",\"amount\":\"5000\",\"formmain_id\":\"9da5a28900084951913df0d233427178\",\"create_time\":1730863191000,\"company_id\":\"0\",\"globalcreditamount\":\"5000\",\"modify_time\":1730863191000,\"localcreditamount\":\"5000\",\"localdebitamount\":\"0\",\"explanation\":\"演示分录2\",\"globaldebitamount\":\"0\",\"detail_id\":\"2\",\"groupdebitamount\":\"0\",\"sts\":\"Y\",\"currtype_code\":\"CNY\",\"org_id\":\"0\",\"busidate\":\"2024-11-05\",\"groupcreditamount\":\"5000\",\"detailindex\":\"2\",\"account_code\":\"2231\",\"id\":\"db9c531af7a94af2975d1c9f1ae21813\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":2}],\"document_rule_num\":1,\"add_status\":\"0\",\"vouchertype\":\"01\",\"attachment\":\"0\",\"delete_status\":\"1\",\"id\":\"9da5a28900084951913df0d233427178\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":1,\"document_rule\":\"PZ-20241106-00001\",\"create_user_id\":\"1\",\"period\":\"11\",\"create_time\":1730863191000,\"company_id\":\"Y\",\"update_status\":\"1\",\"accbook_code\":\"101-0002\",\"sts\":\"Y\",\"org_id\":\"Y\",\"prepareddate\":\"2024-11-05\",\"voucher_id\":\"1\",\"gl_fixtmpfreevalue\":[{\"create_user_id\":\"1\",\"formmain_id\":\"9da5a28900084951913df0d233427178\",\"create_time\":1730863191000,\"company_id\":\"0\",\"checktypecode\":\"0012\",\"modify_time\":1730863191000,\"checkvaluecode\":\"101\",\"detail_id\":\"2\",\"sts\":\"Y\",\"org_id\":\"0\",\"voucher_id\":\"1\",\"id\":\"779d40051ae3470583885d9c202d5ba1\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":1},{\"create_user_id\":\"1\",\"formmain_id\":\"9da5a28900084951913df0d233427178\",\"create_time\":1730863191000,\"company_id\":\"0\",\"checktypecode\":\"0006\",\"modify_time\":1730863191000,\"checkvaluecode\":\"000001\",\"detail_id\":\"2\",\"sts\":\"Y\",\"org_id\":\"0\",\"voucher_id\":\"1\",\"id\":\"f313361e495445958245ec61a00a1216\",\"data_status\":\"Y\",\"modify_user_id\":\"1\",\"sorts\":2}]},\"query\":\"[]\",\"header\":\"[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"index\\\":0,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"77ba4bd1-c693-488f-b3b7-69bb4c02be76\\\",\\\"parameterName\\\":\\\"pubKey\\\",\\\"example\\\":\\\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmlnN6sXjhJN6wUY0DILqiIL1ZX9ZU5Q40Hrr+4qhf3fddV/+/D1CyJo7aVGd3mJjD1BC1RXtnfxetaLzLrfTViq80RQvmmmKgt6rKiYMiW8ibcWoKaWMvwrlm0uT7RzYeXDP0l4qvoe8vjVWL63mQbx0y17p4opwTA9BV7P/CZ+9QyIJstN+yAg/owlNn48Jq4WspQps0/Zl/HvpiRjAPggVOqZLXkCjoBGrpNn/tlrDFbt+btK7tjhvsfT1zPMVAq8dNUKCMw5LoLsMxfT/ZWlI62zUAIbyO2/0iv5kCZw0I+DxPmGKVEOQ4x9FwXosSSD202H93CuBvVy/P31iUwIDAQAB\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"index\\\":1,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"df32aa53-9c8e-4d31-8a9b-d78bc70f9214\\\",\\\"parameterName\\\":\\\"client_id\\\",\\\"example\\\":\\\"u8c\\\"},{\\\"parameterType\\\":\\\"authport\\\",\\\"index\\\":2,\\\"concreteType\\\":\\\"String\\\",\\\"id\\\":\\\"de304f55-ca04-47d9-93f9-70b52d9bba50\\\",\\\"parameterName\\\":\\\"access_token\\\",\\\"example\\\":[\\\"attribute\\\",\\\"data\\\",\\\"access_token\\\"]}]\",\"body\":\"[{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"complex\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":2,\\\"parameterName\\\":\\\"accbookCode\\\",\\\"id\\\":\\\"95ff2224-bdb7-4a9d-a45b-8c19f444022b\\\",\\\"example\\\":\\\"X0644-0001\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":3,\\\"parameterName\\\":\\\"prepareddate\\\",\\\"id\\\":\\\"7106bf79-133c-446e-be58-bf18d43a7c14\\\",\\\"example\\\":\\\"2023-09-19\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":4,\\\"parameterName\\\":\\\"year\\\",\\\"id\\\":\\\"9b005ca9-e246-41c0-bbbb-aead5d6f44f1\\\",\\\"example\\\":\\\"2023\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":5,\\\"parameterName\\\":\\\"num\\\",\\\"id\\\":\\\"fbe1d3a2-69e9-4df7-91d0-bb9005cd333e\\\",\\\"example\\\":\\\"4\\\"},{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":7,\\\"parameterName\\\":\\\"detailindex\\\",\\\"id\\\":\\\"386e20b9-5992-4a95-8fa7-fb64677d55e9\\\",\\\"example\\\":\\\"1\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":8,\\\"parameterName\\\":\\\"explanation\\\",\\\"id\\\":\\\"20cab876-bd5a-46b8-96ba-7112104a273f\\\",\\\"example\\\":\\\"测试\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":9,\\\"parameterName\\\":\\\"accountCode\\\",\\\"id\\\":\\\"e1a89672-8449-4bda-a404-478f0594ac70\\\",\\\"example\\\":\\\"150401\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":10,\\\"parameterName\\\":\\\"currtypeCode\\\",\\\"id\\\":\\\"43b33900-c5da-4afb-bbd7-0865bd02db58\\\",\\\"example\\\":\\\"CNY\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":11,\\\"parameterName\\\":\\\"amount\\\",\\\"id\\\":\\\"4b0fd6a4-b1d0-489e-aec1-ca509e9221ad\\\",\\\"example\\\":\\\"1000\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":12,\\\"parameterName\\\":\\\"localdebitamount\\\",\\\"id\\\":\\\"9a43ad19-f903-4a8a-a5ac-f13c9fba445e\\\",\\\"example\\\":\\\"1000\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":13,\\\"parameterName\\\":\\\"localcreditamount\\\",\\\"id\\\":\\\"df2d1f92-89cb-411d-83ba-62366e931dba\\\",\\\"example\\\":\\\"0\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":14,\\\"parameterName\\\":\\\"groupdebitamount\\\",\\\"id\\\":\\\"61965366-0500-40d7-bae4-5dd16eb90761\\\",\\\"example\\\":\\\"1000\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":15,\\\"parameterName\\\":\\\"groupcreditamount\\\",\\\"id\\\":\\\"bdc3c6c2-de87-45f1-85cf-24f3b92920c6\\\",\\\"example\\\":\\\"0\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":16,\\\"parameterName\\\":\\\"globaldebitamount\\\",\\\"id\\\":\\\"a6069792-2a6b-43ba-97d7-504e1c5e3156\\\",\\\"example\\\":\\\"1000\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":17,\\\"parameterName\\\":\\\"globalcreditamount\\\",\\\"id\\\":\\\"528b2c6b-86a5-47ec-8b26-00259dacb0b4\\\",\\\"example\\\":\\\"0\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":18,\\\"parameterName\\\":\\\"busidate\\\",\\\"id\\\":\\\"11636e2a-b9d8-4ee3-81fc-0e809d11bf4f\\\",\\\"example\\\":\\\"2023-09-19\\\"},{\\\"parameterType\\\":\\\"complexlist\\\",\\\"children\\\":[{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":20,\\\"parameterName\\\":\\\"checktypecode\\\",\\\"id\\\":\\\"b56bf160-7180-47ea-996a-acd8307eb5fa\\\",\\\"example\\\":\\\"0004\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":21,\\\"parameterName\\\":\\\"checkvaluecode\\\",\\\"id\\\":\\\"88d4fbb0-d3b7-4f1e-981d-71e60d10e603\\\",\\\"example\\\":\\\"X0015\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":19,\\\"parameterName\\\":\\\"ass\\\",\\\"id\\\":\\\"c10103af-f382-4c9b-a8f4-0738b664abb0\\\"}],\\\"concreteType\\\":\\\"ObjectCom\\\",\\\"index\\\":6,\\\"parameterName\\\":\\\"detail\\\",\\\"id\\\":\\\"70f9d810-039e-4884-b986-bc5b75331fb4\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":22,\\\"parameterName\\\":\\\"period\\\",\\\"id\\\":\\\"de91d6ad-c07b-4f84-a8c9-52e87de39d50\\\",\\\"example\\\":\\\"09\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":23,\\\"parameterName\\\":\\\"vouchertype\\\",\\\"id\\\":\\\"5de12ed3-d27e-4848-a008-5fb2e5c656a8\\\",\\\"example\\\":\\\"01\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":24,\\\"parameterName\\\":\\\"attachment\\\",\\\"id\\\":\\\"cc0ae4fb-5f33-46c9-a0bf-775b46ae8511\\\",\\\"example\\\":\\\"0\\\"},{\\\"parameterType\\\":\\\"fundamental\\\",\\\"concreteType\\\":\\\"String\\\",\\\"index\\\":25,\\\"parameterName\\\":\\\"prepared\\\",\\\"id\\\":\\\"4b1622d6-980e-4920-82d0-e078e8bdb009\\\",\\\"example\\\":\\\"zhuc\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":1,\\\"parameterName\\\":\\\"sendData\\\",\\\"id\\\":\\\"2fc2918b-73fd-4c31-ba9f-1721132f1fdf\\\"}],\\\"concreteType\\\":\\\"Object\\\",\\\"index\\\":0,\\\"id\\\":\\\"669eebef-e4ae-474e-9b88-46a5490dc3db\\\",\\\"parameterName\\\":\\\"body\\\",\\\"first\\\":true}]\"}";
A88772 s = new A88772();
s.execute(str);
}
static class A88772 {
String execute(String jsonStr) {
- com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
- com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject();
-
com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr);
com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data");
- com.alibaba.fastjson.JSONObject ufinterfaceObject = new com.alibaba.fastjson.JSONObject();
- ufinterfaceObject.put("billtype", "customer");
- ufinterfaceObject.put("isexchange", "Y");
- ufinterfaceObject.put("replace", "Y");
- ufinterfaceObject.put("sender", "openUser");
- ufinterfaceObject.put("account", "ycjf");
- ufinterfaceObject.put("groupcode", "ycjf");
- com.alibaba.fastjson.JSONObject billObject = new com.alibaba.fastjson.JSONObject();
- com.alibaba.fastjson.JSONObject billheadObject = new com.alibaba.fastjson.JSONObject();
- billheadObject.put("code", data.get("code"));
- billheadObject.put("custprop", data.get("custprop"));
- billheadObject.put("custstate", data.get("custstate"));
- billheadObject.put("pk_custclass", data.get("pk_custclass"));
- billheadObject.put("pk_country", data.get("pk_country"));
- billheadObject.put("pk_timezone", "P0800");
- billheadObject.put("pk_format", "ZH-CN");
- billheadObject.put("enablestate", data.get("enablestate"));
- billheadObject.put("name", data.get("name"));
- billheadObject.put("pk_group", data.get("pk_group"));
- billheadObject.put("pk_org", data.get("pk_org"));
- billheadObject.put("taxpayerid", data.get("taxpayerid"));
- billObject.put("billhead", billheadObject);
- ufinterfaceObject.put("bill", billObject);
- bodys.put("ufinterface", ufinterfaceObject);
- returnObject.put("bodys",bodys.toJSONString());
+ com.alibaba.fastjson.JSONArray gl_detail = data.getJSONArray("gl_detail");
+ com.alibaba.fastjson.JSONArray gl_fixtmpfreevalue = data.getJSONArray("gl_fixtmpfreevalue");
+
+ com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject();
+ com.alibaba.fastjson.JSONObject sendData = new com.alibaba.fastjson.JSONObject();
+ sendData.put("accbookCode",data.getString("accbook_code"));
+ sendData.put("prepareddate",data.getString("prepareddate"));
+ sendData.put("year",data.getString("year"));
+ sendData.put("num",data.getString("num"));
+ sendData.put("period",data.getString("period"));
+ sendData.put("vouchertype",data.getString("vouchertype"));
+ sendData.put("attachment",data.getString("attachment"));
+ sendData.put("prepared",data.getString("prepared"));
+ com.alibaba.fastjson.JSONArray detail = new com.alibaba.fastjson.JSONArray();
+ if(gl_detail != null && gl_detail.size() > 0){
+ for (int i = 0; i < gl_detail.size(); i++) {
+ com.alibaba.fastjson.JSONObject detaildata = gl_detail.getJSONObject(i);
+ com.alibaba.fastjson.JSONObject object1 = new com.alibaba.fastjson.JSONObject();
+ object1.put("detailindex",detaildata.getString("detailindex"));
+ object1.put("explanation",detaildata.getString("explanation"));
+ object1.put("accountCode",detaildata.getString("account_code"));
+ object1.put("currtypeCode",detaildata.getString("currtype_code"));
+ object1.put("amount",detaildata.getString("amount"));
+ object1.put("localdebitamount",detaildata.getString("localdebitamount"));
+ object1.put("localcreditamount",detaildata.getString("localcreditamount"));
+ object1.put("groupdebitamount",detaildata.getString("groupdebitamount"));
+ object1.put("groupcreditamount",detaildata.getString("groupcreditamount"));
+ object1.put("globaldebitamount",detaildata.getString("globaldebitamount"));
+ object1.put("globalcreditamount",detaildata.getString("globalcreditamount"));
+ object1.put("busidate",detaildata.getString("busidate"));
+ detail.add(object1);
+ if(gl_fixtmpfreevalue != null && gl_fixtmpfreevalue.size() > 0){
+ com.alibaba.fastjson.JSONArray ass = new com.alibaba.fastjson.JSONArray();
+ for (int i1 = 0; i1 < gl_fixtmpfreevalue.size(); i1++) {
+ if(gl_fixtmpfreevalue.getJSONObject(i1).getString("voucher_id").equals(data.getString("voucher_id"))
+ && gl_fixtmpfreevalue.getJSONObject(i1).getString("detail_id").equals(detaildata.getString("detail_id"))){
+ com.alibaba.fastjson.JSONObject assdetail1 = new com.alibaba.fastjson.JSONObject();
+ assdetail1.put("checktypecode",gl_fixtmpfreevalue.getJSONObject(i1).getString("checktypecode"));
+ assdetail1.put("checkvaluecode",gl_fixtmpfreevalue.getJSONObject(i1).getString("checkvaluecode"));
+ ass.add(assdetail1);
+ }
+ }
+ if(ass.size() > 0){
+ object1.put("ass",ass);
+
+ }
+ }
+ }
+ }
+ sendData.put("detail",detail);
+ returnObject.put("bodys",sendData);
return returnObject.toJSONString();
-
-
-
-
-
}
}
diff --git a/base-webapp/pom.xml b/base-webapp/pom.xml
index 3507e248..f751b1fe 100644
--- a/base-webapp/pom.xml
+++ b/base-webapp/pom.xml
@@ -18,11 +18,11 @@
base-service
${revision}
-
-
-
-
-
+
+ com.hzya.frame
+ fw-bip
+ ${revision}
+
diff --git a/fw-bip/pom.xml b/fw-bip/pom.xml
new file mode 100644
index 00000000..f0f762fa
--- /dev/null
+++ b/fw-bip/pom.xml
@@ -0,0 +1,85 @@
+
+
+
+ kangarooDataCenterV3
+ com.hzya.frame
+ ${revision}
+
+ 4.0.0
+ fw-bip
+ jar
+ ${revision}
+
+
+
+ com.hzya.frame
+ base-service
+ ${revision}
+
+
+ mysql
+ mysql-connector-java
+ ${mysql-connector-java}
+
+
+
+ com.hzya.bip
+ pubbaseapp_nccloud_rtLevel
+ 1
+ system
+ ${basedir}/src/main/webapp/WEB-INF/lib/pubbaseapp_nccloud_rtLevel-1.jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+ none
+ execute
+ true
+
+
+
+
+ repackage
+
+
+
+
+
+
+
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipArchivesDao.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipArchivesDao.java
new file mode 100644
index 00000000..02516313
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipArchivesDao.java
@@ -0,0 +1,15 @@
+package com.hzya.frame.bip.v3.v2207.dao;
+
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity;
+import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
+
+import java.util.List;
+
+
+public interface IBipArchivesDao extends IBaseDao {
+
+ List queryArchivesData(BipArchivesEntity archivesEntity);
+ List queryArchivesDatays(BipArchivesEntity archivesEntity);
+
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipOrgsDao.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipOrgsDao.java
new file mode 100644
index 00000000..0ad05a4c
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipOrgsDao.java
@@ -0,0 +1,17 @@
+package com.hzya.frame.bip.v3.v2207.dao;
+
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
+
+import java.util.List;
+
+
+public interface IBipOrgsDao extends IBaseDao {
+
+ /**
+ * 查询BIP业务单元
+ * @param BipOrgsEntity
+ * @return
+ */
+ List thirdInterfaceGetOrgs(BipOrgsEntity BipOrgsEntity);
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipOrgsDetailsDao.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipOrgsDetailsDao.java
new file mode 100644
index 00000000..e0e6ea3f
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipOrgsDetailsDao.java
@@ -0,0 +1,17 @@
+package com.hzya.frame.bip.v3.v2207.dao;
+
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
+
+import java.util.List;
+
+
+public interface IBipOrgsDetailsDao extends IBaseDao {
+
+ /**
+ * 查询BIP业务单元银行账户
+ * @param BipOrgsDetailsEntity
+ * @return
+ */
+ List thirdInterfaceGetOrgsDetails(BipOrgsDetailsEntity BipOrgsDetailsEntity);
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipSupplierDao.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipSupplierDao.java
new file mode 100644
index 00000000..ba069080
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipSupplierDao.java
@@ -0,0 +1,18 @@
+package com.hzya.frame.bip.v3.v2207.dao;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
+
+import java.util.List;
+
+
+public interface IBipSupplierDao extends IBaseDao {
+
+ /**
+ * 查询BIP供应商
+ * @param bipSupplierEntity
+ * @return
+ */
+ List thirdInterfaceGetSupplier(BipSupplierEntity bipSupplierEntity);
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipSupplierDetailsDao.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipSupplierDetailsDao.java
new file mode 100644
index 00000000..2edaa29e
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/IBipSupplierDetailsDao.java
@@ -0,0 +1,18 @@
+package com.hzya.frame.bip.v3.v2207.dao;
+
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
+import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
+
+import java.util.List;
+
+
+public interface IBipSupplierDetailsDao extends IBaseDao {
+
+ /**
+ * 查询BIP供应商明细
+ * @param bipSupplierDetailsEntity
+ * @return
+ */
+ List thirdInterfaceGetSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity);
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipArchivesDaoImpl.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipArchivesDaoImpl.java
new file mode 100644
index 00000000..987d702c
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipArchivesDaoImpl.java
@@ -0,0 +1,25 @@
+package com.hzya.frame.bip.v3.v2207.dao.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipArchivesDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipArchivesEntity;
+import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository("bipArchivesDaoImpl")
+public class BipArchivesDaoImpl extends MybatisGenericDao implements IBipArchivesDao {
+
+ @Override
+ public List queryArchivesData(BipArchivesEntity entity) {
+ List o = super.query(getSqlIdPrifx() + "queryArchivesData", entity);
+ return o;
+ } @Override
+ public List queryArchivesDatays(BipArchivesEntity entity) {
+ List o = super.query(getSqlIdPrifx() + "queryArchivesDatays", entity);
+ return o;
+ }
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipOrgsDaoImpl.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipOrgsDaoImpl.java
new file mode 100644
index 00000000..478c54ca
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipOrgsDaoImpl.java
@@ -0,0 +1,24 @@
+package com.hzya.frame.bip.v3.v2207.dao.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipOrgsEntity;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository("bipOrgsDaoImpl")
+public class BipOrgsDaoImpl extends MybatisGenericDao implements IBipOrgsDao {
+ /**
+ * 查询BIP业务单元
+ * @param BipOrgsEntity
+ * @return
+ */
+ @DS("oracle91")
+ @Override
+ public List thirdInterfaceGetOrgs(BipOrgsEntity BipOrgsEntity) {
+ return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDaoImpl.thirdInterfaceGetOrgs",BipOrgsEntity);
+ }
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipOrgsDetailsDaoImpl.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipOrgsDetailsDaoImpl.java
new file mode 100644
index 00000000..5d51da6d
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipOrgsDetailsDaoImpl.java
@@ -0,0 +1,19 @@
+package com.hzya.frame.bip.v3.v2207.dao.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipOrgsDetailsDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipOrgsDetailsEntity;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository("bipOrgsDetailsDaoImpl")
+public class BipOrgsDetailsDaoImpl extends MybatisGenericDao implements IBipOrgsDetailsDao {
+ @DS("oracle91")
+ @Override
+ public List thirdInterfaceGetOrgsDetails(BipOrgsDetailsEntity bipOrgsDetailsEntity) {
+ return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipOrgsDetailsDaoImpl.thirdInterfaceGetOrgsDetails",bipOrgsDetailsEntity);
+ }
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipSupplierDaoImpl.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipSupplierDaoImpl.java
new file mode 100644
index 00000000..9abe9ee7
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipSupplierDaoImpl.java
@@ -0,0 +1,25 @@
+package com.hzya.frame.bip.v3.v2207.dao.impl;
+
+import cn.hutool.http.HttpRequest;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
+import com.hzya.frame.util.HttpUtil;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository("bipSupplierDaoImpl")
+public class BipSupplierDaoImpl extends MybatisGenericDao implements IBipSupplierDao {
+ /**
+ * 查询BIP供应商
+ * @param bipSupplierEntity
+ * @return
+ */
+ @DS("oracle91")
+ @Override
+ public List thirdInterfaceGetSupplier(BipSupplierEntity bipSupplierEntity) {
+ return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipSupplierDaoImpl.thirdInterfaceGetSupplier",bipSupplierEntity);
+ }
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipSupplierDetailsDaoImpl.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipSupplierDetailsDaoImpl.java
new file mode 100644
index 00000000..89443371
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dao/impl/BipSupplierDetailsDaoImpl.java
@@ -0,0 +1,20 @@
+package com.hzya.frame.bip.v3.v2207.dao.impl;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDao;
+import com.hzya.frame.bip.v3.v2207.dao.IBipSupplierDetailsDao;
+import com.hzya.frame.bip.v3.v2207.entity.BipSupplierDetailsEntity;
+import com.hzya.frame.bip.v3.v2207.entity.BipSupplierEntity;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository("bipSupplierDetailsDaoImpl")
+public class BipSupplierDetailsDaoImpl extends MybatisGenericDao implements IBipSupplierDetailsDao {
+ @DS("oracle91")
+ @Override
+ public List thirdInterfaceGetSupplierDetails(BipSupplierDetailsEntity bipSupplierDetailsEntity) {
+ return super.query("com.hzya.frame.bip.v3.v2207.dao.impl.BipSupplierDetailsDaoImpl.thirdInterfaceGetSupplierDetails",bipSupplierDetailsEntity);
+ }
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dps/service/IPayMentService.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dps/service/IPayMentService.java
new file mode 100644
index 00000000..ba800dce
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dps/service/IPayMentService.java
@@ -0,0 +1,38 @@
+package com.hzya.frame.bip.v3.v2207.dps.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+
+public interface IPayMentService {
+
+ /**
+ *
+ * @content 获取杭泰OA付款单传递CFS
+ * @Param
+ * @Return
+ * @Author hecan
+ * @Date 2023/10/16 11:59
+ * **/
+ String sendOAPayMentToCFS(JSONObject jsonObject, String type);
+
+ /**
+ *
+ * @content 获取CFS登录校验码
+ * @Param
+ * @Return
+ * @Author hecan
+ * @Date 2023/10/16 13:37
+ * **/
+ String sendCFSToken(String name, String password);
+
+ /**
+ *
+ * @content 获取杭泰OA报销单传递CFS
+ * @Param
+ * @Return
+ * @Author hecan
+ * @Date 2023/10/16 16:17
+ * **/
+ String sendExpenseToCFS(JSONObject jsonObject);
+
+}
diff --git a/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dps/service/impl/PayMentServiceImpl.java b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dps/service/impl/PayMentServiceImpl.java
new file mode 100644
index 00000000..1b9308a5
--- /dev/null
+++ b/fw-bip/src/main/java/com/hzya/frame/bip/v3/v2207/dps/service/impl/PayMentServiceImpl.java
@@ -0,0 +1,389 @@
+package com.hzya.frame.bip.v3.v2207.dps.service.impl;
+
+import cn.hutool.http.HttpRequest;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.bip.v3.v2207.dps.service.IPayMentService;
+import com.hzya.frame.dateutil.DateUtil;
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.StringReader;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+
+@Service(value = "payMentServiceImpl")
+public class PayMentServiceImpl implements IPayMentService {
+
+ private static final Logger logger = LoggerFactory.getLogger(PayMentServiceImpl.class);
+
+ private static final String NAME="admin";
+ private static final String PASSWORD="aHRzejg4OA==";
+ private static final String CFSURL="http://101.132.140.208:26883/erp/services/";//测试端口:26893,正式端口:26883
+
+ /**
+ *
+ * @content 杭泰OA付款单传递CFS 注:付款单,资金归集,资金拨付,同名账户划转和借款单都用同一个接口
+ * @Param
+ * @Return
+ * @Author hecan
+ * @Date 2023/10/13 10:40
+ * **/
+ public String sendOAPayMentToCFS(JSONObject jsonStr,String type){
+ logger.info("开始执行杭泰OA付款单传递CFS");
+ try {
+ String cfsToken = sendCFSToken(NAME, PASSWORD);
+ if(null!=cfsToken) {
+ String jsonStrObj = jsonStr.getString("jsonStr");
+ JSONObject jsonObjectMain = JSON.parseObject(jsonStrObj);
+ String erpVoucherNo = jsonObjectMain.getString("erpVoucherNo");//OA主键
+ String purpose = jsonObjectMain.getString("purpose");//摘要
+ String isForindividual = "0";//是否对私付款
+ StringBuffer stringBuffer = new StringBuffer();
+ String documentType=null;
+ switch (type){
+ case "pay"://付款单
+ documentType="01";
+ break;
+ case "fundc"://资金归集
+ documentType="02";
+ break;
+ case "funda"://资金拨付
+ documentType="03";
+ break;
+ case "acc"://同名账户划转
+ documentType="04";
+ break;
+ case "loan"://借款单
+ documentType="05";
+ break;
+ default:
+ break;
+ }
+ JSONArray jsonStrList = jsonObjectMain.getJSONArray("details");
+ if (null != jsonStrList && jsonStrList.size() > 0) {
+ for (Object seeyonEntity : jsonStrList) {
+ JSONObject jsonObjectFormson = JSON.parseObject(JSON.toJSONString(seeyonEntity));
+ String payerAccName = jsonObjectFormson.getString("payerAccName");//转出方账户名(付款账户)
+ String payerAccNo = jsonObjectFormson.getString("payerAccNo");//转出方账号(付款账号)
+ String curCode = jsonObjectFormson.getString("curCode");//付款方币种
+ String payeeAccName = jsonObjectFormson.getString("payeeAccName");//收款人帐户名称
+ String payeeAccNo = jsonObjectFormson.getString("payeeAccNo");//收款方账户号
+ BigDecimal amount = jsonObjectFormson.getBigDecimal("amount");//发生额
+ String payeeBankCode = jsonObjectFormson.getString("payeeBankCode");//联行号
+ String isQuick = jsonObjectFormson.getString("isQuick");//加急标志
+ String payType = jsonObjectFormson.getString("payType");//结算方式
+ String businessType = jsonObjectFormson.getString("businessType");//业务类别
+ stringBuffer.append("\n");
+ }
+ } else {
+ stringBuffer.append("\n");
+ }
+ String result=null;
+ String xml= requestXML(cfsToken,"BkPaymentMainExchange",stringBuffer,"OA付款单同步发送");
+ String url = "HTSZ_OA_BkPaymentMainWebService?wsdl";
+ switch (type){
+ case "pay"://付款单
+ logger.info("OA付款单发送CFS的请求参数为:{}", xml);
+ result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("OA付款单发送CFS的返回参数为:{}", result);
+ break;
+ case "fundc"://资金归集
+ logger.info("OA资金归集发送CFS的请求参数为:{}", xml);
+ result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("OA资金归集发送CFS的返回参数为:{}", result);
+ break;
+ case "funda"://资金调拨
+ logger.info("OA资金拨付发送CFS的请求参数为:{}", xml);
+ result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("OA资金拨付发送CFS的返回参数为:{}", result);
+ break;
+ case "acc"://同名账户划转
+ logger.info("OA同名账户划转发送CFS的请求参数为:{}", xml);
+ result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("OA同名账户划转发送CFS的返回参数为:{}", result);
+ break;
+ case "loan"://借款单
+ logger.info("OA借还款发送CFS的请求参数为:{}", xml);
+ result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("OA借还款发送CFS的返回参数为:{}", result);
+ break;
+ default:
+ break;
+ }
+ return analyzeXML(result,"pay");
+ }else{
+ logger.info("请先登录CFS登录接口获取Token");
+ return null;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ logger.info("杭泰OA付款单传递CFS错误,原因为:{}", e.getMessage());
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @content 获取CFS登录校验码
+ * @Param
+ * @Return
+ * @Author hecan
+ * @Date 2023/10/13 15:38
+ * **/
+ public String sendCFSToken(String name,String password) {
+ try {
+ String xml="\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "\n" +
+ "\n" +
+ "LogOn\n" +
+ ""+DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss")+"\n" +
+ "OA\n" +
+ "CFS\n" +
+ "OA登录验证发送\n" +
+ "\n" +
+ "\n" +
+ ""+name+"\n" +
+ ""+password+"\n" +
+ "\n" +
+ "\n" +
+ " ]]>\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "";
+ logger.info("CFS登录的请求参数为:{}",xml);
+ String url="HTSZ_OA_LogOnWebService?wsdl";
+ String result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("CFS登录的返回参数为:{}",result);
+ return analyzeXML(result,"login");
+ }catch (Exception e){
+ e.printStackTrace();
+ logger.info("获取CFS登录失败,原因为:{}",e.getMessage());
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @content 获取杭泰OA报销单传递CFS
+ * @Param
+ * @Return
+ * @Author hecan
+ * @Date 2023/10/16 16:17
+ * **/
+ @Override
+ public String sendExpenseToCFS(JSONObject jsonStr) {
+ logger.info("开始执行杭泰OA报销单传递CFS");
+ try {
+ String token = sendCFSToken(NAME, PASSWORD);
+ if(null != token){
+ String jsonStrObj = jsonStr.getString("jsonStr");
+ JSONObject jsonObjectMain = JSON.parseObject(jsonStrObj);
+ String erpVoucherNo = jsonObjectMain.getString("erpVoucherNo");//OA主键
+ String purpose = jsonObjectMain.getString("purpose");//摘要
+ StringBuffer stringBuffer = new StringBuffer();
+ JSONArray jsonStrList = jsonObjectMain.getJSONArray("details");
+ if(null != jsonStrList && jsonStrList.size()>0){
+ for (Object o : jsonStrList) {
+ JSONObject jsonObjectDetails = JSON.parseObject(JSON.toJSONString(o));
+ String payerAccName = jsonObjectDetails.getString("payerAccName");//转出方账户名(付款账户)
+ String payerAccNo = jsonObjectDetails.getString("payerAccNo");//转出方账号(付款账号)
+ String curCode = jsonObjectDetails.getString("curCode");//付款方币种
+ String payeeAccName = jsonObjectDetails.getString("payeeAccName");//收款人帐户名称
+ String payeeAccNo = jsonObjectDetails.getString("payeeAccNo");//收款方账户号
+ BigDecimal amount = jsonObjectDetails.getBigDecimal("amount");//发生额
+ String payeeBankCode = jsonObjectDetails.getString("payeeBankCode");//联行号
+ String isQuick = jsonObjectDetails.getString("isQuick");//加急标志
+ String payType = jsonObjectDetails.getString("payType");//结算方式
+ stringBuffer.append("\n");
+ }
+ } else {
+ stringBuffer.append("\n");
+ }
+ String xml= requestXML(token,"BkExpenseExchange",stringBuffer,"OA费用报销单同步发送");
+ logger.info("OA报销单发送CFS的请求参数为:{}", xml);
+ String url = "HTSZ_OA_BkExpenseWebService?wsdl";
+ String result = HttpRequest.post(CFSURL+url).header("Content-Type", "soap/xml").timeout(30000).body(xml).execute().body();
+ logger.info("OA报销单发送CFS的返回参数为:{}", result);
+ return analyzeXML(result,"pay");
+ }
+ }catch (Exception e){
+ logger.info("杭泰OA报销单传递CFS错误,原因为:{}", e.getMessage());
+ }
+ return null;
+ }
+
+ //null转成空字符串
+ private static String nullConvert(String str){
+ if (null == str){
+ return "";
+ }
+ return str;
+ }
+
+ private String requestXML(String token,String code,StringBuffer stringBuffer,String remark){
+ String xml = "\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "\n" +
+ "\n" +
+ "" + code + "\n" +
+ "" + DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss") + "\n" +
+ "OA\n" +
+ "CFS\n" +
+ "" + remark + "\n" +
+ "" + token + "\n" +
+ "\n" +
+ "\n" +
+ "\n";
+ if (stringBuffer != null) {
+ xml += stringBuffer.toString();
+ xml += "
\n" +
+ "\n" +
+ "\n" +
+ " ]]>\n" +
+ " \n" +
+ " \n" +
+ " \n" +
+ "";
+ } else {
+ xml += "\n" +
+ "