diff --git a/lc123/cloud/app/plugin/operate/pm/PurOrderSubmitOp.java b/lc123/cloud/app/plugin/operate/pm/PurOrderSubmitOp.java index c54fbcb..0f578fb 100644 --- a/lc123/cloud/app/plugin/operate/pm/PurOrderSubmitOp.java +++ b/lc123/cloud/app/plugin/operate/pm/PurOrderSubmitOp.java @@ -1,6 +1,5 @@ package tqq9.lc123.cloud.app.plugin.operate.pm; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.dataentity.entity.DynamicObject; @@ -9,6 +8,9 @@ import kd.bos.entity.operate.result.OperationResult; import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.args.AfterOperationArgs; import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import org.apache.commons.lang3.StringUtils; +import tqq9.lc123.cloud.app.plugin.trd.FWImpl; import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils; import java.math.BigDecimal; @@ -23,393 +25,25 @@ public class PurOrderSubmitOp extends AbstractOperationServicePlugIn { super.afterExecuteOperationTransaction(e); OperationResult operationResult = this.getOperationResult(); List successPkIds = operationResult.getSuccessPkIds(); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); for (Object successPkId : successPkIds) { DynamicObject pm_purorderbill = BusinessDataServiceHelper.loadSingle(successPkId, "pm_purorderbill"); - String billno = pm_purorderbill.getString("billno");//lcbh - DynamicObject creator = pm_purorderbill.getDynamicObject("creator");//cjr - String cjr = "363";//TODO - DynamicObject tqq9_dept = pm_purorderbill.getDynamicObject("tqq9_dept");//cjbm - String cjbm = "18";//TODO - Date createtime = pm_purorderbill.getDate("createtime"); - String cjrq = sdf.format(createtime);//cjrq - DynamicObject org = pm_purorderbill.getDynamicObject("org");//ywgz - String ywgz = "4";//TODO - DynamicObject biztype = pm_purorderbill.getDynamicObject("biztype"); - String cglx = biztype.getString("name");//cglx - String tqq9_cgyt = pm_purorderbill.getString("tqq9_cgyt");//cgyt - int cgyt = 0;//办公采购 - if("CGT001".equals(tqq9_cgyt)){ - cgyt = 1;//缺货采购 - } - Date tqq9_datefield = pm_purorderbill.getDate("tqq9_datefield"); - String yjfhsj = null;//yjfhsj - if(tqq9_datefield != null){ - yjfhsj = sdf.format(tqq9_datefield); - } - DynamicObject paycondition = pm_purorderbill.getDynamicObject("paycondition"); - int fktj = 0; - if(paycondition != null){ - String number = paycondition.getString("number"); - if("001".equals(number)){ - fktj = 2; - }else if ("002".equals(number)){ - fktj = 1; - }else if ("003".equals(number)){ - fktj = 0; - }else if ("004".equals(number)){ - fktj = 3; + //组装数据,调用泛微接口 + String resultStr = FWImpl.sendFW(pm_purorderbill); + if(StringUtils.isNotBlank(resultStr)){ + JSONObject resultObj = JSONObject.parseObject(resultStr); + String code = resultObj.getString("code"); + if("SUCCESS".equals(code)){ + JSONObject data = resultObj.getJSONObject("data"); + if(data != null){ + String requestid = data.getString("requestid"); + pm_purorderbill.set("tqq9_fwrequestid", requestid); + SaveServiceHelper.save(new DynamicObject[]{pm_purorderbill}); + } } } - DynamicObject settletype = pm_purorderbill.getDynamicObject("settletype"); - int jsfs = 0; - if(settletype != null){ - String number = settletype.getString("number"); - if("JSFS01".equals(number)){ - fktj = 0; - }else if ("JSFS04".equals(number)){ - fktj = 1; - }else if ("JSFS08".equals(number)){ - fktj = 2; - }else if ("JSFS09".equals(number)){ - fktj = 3; - }else if ("LC001".equals(number)){ - fktj = 4; - } - } - boolean tqq9_sfsyhf = pm_purorderbill.getBoolean("tqq9_sfsyhf");//货返 - String hfxx = ""; - if(tqq9_sfsyhf){ - hfxx = "货返信息:"; - String tqq9_hshfsygs = pm_purorderbill.getString("tqq9_hshfsygs"); - if("A".equals(tqq9_hshfsygs)){ - //本年 - hfxx = hfxx + "含税货返使用归属为本年,"; - }else{ - //上年 - hfxx = hfxx + "含税货返使用归属为上年,"; - } - BigDecimal tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje"); - hfxx = hfxx + "含税货返使用金额"+tqq9_hshfsyje+"元,"; - BigDecimal tqq9_hshfzje = pm_purorderbill.getBigDecimal("tqq9_hshfzje"); - hfxx = hfxx + "含税货返总金额"+tqq9_hshfzje+"元,"; - BigDecimal tqq9_hshfkyje = pm_purorderbill.getBigDecimal("tqq9_hshfkyje"); - hfxx = hfxx + "含税货返可用金额"+tqq9_hshfkyje+"元,"; - DynamicObject tqq9_hshfsysl = pm_purorderbill.getDynamicObject("tqq9_hshfsysl"); - String taxRateStr = "0"; - if(tqq9_hshfsysl != null){ - String number = tqq9_hshfsysl.getString("number"); - taxRateStr = number.substring(1); - } - hfxx = hfxx + "含税货返使用税率"+taxRateStr+"%。"; - } - boolean tqq9_sfsyxf = pm_purorderbill.getBoolean("tqq9_sfsyxf");//现返 - String xfxx = ""; - if(tqq9_sfsyxf){ - xfxx = "现返信息:"; - String tqq9_hsxfsygs = pm_purorderbill.getString("tqq9_hsxfsygs"); - if("A".equals(tqq9_hsxfsygs)){ - //本年 - xfxx = xfxx + "含税现返使用归属为本年,"; - }else{ - //上年 - xfxx = xfxx + "含税现返使用归属为本年,"; - } - BigDecimal tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje"); - xfxx = xfxx + "含税现返使用金额"+tqq9_hsxfsyje+"元,"; - BigDecimal tqq9_hsxfzje = pm_purorderbill.getBigDecimal("tqq9_hsxfzje"); - xfxx = xfxx + "含税现返总金额"+tqq9_hsxfzje+"元,"; - BigDecimal tqq9_hsxfkyje = pm_purorderbill.getBigDecimal("tqq9_hsxfkyje"); - xfxx = xfxx + "含税现返可用金额"+tqq9_hsxfkyje+"元,"; - DynamicObject tqq9_hsxfsysl = pm_purorderbill.getDynamicObject("tqq9_hsxfsysl"); - String taxRateStr = "0"; - if(tqq9_hsxfsysl != null){ - String number = tqq9_hsxfsysl.getString("number"); - taxRateStr = number.substring(1); - } - xfxx = xfxx + "含税现返使用税率"+taxRateStr+"%。"; - } - BigDecimal zkqjshj = pm_purorderbill.getBigDecimal("tqq9_totalamount");//zkqjshj - BigDecimal yhzkje = pm_purorderbill.getBigDecimal("tqq9_discountamount");//yhzkje - BigDecimal zkhjshj = pm_purorderbill.getBigDecimal("totalallamount");//zkhjshj - BigDecimal zkhflhjshj = pm_purorderbill.getBigDecimal("tqq9_payamount");//zkhflhjshj - BigDecimal yyfje = pm_purorderbill.getBigDecimal("paidpreallamount");//yyfje - BigDecimal yfje = pm_purorderbill.getBigDecimal("paidallamount");//yfje - BigDecimal zflhzkje = pm_purorderbill.getBigDecimal("tqq9_alldiscountamt");//zflhzkje - BigDecimal lswdhzl = pm_purorderbill.getBigDecimal("tqq9_lswdhsl");//lswdhzl - BigDecimal lswdhze = pm_purorderbill.getBigDecimal("tqq9_lswdhje");//lswdhze - BigDecimal ddje = pm_purorderbill.getBigDecimal("tqq9_orderamount");//ddje - DynamicObject supplier = pm_purorderbill.getDynamicObject("supplier"); - String dhgys = supplier.getString("number");//dhgys - String shck = null; - - //物料明细 - JSONObject detail1 = new JSONObject(); - JSONArray recordsArr1 = new JSONArray(); - DynamicObjectCollection billentries = pm_purorderbill.getDynamicObjectCollection("billentry"); - for (DynamicObject billentry : billentries) { - DynamicObject material = billentry.getDynamicObject("material"); - DynamicObject masterid = material.getDynamicObject("masterid"); - masterid = BusinessDataServiceHelper.loadSingle(masterid.getPkValue(), masterid.getDynamicObjectType().getName()); - DynamicObject tqq9_brand = billentry.getDynamicObject("tqq9_brand"); - String pp = null; - if(tqq9_brand != null){ - pp = tqq9_brand.getString("name"); - } - String ggxh = masterid.getString("modelnum"); - DynamicObject unit = billentry.getDynamicObject("unit"); - String jldw = null; - if(unit != null){ - jldw = unit.getString("name"); - } - BigDecimal sl = billentry.getBigDecimal("qty"); - BigDecimal hsdj = billentry.getBigDecimal("priceandtax"); - BigDecimal tax_rate = billentry.getBigDecimal("taxrate"); - BigDecimal zkqjshj_e = billentry.getBigDecimal("tqq9_amount"); - BigDecimal yhzkje_e = billentry.getBigDecimal("tqq9_disamount"); - BigDecimal zkhjshj_e = billentry.getBigDecimal("amountandtax"); - BigDecimal hfsyje = billentry.getBigDecimal("tqq9_hfamount"); - BigDecimal xfsyje = billentry.getBigDecimal("tqq9_xfamount"); - BigDecimal zkhflhjshj_e = billentry.getBigDecimal("tqq9_zkflhjshj"); - BigDecimal cb = billentry.getBigDecimal("tqq9_costprice"); - BigDecimal yjxssjy = billentry.getBigDecimal("tqq9_expectsaletime"); - String bz = billentry.getString("entrycomment"); - String wlmc = masterid.getString("number"); - String wlbm = masterid.getString("number"); - - JSONObject e1 = new JSONObject(); - e1.put("fieldName", "wlbm"); - e1.put("fieldValue", wlbm); - JSONObject e2 = new JSONObject(); - e2.put("fieldName", "pp"); - e2.put("fieldValue", pp); - JSONObject e3 = new JSONObject(); - e3.put("fieldName", "ggxh"); - e3.put("fieldValue", ggxh); - JSONObject e4 = new JSONObject(); - e4.put("fieldName", "jldw"); - e4.put("fieldValue", jldw); - JSONObject e5 = new JSONObject(); - e5.put("fieldName", "sl"); - e5.put("fieldValue", sl); - JSONObject e6 = new JSONObject(); - e6.put("fieldName", "hsdj"); - e6.put("fieldValue", hsdj); - JSONObject e7 = new JSONObject(); - e7.put("fieldName", "tax_rate"); - e7.put("fieldValue", tax_rate); - JSONObject e8 = new JSONObject(); - e8.put("fieldName", "zkqjshj"); - e8.put("fieldValue", zkqjshj_e); - JSONObject e9 = new JSONObject(); - e9.put("fieldName", "yhzkje"); - e9.put("fieldValue", yhzkje_e); - JSONObject e10 = new JSONObject(); - e10.put("fieldName", "zkhjshj"); - e10.put("fieldValue", zkhjshj_e); - JSONObject e11 = new JSONObject(); - e11.put("fieldName", "hfsyje"); - e11.put("fieldValue", hfsyje); - JSONObject e12 = new JSONObject(); - e12.put("fieldName", "xfsyje"); - e12.put("fieldValue", xfsyje); - JSONObject e13 = new JSONObject(); - e13.put("fieldName", "zkhflhjshj"); - e13.put("fieldValue", zkhflhjshj_e); - JSONObject e14 = new JSONObject(); - e14.put("fieldName", "cb"); - e14.put("fieldValue", cb); - JSONObject e15 = new JSONObject(); - e15.put("fieldName", "yjxssjy"); - e15.put("fieldValue", yjxssjy); - JSONObject e16 = new JSONObject(); - e16.put("fieldName", "bz"); - e16.put("fieldValue", bz); - JSONObject e17 = new JSONObject(); - e17.put("fieldName", "wlmc"); - e17.put("fieldValue", wlmc); - - List elist = Arrays.asList(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17); - JSONArray recordsArr = new JSONArray(); - for (JSONObject obj : elist) { - recordsArr.add(obj); - } - - JSONObject recordObj = new JSONObject(); - recordObj.put("recordOrder", 0); - recordObj.put("workflowRequestTableFields", recordsArr); - - recordsArr1.add(recordObj); - - DynamicObject warehouse = billentry.getDynamicObject("warehouse"); - shck = warehouse.getString("number");//shck - } - detail1.put("tableDBName", "formtable_main_97_dt1"); - detail1.put("workflowRequestTableRecords", recordsArr1); - - //预付明细 - JSONObject detail12 = new JSONObject(); - JSONArray recordsArr2 = new JSONArray(); - DynamicObjectCollection payEntries = pm_purorderbill.getDynamicObjectCollection("purbillentry_pay"); - for (DynamicObject payEntry : payEntries) { - DynamicObject payname = payEntry.getDynamicObject("payname");//kxmc - String kxmc = null; - if(payname != null){ - kxmc = payname.getString("name"); - } - Date paydate = payEntry.getDate("paydate");//fkrq - String fkrq = sdf.format(paydate); - BigDecimal fkbl = payEntry.getBigDecimal("payrate");//fkbl - BigDecimal fkje = payEntry.getBigDecimal("payamount");//fkje - boolean sfyf = payEntry.getBoolean("isprepay");//fkje - String pretimepoint = payEntry.getString("pretimepoint");//yfsd - String yfsd = null; - if("A".equals(pretimepoint)){ - yfsd = "采购合同"; - }else if("B".equals(pretimepoint)){ - yfsd = "采购订单"; - } - BigDecimal glfkje = payEntry.getBigDecimal("joinpayamount");//glfkje - BigDecimal yfje_p = payEntry.getBigDecimal("paidamount");//yfje - BigDecimal bcjsje = payEntry.getBigDecimal("joinpayamount");//bcjsje - String fkd = payEntry.getString("tqq9_paybillno");//fkd - - - JSONObject p1 = new JSONObject(); - p1.put("fieldName", "kxmc"); - p1.put("fieldValue", kxmc); - JSONObject p2 = new JSONObject(); - p2.put("fieldName", "fkbl"); - p2.put("fieldValue", fkbl); - JSONObject p3 = new JSONObject(); - p3.put("fieldName", "fkje"); - p3.put("fieldValue", fkje); - JSONObject p4 = new JSONObject(); - p4.put("fieldName", "sfyf"); - p4.put("fieldValue", sfyf?0:1); - JSONObject p5 = new JSONObject(); - p5.put("fieldName", "yfsd"); - p5.put("fieldValue", yfsd); - JSONObject p6 = new JSONObject(); - p6.put("fieldName", "glfkje"); - p6.put("fieldValue", glfkje); - JSONObject p7 = new JSONObject(); - p7.put("fieldName", "yfje"); - p7.put("fieldValue", yfje_p); - JSONObject p8 = new JSONObject(); - p8.put("fieldName", "bcjsje"); - p8.put("fieldValue", bcjsje); - JSONObject p9 = new JSONObject(); - p9.put("fieldName", "fkd"); - p9.put("fieldValue", fkd); - - List plist = Arrays.asList(p1,p2,p3,p4,p5,p6,p7,p8,p9); - JSONArray recordsArr = new JSONArray(); - for (JSONObject obj : plist) { - recordsArr2.add(obj); - } - - JSONObject recordObj2 = new JSONObject(); - recordObj2.put("recordOrder", 0); - recordObj2.put("workflowRequestTableFields", recordsArr); - - recordsArr2.add(recordObj2); - } - detail12.put("tableDBName", "formtable_main_97_dt2"); - detail12.put("workflowRequestTableRecords", recordsArr2); - JSONArray detailRootArr = new JSONArray(); - detailRootArr.add(detail1); - detailRootArr.add(detail12); - - //单头赋值 - JSONObject m1 = new JSONObject(); - m1.put("fieldName", "KDBillType"); - m1.put("fieldValue", "pm_purorderbill"); - JSONObject m2 = new JSONObject(); - m2.put("fieldName", "shck"); - m2.put("fieldValue", shck); - JSONObject m3 = new JSONObject(); - m3.put("fieldName", "lcbh"); - m3.put("fieldValue", billno); - JSONObject m4 = new JSONObject(); - m4.put("fieldName", "cjr"); - m4.put("fieldValue", cjr); - JSONObject m5 = new JSONObject(); - m5.put("fieldName", "cjbm"); - m5.put("fieldValue", cjbm); - JSONObject m6 = new JSONObject(); - m6.put("fieldName", "cjrq"); - m6.put("fieldValue", cjrq); - JSONObject m7 = new JSONObject(); - m7.put("fieldName", "ywgz"); - m7.put("fieldValue", ywgz); - JSONObject m8 = new JSONObject(); - m8.put("fieldName", "cglx"); - m8.put("fieldValue", cglx); - JSONObject m9 = new JSONObject(); - m9.put("fieldName", "cgzz"); - m9.put("fieldValue", ywgz); - JSONObject m10 = new JSONObject(); - m10.put("fieldName", "cgyt"); - m10.put("fieldValue", cgyt); - JSONObject m11 = new JSONObject(); - m11.put("fieldName", "yjfhsj"); - m11.put("fieldValue", yjfhsj); - JSONObject m12 = new JSONObject(); - m12.put("fieldName", "fktj"); - m12.put("fieldValue", fktj); - JSONObject m13 = new JSONObject(); - m13.put("fieldName", "jsfs"); - m13.put("fieldValue", jsfs); - JSONObject m14 = new JSONObject(); - m14.put("fieldName", "hfxx"); - m14.put("fieldValue", hfxx); - JSONObject m15 = new JSONObject(); - m15.put("fieldName", "xfxx"); - m15.put("fieldValue", xfxx); - JSONObject m16 = new JSONObject(); - m16.put("fieldName", "zkqjshj"); - m16.put("fieldValue", zkqjshj); - JSONObject m17 = new JSONObject(); - m17.put("fieldName", "yhzkje"); - m17.put("fieldValue", yhzkje); - JSONObject m18 = new JSONObject(); - m18.put("fieldName", "zkhjshj"); - m18.put("fieldValue", zkhjshj); - JSONObject m19 = new JSONObject(); - m19.put("fieldName", "zkhflhjshj"); - m19.put("fieldValue", zkhflhjshj); - JSONObject m20 = new JSONObject(); - m20.put("fieldName", "yyfje"); - m20.put("fieldValue", yyfje); - JSONObject m21 = new JSONObject(); - m21.put("fieldName", "yfje"); - m21.put("fieldValue", yfje); - JSONObject m22 = new JSONObject(); - m22.put("fieldName", "zflhzkje"); - m22.put("fieldValue", zflhzkje); - JSONObject m23 = new JSONObject(); - m23.put("fieldName", "lswdhzl"); - m23.put("fieldValue", lswdhzl); - JSONObject m24 = new JSONObject(); - m24.put("fieldName", "lswdhze"); - m24.put("fieldValue", lswdhze); - JSONObject m25 = new JSONObject(); - m25.put("fieldName", "ddje"); - m25.put("fieldValue", ddje); - JSONObject m26 = new JSONObject(); - m26.put("fieldName", "dhgys"); - m26.put("fieldValue", dhgys); - - List mlist = Arrays.asList(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20,m21,m22,m23,m24,m25,m26); - JSONArray mainArr = new JSONArray(); - for (JSONObject obj : mlist) { - mainArr.add(obj); - } - - FWRestfulUtils fwRestfulUtils = new FWRestfulUtils(); - String resultStr = fwRestfulUtils.doBillAction("api/cube/restful/interface/saveOrUpdateModeData/CK", mainArr, detailRootArr, "新增采购单", "96"); } } + + + } diff --git a/lc123/cloud/app/plugin/trd/FWImpl.java b/lc123/cloud/app/plugin/trd/FWImpl.java index 4357fa5..2f9dd47 100644 --- a/lc123/cloud/app/plugin/trd/FWImpl.java +++ b/lc123/cloud/app/plugin/trd/FWImpl.java @@ -1,12 +1,17 @@ package tqq9.lc123.cloud.app.plugin.trd; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.servicehelper.BusinessDataServiceHelper; import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils; +import java.math.BigDecimal; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; +import java.util.List; /** * 泛微接口实现,用于后续单独推送的功能实现 @@ -45,7 +50,397 @@ public class FWImpl { mainTable.put("bmbm", "5g5be27147e2ff9d"); FWRestfulUtils fwRestfulUtils = new FWRestfulUtils(); - String resultStr = fwRestfulUtils.doAction("api/cube/restful/interface/saveOrUpdateModeData/CK", mainTable, tqq9_fwuserid); + String resultStr = fwRestfulUtils.doAction("api/cube/restful/interface/saveOrUpdateModeData/CK", mainTable, tqq9_fwuserid, "推送仓库信息", number); + return resultStr; + } + + + + public static String sendFW(DynamicObject pm_purorderbill){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String billno = pm_purorderbill.getString("billno");//lcbh + DynamicObject creator = pm_purorderbill.getDynamicObject("creator");//cjr + String cjr = "363";//TODO + DynamicObject tqq9_dept = pm_purorderbill.getDynamicObject("tqq9_dept");//cjbm + String cjbm = "18";//TODO + Date createtime = pm_purorderbill.getDate("createtime"); + String cjrq = sdf.format(createtime);//cjrq + DynamicObject org = pm_purorderbill.getDynamicObject("org");//ywgz + String ywgz = "4";//TODO + DynamicObject biztype = pm_purorderbill.getDynamicObject("biztype"); + String cglx = biztype.getString("name");//cglx + String tqq9_cgyt = pm_purorderbill.getString("tqq9_cgyt");//cgyt + int cgyt = 0;//办公采购 + if("CGT001".equals(tqq9_cgyt)){ + cgyt = 1;//缺货采购 + } + Date tqq9_datefield = pm_purorderbill.getDate("tqq9_datefield"); + String yjfhsj = null;//yjfhsj + if(tqq9_datefield != null){ + yjfhsj = sdf.format(tqq9_datefield); + } + DynamicObject paycondition = pm_purorderbill.getDynamicObject("paycondition"); + int fktj = 0; + if(paycondition != null){ + String number = paycondition.getString("number"); + if("001".equals(number)){ + fktj = 2; + }else if ("002".equals(number)){ + fktj = 1; + }else if ("003".equals(number)){ + fktj = 0; + }else if ("004".equals(number)){ + fktj = 3; + } + } + DynamicObject settletype = pm_purorderbill.getDynamicObject("settletype"); + int jsfs = 0; + if(settletype != null){ + String number = settletype.getString("number"); + if("JSFS01".equals(number)){ + fktj = 0; + }else if ("JSFS04".equals(number)){ + fktj = 1; + }else if ("JSFS08".equals(number)){ + fktj = 2; + }else if ("JSFS09".equals(number)){ + fktj = 3; + }else if ("LC001".equals(number)){ + fktj = 4; + } + } + boolean tqq9_sfsyhf = pm_purorderbill.getBoolean("tqq9_sfsyhf");//货返 + String hfxx = ""; + if(tqq9_sfsyhf){ + hfxx = "货返信息:"; + String tqq9_hshfsygs = pm_purorderbill.getString("tqq9_hshfsygs"); + if("A".equals(tqq9_hshfsygs)){ + //本年 + hfxx = hfxx + "含税货返使用归属为本年,"; + }else{ + //上年 + hfxx = hfxx + "含税货返使用归属为上年,"; + } + BigDecimal tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje"); + hfxx = hfxx + "含税货返使用金额"+tqq9_hshfsyje+"元,"; + BigDecimal tqq9_hshfzje = pm_purorderbill.getBigDecimal("tqq9_hshfzje"); + hfxx = hfxx + "含税货返总金额"+tqq9_hshfzje+"元,"; + BigDecimal tqq9_hshfkyje = pm_purorderbill.getBigDecimal("tqq9_hshfkyje"); + hfxx = hfxx + "含税货返可用金额"+tqq9_hshfkyje+"元,"; + DynamicObject tqq9_hshfsysl = pm_purorderbill.getDynamicObject("tqq9_hshfsysl"); + String taxRateStr = "0"; + if(tqq9_hshfsysl != null){ + String number = tqq9_hshfsysl.getString("number"); + taxRateStr = number.substring(1); + } + hfxx = hfxx + "含税货返使用税率"+taxRateStr+"%。"; + } + boolean tqq9_sfsyxf = pm_purorderbill.getBoolean("tqq9_sfsyxf");//现返 + String xfxx = ""; + if(tqq9_sfsyxf){ + xfxx = "现返信息:"; + String tqq9_hsxfsygs = pm_purorderbill.getString("tqq9_hsxfsygs"); + if("A".equals(tqq9_hsxfsygs)){ + //本年 + xfxx = xfxx + "含税现返使用归属为本年,"; + }else{ + //上年 + xfxx = xfxx + "含税现返使用归属为本年,"; + } + BigDecimal tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje"); + xfxx = xfxx + "含税现返使用金额"+tqq9_hsxfsyje+"元,"; + BigDecimal tqq9_hsxfzje = pm_purorderbill.getBigDecimal("tqq9_hsxfzje"); + xfxx = xfxx + "含税现返总金额"+tqq9_hsxfzje+"元,"; + BigDecimal tqq9_hsxfkyje = pm_purorderbill.getBigDecimal("tqq9_hsxfkyje"); + xfxx = xfxx + "含税现返可用金额"+tqq9_hsxfkyje+"元,"; + DynamicObject tqq9_hsxfsysl = pm_purorderbill.getDynamicObject("tqq9_hsxfsysl"); + String taxRateStr = "0"; + if(tqq9_hsxfsysl != null){ + String number = tqq9_hsxfsysl.getString("number"); + taxRateStr = number.substring(1); + } + xfxx = xfxx + "含税现返使用税率"+taxRateStr+"%。"; + } + BigDecimal zkqjshj = pm_purorderbill.getBigDecimal("tqq9_totalamount");//zkqjshj + BigDecimal yhzkje = pm_purorderbill.getBigDecimal("tqq9_discountamount");//yhzkje + BigDecimal zkhjshj = pm_purorderbill.getBigDecimal("totalallamount");//zkhjshj + BigDecimal zkhflhjshj = pm_purorderbill.getBigDecimal("tqq9_payamount");//zkhflhjshj + BigDecimal yyfje = pm_purorderbill.getBigDecimal("paidpreallamount");//yyfje + BigDecimal yfje = pm_purorderbill.getBigDecimal("paidallamount");//yfje + BigDecimal zflhzkje = pm_purorderbill.getBigDecimal("tqq9_alldiscountamt");//zflhzkje + BigDecimal lswdhzl = pm_purorderbill.getBigDecimal("tqq9_lswdhsl");//lswdhzl + BigDecimal lswdhze = pm_purorderbill.getBigDecimal("tqq9_lswdhje");//lswdhze + BigDecimal ddje = pm_purorderbill.getBigDecimal("tqq9_orderamount");//ddje + DynamicObject supplier = pm_purorderbill.getDynamicObject("supplier"); + String dhgys = supplier.getString("number");//dhgys + String shck = null; + + //物料明细 + JSONObject detail1 = new JSONObject(); + JSONArray recordsArr1 = new JSONArray(); + DynamicObjectCollection billentries = pm_purorderbill.getDynamicObjectCollection("billentry"); + for (DynamicObject billentry : billentries) { + DynamicObject material = billentry.getDynamicObject("material"); + DynamicObject masterid = material.getDynamicObject("masterid"); + masterid = BusinessDataServiceHelper.loadSingle(masterid.getPkValue(), masterid.getDynamicObjectType().getName()); + DynamicObject tqq9_brand = billentry.getDynamicObject("tqq9_brand"); + String pp = null; + if(tqq9_brand != null){ + pp = tqq9_brand.getString("name"); + } + String ggxh = masterid.getString("modelnum"); + DynamicObject unit = billentry.getDynamicObject("unit"); + String jldw = null; + if(unit != null){ + jldw = unit.getString("name"); + } + BigDecimal sl = billentry.getBigDecimal("qty"); + BigDecimal hsdj = billentry.getBigDecimal("priceandtax"); + BigDecimal tax_rate = billentry.getBigDecimal("taxrate"); + BigDecimal zkqjshj_e = billentry.getBigDecimal("tqq9_amount"); + BigDecimal yhzkje_e = billentry.getBigDecimal("tqq9_disamount"); + BigDecimal zkhjshj_e = billentry.getBigDecimal("amountandtax"); + BigDecimal hfsyje = billentry.getBigDecimal("tqq9_hfamount"); + BigDecimal xfsyje = billentry.getBigDecimal("tqq9_xfamount"); + BigDecimal zkhflhjshj_e = billentry.getBigDecimal("tqq9_zkflhjshj"); + BigDecimal cb = billentry.getBigDecimal("tqq9_costprice"); + BigDecimal yjxssjy = billentry.getBigDecimal("tqq9_expectsaletime"); + String bz = billentry.getString("entrycomment"); + String wlmc = masterid.getString("number"); + String wlbm = masterid.getString("number"); + + JSONObject e1 = new JSONObject(); + e1.put("fieldName", "wlbm"); + e1.put("fieldValue", wlbm); + JSONObject e2 = new JSONObject(); + e2.put("fieldName", "pp"); + e2.put("fieldValue", pp); + JSONObject e3 = new JSONObject(); + e3.put("fieldName", "ggxh"); + e3.put("fieldValue", ggxh); + JSONObject e4 = new JSONObject(); + e4.put("fieldName", "jldw"); + e4.put("fieldValue", jldw); + JSONObject e5 = new JSONObject(); + e5.put("fieldName", "sl"); + e5.put("fieldValue", sl); + JSONObject e6 = new JSONObject(); + e6.put("fieldName", "hsdj"); + e6.put("fieldValue", hsdj); + JSONObject e7 = new JSONObject(); + e7.put("fieldName", "tax_rate"); + e7.put("fieldValue", tax_rate); + JSONObject e8 = new JSONObject(); + e8.put("fieldName", "zkqjshj"); + e8.put("fieldValue", zkqjshj_e); + JSONObject e9 = new JSONObject(); + e9.put("fieldName", "yhzkje"); + e9.put("fieldValue", yhzkje_e); + JSONObject e10 = new JSONObject(); + e10.put("fieldName", "zkhjshj"); + e10.put("fieldValue", zkhjshj_e); + JSONObject e11 = new JSONObject(); + e11.put("fieldName", "hfsyje"); + e11.put("fieldValue", hfsyje); + JSONObject e12 = new JSONObject(); + e12.put("fieldName", "xfsyje"); + e12.put("fieldValue", xfsyje); + JSONObject e13 = new JSONObject(); + e13.put("fieldName", "zkhflhjshj"); + e13.put("fieldValue", zkhflhjshj_e); + JSONObject e14 = new JSONObject(); + e14.put("fieldName", "cb"); + e14.put("fieldValue", cb!=null&&cb.compareTo(BigDecimal.ZERO)!=0?cb:0); + JSONObject e15 = new JSONObject(); + e15.put("fieldName", "yjxssjy"); + e15.put("fieldValue", yjxssjy); + JSONObject e16 = new JSONObject(); + e16.put("fieldName", "bz"); + e16.put("fieldValue", bz); + JSONObject e17 = new JSONObject(); + e17.put("fieldName", "wlmc"); + e17.put("fieldValue", wlmc); + + List elist = Arrays.asList(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17); + JSONArray recordsArr = new JSONArray(); + for (JSONObject obj : elist) { + recordsArr.add(obj); + } + + JSONObject recordObj = new JSONObject(); + recordObj.put("recordOrder", 0); + recordObj.put("workflowRequestTableFields", recordsArr); + + recordsArr1.add(recordObj); + + DynamicObject warehouse = billentry.getDynamicObject("warehouse"); + shck = warehouse.getString("number");//shck + } + detail1.put("tableDBName", "formtable_main_97_dt1"); + detail1.put("workflowRequestTableRecords", recordsArr1); + + //预付明细 + JSONObject detail12 = new JSONObject(); + JSONArray recordsArr2 = new JSONArray(); + DynamicObjectCollection payEntries = pm_purorderbill.getDynamicObjectCollection("purbillentry_pay"); + for (DynamicObject payEntry : payEntries) { + DynamicObject payname = payEntry.getDynamicObject("payname");//kxmc + String kxmc = null; + if(payname != null){ + kxmc = payname.getString("name"); + } + Date paydate = payEntry.getDate("paydate");//fkrq + String fkrq = sdf.format(paydate); + BigDecimal fkbl = payEntry.getBigDecimal("payrate");//fkbl + BigDecimal fkje = payEntry.getBigDecimal("payamount");//fkje + boolean sfyf = payEntry.getBoolean("isprepay");//fkje + String pretimepoint = payEntry.getString("pretimepoint");//yfsd + String yfsd = null; + if("A".equals(pretimepoint)){ + yfsd = "采购合同"; + }else if("B".equals(pretimepoint)){ + yfsd = "采购订单"; + } + BigDecimal glfkje = payEntry.getBigDecimal("joinpayamount");//glfkje + BigDecimal yfje_p = payEntry.getBigDecimal("paidamount");//yfje + BigDecimal bcjsje = payEntry.getBigDecimal("joinpayamount");//bcjsje + String fkd = payEntry.getString("tqq9_paybillno");//fkd + + + JSONObject p1 = new JSONObject(); + p1.put("fieldName", "kxmc"); + p1.put("fieldValue", kxmc); + JSONObject p2 = new JSONObject(); + p2.put("fieldName", "fkbl"); + p2.put("fieldValue", fkbl); + JSONObject p3 = new JSONObject(); + p3.put("fieldName", "fkje"); + p3.put("fieldValue", fkje); + JSONObject p4 = new JSONObject(); + p4.put("fieldName", "sfyf"); + p4.put("fieldValue", sfyf?0:1); + JSONObject p5 = new JSONObject(); + p5.put("fieldName", "yfsd"); + p5.put("fieldValue", yfsd); + JSONObject p6 = new JSONObject(); + p6.put("fieldName", "glfkje"); + p6.put("fieldValue", glfkje); + JSONObject p7 = new JSONObject(); + p7.put("fieldName", "yfje"); + p7.put("fieldValue", yfje_p); + JSONObject p8 = new JSONObject(); + p8.put("fieldName", "bcjsje"); + p8.put("fieldValue", bcjsje); + JSONObject p9 = new JSONObject(); + p9.put("fieldName", "fkd"); + p9.put("fieldValue", fkd); + JSONObject p10 = new JSONObject(); + p10.put("fieldName", "fkrq"); + p10.put("fieldValue", fkrq); + + List plist = Arrays.asList(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); + JSONArray recordsArr = new JSONArray(); + for (JSONObject obj : plist) { + recordsArr.add(obj); + } + JSONObject recordObj = new JSONObject(); + recordObj.put("recordOrder", 0); + recordObj.put("workflowRequestTableFields", recordsArr); + recordsArr2.add(recordObj); + } + detail12.put("tableDBName", "formtable_main_97_dt2"); + detail12.put("workflowRequestTableRecords", recordsArr2); + JSONArray detailRootArr = new JSONArray(); + detailRootArr.add(detail1); + detailRootArr.add(detail12); + + //单头赋值 + JSONObject m1 = new JSONObject(); + m1.put("fieldName", "KDBillType"); + m1.put("fieldValue", "pm_purorderbill"); + JSONObject m2 = new JSONObject(); + m2.put("fieldName", "shck"); + m2.put("fieldValue", shck); + JSONObject m3 = new JSONObject(); + m3.put("fieldName", "lcbh"); + m3.put("fieldValue", billno); + JSONObject m4 = new JSONObject(); + m4.put("fieldName", "cjr"); + m4.put("fieldValue", cjr); + JSONObject m5 = new JSONObject(); + m5.put("fieldName", "cjbm"); + m5.put("fieldValue", cjbm); + JSONObject m6 = new JSONObject(); + m6.put("fieldName", "cjrq"); + m6.put("fieldValue", cjrq); + JSONObject m7 = new JSONObject(); + m7.put("fieldName", "ywgz"); + m7.put("fieldValue", ywgz); + JSONObject m8 = new JSONObject(); + m8.put("fieldName", "cglx"); + m8.put("fieldValue", cglx); + JSONObject m9 = new JSONObject(); + m9.put("fieldName", "cgzz"); + m9.put("fieldValue", ywgz); + JSONObject m10 = new JSONObject(); + m10.put("fieldName", "cgyt"); + m10.put("fieldValue", cgyt); + JSONObject m11 = new JSONObject(); + m11.put("fieldName", "yjfhsj"); + m11.put("fieldValue", yjfhsj); + JSONObject m12 = new JSONObject(); + m12.put("fieldName", "fktj"); + m12.put("fieldValue", fktj); + JSONObject m13 = new JSONObject(); + m13.put("fieldName", "jsfs"); + m13.put("fieldValue", jsfs); + JSONObject m14 = new JSONObject(); + m14.put("fieldName", "hfxx"); + m14.put("fieldValue", hfxx); + JSONObject m15 = new JSONObject(); + m15.put("fieldName", "xfxx"); + m15.put("fieldValue", xfxx); + JSONObject m16 = new JSONObject(); + m16.put("fieldName", "zkqjshj"); + m16.put("fieldValue", zkqjshj); + JSONObject m17 = new JSONObject(); + m17.put("fieldName", "yhzkje"); + m17.put("fieldValue", yhzkje); + JSONObject m18 = new JSONObject(); + m18.put("fieldName", "zkhjshj"); + m18.put("fieldValue", zkhjshj); + JSONObject m19 = new JSONObject(); + m19.put("fieldName", "zkhflhjshj"); + m19.put("fieldValue", zkhflhjshj); + JSONObject m20 = new JSONObject(); + m20.put("fieldName", "yyfje"); + m20.put("fieldValue", yyfje); + JSONObject m21 = new JSONObject(); + m21.put("fieldName", "yfje"); + m21.put("fieldValue", yfje); + JSONObject m22 = new JSONObject(); + m22.put("fieldName", "zflhzkje"); + m22.put("fieldValue", zflhzkje); + JSONObject m23 = new JSONObject(); + m23.put("fieldName", "lswdhzl"); + m23.put("fieldValue", lswdhzl); + JSONObject m24 = new JSONObject(); + m24.put("fieldName", "lswdhze"); + m24.put("fieldValue", lswdhze); + JSONObject m25 = new JSONObject(); + m25.put("fieldName", "ddje"); + m25.put("fieldValue", ddje); + JSONObject m26 = new JSONObject(); + m26.put("fieldName", "dhgys"); + m26.put("fieldValue", dhgys); + + List mlist = Arrays.asList(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20,m21,m22,m23,m24,m25,m26); + JSONArray mainArr = new JSONArray(); + for (JSONObject obj : mlist) { + mainArr.add(obj); + } + FWRestfulUtils fwRestfulUtils = new FWRestfulUtils(); + String resultStr = fwRestfulUtils.doBillAction(mainArr, detailRootArr, "新增采购单", "96", billno); return resultStr; } diff --git a/lc123/cloud/app/plugin/utils/FWRestfulUtils.java b/lc123/cloud/app/plugin/utils/FWRestfulUtils.java index c892cad..6e65734 100644 --- a/lc123/cloud/app/plugin/utils/FWRestfulUtils.java +++ b/lc123/cloud/app/plugin/utils/FWRestfulUtils.java @@ -9,6 +9,10 @@ import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import kd.bos.dataentity.OperateOption; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.OperationServiceHelper; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.CloseableHttpResponse; @@ -61,7 +65,6 @@ public class FWRestfulUtils { * 通过第一步中注册系统返回信息进行获取token信息 */ public static String getoken(String spk, String secret){ - // 公钥加密,所以RSA对象私钥为null RSA rsa = new RSA(null,spk); //对秘钥进行加密传输,防止篡改数据 @@ -79,47 +82,18 @@ public class FWRestfulUtils { return token; } - /** - * 第三步: - * 调用ecology系统的rest接口,请求头部带上token和用户标识认证信息 - * - * @param address ecology系统地址 - * @param api rest api 接口地址(该测试代码仅支持GET请求) - * @param jsonParams 请求参数json串 - * - * 注意:ECOLOGY系统所有POST接口调用请求头请设置 "Content-Type","application/x-www-form-urlencoded; charset=utf-8" - */ - public static String testRestful(String address,String api,String jsonParams){ - -// String spk = SYSTEM_CACHE.get("SERVER_PUBLIC_KEY"); -// //封装请求头参数 -// RSA rsa = new RSA(null,spk); -// //对用户信息进行加密传输,暂仅支持传输OA用户ID -// String encryptUserid = rsa.encryptBase64("1",CharsetUtil.CHARSET_UTF_8,KeyType.PublicKey); -// System.out.println("encryptUserid():"+encryptUserid); -// -// //调用ECOLOGY系统接口 -// String data = HttpRequest.get(address + api) -// .header("appid",APPID) -// .header("token",token) -// .header("userid",encryptUserid) -// .body(jsonParams) -// .execute().body(); -// System.out.println("testRestful():"+data); - return null; - } /** *restful接口调用案例 *以getModeDataPageList为例 */ - public String doAction(String url, JSONObject mainTable, String fwuserid){ + public String doAction(String url, JSONObject mainTable, String fwuserid, String requestName, String billno){ CloseableHttpResponse response;// 响应类, CloseableHttpClient httpClient = HttpClients.createDefault(); //restful接口url - HttpPost httpPost = new HttpPost(FW_Main_URL + url); - + url = FW_Main_URL + url; + HttpPost httpPost = new HttpPost(url); //当前日期 String currentDate = getCurrentDate(); //当前时间 @@ -127,32 +101,32 @@ public class FWRestfulUtils { //获取时间戳 String currentTimeTamp = getTimestamp(); - Map params = new HashMap<>(); - Map dataParam = new HashMap<>(); - Map datajson = new HashMap<>(); - //header Map header = new HashMap<>(); header.put("systemid", FW_systemid); header.put("currentDateTime", currentTimeTamp); + //Md5是:系统标识+密码+时间戳 并且md5加密的结果 String md5Source = FW_systemid + FW_password + currentTimeTamp; String md5OfStr = getMD5Str(md5Source).toLowerCase(); - //Md5是:系统标识+密码+时间戳 并且md5加密的结果 header.put("Md5",md5OfStr); //封装mainTable参数 + Map dataParam = new HashMap<>(); dataParam.put("mainTable",mainTable); //封装operationinfo参数 JSONObject operationinfo = new JSONObject(); operationinfo.put("operator", fwuserid); dataParam.put("operationinfo",operationinfo); - System.out.println("===请求参数dataparam==="+dataParam); + + Map params = new HashMap<>(); params.put("data",dataParam); + Map[] arr = new Map[1]; arr[0] = dataParam; + Map datajson = new HashMap<>(); datajson.put("header", header); datajson.put("data", arr); @@ -160,16 +134,29 @@ public class FWRestfulUtils { List list = new ArrayList<>(); list.add(new BasicNameValuePair("datajson", JSON.toJSONString(datajson))); + DynamicObject pushlog = BusinessDataServiceHelper.newDynamicObject("tqq9_fwpushlog"); + pushlog.set("name", requestName); + pushlog.set("tqq9_billno", billno); + pushlog.set("tqq9_url", url); + pushlog.set("tqq9_header_tag", JSON.toJSONString(header)); + pushlog.set("tqq9_body_tag", JSON.toJSONString(list)); + pushlog.set("enable", "1"); + pushlog.set("status", "C"); + try{ httpPost.addHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); httpPost.setEntity(new UrlEncodedFormEntity(list, "UTF-8")); response = httpClient.execute(httpPost); + pushlog.set("tqq9_returnstring_tag", response.toString()); if (response != null && response.getEntity() != null) { //返回信息 String resulString = EntityUtils.toString(response.getEntity()); System.out.println("成功"+ resulString); + OperationServiceHelper.executeOperate("save", "tqq9_fwpushlog", new DynamicObject[]{pushlog}, OperateOption.create()); return resulString; }else{ + pushlog.set("tqq9_returnstring_tag", response.toString()); + OperationServiceHelper.executeOperate("save", "tqq9_fwpushlog", new DynamicObject[]{pushlog}, OperateOption.create()); System.out.println("获取数据失败,请查看日志"+currentDate+" "+currentTime); } }catch (Exception e){ @@ -179,7 +166,16 @@ public class FWRestfulUtils { } - public String doBillAction(String url, JSONArray mainData, JSONArray detailData, String requestName, String workflowid){ + /** + * 发起审批流程 + * @param mainData + * @param detailData + * @param requestName + * @param workflowid + * @param billno + * @return + */ + public String doBillAction(JSONArray mainData, JSONArray detailData, String requestName, String workflowid, String billno){ Map registMap = regist(); if(registMap != null && registMap.size() > 0){ String spk = StrUtil.nullToEmpty((String) registMap.get("spk")); @@ -189,9 +185,9 @@ public class FWRestfulUtils { if(StringUtils.isNotBlank(token)){ CloseableHttpResponse response;// 响应类, CloseableHttpClient httpClient = HttpClients.createDefault(); - //restful接口url - HttpPost httpPost = new HttpPost("http://180.166.208.42:8043/" + "api/workflow/paService/doCreateRequest"); + String url = "http://180.166.208.42:8043/" + "api/workflow/paService/doCreateRequest"; + HttpPost httpPost = new HttpPost(url); //当前日期 String currentDate = getCurrentDate(); //当前时间 @@ -201,7 +197,6 @@ public class FWRestfulUtils { RSA rsa = new RSA(null,spk); //对用户信息进行加密传输,暂仅支持传输OA用户ID String encryptUserid = rsa.encryptBase64("363", CharsetUtil.CHARSET_UTF_8, KeyType.PublicKey); - //装填参数 List list = new ArrayList<>(); list.add(new BasicNameValuePair("mainData", JSON.toJSONString(mainData))); @@ -209,19 +204,31 @@ public class FWRestfulUtils { list.add(new BasicNameValuePair("requestName", requestName)); list.add(new BasicNameValuePair("workflowId", workflowid)); + DynamicObject pushlog = BusinessDataServiceHelper.newDynamicObject("tqq9_fwpushlog"); + pushlog.set("name", requestName); + pushlog.set("tqq9_billno", billno); + pushlog.set("tqq9_url", url); + pushlog.set("tqq9_header_tag", "appid:"+FW_appid+";token:"+token+";userid:"+encryptUserid); + pushlog.set("tqq9_body_tag", JSON.toJSONString(list)); + pushlog.set("enable", "1"); + pushlog.set("status", "C"); + try{ httpPost.addHeader("appid",FW_appid); httpPost.addHeader("token",token); httpPost.addHeader("userid",encryptUserid); -// httpPost.addHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); httpPost.setEntity(new UrlEncodedFormEntity(list, "UTF-8")); response = httpClient.execute(httpPost); if (response != null && response.getEntity() != null) { //返回信息 String resulString = EntityUtils.toString(response.getEntity()); + pushlog.set("tqq9_returnstring_tag", resulString); System.out.println("成功"+ resulString); + OperationServiceHelper.executeOperate("save", "tqq9_fwpushlog", new DynamicObject[]{pushlog}, OperateOption.create()); return resulString; }else{ + pushlog.set("tqq9_returnstring_tag", response.toString()); + OperationServiceHelper.executeOperate("save", "tqq9_fwpushlog", new DynamicObject[]{pushlog}, OperateOption.create()); System.out.println("获取数据失败,请查看日志"+currentDate+" "+currentTime); } }catch (Exception e){