From 711838c3cbc1c6cc42ab91f17c8ddf2c31bef173 Mon Sep 17 00:00:00 2001 From: "tanfengling@x-ri.com" <123456> Date: Sat, 25 Oct 2025 17:43:02 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=B3=9B=E5=BE=AE=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E9=80=80=E8=B4=A7=E7=94=B3=E8=AF=B7=E5=8D=95=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E3=80=91=20=E3=80=90=E6=B3=9B=E5=BE=AE?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pm/PurrefundApplySubmitToFwOp.java | 44 + .../operate/sys/SupplierSubmitToFwOp.java | 43 + lc123/cloud/app/plugin/trd/FWImpl.java | 1332 +++++++++++++---- 3 files changed, 1098 insertions(+), 321 deletions(-) create mode 100644 lc123/cloud/app/plugin/operate/pm/PurrefundApplySubmitToFwOp.java create mode 100644 lc123/cloud/app/plugin/operate/sys/SupplierSubmitToFwOp.java diff --git a/lc123/cloud/app/plugin/operate/pm/PurrefundApplySubmitToFwOp.java b/lc123/cloud/app/plugin/operate/pm/PurrefundApplySubmitToFwOp.java new file mode 100644 index 0000000..c63b63b --- /dev/null +++ b/lc123/cloud/app/plugin/operate/pm/PurrefundApplySubmitToFwOp.java @@ -0,0 +1,44 @@ +package tqq9.lc123.cloud.app.plugin.operate.pm; + +import com.alibaba.fastjson.JSONObject; +import kd.bos.dataentity.entity.DynamicObject; +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 java.util.List; + +/** + * 采购退货申请提交泛微 + */ +public class PurrefundApplySubmitToFwOp extends AbstractOperationServicePlugIn { + + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + OperationResult operationResult = this.getOperationResult(); + List successPkIds = operationResult.getSuccessPkIds(); + for (Object successPkId : successPkIds) { + DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "pm_purrefundapplybill"); + String resultStr = FWImpl.pushFwPurRefund(bill); + 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"); + bill.set("tqq9_fwrequestid", requestid); + SaveServiceHelper.save(new DynamicObject[]{bill}); + } + } + } + } + + } +} diff --git a/lc123/cloud/app/plugin/operate/sys/SupplierSubmitToFwOp.java b/lc123/cloud/app/plugin/operate/sys/SupplierSubmitToFwOp.java new file mode 100644 index 0000000..64e9f61 --- /dev/null +++ b/lc123/cloud/app/plugin/operate/sys/SupplierSubmitToFwOp.java @@ -0,0 +1,43 @@ +package tqq9.lc123.cloud.app.plugin.operate.sys; + +import com.alibaba.fastjson.JSONObject; +import kd.bos.dataentity.entity.DynamicObject; +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 java.util.List; + +/** + * 供应商提交到泛微 + */ +public class SupplierSubmitToFwOp extends AbstractOperationServicePlugIn { + + + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + OperationResult operationResult = this.getOperationResult(); + List successPkIds = operationResult.getSuccessPkIds(); + for (Object successPkId : successPkIds) { + DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "bd_supplier"); + String resultStr = FWImpl.pushFwSupplier(bill); + 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"); + bill.set("tqq9_fwrequestid", requestid); + SaveServiceHelper.save(new DynamicObject[]{bill}); + } + } + } + } + } +} diff --git a/lc123/cloud/app/plugin/trd/FWImpl.java b/lc123/cloud/app/plugin/trd/FWImpl.java index a198978..a847110 100644 --- a/lc123/cloud/app/plugin/trd/FWImpl.java +++ b/lc123/cloud/app/plugin/trd/FWImpl.java @@ -34,16 +34,16 @@ public class FWImpl { String enable = dataEntity.getString("enable");//使用状态:可用-1,禁用-0 DynamicObject tqq9_dept = dataEntity.getDynamicObject("tqq9_dept");//部门 String bmbm = "18"; - if (tqq9_dept != null) { + if(tqq9_dept != null){ String deptNumber = tqq9_dept.getString("number"); String fwOrgNumber = FWUtils.getFwOrgNumberByKdOrgNumber(deptNumber); - if (StringUtils.isNotBlank(fwOrgNumber)) { + if(StringUtils.isNotBlank(fwOrgNumber)){ bmbm = fwOrgNumber; } } DynamicObject creator = dataEntity.getDynamicObject("creator");//创建人 - String tqq9_fwuserid = "363"; - if (creator != null) { + String tqq9_fwuserid= "363"; + if(creator != null){ creator = BusinessDataServiceHelper.loadSingle(creator.getPkValue(), creator.getDynamicObjectType().getName(), "id,name,number,tqq9_fwuserid"); tqq9_fwuserid = creator.getString("tqq9_fwuserid"); } @@ -71,14 +71,14 @@ public class FWImpl { String billno = pm_purorderbill.getString("billno");//lcbh String tqq9_fwrequestid = pm_purorderbill.getString("tqq9_fwrequestid");//泛微流程ID DynamicObject creator = pm_purorderbill.getDynamicObject("creator");//cjr - String cjr = "363"; - if (creator != null) { + String cjr = ""; + if(creator != null){ creator = BusinessDataServiceHelper.loadSingle(creator.getPkValue(), creator.getDynamicObjectType().getName(), "id,name,number,tqq9_fwuserid"); cjr = creator.getString("tqq9_fwuserid"); } DynamicObject tqq9_dept = pm_purorderbill.getDynamicObject("tqq9_dept");//cjbm - String cjbm = "18"; - if (tqq9_dept != null) { + String cjbm = ""; + if(tqq9_dept != null){ String deptNumber = tqq9_dept.getString("number"); String fwOrgNumber = FWUtils.getFwOrgNumberByKdOrgNumber(deptNumber); if (StringUtils.isNotBlank(fwOrgNumber)) { @@ -100,93 +100,93 @@ public class FWImpl { String cglx = biztype.getString("name");//cglx String tqq9_cgyt = pm_purorderbill.getString("tqq9_cgyt");//cgyt int cgyt = 0;//办公采购 - if ("CGT001".equals(tqq9_cgyt)) { + if("CGT001".equals(tqq9_cgyt)){ cgyt = 1;//缺货采购 } Date tqq9_datefield = pm_purorderbill.getDate("tqq9_datefield"); String yjfhsj = null;//yjfhsj - if (tqq9_datefield != null) { + if(tqq9_datefield != null){ yjfhsj = sdf.format(tqq9_datefield); } DynamicObject paycondition = pm_purorderbill.getDynamicObject("paycondition"); int fktj = 0; - if (paycondition != null) { + if(paycondition != null){ String number = paycondition.getString("number"); - if ("001".equals(number)) { + if("001".equals(number)){ fktj = 2; - } else if ("002".equals(number)) { + }else if ("002".equals(number)){ fktj = 1; - } else if ("004".equals(number)) { + }else if ("004".equals(number)){ fktj = 3; } } DynamicObject settletype = pm_purorderbill.getDynamicObject("settletype"); int jsfs = 0; - if (settletype != null) { + if(settletype != null){ String number = settletype.getString("number"); - if ("JSFS01".equals(number)) { + if("JSFS01".equals(number)){ fktj = 0; - } else if ("JSFS04".equals(number)) { + }else if ("JSFS04".equals(number)){ fktj = 1; - } else if ("JSFS08".equals(number)) { + }else if ("JSFS08".equals(number)){ fktj = 2; - } else if ("JSFS09".equals(number)) { + }else if ("JSFS09".equals(number)){ fktj = 3; - } else if ("LC001".equals(number)) { + }else if ("LC001".equals(number)){ fktj = 4; } } boolean tqq9_sfsyhf = pm_purorderbill.getBoolean("tqq9_sfsyhf");//货返 String hfxx = ""; - if (tqq9_sfsyhf) { + if(tqq9_sfsyhf){ hfxx = "货返信息:"; String tqq9_hshfsygs = pm_purorderbill.getString("tqq9_hshfsygs"); - if ("A".equals(tqq9_hshfsygs)) { + if("A".equals(tqq9_hshfsygs)){ //本年 hfxx = hfxx + "含税货返使用归属为本年,"; - } else { + }else{ //上年 hfxx = hfxx + "含税货返使用归属为上年,"; } BigDecimal tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje"); - hfxx = hfxx + "含税货返使用金额" + tqq9_hshfsyje + "元,"; + hfxx = hfxx + "含税货返使用金额"+tqq9_hshfsyje+"元,"; BigDecimal tqq9_hshfzje = pm_purorderbill.getBigDecimal("tqq9_hshfzje"); - hfxx = hfxx + "含税货返总金额" + tqq9_hshfzje + "元,"; + hfxx = hfxx + "含税货返总金额"+tqq9_hshfzje+"元,"; BigDecimal tqq9_hshfkyje = pm_purorderbill.getBigDecimal("tqq9_hshfkyje"); - hfxx = hfxx + "含税货返可用金额" + tqq9_hshfkyje + "元,"; + hfxx = hfxx + "含税货返可用金额"+tqq9_hshfkyje+"元,"; DynamicObject tqq9_hshfsysl = pm_purorderbill.getDynamicObject("tqq9_hshfsysl"); String taxRateStr = "0"; - if (tqq9_hshfsysl != null) { + if(tqq9_hshfsysl != null){ String number = tqq9_hshfsysl.getString("number"); taxRateStr = number.substring(1); } - hfxx = hfxx + "含税货返使用税率" + taxRateStr + "%。"; + hfxx = hfxx + "含税货返使用税率"+taxRateStr+"%。"; } boolean tqq9_sfsyxf = pm_purorderbill.getBoolean("tqq9_sfsyxf");//现返 String xfxx = ""; - if (tqq9_sfsyxf) { + if(tqq9_sfsyxf){ xfxx = "现返信息:"; String tqq9_hsxfsygs = pm_purorderbill.getString("tqq9_hsxfsygs"); - if ("A".equals(tqq9_hsxfsygs)) { + if("A".equals(tqq9_hsxfsygs)){ //本年 xfxx = xfxx + "含税现返使用归属为本年,"; - } else { + }else{ //上年 xfxx = xfxx + "含税现返使用归属为本年,"; } BigDecimal tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje"); - xfxx = xfxx + "含税现返使用金额" + tqq9_hsxfsyje + "元,"; + xfxx = xfxx + "含税现返使用金额"+tqq9_hsxfsyje+"元,"; BigDecimal tqq9_hsxfzje = pm_purorderbill.getBigDecimal("tqq9_hsxfzje"); - xfxx = xfxx + "含税现返总金额" + tqq9_hsxfzje + "元,"; + xfxx = xfxx + "含税现返总金额"+tqq9_hsxfzje+"元,"; BigDecimal tqq9_hsxfkyje = pm_purorderbill.getBigDecimal("tqq9_hsxfkyje"); - xfxx = xfxx + "含税现返可用金额" + tqq9_hsxfkyje + "元,"; + xfxx = xfxx + "含税现返可用金额"+tqq9_hsxfkyje+"元,"; DynamicObject tqq9_hsxfsysl = pm_purorderbill.getDynamicObject("tqq9_hsxfsysl"); String taxRateStr = "0"; - if (tqq9_hsxfsysl != null) { + if(tqq9_hsxfsysl != null){ String number = tqq9_hsxfsysl.getString("number"); taxRateStr = number.substring(1); } - xfxx = xfxx + "含税现返使用税率" + taxRateStr + "%。"; + xfxx = xfxx + "含税现返使用税率"+taxRateStr+"%。"; } BigDecimal zkqjshj = pm_purorderbill.getBigDecimal("tqq9_totalamount");//zkqjshj BigDecimal yhzkje = pm_purorderbill.getBigDecimal("tqq9_discountamount");//yhzkje @@ -215,13 +215,13 @@ public class FWImpl { masterid = BusinessDataServiceHelper.loadSingle(masterid.getPkValue(), masterid.getDynamicObjectType().getName()); DynamicObject tqq9_brand = billentry.getDynamicObject("tqq9_brand"); String pp = null; - if (tqq9_brand != 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) { + if(unit != null){ jldw = unit.getString("name"); } BigDecimal sl = billentry.getBigDecimal("qty"); @@ -240,7 +240,7 @@ public class FWImpl { String wlbm = masterid.getString("number"); boolean ispresent = billentry.getBoolean("ispresent"); int sfzp = 0; - if (ispresent) { + if(ispresent){ sfzp = 1; } BigDecimal tqq9_dis83price = billentry.getBigDecimal("tqq9_dis83price"); @@ -286,7 +286,7 @@ public class FWImpl { 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); + e14.put("fieldValue", cb!=null&&cb.compareTo(BigDecimal.ZERO)!=0?cb:0); JSONObject e15 = new JSONObject(); e15.put("fieldName", "yjxssjy"); e15.put("fieldValue", yjxssjy); @@ -301,9 +301,9 @@ public class FWImpl { e18.put("fieldValue", sfzp); JSONObject e19 = new JSONObject(); e19.put("fieldName", "sc83zsj"); - e19.put("fieldValue", tqq9_dis83price != null && tqq9_dis83price.compareTo(BigDecimal.ZERO) != 0 ? tqq9_dis83price : 0); + e19.put("fieldValue", tqq9_dis83price != null && tqq9_dis83price.compareTo(BigDecimal.ZERO) != 0?tqq9_dis83price:0); - List elist = Arrays.asList(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19); + List elist = Arrays.asList(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18,e19); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -318,7 +318,7 @@ public class FWImpl { } detail1.put("tableDBName", "formtable_main_97_dt1"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } @@ -329,7 +329,7 @@ public class FWImpl { for (DynamicObject payEntry : payEntries) { DynamicObject payname = payEntry.getDynamicObject("payname");//kxmc String kxmc = null; - if (payname != null) { + if(payname != null){ kxmc = payname.getString("name"); } Date paydate = payEntry.getDate("paydate");//fkrq @@ -339,9 +339,9 @@ public class FWImpl { boolean sfyf = payEntry.getBoolean("isprepay");//fkje String pretimepoint = payEntry.getString("pretimepoint");//yfsd String yfsd = null; - if ("A".equals(pretimepoint)) { + if("A".equals(pretimepoint)){ yfsd = "采购合同"; - } else if ("B".equals(pretimepoint)) { + }else if("B".equals(pretimepoint)){ yfsd = "采购订单"; } BigDecimal glfkje = payEntry.getBigDecimal("joinpayamount");//glfkje @@ -360,7 +360,7 @@ public class FWImpl { p3.put("fieldValue", fkje); JSONObject p4 = new JSONObject(); p4.put("fieldName", "sfyf"); - p4.put("fieldValue", sfyf ? 0 : 1); + p4.put("fieldValue", sfyf?0:1); JSONObject p5 = new JSONObject(); p5.put("fieldName", "yfsd"); p5.put("fieldValue", yfsd); @@ -380,7 +380,7 @@ public class FWImpl { p10.put("fieldName", "fkrq"); p10.put("fieldValue", fkrq); - List plist = Arrays.asList(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); + List plist = Arrays.asList(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(plist); JSONObject recordObj = new JSONObject(); @@ -390,7 +390,7 @@ public class FWImpl { } detail12.put("tableDBName", "formtable_main_97_dt2"); detail12.put("workflowRequestTableRecords", recordsArr2); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail12.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -486,8 +486,8 @@ public class FWImpl { m29.put("fieldName", "khlxdz"); m29.put("fieldValue", khlxdz); - 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, m27, m28, m29); + 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,m27,m28,m29); JSONArray mainArr = new JSONArray(); mainArr.addAll(mlist); String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_XZCGDD"); @@ -509,7 +509,7 @@ public class FWImpl { String sqr = creator.getString("tqq9_fwuserid"); String bm = null; DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); - if (tqq9_dept != null) { + if(tqq9_dept != null){ String number = tqq9_dept.getString("number"); bm = FWUtils.getFwOrgNumberByKdOrgNumber(number); } @@ -523,45 +523,45 @@ public class FWImpl { String biztypeNumber = biztype.getString("number"); int ywlxrk = 1; String ywlxxsm = "其他入库"; - if ("350".equals(biztypeNumber)) { + if("350".equals(biztypeNumber)){ ywlxrk = 0; ywlxxsm = "盘盈入库"; - } else if ("354".equals(biztypeNumber)) { + }else if("354".equals(biztypeNumber)){ ywlxxsm = "其他入库"; - } else if ("605".equals(biztypeNumber)) { + }else if("605".equals(biztypeNumber)){ ywlxrk = 2; ywlxxsm = "调拨入库"; - } else if ("606".equals(biztypeNumber)) { + }else if("606".equals(biztypeNumber)){ ywlxrk = 3; ywlxxsm = "赠品入库"; - } else if ("607".equals(biztypeNumber)) { + }else if("607".equals(biztypeNumber)){ ywlxrk = 4; ywlxxsm = "礼品入库"; - } else if ("608".equals(biztypeNumber)) { + }else if("608".equals(biztypeNumber)){ ywlxrk = 5; ywlxxsm = "展会领用入库"; - } else if ("609".equals(biztypeNumber)) { + }else if("609".equals(biztypeNumber)){ ywlxrk = 6; ywlxxsm = "拍照领用入库"; - } else if ("610".equals(biztypeNumber)) { + }else if("610".equals(biztypeNumber)){ ywlxrk = 7; ywlxxsm = "换货入库"; - } else if ("611".equals(biztypeNumber)) { + }else if("611".equals(biztypeNumber)){ ywlxrk = 8; ywlxxsm = "错货入库"; } String jsr = null; DynamicObject tqq9_jsr = bill.getDynamicObject("tqq9_jsr"); - if (tqq9_jsr != null) { + if(tqq9_jsr != null){ tqq9_jsr = BusinessDataServiceHelper.loadSingle(tqq9_jsr.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); jsr = tqq9_jsr.getString("tqq9_fwuserid"); } String kgy = null; DynamicObject tqq9_operator = bill.getDynamicObject("tqq9_operator"); - if (tqq9_operator != null) { + if(tqq9_operator != null){ tqq9_operator = BusinessDataServiceHelper.loadSingle(tqq9_operator.getPkValue(), "bd_operator"); DynamicObject user = tqq9_operator.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); kgy = user.getString("tqq9_fwuserid"); } @@ -573,20 +573,20 @@ public class FWImpl { String dpdh = bill.getString("tqq9_dpdh"); String szkf = null; DynamicObject tqq9_sskf = bill.getDynamicObject("tqq9_sskf"); - if (tqq9_sskf != null) { + if(tqq9_sskf != null){ tqq9_sskf = BusinessDataServiceHelper.loadSingle(tqq9_sskf.getPkValue(), "bd_operator"); DynamicObject user = tqq9_sskf.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); szkf = user.getString("tqq9_fwuserid"); } } String szxs = null; DynamicObject tqq9_ssxs = bill.getDynamicObject("tqq9_ssxs"); - if (tqq9_ssxs != null) { + if(tqq9_ssxs != null){ tqq9_ssxs = BusinessDataServiceHelper.loadSingle(tqq9_ssxs.getPkValue(), "bd_operator"); DynamicObject user = tqq9_ssxs.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); szxs = user.getString("tqq9_fwuserid"); } @@ -596,10 +596,10 @@ public class FWImpl { String khfptt = bill.getString("tqq9_khfptt"); DynamicObject tqq9_sscg = bill.getDynamicObject("tqq9_sscg"); String szcg = null; - if (tqq9_sscg != null) { + if(tqq9_sscg != null){ tqq9_sscg = BusinessDataServiceHelper.loadSingle(tqq9_sscg.getPkValue(), "bd_operator"); DynamicObject user = tqq9_sscg.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); szcg = user.getString("tqq9_fwuserid"); } @@ -619,12 +619,12 @@ public class FWImpl { String ggxh = masterid.getString("modelnum"); DynamicObject tqq9_brand = masterid.getDynamicObject("tqq9_brand"); String pp = null; - if (tqq9_brand != null) { + if(tqq9_brand != null){ pp = tqq9_brand.getString("name"); } String jldw = null; DynamicObject unit = billentry.getDynamicObject("unit"); - if (unit != null) { + if(unit != null){ jldw = unit.getString("name"); } BigDecimal sl = billentry.getBigDecimal("qty"); @@ -632,7 +632,7 @@ public class FWImpl { BigDecimal je = billentry.getBigDecimal("amount"); int sfzp = 1; boolean ispresent = billentry.getBoolean("ispresent"); - if (ispresent) { + if(ispresent){ sfzp = 0; } @@ -664,7 +664,7 @@ public class FWImpl { e15.put("fieldName", "sfzp"); e15.put("fieldValue", sfzp); - List elist = Arrays.asList(e1, e12, e2, e3, e4, e5, e6, e7,//e8,e9,e10,e11,e13,e14 + List elist = Arrays.asList(e1,e12,e2,e3,e4,e5,e6,e7,//e8,e9,e10,e11,e13,e14 e15); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -676,13 +676,13 @@ public class FWImpl { //入库仓库 DynamicObject warehouse = billentry.getDynamicObject("warehouse"); - if (warehouse != null) { + if(warehouse != null){ rkck = warehouse.getString("number"); } } detail1.put("tableDBName", "formtable_main_110_dt2"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -762,12 +762,12 @@ public class FWImpl { m27.put("fieldName", "szcg"); m27.put("fieldValue", szcg); - List mlist = new ArrayList<>(Arrays.asList(m1, m2, m3, m4, m5, m6, m7, m8, m9, m13, m14, m15, m16, m17, m18, m19, m20, m21, - m22, m23, m24, m25, m26, m27)); - if (ywlxrk == 2) { + List mlist = new ArrayList<>(Arrays.asList(m1,m2,m3,m4,m5,m6,m7,m8,m9,m13,m14,m15,m16,m17,m18,m19,m20,m21, + m22,m23,m24,m25,m26,m27)); + if (ywlxrk == 2){ int dblx = 0; String tqq9_dblx = bill.getString("tqq9_dblx"); - if ("B".equals(tqq9_dblx)) { + if("B".equals(tqq9_dblx)){ dblx = 1; } JSONObject m10 = new JSONObject(); @@ -775,15 +775,15 @@ public class FWImpl { m10.put("fieldValue", dblx); int dbfl = 0; String tqq9_dbrk = bill.getString("tqq9_dbrk"); - if ("B".equals(tqq9_dbrk)) { + if("B".equals(tqq9_dbrk)){ dbfl = 1; - } else if ("C".equals(tqq9_dbrk)) { + }else if("C".equals(tqq9_dbrk)){ dbfl = 2; - } else if ("F".equals(tqq9_dbrk)) { + }else if("F".equals(tqq9_dbrk)){ dbfl = 4; - } else if ("G".equals(tqq9_dbrk)) { + }else if("G".equals(tqq9_dbrk)){ dbfl = 5; - } else if ("QT".equals(tqq9_dbrk)) { + }else if("QT".equals(tqq9_dbrk)){ dbfl = 6; } JSONObject m11 = new JSONObject(); @@ -813,7 +813,7 @@ public class FWImpl { String sqr = creator.getString("tqq9_fwuserid"); String bm = null; DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); - if (tqq9_dept != null) { + if(tqq9_dept != null){ String number = tqq9_dept.getString("number"); bm = FWUtils.getFwOrgNumberByKdOrgNumber(number); } @@ -827,48 +827,48 @@ public class FWImpl { String biztypeNumber = biztype.getString("number"); int ywlxck = 1; String ywlxxsm = "其他出库"; - if ("351".equals(biztypeNumber)) { + if("351".equals(biztypeNumber)){ ywlxck = 0; ywlxxsm = "盘亏入库"; - } else if ("355".equals(biztypeNumber)) { + }else if("355".equals(biztypeNumber)){ ywlxxsm = "其他出库"; - } else if ("612".equals(biztypeNumber)) { + }else if("612".equals(biztypeNumber)){ ywlxck = 2; ywlxxsm = "调拨出库"; - } else if ("613".equals(biztypeNumber)) { + }else if("613".equals(biztypeNumber)){ ywlxck = 3; ywlxxsm = "礼品领用"; - } else if ("614".equals(biztypeNumber)) { + }else if("614".equals(biztypeNumber)){ ywlxck = 4; ywlxxsm = "展会领用"; - } else if ("615".equals(biztypeNumber)) { + }else if("615".equals(biztypeNumber)){ ywlxck = 5; ywlxxsm = "拍照领用"; - } else if ("616".equals(biztypeNumber)) { + }else if("616".equals(biztypeNumber)){ ywlxck = 6; ywlxxsm = "样品领用"; - } else if ("617".equals(biztypeNumber)) { + }else if("617".equals(biztypeNumber)){ ywlxck = 7; ywlxxsm = "报损出库"; } String drzz = ywgz; DynamicObject tqq9_drck2 = bill.getDynamicObject("tqq9_drck2"); - if (tqq9_drck2 != null) { + if(tqq9_drck2 != null){ String number = tqq9_drck2.getString("number"); drzz = FWUtils.getFwOrgNumberByKdOrgNumber(number); } String jsr = null; DynamicObject tqq9_jsr = bill.getDynamicObject("tqq9_jsr"); - if (tqq9_jsr != null) { + if(tqq9_jsr != null){ tqq9_jsr = BusinessDataServiceHelper.loadSingle(tqq9_jsr.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); jsr = tqq9_jsr.getString("tqq9_fwuserid"); } String kgy = null; DynamicObject operator = bill.getDynamicObject("operator"); - if (operator != null) { + if(operator != null){ operator = BusinessDataServiceHelper.loadSingle(operator.getPkValue(), "bd_operator"); DynamicObject user = operator.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); kgy = user.getString("tqq9_fwuserid"); } @@ -877,31 +877,31 @@ public class FWImpl { BigDecimal hzje = bill.getBigDecimal("tqq9_hzje"); String shdh = null; DynamicObject tqq9_returnapply = bill.getDynamicObject("tqq9_returnapply"); - if (tqq9_returnapply != null) { + if(tqq9_returnapply != null){ shdh = tqq9_returnapply.getString("billno"); } String dyxsddh = null; DynamicObject tqq9_saleorderbill = bill.getDynamicObject("tqq9_saleorderbill"); - if (tqq9_saleorderbill != null) { + if(tqq9_saleorderbill != null){ dyxsddh = tqq9_saleorderbill.getString("billno"); } String dpdh = bill.getString("tqq9_dpdh"); String szkf = null; DynamicObject tqq9_sskf = bill.getDynamicObject("tqq9_sskf"); - if (tqq9_sskf != null) { + if(tqq9_sskf != null){ tqq9_sskf = BusinessDataServiceHelper.loadSingle(tqq9_sskf.getPkValue(), "bd_operator"); DynamicObject user = tqq9_sskf.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); szkf = user.getString("tqq9_fwuserid"); } } String szxs = null; DynamicObject tqq9_ssxs = bill.getDynamicObject("tqq9_ssxs"); - if (tqq9_ssxs != null) { + if(tqq9_ssxs != null){ tqq9_ssxs = BusinessDataServiceHelper.loadSingle(tqq9_ssxs.getPkValue(), "bd_operator"); DynamicObject user = tqq9_ssxs.getDynamicObject("operatorid"); - if (user != null) { + if(user != null){ user = BusinessDataServiceHelper.loadSingle(user.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); szxs = user.getString("tqq9_fwuserid"); } @@ -910,7 +910,7 @@ public class FWImpl { String wtyy = bill.getString("tqq9_wtyy"); DynamicObject tqq9_kufptt = bill.getDynamicObject("tqq9_kufptt"); String khfptt = null; - if (tqq9_kufptt != null) { + if(tqq9_kufptt != null){ khfptt = tqq9_kufptt.getString("number"); } String ckck = null; @@ -927,12 +927,12 @@ public class FWImpl { String ggxh = masterid.getString("modelnum"); DynamicObject tqq9_brand = masterid.getDynamicObject("tqq9_brand"); String pp = null; - if (tqq9_brand != null) { + if(tqq9_brand != null){ pp = tqq9_brand.getString("name"); } String jldw = null; DynamicObject unit = billentry.getDynamicObject("unit"); - if (unit != null) { + if(unit != null){ jldw = unit.getString("name"); } BigDecimal sl = billentry.getBigDecimal("qty"); @@ -944,12 +944,12 @@ public class FWImpl { String yxjzsj = sdf.format(expirydate); String drph = null; DynamicObject lot = billentry.getDynamicObject("lot"); - if (lot != null) { + if(lot != null){ drph = lot.getString("number"); } String zczh = null; DynamicObject tqq9_zczh = billentry.getDynamicObject("tqq9_zczh"); - if (tqq9_zczh != null) { + if(tqq9_zczh != null){ zczh = tqq9_zczh.getString("number"); } String xkzh = billentry.getString("tqq9_licenseno"); @@ -997,7 +997,7 @@ public class FWImpl { e14.put("fieldName", "xkzh"); e14.put("fieldValue", xkzh); - List elist = Arrays.asList(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14); + List elist = Arrays.asList(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -1008,13 +1008,13 @@ public class FWImpl { //出库仓库 DynamicObject warehouse = billentry.getDynamicObject("warehouse"); - if (warehouse != null) { + if(warehouse != null){ ckck = warehouse.getString("number"); } } detail1.put("tableDBName", "formtable_main_110_dt1"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -1094,36 +1094,36 @@ public class FWImpl { m26.put("fieldName", "ckck"); m26.put("fieldValue", ckck); - List mlist = new ArrayList<>(Arrays.asList(m1, m2, m3, m4, - m5, m6, m7, m8, m9, m12, m13, m14, m15, m16, m17, m18, m19, m20, m21, m22, m23, m24, m25, m26)); - if (ywlxck == 2) { + List mlist = new ArrayList<>(Arrays.asList(m1,m2,m3,m4, + m5,m6,m7,m8,m9,m12,m13,m14,m15,m16,m17,m18,m19,m20,m21,m22,m23,m24,m25,m26)); + if (ywlxck == 2){ int dblx = 0; String tqq9_dblx = bill.getString("tqq9_dblxqtckd"); - if ("B".equals(tqq9_dblx)) { + if("B".equals(tqq9_dblx)){ dblx = 1; } int dbfl = 0; String tqq9_dbck = bill.getString("tqq9_dbck"); - if ("B".equals(tqq9_dbck)) { + if("B".equals(tqq9_dbck)){ dbfl = 1; - } else if ("C".equals(tqq9_dbck)) { + }else if("C".equals(tqq9_dbck)){ dbfl = 2; - } else if ("F".equals(tqq9_dbck)) { + }else if("F".equals(tqq9_dbck)){ dbfl = 4; - } else if ("G".equals(tqq9_dbck)) { + }else if("G".equals(tqq9_dbck)){ dbfl = 5; - } else if ("QT".equals(tqq9_dbck)) { + }else if("QT".equals(tqq9_dbck)){ dbfl = 6; } int shlx = 0; String tqq9_shlx = bill.getString("tqq9_shlx"); - if ("B".equals(tqq9_shlx)) { + if("B".equals(tqq9_shlx)){ shlx = 1; - } else if ("C".equals(tqq9_shlx)) { + }else if("C".equals(tqq9_shlx)){ shlx = 3; - } else if ("D".equals(tqq9_shlx)) { + }else if("D".equals(tqq9_shlx)){ shlx = 4; - } else if ("E".equals(tqq9_shlx)) { + }else if("E".equals(tqq9_shlx)){ shlx = 5; } JSONObject m10 = new JSONObject(); @@ -1139,19 +1139,19 @@ public class FWImpl { mlist.add(m10); mlist.add(m11); mlist.add(m29); - } else if (ywlxck == 0) { + }else if(ywlxck == 0){ //盘亏出库 int pkyy = 0; String tqq9_pkyy = bill.getString("tqq9_pkyy"); - if ("B".equals(tqq9_pkyy)) { + if("B".equals(tqq9_pkyy)){ pkyy = 1; - } else if ("C".equals(tqq9_pkyy)) { + }else if("C".equals(tqq9_pkyy)){ pkyy = 2; } String pkzrr = null; DynamicObject tqq9_zrr = bill.getDynamicObject("tqq9_zrr"); - if (tqq9_zrr != null) { - tqq9_zrr = BusinessDataServiceHelper.loadSingle(tqq9_zrr.getPkValue(), "bos_user", "id,tqq9_fwuserid"); + if(tqq9_zrr != null){ + tqq9_zrr = BusinessDataServiceHelper.loadSingle(tqq9_zrr.getPkValue(), "bos_user","id,tqq9_fwuserid"); pkzrr = tqq9_zrr.getString("tqq9_fwuserid"); } JSONObject m27 = new JSONObject(); @@ -1162,25 +1162,25 @@ public class FWImpl { m28.put("fieldValue", pkzrr); mlist.add(m27); mlist.add(m28); - } else if (ywlxck == 7) { + }else if(ywlxck == 7){ //报损出库 int bsckfl = 8; String tqq9_bsck = bill.getString("tqq9_bsck"); - if ("A".equals(tqq9_bsck)) { + if("A".equals(tqq9_bsck)){ bsckfl = 0; - } else if ("B".equals(tqq9_bsck)) { + }else if("B".equals(tqq9_bsck)){ bsckfl = 1; - } else if ("C".equals(tqq9_bsck)) { + }else if("C".equals(tqq9_bsck)){ bsckfl = 2; - } else if ("D".equals(tqq9_bsck)) { + }else if("D".equals(tqq9_bsck)){ bsckfl = 3; - } else if ("E".equals(tqq9_bsck)) { + }else if("E".equals(tqq9_bsck)){ bsckfl = 4; - } else if ("F".equals(tqq9_bsck)) { + }else if("F".equals(tqq9_bsck)){ bsckfl = 5; - } else if ("G".equals(tqq9_bsck)) { + }else if("G".equals(tqq9_bsck)){ bsckfl = 6; - } else if ("H".equals(tqq9_bsck)) { + }else if("H".equals(tqq9_bsck)){ bsckfl = 7; } JSONObject m29 = new JSONObject(); @@ -1200,7 +1200,7 @@ public class FWImpl { /** * 付款申请推送泛微 */ - public static String pushFwPayApply(DynamicObject bill) { + public static String pushFwPayApply(DynamicObject bill){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");//泛微流程ID String billno = bill.getString("billno"); @@ -1209,7 +1209,7 @@ public class FWImpl { String cjr = creator.getString("tqq9_fwuserid"); String cjbm = null; DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); - if (tqq9_dept != null) { + if(tqq9_dept != null){ String number = tqq9_dept.getString("number"); cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); } @@ -1221,7 +1221,7 @@ public class FWImpl { DynamicObject billtype = bill.getDynamicObject("billtype"); String billtypenumber = billtype.getString("number"); int djlx = 0; - if ("ap_payapply_oth_BT_S".equals(billtypenumber)) { + if("ap_payapply_oth_BT_S".equals(billtypenumber)){ djlx = 1; } DynamicObject payorg = bill.getDynamicObject("payorg"); @@ -1230,15 +1230,15 @@ public class FWImpl { String qksy = bill.getString("applycause"); int sfdpyf = 1; boolean isprepayinvoice = bill.getBoolean("isprepayinvoice"); - if (isprepayinvoice) { + if(isprepayinvoice){ sfdpyf = 0; } BigDecimal sqje = bill.getBigDecimal("applyamount"); int fklx = 0; String tqq9_fklx = bill.getString("tqq9_fklx"); - if ("B".equals(tqq9_fklx)) { + if("B".equals(tqq9_fklx)){ fklx = 1; - } else if ("C".equals(tqq9_fklx)) { + }else if("C".equals(tqq9_fklx)){ fklx = 2; } String wlzh = null; @@ -1246,13 +1246,13 @@ public class FWImpl { String qwfkr = null; int fktj = 0; DynamicObject tqq9_fktj = bill.getDynamicObject("tqq9_fktj"); - if (tqq9_fktj != null) { + if(tqq9_fktj != null){ String number = tqq9_fktj.getString("number"); - if ("002".equals(number)) { + if("002".equals(number)){ fktj = 1; - } else if ("001".equals(number)) { + }else if("001".equals(number)){ fktj = 2; - } else if ("004".equals(number)) { + }else if("004".equals(number)){ fktj = 3; } } @@ -1280,7 +1280,7 @@ public class FWImpl { String cgddh = entry.getString("e_corebillno"); String fyxm = null; DynamicObject e_expenseitem = entry.getDynamicObject("e_expenseitem"); - if (e_expenseitem != null) { + if(e_expenseitem != null){ e_expenseitem = BusinessDataServiceHelper.loadSingle(e_expenseitem.getPkValue(), "er_expenseitemedit", "id,name,number"); fyxm = e_expenseitem.getString("name"); } @@ -1291,28 +1291,28 @@ public class FWImpl { BigDecimal zbzfje_e = entry.getBigDecimal("tqq9_zbzf"); BigDecimal yfje = entry.getBigDecimal("e_paidamt"); DynamicObject e_asstact = entry.getDynamicObject("e_asstact"); - if (e_asstact != null) { + if(e_asstact != null){ skgys = e_asstact.getString("number"); } wlzh = entry.getString("e_assacct"); DynamicObject e_bebank = entry.getDynamicObject("e_bebank"); - if (e_bebank != null) { + if(e_bebank != null){ wlyh = e_bebank.getString("name"); } Date e_expaydate = entry.getDate("e_expaydate"); qwfkr = sdf.format(e_expaydate); DynamicObject e_settlementtype = entry.getDynamicObject("e_settlementtype"); - if (e_settlementtype != null) { + if(e_settlementtype != null){ String number = e_settlementtype.getString("number"); - if ("JSFS01".equals(number)) { + if("JSFS01".equals(number)){ jsfs = 0; - } else if ("JSFS04".equals(number)) { + }else if("JSFS04".equals(number)){ jsfs = 1; - } else if ("JSFS08".equals(number) || "JSFS16_S".equals(number)) { + }else if("JSFS08".equals(number) || "JSFS16_S".equals(number)){ jsfs = 2; - } else if ("JSFS09".equals(number) || "JSFS12".equals(number)) { + }else if("JSFS09".equals(number) || "JSFS12".equals(number)){ jsfs = 3; - } else if ("LC001".equals(number)) { + }else if("LC001".equals(number)){ jsfs = 4; } } @@ -1327,24 +1327,24 @@ public class FWImpl { e2.put("fieldValue", fyxm); JSONObject e3 = new JSONObject(); e3.put("fieldName", "bcsjzfje"); - e3.put("fieldValue", bcsjzfje_e == null || bcsjzfje_e.compareTo(BigDecimal.ZERO) == 0 ? 0 : bcsjzfje_e); + e3.put("fieldValue", bcsjzfje_e==null||bcsjzfje_e.compareTo(BigDecimal.ZERO)==0?0:bcsjzfje_e); JSONObject e4 = new JSONObject(); e4.put("fieldName", "cgddyfje"); - e4.put("fieldValue", cgddyfje == null || cgddyfje.compareTo(BigDecimal.ZERO) == 0 ? 0 : cgddyfje); + e4.put("fieldValue", cgddyfje==null||cgddyfje.compareTo(BigDecimal.ZERO)==0?0:cgddyfje); JSONObject e5 = new JSONObject(); e5.put("fieldName", "xfsyje"); - e5.put("fieldValue", xfsyje == null || xfsyje.compareTo(BigDecimal.ZERO) == 0 ? 0 : xfsyje); + e5.put("fieldValue", xfsyje==null||xfsyje.compareTo(BigDecimal.ZERO)==0?0:xfsyje); JSONObject e6 = new JSONObject(); e6.put("fieldName", "hfsyje"); - e6.put("fieldValue", hfsyje == null || hfsyje.compareTo(BigDecimal.ZERO) == 0 ? 0 : hfsyje); + e6.put("fieldValue", hfsyje==null||hfsyje.compareTo(BigDecimal.ZERO)==0?0:hfsyje); JSONObject e7 = new JSONObject(); e7.put("fieldName", "zbzfje"); - e7.put("fieldValue", zbzfje_e == null || zbzfje_e.compareTo(BigDecimal.ZERO) == 0 ? 0 : zbzfje_e); + e7.put("fieldValue", zbzfje_e==null||zbzfje_e.compareTo(BigDecimal.ZERO)==0?0:zbzfje_e); JSONObject e8 = new JSONObject(); e8.put("fieldName", "yfje"); - e8.put("fieldValue", yfje == null || yfje.compareTo(BigDecimal.ZERO) == 0 ? 0 : yfje); + e8.put("fieldValue", yfje==null||yfje.compareTo(BigDecimal.ZERO)==0?0:yfje); - List elist = Arrays.asList(e1, e2, e3, e4, e5, e6, e7, e8); + List elist = Arrays.asList(e1,e2,e3,e4,e5,e6,e7,e8); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -1355,7 +1355,7 @@ public class FWImpl { } detail1.put("tableDBName", "formtable_main_100_dt1"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -1400,7 +1400,7 @@ public class FWImpl { m12.put("fieldValue", sfdpyf); JSONObject m13 = new JSONObject(); m13.put("fieldName", "sqje"); - m13.put("fieldValue", sqje == null || sqje.compareTo(BigDecimal.ZERO) == 0 ? 0 : sqje); + m13.put("fieldValue", sqje==null||sqje.compareTo(BigDecimal.ZERO)==0?0:sqje); JSONObject m14 = new JSONObject(); m14.put("fieldName", "fklx"); m14.put("fieldValue", fklx); @@ -1424,37 +1424,37 @@ public class FWImpl { m20.put("fieldValue", dqr); JSONObject m21 = new JSONObject(); m21.put("fieldName", "bcsjzfje"); - m21.put("fieldValue", bcsjzfje == null || bcsjzfje.compareTo(BigDecimal.ZERO) == 0 ? 0 : bcsjzfje); + m21.put("fieldValue", bcsjzfje==null||bcsjzfje.compareTo(BigDecimal.ZERO)==0?0:bcsjzfje); JSONObject m22 = new JSONObject(); m22.put("fieldName", "cgddyfze"); - m22.put("fieldValue", cgddyfze == null || cgddyfze.compareTo(BigDecimal.ZERO) == 0 ? 0 : cgddyfze); + m22.put("fieldValue", cgddyfze==null||cgddyfze.compareTo(BigDecimal.ZERO)==0?0:cgddyfze); JSONObject m23 = new JSONObject(); m23.put("fieldName", "ljyfzje"); - m23.put("fieldValue", ljyfzje == null || ljyfzje.compareTo(BigDecimal.ZERO) == 0 ? 0 : ljyfzje); + m23.put("fieldValue", ljyfzje==null||ljyfzje.compareTo(BigDecimal.ZERO)==0?0:ljyfzje); JSONObject m24 = new JSONObject(); m24.put("fieldName", "hfsyzje"); - m24.put("fieldValue", hfsyzje == null || hfsyzje.compareTo(BigDecimal.ZERO) == 0 ? 0 : hfsyzje); + m24.put("fieldValue", hfsyzje==null||hfsyzje.compareTo(BigDecimal.ZERO)==0?0:hfsyzje); JSONObject m25 = new JSONObject(); m25.put("fieldName", "xfsyzje"); - m25.put("fieldValue", xfsyzje == null || xfsyzje.compareTo(BigDecimal.ZERO) == 0 ? 0 : xfsyzje); + m25.put("fieldValue", xfsyzje==null||xfsyzje.compareTo(BigDecimal.ZERO)==0?0:xfsyzje); JSONObject m26 = new JSONObject(); m26.put("fieldName", "zbzfje"); - m26.put("fieldValue", zbzfje == null || zbzfje.compareTo(BigDecimal.ZERO) == 0 ? 0 : zbzfje); + m26.put("fieldValue", zbzfje==null||zbzfje.compareTo(BigDecimal.ZERO)==0?0:zbzfje); JSONObject m27 = new JSONObject(); m27.put("fieldName", "qpje"); - m27.put("fieldValue", qpje == null || qpje.compareTo(BigDecimal.ZERO) == 0 ? 0 : qpje); + m27.put("fieldValue", qpje==null||qpje.compareTo(BigDecimal.ZERO)==0?0:qpje); JSONObject m28 = new JSONObject(); m28.put("fieldName", "yjdpsj"); m28.put("fieldValue", yjdpsj); JSONObject m29 = new JSONObject(); m29.put("fieldName", "qhje"); - m29.put("fieldValue", qhje == null || qhje.compareTo(BigDecimal.ZERO) == 0 ? 0 : qhje); + m29.put("fieldValue", qhje==null||qhje.compareTo(BigDecimal.ZERO)==0?0:qhje); JSONObject m30 = new JSONObject(); m30.put("fieldName", "yjdhsj"); m30.put("fieldValue", yjdhsj); - List mlist = new ArrayList<>(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, m27, m28, m29, m30)); + List mlist = new ArrayList<>(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,m27,m28,m29,m30)); // 附件 List fjList = new ArrayList<>(); List> attachments = AttachmentServiceHelper.getAttachments("ap_payapply", bill.getPkValue(), "attachmentpanel"); @@ -1470,7 +1470,7 @@ public class FWImpl { fjList.add(fj); } - if (fjList.size() > 0) { + if(fjList.size() > 0){ JSONObject fjObj = new JSONObject(); fjObj.put("fieldName", "fj"); fjObj.put("fieldValue", fjList); @@ -1489,7 +1489,7 @@ public class FWImpl { /** * 采购订单变更单推送泛微 */ - public static String pushFwPurChange(DynamicObject bill) { + public static String pushFwPurChange(DynamicObject bill){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");//泛微流程ID String ycgddh = bill.getString("billno"); @@ -1499,7 +1499,7 @@ public class FWImpl { String cjr = creator.getString("tqq9_fwuserid"); String cjbm = null; DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); - if (tqq9_dept != null) { + if(tqq9_dept != null){ String number = tqq9_dept.getString("number"); cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); } @@ -1511,88 +1511,88 @@ public class FWImpl { String cglx = bill.getString("tqq9_cglx"); int cgyt = 0; String tqq9_cgyt = bill.getString("tqq9_cgyt"); - if ("CGT001".equals(tqq9_cgyt)) { + if("CGT001".equals(tqq9_cgyt)){ cgyt = 1; } Date tqq9_datefield = bill.getDate("tqq9_datefield"); String yjfhsj = sdf.format(tqq9_datefield); int fktj = 0; DynamicObject paycondition = bill.getDynamicObject("paycondition"); - if (paycondition != null) { + if(paycondition != null){ String number = paycondition.getString("number"); - if ("002".equals(number)) { + if("002".equals(number)){ fktj = 1; - } else if ("001".equals(number)) { + }else if("001".equals(number)){ fktj = 2; - } else if ("004".equals(number)) { + }else if("004".equals(number)){ fktj = 3; } } int jsfs = 0; DynamicObject settletype = bill.getDynamicObject("settletype"); - if (settletype != null) { + if(settletype != null){ String number = settletype.getString("number"); - if ("JSFS04".equals(number)) { + if("JSFS04".equals(number)){ jsfs = 1; - } else if ("JSFS08".equals(number) || "JSFS16_S".equals(number)) { + }else if("JSFS08".equals(number) || "JSFS16_S".equals(number)){ jsfs = 2; - } else if ("JSFS09".equals(number) || "JSFS12".equals(number)) { + }else if("JSFS09".equals(number) || "JSFS12".equals(number)){ jsfs = 3; - } else if ("LC001".equals(number)) { + }else if("LC001".equals(number)){ jsfs = 4; } } boolean tqq9_sfsyhf = bill.getBoolean("tqq9_sfsyhf");//货返 String hfxx = ""; - if (tqq9_sfsyhf) { + if(tqq9_sfsyhf){ hfxx = "货返信息:"; String tqq9_hshfsygs = bill.getString("tqq9_hshfsygs"); - if ("A".equals(tqq9_hshfsygs)) { + if("A".equals(tqq9_hshfsygs)){ //本年 hfxx = hfxx + "含税货返使用归属为本年,"; - } else { + }else{ //上年 hfxx = hfxx + "含税货返使用归属为上年,"; } BigDecimal tqq9_hshfsyje = bill.getBigDecimal("tqq9_hshfsyje"); - hfxx = hfxx + "含税货返使用金额" + tqq9_hshfsyje + "元,"; + hfxx = hfxx + "含税货返使用金额"+tqq9_hshfsyje+"元,"; BigDecimal tqq9_hshfzje = bill.getBigDecimal("tqq9_hshfzje"); - hfxx = hfxx + "含税货返总金额" + tqq9_hshfzje + "元,"; + hfxx = hfxx + "含税货返总金额"+tqq9_hshfzje+"元,"; BigDecimal tqq9_hshfkyje = bill.getBigDecimal("tqq9_hshfkyje"); - hfxx = hfxx + "含税货返可用金额" + tqq9_hshfkyje + "元,"; + hfxx = hfxx + "含税货返可用金额"+tqq9_hshfkyje+"元,"; DynamicObject tqq9_hshfsysl = bill.getDynamicObject("tqq9_hshfsysl"); String taxRateStr = "0"; - if (tqq9_hshfsysl != null) { + if(tqq9_hshfsysl != null){ String number = tqq9_hshfsysl.getString("number"); taxRateStr = number.substring(1); } - hfxx = hfxx + "含税货返使用税率" + taxRateStr + "%。"; + hfxx = hfxx + "含税货返使用税率"+taxRateStr+"%。"; } boolean tqq9_sfsyxf = bill.getBoolean("tqq9_sfsyxf");//现返 String xfxx = ""; - if (tqq9_sfsyxf) { + if(tqq9_sfsyxf){ xfxx = "现返信息:"; String tqq9_hsxfsygs = bill.getString("tqq9_hsxfsygs"); - if ("A".equals(tqq9_hsxfsygs)) { + if("A".equals(tqq9_hsxfsygs)){ //本年 xfxx = xfxx + "含税现返使用归属为本年,"; - } else { + }else{ //上年 xfxx = xfxx + "含税现返使用归属为本年,"; } BigDecimal tqq9_hsxfsyje = bill.getBigDecimal("tqq9_hsxfsyje"); - xfxx = xfxx + "含税现返使用金额" + tqq9_hsxfsyje + "元,"; + xfxx = xfxx + "含税现返使用金额"+tqq9_hsxfsyje+"元,"; BigDecimal tqq9_hsxfzje = bill.getBigDecimal("tqq9_hsxfzje"); - xfxx = xfxx + "含税现返总金额" + tqq9_hsxfzje + "元,"; + xfxx = xfxx + "含税现返总金额"+tqq9_hsxfzje+"元,"; BigDecimal tqq9_hsxfkyje = bill.getBigDecimal("tqq9_hsxfkyje"); - xfxx = xfxx + "含税现返可用金额" + tqq9_hsxfkyje + "元,"; + xfxx = xfxx + "含税现返可用金额"+tqq9_hsxfkyje+"元,"; DynamicObject tqq9_hsxfsysl = bill.getDynamicObject("tqq9_hsxfsysl"); String taxRateStr = "0"; - if (tqq9_hsxfsysl != null) { + if(tqq9_hsxfsysl != null){ String number = tqq9_hsxfsysl.getString("number"); taxRateStr = number.substring(1); } - xfxx = xfxx + "含税现返使用税率" + taxRateStr + "%。"; + xfxx = xfxx + "含税现返使用税率"+taxRateStr+"%。"; } BigDecimal zkqjshj = bill.getBigDecimal("tqq9_totalamount"); BigDecimal yhzkje = bill.getBigDecimal("tqq9_discountamount"); @@ -1607,7 +1607,7 @@ public class FWImpl { String bgyy = bill.getString("changereason"); String dhgys = null; DynamicObject supplier = bill.getDynamicObject("supplier"); - if (supplier != null) { + if(supplier != null){ dhgys = supplier.getString("number"); } String khlxr = bill.getString("tqq9_khlxr"); @@ -1626,13 +1626,13 @@ public class FWImpl { masterid = BusinessDataServiceHelper.loadSingle(masterid.getPkValue(), masterid.getDynamicObjectType().getName()); DynamicObject tqq9_brand = billentry.getDynamicObject("tqq9_brand"); String pp = null; - if (tqq9_brand != 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) { + if(unit != null){ jldw = unit.getString("name"); } String wlmc = masterid.getString("number"); @@ -1652,7 +1652,7 @@ public class FWImpl { String bz = billentry.getString("entrycomment"); boolean ispresent = billentry.getBoolean("ispresent"); int sfzp = 0; - if (ispresent) { + if(ispresent){ sfzp = 1; } @@ -1670,37 +1670,37 @@ public class FWImpl { e4.put("fieldValue", jldw); JSONObject e5 = new JSONObject(); e5.put("fieldName", "sl"); - e5.put("fieldValue", sl != null && sl.compareTo(BigDecimal.ZERO) != 0 ? sl : 0); + e5.put("fieldValue", sl!=null&&sl.compareTo(BigDecimal.ZERO)!=0?sl:0); JSONObject e6 = new JSONObject(); e6.put("fieldName", "hsdj"); - e6.put("fieldValue", hsdj != null && hsdj.compareTo(BigDecimal.ZERO) != 0 ? hsdj : 0); + e6.put("fieldValue", hsdj!=null&&hsdj.compareTo(BigDecimal.ZERO)!=0?hsdj:0); JSONObject e7 = new JSONObject(); e7.put("fieldName", "tax_rate"); - e7.put("fieldValue", tax_rate != null && tax_rate.compareTo(BigDecimal.ZERO) != 0 ? tax_rate : 0); + e7.put("fieldValue", tax_rate!=null&&tax_rate.compareTo(BigDecimal.ZERO)!=0?tax_rate:0); JSONObject e8 = new JSONObject(); e8.put("fieldName", "zkqjshj"); - e8.put("fieldValue", zkqjshj_e != null && zkqjshj_e.compareTo(BigDecimal.ZERO) != 0 ? zkqjshj_e : 0); + e8.put("fieldValue", zkqjshj_e!=null&&zkqjshj_e.compareTo(BigDecimal.ZERO)!=0?zkqjshj_e:0); JSONObject e9 = new JSONObject(); e9.put("fieldName", "yhzkje"); - e9.put("fieldValue", yhzkje_e != null && yhzkje_e.compareTo(BigDecimal.ZERO) != 0 ? yhzkje_e : 0); + e9.put("fieldValue", yhzkje_e!=null&&yhzkje_e.compareTo(BigDecimal.ZERO)!=0?yhzkje_e:0); JSONObject e10 = new JSONObject(); e10.put("fieldName", "zkhjshj"); - e10.put("fieldValue", zkhjshj_e != null && zkhjshj_e.compareTo(BigDecimal.ZERO) != 0 ? zkhjshj_e : 0); + e10.put("fieldValue", zkhjshj_e!=null&&zkhjshj_e.compareTo(BigDecimal.ZERO)!=0?zkhjshj_e:0); JSONObject e11 = new JSONObject(); e11.put("fieldName", "hfsyje"); - e11.put("fieldValue", hfsyje != null && hfsyje.compareTo(BigDecimal.ZERO) != 0 ? hfsyje : 0); + e11.put("fieldValue", hfsyje!=null&&hfsyje.compareTo(BigDecimal.ZERO)!=0?hfsyje:0); JSONObject e12 = new JSONObject(); e12.put("fieldName", "xfsyje"); - e12.put("fieldValue", xfsyje != null && xfsyje.compareTo(BigDecimal.ZERO) != 0 ? xfsyje : 0); + e12.put("fieldValue", xfsyje!=null&&xfsyje.compareTo(BigDecimal.ZERO)!=0?xfsyje:0); JSONObject e13 = new JSONObject(); e13.put("fieldName", "zkhflhjshj"); - e13.put("fieldValue", zkhflhjshj_e != null && zkhflhjshj_e.compareTo(BigDecimal.ZERO) != 0 ? zkhflhjshj_e : 0); + e13.put("fieldValue", zkhflhjshj_e!=null&&zkhflhjshj_e.compareTo(BigDecimal.ZERO)!=0?zkhflhjshj_e:0); JSONObject e14 = new JSONObject(); e14.put("fieldName", "cb"); - e14.put("fieldValue", cb != null && cb.compareTo(BigDecimal.ZERO) != 0 ? cb : 0); + e14.put("fieldValue", cb!=null&&cb.compareTo(BigDecimal.ZERO)!=0?cb:0); JSONObject e15 = new JSONObject(); e15.put("fieldName", "yjxssjy"); - e15.put("fieldValue", yjxssjy != null && yjxssjy.compareTo(BigDecimal.ZERO) != 0 ? yjxssjy : 0); + e15.put("fieldValue", yjxssjy!=null&&yjxssjy.compareTo(BigDecimal.ZERO)!=0?yjxssjy:0); JSONObject e16 = new JSONObject(); e16.put("fieldName", "bz"); e16.put("fieldValue", bz); @@ -1712,12 +1712,12 @@ public class FWImpl { e18.put("fieldValue", sfzp); JSONObject e19 = new JSONObject(); e19.put("fieldName", "sc83zsj"); - e19.put("fieldValue", sc83zsj != null && sc83zsj.compareTo(BigDecimal.ZERO) != 0 ? sc83zsj : 0); + e19.put("fieldValue", sc83zsj != null && sc83zsj.compareTo(BigDecimal.ZERO) != 0?sc83zsj:0); JSONObject e20 = new JSONObject(); e20.put("fieldName", "jshj"); - e20.put("fieldValue", jshj != null && jshj.compareTo(BigDecimal.ZERO) != 0 ? jshj : 0); + e20.put("fieldValue", jshj!=null&&jshj.compareTo(BigDecimal.ZERO)!=0?jshj:0); - List elist = Arrays.asList(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20); + List elist = Arrays.asList(e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18,e19,e20); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -1732,7 +1732,7 @@ public class FWImpl { } detail1.put("tableDBName", "formtable_main_98_dt1"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } @@ -1744,26 +1744,26 @@ public class FWImpl { for (DynamicObject purEntry : purEntries) { String kxmc = null; DynamicObject payname = purEntry.getDynamicObject("payname"); - if (payname != null) { + if(payname != null){ kxmc = payname.getString("name"); } String fkrq = null; Date paydate = purEntry.getDate("paydate"); - if (paydate != null) { + if(paydate != null){ fkrq = sdf.format(paydate); } BigDecimal fkbl = purEntry.getBigDecimal("payrate"); BigDecimal fkje = purEntry.getBigDecimal("payamount"); int sfyf = 1; boolean isprepay = purEntry.getBoolean("isprepay"); - if (isprepay) { + if(isprepay){ sfyf = 0; } String yfsd = null; String pretimepoint = purEntry.getString("pretimepoint"); - if ("A".equals(pretimepoint)) { + if("A".equals(pretimepoint)){ yfsd = "采购合同"; - } else if ("B".equals(pretimepoint)) { + }else if("B".equals(pretimepoint)){ yfsd = "采购订单"; } @@ -1780,7 +1780,7 @@ public class FWImpl { p2.put("fieldValue", fkbl); JSONObject p3 = new JSONObject(); p3.put("fieldName", "fkje"); - p3.put("fieldValue", fkje != null && fkje.compareTo(BigDecimal.ZERO) != 0 ? fkje : 0); + p3.put("fieldValue", fkje!= null && fkje.compareTo(BigDecimal.ZERO) != 0?fkje:0); JSONObject p4 = new JSONObject(); p4.put("fieldName", "sfyf"); p4.put("fieldValue", sfyf); @@ -1792,10 +1792,10 @@ public class FWImpl { p6.put("fieldValue", glfkje); JSONObject p7 = new JSONObject(); p7.put("fieldName", "yfje"); - p7.put("fieldValue", yfje_p != null && yfje_p.compareTo(BigDecimal.ZERO) != 0 ? yfje_p : 0); + p7.put("fieldValue", yfje_p!= null && yfje_p.compareTo(BigDecimal.ZERO) != 0?yfje_p:0); JSONObject p8 = new JSONObject(); p8.put("fieldName", "bcjsje"); - p8.put("fieldValue", bcjsje != null && bcjsje.compareTo(BigDecimal.ZERO) != 0 ? bcjsje : 0); + p8.put("fieldValue", bcjsje!= null && bcjsje.compareTo(BigDecimal.ZERO) != 0?bcjsje:0); JSONObject p9 = new JSONObject(); p9.put("fieldName", "fkd"); p9.put("fieldValue", "FKD234124"); @@ -1803,7 +1803,7 @@ public class FWImpl { p10.put("fieldName", "fkrq"); p10.put("fieldValue", fkrq); - List plist = Arrays.asList(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); + List plist = Arrays.asList(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(plist); JSONObject recordObj = new JSONObject(); @@ -1813,7 +1813,7 @@ public class FWImpl { } detail12.put("tableDBName", "formtable_main_98_dt2"); detail12.put("workflowRequestTableRecords", recordsArr2); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail12.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -1866,34 +1866,34 @@ public class FWImpl { m14.put("fieldValue", xfxx); JSONObject m15 = new JSONObject(); m15.put("fieldName", "zkqjshj"); - m15.put("fieldValue", zkqjshj != null && zkqjshj.compareTo(BigDecimal.ZERO) != 0 ? zkqjshj : 0); + m15.put("fieldValue", zkqjshj!=null&&zkqjshj.compareTo(BigDecimal.ZERO)!=0?zkqjshj:0); JSONObject m16 = new JSONObject(); m16.put("fieldName", "yhzkje"); - m16.put("fieldValue", yhzkje != null && yhzkje.compareTo(BigDecimal.ZERO) != 0 ? yhzkje : 0); + m16.put("fieldValue", yhzkje!=null&&yhzkje.compareTo(BigDecimal.ZERO)!=0?yhzkje:0); JSONObject m17 = new JSONObject(); m17.put("fieldName", "zkhjshj"); - m17.put("fieldValue", zkhjshj != null && zkhjshj.compareTo(BigDecimal.ZERO) != 0 ? zkhjshj : 0); + m17.put("fieldValue", zkhjshj!=null&&zkhjshj.compareTo(BigDecimal.ZERO)!=0?zkhjshj:0); JSONObject m18 = new JSONObject(); m18.put("fieldName", "zkhflhjshj"); - m18.put("fieldValue", zkhflhjshj != null && zkhflhjshj.compareTo(BigDecimal.ZERO) != 0 ? zkhflhjshj : 0); + m18.put("fieldValue", zkhflhjshj!=null&&zkhflhjshj.compareTo(BigDecimal.ZERO)!=0?zkhflhjshj:0); JSONObject m19 = new JSONObject(); m19.put("fieldName", "yyfje"); - m19.put("fieldValue", yyfje != null && yyfje.compareTo(BigDecimal.ZERO) != 0 ? yyfje : 0); + m19.put("fieldValue", yyfje!=null&&yyfje.compareTo(BigDecimal.ZERO)!=0?yyfje:0); JSONObject m20 = new JSONObject(); m20.put("fieldName", "yfje"); - m20.put("fieldValue", yfje != null && yfje.compareTo(BigDecimal.ZERO) != 0 ? yfje : 0); + m20.put("fieldValue", yfje!=null&&yfje.compareTo(BigDecimal.ZERO)!=0?yfje:0); JSONObject m21 = new JSONObject(); m21.put("fieldName", "zflhzkje"); - m21.put("fieldValue", zflhzkje == null || zflhzkje.compareTo(BigDecimal.ZERO) == 0 ? 0 : zflhzkje); + m21.put("fieldValue", zflhzkje==null||zflhzkje.compareTo(BigDecimal.ZERO)==0?0:zflhzkje); JSONObject m22 = new JSONObject(); m22.put("fieldName", "lswdhzl"); - m22.put("fieldValue", lswdhzl == null || lswdhzl.compareTo(BigDecimal.ZERO) == 0 ? 0 : lswdhzl); + m22.put("fieldValue", lswdhzl==null||lswdhzl.compareTo(BigDecimal.ZERO)==0?0:lswdhzl); JSONObject m23 = new JSONObject(); m23.put("fieldName", "lswdhze"); - m23.put("fieldValue", lswdhze == null || lswdhze.compareTo(BigDecimal.ZERO) == 0 ? 0 : lswdhze); + m23.put("fieldValue", lswdhze==null||lswdhze.compareTo(BigDecimal.ZERO)==0?0:lswdhze); JSONObject m24 = new JSONObject(); m24.put("fieldName", "ddje"); - m24.put("fieldValue", ddje == null || ddje.compareTo(BigDecimal.ZERO) == 0 ? 0 : ddje); + m24.put("fieldValue", ddje==null||ddje.compareTo(BigDecimal.ZERO)==0?0:ddje); JSONObject m25 = new JSONObject(); m25.put("fieldName", "ycgddh"); m25.put("fieldValue", ycgddh); @@ -1916,8 +1916,8 @@ public class FWImpl { m31.put("fieldName", "shck"); m31.put("fieldValue", shck); - List mlist = new ArrayList<>(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, m27, m28, m29, m30, m31)); + List mlist = new ArrayList<>(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,m27,m28,m29,m30,m31)); JSONArray mainArr = new JSONArray(); mainArr.addAll(mlist); String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_BGCGD"); @@ -1931,7 +1931,7 @@ public class FWImpl { /** * 采购退货申请推送泛微 */ - public static String pushFwPurRefund(DynamicObject bill) { + public static String pushFwPurRefund(DynamicObject bill){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String billno = bill.getString("billno"); String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid"); @@ -1940,7 +1940,7 @@ public class FWImpl { String cjr = creator.getString("tqq9_fwuserid"); String cjbm = null; DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); - if (tqq9_dept != null) { + if(tqq9_dept != null){ String number = tqq9_dept.getString("number"); cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); } @@ -1953,19 +1953,19 @@ public class FWImpl { DynamicObject biztype = bill.getDynamicObject("biztype"); String biztypenumber = biztype.getString("number"); int ywlx = 0; - if ("1102".equals(biztypenumber)) { + if("1102".equals(biztypenumber)){ ywlx = 1; - } else if ("1104".equals(biztypenumber)) { + }else if("1104".equals(biztypenumber)){ ywlx = 2; } int sfxykhzsqd = 1; boolean tqq9_sfkhp = bill.getBoolean("tqq9_sfkhp"); - if (tqq9_sfkhp) { + if(tqq9_sfkhp){ sfxykhzsqd = 0; } String fplb = null; DynamicObject invoicebiztype = bill.getDynamicObject("invoicebiztype"); - if (invoicebiztype != null) { + if(invoicebiztype != null){ fplb = invoicebiztype.getString("name"); } BigDecimal se = bill.getBigDecimal("totaltaxamount"); @@ -1975,7 +1975,7 @@ public class FWImpl { BigDecimal thslhz = bill.getBigDecimal("tqq9_allqty"); String dhgys = null; DynamicObject supplier = bill.getDynamicObject("supplier"); - if (supplier != null) { + if(supplier != null){ dhgys = supplier.getString("number"); } @@ -1991,13 +1991,13 @@ public class FWImpl { String wlbm = masterid.getString("number"); DynamicObject tqq9_brand = billentry.getDynamicObject("tqq9_brand"); String pp = null; - if (tqq9_brand != 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) { + if(unit != null){ jldw = unit.getString("name"); } BigDecimal thsl = billentry.getBigDecimal("qty"); @@ -2022,18 +2022,18 @@ public class FWImpl { e4.put("fieldValue", jldw); JSONObject e5 = new JSONObject(); e5.put("fieldName", "thsl"); - e5.put("fieldValue", thsl != null && thsl.compareTo(BigDecimal.ZERO) != 0 ? thsl : 0); + e5.put("fieldValue", thsl!=null&&thsl.compareTo(BigDecimal.ZERO)!=0?thsl:0); JSONObject e6 = new JSONObject(); e6.put("fieldName", "hsdj"); - e6.put("fieldValue", hsdj != null && hsdj.compareTo(BigDecimal.ZERO) != 0 ? hsdj : 0); + e6.put("fieldValue", hsdj!=null&&hsdj.compareTo(BigDecimal.ZERO)!=0?hsdj:0); JSONObject e7 = new JSONObject(); e7.put("fieldName", "yhzkje"); - e7.put("fieldValue", yhzkje != null && yhzkje.compareTo(BigDecimal.ZERO) != 0 ? yhzkje : 0); + e7.put("fieldValue", yhzkje!=null&&yhzkje.compareTo(BigDecimal.ZERO)!=0?yhzkje:0); JSONObject e8 = new JSONObject(); e8.put("fieldName", "zkhjshj"); - e8.put("fieldValue", zkhjshj_e != null && zkhjshj_e.compareTo(BigDecimal.ZERO) != 0 ? zkhjshj_e : 0); + e8.put("fieldValue", zkhjshj_e!=null&&zkhjshj_e.compareTo(BigDecimal.ZERO)!=0?zkhjshj_e:0); - List elist = Arrays.asList(e0, e1, e2, e3, e4, e5, e6, e7, e8); + List elist = Arrays.asList(e0,e1,e2,e3,e4,e5,e6,e7,e8); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -2044,7 +2044,7 @@ public class FWImpl { } detail1.put("tableDBName", "formtable_main_99_dt1"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -2083,19 +2083,19 @@ public class FWImpl { m10.put("fieldValue", fplb); JSONObject m11 = new JSONObject(); m11.put("fieldName", "se"); - m11.put("fieldValue", se != null && se.compareTo(BigDecimal.ZERO) != 0 ? se : 0); + m11.put("fieldValue", se!=null&&se.compareTo(BigDecimal.ZERO)!=0?se:0); JSONObject m12 = new JSONObject(); m12.put("fieldName", "zkhjshj"); - m12.put("fieldValue", zkhjshj != null && zkhjshj.compareTo(BigDecimal.ZERO) != 0 ? zkhjshj : 0); + m12.put("fieldValue", zkhjshj!=null&&zkhjshj.compareTo(BigDecimal.ZERO)!=0?zkhjshj:0); JSONObject m13 = new JSONObject(); m13.put("fieldName", "sjtkje"); - m13.put("fieldValue", sjtkje != null && sjtkje.compareTo(BigDecimal.ZERO) != 0 ? sjtkje : 0); + m13.put("fieldValue", sjtkje!=null&&sjtkje.compareTo(BigDecimal.ZERO)!=0?sjtkje:0); JSONObject m14 = new JSONObject(); m14.put("fieldName", "bz"); m14.put("fieldValue", bz); JSONObject m15 = new JSONObject(); m15.put("fieldName", "thslhz"); - m15.put("fieldValue", thslhz != null && thslhz.compareTo(BigDecimal.ZERO) != 0 ? thslhz : 0); + m15.put("fieldValue", thslhz!=null&&thslhz.compareTo(BigDecimal.ZERO)!=0?thslhz:0); JSONObject m16 = new JSONObject(); m16.put("fieldName", "dhgys"); m16.put("fieldValue", dhgys); @@ -2103,8 +2103,8 @@ public class FWImpl { m17.put("fieldName", "cgddh"); m17.put("fieldValue", cgddh); - List mlist = new ArrayList<>(Arrays.asList(m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, - m11, m12, m13, m14, m15, m16, m17)); + List mlist = new ArrayList<>(Arrays.asList(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10, + m11,m12,m13,m14,m15,m16,m17)); JSONArray mainArr = new JSONArray(); mainArr.addAll(mlist); String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_CGTHSQ"); @@ -2118,11 +2118,10 @@ public class FWImpl { /** * 采购合同推送泛微 - * * @param bill * @return */ - public static String pushFwPurconm(DynamicObject bill) { + public static String pushFwPurconm(DynamicObject bill){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String billno = bill.getString("billno"); String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid"); @@ -2131,7 +2130,7 @@ public class FWImpl { String cjr = creator.getString("tqq9_fwuserid"); String cjbm = null; DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); - if (tqq9_dept != null) { + if(tqq9_dept != null){ String number = tqq9_dept.getString("number"); cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); } @@ -2144,21 +2143,21 @@ public class FWImpl { int htlx = 0; DynamicObject type = bill.getDynamicObject("type"); String typeNumber = type.getString("number"); - if ("FLHT".equals(typeNumber)) { + if("FLHT".equals(typeNumber)){ htlx = 1; - } else if ("KJFLHT".equals(typeNumber)) { + }else if("KJFLHT".equals(typeNumber)){ htlx = 2; } int htmb = 0; String tqq9_htmb = bill.getString("tqq9_htmb"); - if ("FLCMB".equals(tqq9_htmb)) { + if("FLCMB".equals(tqq9_htmb)){ htmb = 1; } int ywms = 0; String bizmode = bill.getString("bizmode"); - if ("B".equals(bizmode)) { + if ("B".equals(bizmode)){ ywms = 1; - } else if ("C".equals(bizmode)) { + }else if ("C".equals(bizmode)){ ywms = 2; } Date biztimebegin = bill.getDate("biztimebegin"); @@ -2168,18 +2167,18 @@ public class FWImpl { int htzt = 0; DynamicObject contparties = bill.getDynamicObject("contparties"); String contpartiesNumber = contparties.getString("number"); - if ("02".equals(contpartiesNumber)) { + if("02".equals(contpartiesNumber)){ htzt = 1; - } else if ("03".equals(contpartiesNumber)) { + }else if("03".equals(contpartiesNumber)){ htzt = 2; } int fktj = 0; String tqq9_jsfs = bill.getString("tqq9_jsfs"); - if ("kdfh".equals(tqq9_jsfs)) { + if("kdfh".equals(tqq9_jsfs)){ fktj = 1; - } else if ("yfhf".equals(tqq9_jsfs)) { + }else if("yfhf".equals(tqq9_jsfs)){ fktj = 2; - } else if ("ymjz".equals(tqq9_jsfs)) { + }else if("ymjz".equals(tqq9_jsfs)){ fktj = 3; } int zq = bill.getInt("tqq9_zq"); @@ -2190,7 +2189,7 @@ public class FWImpl { DynamicObject tqq9_brand = BusinessDataServiceHelper.loadSingle(id, "tqq9_brand", "id,name,number"); pp = pp + "," + tqq9_brand.getString("name"); } - if (StringUtils.isNotBlank(pp)) { + if(StringUtils.isNotBlank(pp)){ pp = pp.substring(1); } @@ -2198,7 +2197,7 @@ public class FWImpl { String dhlxr = null; String dhlxrdh = null; DynamicObject providerlinkman = bill.getDynamicObject("providerlinkman"); - if (providerlinkman != null) { + if(providerlinkman != null){ providerlinkman = BusinessDataServiceHelper.loadSingle(providerlinkman.getPkValue(), providerlinkman.getDynamicObjectType().getName()); dhlxr = providerlinkman.getString("name"); dhlxrdh = providerlinkman.getString("phone"); @@ -2206,12 +2205,12 @@ public class FWImpl { String dhlxdz = bill.getString("provideraddress"); String dhgys = null; DynamicObject supplier = bill.getDynamicObject("supplier"); - if (supplier != null) { + if(supplier != null){ dhgys = supplier.getString("number"); } String dsf = null; DynamicObject partc = bill.getDynamicObject("partc"); - if (partc != null) { + if(partc != null){ dsf = partc.getString("number"); } @@ -2220,13 +2219,13 @@ public class FWImpl { JSONArray recordsArr1 = new JSONArray(); QFilter f1 = new QFilter("tqq9_conm_purcontract.id", "=", bill.getPkValue()); QFilter f2 = new QFilter("enable", "=", "1"); - DynamicObject[] ruleArr = BusinessDataServiceHelper.load("tqq9_pur_rebate", "id", new QFilter[]{f1, f2}); + DynamicObject[] ruleArr = BusinessDataServiceHelper.load("tqq9_pur_rebate", "id", new QFilter[]{f1,f2}); for (DynamicObject rule : ruleArr) { rule = BusinessDataServiceHelper.loadSingle(rule.getPkValue(), "tqq9_pur_rebate"); String flgzdjh = rule.getString("number"); String tqq9_rulestype = rule.getString("tqq9_rulestype"); int gzlx = 0; - if ("1".equals(tqq9_rulestype)) { + if("1".equals(tqq9_rulestype)){ gzlx = 1; } Date tqq9_startdate = rule.getDate("tqq9_startdate"); @@ -2242,7 +2241,7 @@ public class FWImpl { DynamicObject tqq9_brand = BusinessDataServiceHelper.loadSingle(id, "tqq9_brand", "id,name,number"); flpp = flpp + "," + tqq9_brand.getString("name"); } - if (StringUtils.isNotBlank(flpp)) { + if(StringUtils.isNotBlank(flpp)){ flpp = flpp.substring(1); } String flsp = ""; @@ -2252,7 +2251,7 @@ public class FWImpl { rebategoods = BusinessDataServiceHelper.loadSingle(id, "bd_material", "id,name,number"); flsp = flsp + "," + rebategoods.getString("name"); } - if (StringUtils.isNotBlank(flsp)) { + if(StringUtils.isNotBlank(flsp)){ flsp = flsp.substring(1); } String zdcgddbh = ""; @@ -2262,7 +2261,7 @@ public class FWImpl { purchaseorder = BusinessDataServiceHelper.loadSingle(id, "pm_purorderbill", "id,name,billno"); zdcgddbh = zdcgddbh + "," + purchaseorder.getString("billno"); } - if (StringUtils.isNotBlank(zdcgddbh)) { + if(StringUtils.isNotBlank(zdcgddbh)){ zdcgddbh = zdcgddbh.substring(1); } String pccgddbh = ""; @@ -2272,7 +2271,7 @@ public class FWImpl { exclupur = BusinessDataServiceHelper.loadSingle(id, "pm_purorderbill", "id,name,billno"); pccgddbh = pccgddbh + "," + exclupur.getString("billno"); } - if (StringUtils.isNotBlank(pccgddbh)) { + if(StringUtils.isNotBlank(pccgddbh)){ pccgddbh = pccgddbh.substring(1); } String pcsjdbpcddbh = ""; @@ -2282,67 +2281,67 @@ public class FWImpl { exclunopur = BusinessDataServiceHelper.loadSingle(id, "pm_purorderbill", "id,name,billno"); pcsjdbpcddbh = pcsjdbpcddbh + "," + exclunopur.getString("billno"); } - if (StringUtils.isNotBlank(pcsjdbpcddbh)) { + if(StringUtils.isNotBlank(pcsjdbpcddbh)){ pcsjdbpcddbh = pcsjdbpcddbh.substring(1); } int pchjs = 1; boolean tqq9_excludnum = rule.getBoolean("tqq9_excludnum"); - if (tqq9_excludnum) { + if (tqq9_excludnum){ pchjs = 0; } String pckssj = null; Date tqq9_startexcludate = rule.getDate("tqq9_startexcludate"); - if (tqq9_startexcludate != null) { + if(tqq9_startexcludate != null){ pckssj = sdf.format(tqq9_startexcludate); } String pcjssj = null; Date tqq9_endexcludate = rule.getDate("tqq9_endexcludate"); - if (tqq9_endexcludate != null) { + if(tqq9_endexcludate != null){ pcjssj = sdf.format(tqq9_endexcludate); } int flzt = 0; String tqq9_rebatesub = rule.getString("tqq9_rebatesub"); - if ("1".equals(tqq9_rebatesub)) { + if ("1".equals(tqq9_rebatesub)){ flzt = 1; } int gzlc = 1; boolean tqq9_guangzhoulici = rule.getBoolean("tqq9_guangzhoulici"); - if (tqq9_guangzhoulici) { + if(tqq9_guangzhoulici){ gzlc = 0; } BigDecimal gzlcbl = rule.getBigDecimal("tqq9_gzlcbl"); int shlc = 1; boolean tqq9_shanghailici = rule.getBoolean("tqq9_shanghailici"); - if (tqq9_shanghailici) { + if(tqq9_shanghailici){ shlc = 0; } BigDecimal shlcbl = rule.getBigDecimal("tqq9_shlcbl"); int bjlc = 1; boolean tqq9_beijinglichi = rule.getBoolean("tqq9_beijinglichi"); - if (tqq9_beijinglichi) { + if(tqq9_beijinglichi){ bjlc = 0; } BigDecimal bjlcbl = rule.getBigDecimal("tqq9_bjlcbl"); int sfhs = 1; boolean tqq9_istax = rule.getBoolean("tqq9_istax"); - if (tqq9_istax) { + if (tqq9_istax){ sfhs = 0; } int fljstl = 0; String tqq9_rebatesettlespe = rule.getString("tqq9_rebatesettlespe"); - if ("1".equals(tqq9_rebatesettlespe)) { + if ("1".equals(tqq9_rebatesettlespe)){ fljstl = 1; } int jsjezb = 0; String tqq9_cal_amt = rule.getString("tqq9_cal_amt"); - if ("1".equals(tqq9_cal_amt)) { + if("1".equals(tqq9_cal_amt)){ jsjezb = 1; - } else if ("2".equals(tqq9_cal_amt)) { + }else if("2".equals(tqq9_cal_amt)){ jsjezb = 2; } int jscgzb = 0; String tqq9_calc_procurement = rule.getString("tqq9_calc_procurement"); - if ("1".equals(tqq9_calc_procurement)) { + if("1".equals(tqq9_calc_procurement)){ jscgzb = 1; } BigDecimal ksjsjsbbh = rule.getBigDecimal("tqq9_excl_start_base"); @@ -2356,7 +2355,7 @@ public class FWImpl { exclunopur = BusinessDataServiceHelper.loadSingle(id, "bd_supplier", "id,name,number"); flgys = flgys + "," + exclunopur.getString("number"); } - if (StringUtils.isNotBlank(flgys)) { + if(StringUtils.isNotBlank(flgys)){ flgys = flgys.substring(1); } JSONObject e0 = new JSONObject(); @@ -2373,10 +2372,10 @@ public class FWImpl { e3.put("fieldValue", fljssj); JSONObject e4 = new JSONObject(); e4.put("fieldName", "ygbl"); - e4.put("fieldValue", ygbl != null && ygbl.compareTo(BigDecimal.ZERO) != 0 ? ygbl : 0); + e4.put("fieldValue", ygbl!=null&&ygbl.compareTo(BigDecimal.ZERO)!=0?ygbl:0); JSONObject e5 = new JSONObject(); e5.put("fieldName", "mbcgje"); - e5.put("fieldValue", mbcgje != null && mbcgje.compareTo(BigDecimal.ZERO) != 0 ? mbcgje : 0); + e5.put("fieldValue", mbcgje!=null&&mbcgje.compareTo(BigDecimal.ZERO)!=0?mbcgje:0); JSONObject e6 = new JSONObject(); e6.put("fieldName", "flpp"); e6.put("fieldValue", flpp); @@ -2409,19 +2408,19 @@ public class FWImpl { e15.put("fieldValue", gzlc); JSONObject e16 = new JSONObject(); e16.put("fieldName", "gzlcbl"); - e16.put("fieldValue", gzlcbl != null && gzlcbl.compareTo(BigDecimal.ZERO) != 0 ? gzlcbl : 0); + e16.put("fieldValue", gzlcbl!=null&&gzlcbl.compareTo(BigDecimal.ZERO)!=0?gzlcbl:0); JSONObject e17 = new JSONObject(); e17.put("fieldName", "shlc"); e17.put("fieldValue", shlc); JSONObject e18 = new JSONObject(); e18.put("fieldName", "shlcbl"); - e18.put("fieldValue", shlcbl != null && shlcbl.compareTo(BigDecimal.ZERO) != 0 ? shlcbl : 0); + e18.put("fieldValue", shlcbl!=null&&shlcbl.compareTo(BigDecimal.ZERO)!=0?shlcbl:0); JSONObject e19 = new JSONObject(); e19.put("fieldName", "bjlc"); e19.put("fieldValue", bjlc); JSONObject e20 = new JSONObject(); e20.put("fieldName", "bjlcbl"); - e20.put("fieldValue", bjlcbl != null && bjlcbl.compareTo(BigDecimal.ZERO) != 0 ? bjlcbl : 0); + e20.put("fieldValue", bjlcbl!=null&&bjlcbl.compareTo(BigDecimal.ZERO)!=0?bjlcbl:0); JSONObject e21 = new JSONObject(); e21.put("fieldName", "sfhs"); e21.put("fieldValue", sfhs); @@ -2436,22 +2435,22 @@ public class FWImpl { e24.put("fieldValue", jscgzb); JSONObject e25 = new JSONObject(); e25.put("fieldName", "ksjsjsbbh"); - e25.put("fieldValue", ksjsjsbbh != null && ksjsjsbbh.compareTo(BigDecimal.ZERO) != 0 ? ksjsjsbbh : 0); + e25.put("fieldValue", ksjsjsbbh!=null&&ksjsjsbbh.compareTo(BigDecimal.ZERO)!=0?ksjsjsbbh:0); JSONObject e26 = new JSONObject(); e26.put("fieldName", "jsjsjsbbh"); - e26.put("fieldValue", jsjsjsbbh != null && jsjsjsbbh.compareTo(BigDecimal.ZERO) != 0 ? jsjsjsbbh : 0); + e26.put("fieldValue", jsjsjsbbh!=null&&jsjsjsbbh.compareTo(BigDecimal.ZERO)!=0?jsjsjsbbh:0); JSONObject e27 = new JSONObject(); e27.put("fieldName", "bl"); - e27.put("fieldValue", bl != null && bl.compareTo(BigDecimal.ZERO) != 0 ? bl : 0); + e27.put("fieldValue", bl!=null&&bl.compareTo(BigDecimal.ZERO)!=0?bl:0); JSONObject e28 = new JSONObject(); e28.put("fieldName", "flje"); - e28.put("fieldValue", flje != null && flje.compareTo(BigDecimal.ZERO) != 0 ? flje : 0); + e28.put("fieldValue", flje!=null&&flje.compareTo(BigDecimal.ZERO)!=0?flje:0); JSONObject e29 = new JSONObject(); e29.put("fieldName", "flgys"); e29.put("fieldValue", flgys); - List elist = Arrays.asList(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18 - , e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29); + List elist = Arrays.asList(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10,e11,e12,e13,e14,e15,e16,e17,e18 + ,e19,e20,e21,e22,e23,e24,e25,e26,e27,e28,e29); JSONArray recordsArr = new JSONArray(); recordsArr.addAll(elist); @@ -2462,7 +2461,7 @@ public class FWImpl { } detail1.put("tableDBName", "formtable_main_101_dt1"); detail1.put("workflowRequestTableRecords", recordsArr1); - if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ detail1.put("deleteAll", "1"); } JSONArray detailRootArr = new JSONArray(); @@ -2539,8 +2538,8 @@ public class FWImpl { m23.put("fieldName", "dsf"); m23.put("fieldValue", dsf); - List mlist = new ArrayList<>(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)); + List mlist = new ArrayList<>(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)); JSONArray mainArr = new JSONArray(); mainArr.addAll(mlist); @@ -2555,11 +2554,10 @@ public class FWImpl { /** * 采购合同变更单 - * * @param bill * @return */ - public static String pushFwPurconmChange(DynamicObject bill) { + public static String pushFwPurconmChange(DynamicObject bill){ /* SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String billno = bill.getString("billno"); @@ -3396,4 +3394,696 @@ public class FWImpl { //如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口 return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "短缺处理单流程", fw_wfid_xzcgdd, billno, tqq9_fwrequestid); } + + + public static String pushFwSupplier(DynamicObject bill){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid"); + String gysmc = bill.getString("name"); + String gysbh = bill.getString("number"); + DynamicObject creator = bill.getDynamicObject("creator"); + creator = BusinessDataServiceHelper.loadSingle(creator.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); + String cjr = creator.getString("tqq9_fwuserid"); + Date createtime = bill.getDate("createtime"); + String cjsj = sdf.format(createtime); + String cjbm = null; + DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); + if(tqq9_dept != null){ + String number = tqq9_dept.getString("number"); + cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); + } + DynamicObject org = bill.getDynamicObject("org"); + String orgNumber = org.getString("number"); + String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber); + int gysfl = 0; + String tqq9_combofield5_gysfl = bill.getString("tqq9_combofield5_gysfl"); + if ("02".equals(tqq9_combofield5_gysfl)){ + gysfl = 1; + } + + String cjlx = ""; + String tqq9_mulcombofield = bill.getString("tqq9_mulcombofield"); + if(StringUtils.isNotBlank(tqq9_mulcombofield)){ + if(tqq9_mulcombofield.contains("A")){ + cjlx = cjlx + "," + "0"; + } + if(tqq9_mulcombofield.contains("B")){ + cjlx = cjlx + "," + "1"; + } + if(StringUtils.isNotBlank(cjlx)){ + cjlx = cjlx.substring(1); + } + } + String gysqyzz = ""; + String tqq9_mulcombofield1 = bill.getString("tqq9_mulcombofield1"); + if(StringUtils.isNotBlank(tqq9_mulcombofield1)){ + if(tqq9_mulcombofield1.contains("A")){ + gysqyzz = gysqyzz + "," + "0"; + } + if(tqq9_mulcombofield1.contains("B")){ + gysqyzz = gysqyzz + "," + "1"; + } + if(tqq9_mulcombofield1.contains("C")){ + gysqyzz = gysqyzz + "," + "2"; + } + if(StringUtils.isNotBlank(gysqyzz)){ + gysqyzz = gysqyzz.substring(1); + } + } + int oazt = 0; + int sfnbgys = 1; + boolean chkisinternalcompany = bill.getBoolean("chkisinternalcompany"); + if (chkisinternalcompany){ + sfnbgys = 0; + } + String nbywdy = null; + DynamicObject internal_company = bill.getDynamicObject("internal_company"); + if(internal_company != null){ + nbywdy = internal_company.getString("name"); + } + int sfylqx = 1; + boolean tqq9_sfylqx = bill.getBoolean("tqq9_sfylqx"); + if(tqq9_sfylqx){ + sfylqx = 0; + } + int sfcggys = 1; + boolean tqq9_ispur = bill.getBoolean("tqq9_ispur"); + if (tqq9_ispur){ + sfcggys = 0; + } + int zzsyzxyxts = bill.getInt("tqq9_minvaliddays"); + int sfyyyzz = 1; + boolean tqq9_gysyyzz = bill.getBoolean("tqq9_gysyyzz"); + if(tqq9_gysyyzz){ + sfyyyzz = 0; + } + int sfyylqxscxkz = 1; + boolean tqq9_gysylqxscxkz = bill.getBoolean("tqq9_gysylqxscxkz"); + if(tqq9_gysylqxscxkz){ + sfyylqxscxkz = 0; + } + int sfyylqxjyxkz = 1; + boolean tqq9_gysylqxjyxkz = bill.getBoolean("tqq9_gysylqxjyxkz"); + if(tqq9_gysylqxjyxkz){ + sfyylqxjyxkz = 0; + } + int sfydelylqxjybapz = 1; + boolean tqq9_gysdelylqxjybapz = bill.getBoolean("tqq9_gysdelylqxjybapz"); + if(tqq9_gysdelylqxjybapz){ + sfydelylqxjybapz = 0; + } + int sfyyljgzhxkz = 1; + boolean tqq9_gysyljgzxxkz = bill.getBoolean("tqq9_gysyljgzxxkz"); + if(tqq9_gysyljgzxxkz){ + sfyyljgzhxkz = 0; + } + int sfyhzpxkz = 1; + boolean tqq9_gyshzpxkz = bill.getBoolean("tqq9_gyshzpxkz"); + if(tqq9_gyshzpxkz){ + sfyhzpxkz = 0; + } + int sfyzlbzs = 1; + boolean tqq9_gyszlbzs = bill.getBoolean("tqq9_gyszlbzs"); + if(tqq9_gyszlbzs){ + sfyzlbzs = 0; + } + int sfyfrwtsqs = 1; + boolean tqq9_gysfrwtsqs = bill.getBoolean("tqq9_gysfrwtsqs"); + if(tqq9_gysfrwtsqs){ + sfyfrwtsqs = 0; + } + String bz = bill.getString("tqq9_bzgys"); + String tyshxydm = bill.getString("tqq9_textfield33"); + String yyzzbh = bill.getString("tqq9_textfield13"); + String fddbr = bill.getString("tqq9_textfield210"); + String clrq = null; + Date tqq9_datefield51 = bill.getDate("tqq9_datefield51"); + if(tqq9_datefield51 != null){ + clrq = sdf.format(tqq9_datefield51); + } + String qsrq = null; + Date tqq9_yyzzqsrq1 = bill.getDate("tqq9_yyzzqsrq1"); + if(tqq9_yyzzqsrq1 != null){ + qsrq = sdf.format(tqq9_yyzzqsrq1); + } + String sxrq = null; + Date tqq9_datefield91 = bill.getDate("tqq9_datefield91"); + if(tqq9_datefield91 != null){ + sxrq = sdf.format(tqq9_datefield91); + } + String zczb = bill.getString("tqq9_textfield3_zczb1"); + String zs = bill.getString("tqq9_textfield4_zs1"); + int ylxs = 1; + boolean tqq9_yyzzsfylxs1 = bill.getBoolean("tqq9_yyzzsfylxs1"); + if (tqq9_yyzzsfylxs1){ + ylxs = 0; + } + String ylqxscxkzbh = bill.getString("tqq9_textfield18"); + String qymc2 = bill.getString("tqq9_textfield22"); + String fddbr2 = bill.getString("tqq9_textfield19"); + String qyfzr2 = bill.getString("tqq9_textfield15"); + String zs2 = bill.getString("tqq9_textfield20"); + String scdz2 = bill.getString("tqq9_textfield21"); + String qsrq2 = null; + Date tqq9_datefield = bill.getDate("tqq9_datefield"); + if(tqq9_datefield != null){ + qsrq2 = sdf.format(tqq9_datefield); + } + String sxrq2 = null; + Date tqq9_datefield1 = bill.getDate("tqq9_datefield1"); + if(tqq9_datefield1 != null){ + sxrq2 = sdf.format(tqq9_datefield1); + } + String scfwelcpfl = ""; + DynamicObjectCollection tqq9_scfwelcpfl = bill.getDynamicObjectCollection("tqq9_scfwelcpfl"); + for (DynamicObject exclunopur : tqq9_scfwelcpfl) { + long id = exclunopur.getLong("fbasedataid.id"); + exclunopur = BusinessDataServiceHelper.loadSingle(id, "tqq9_reggoodstype", "id,name,number"); + scfwelcpfl = scfwelcpfl + "," + exclunopur.getString("name"); + } + if(StringUtils.isNotBlank(scfwelcpfl)){ + scfwelcpfl = scfwelcpfl.substring(1); + } + String scfwslcpfl = ""; + DynamicObjectCollection tqq9_scfwslcpfl = bill.getDynamicObjectCollection("tqq9_scfwslcpfl"); + for (DynamicObject exclunopur : tqq9_scfwslcpfl) { + long id = exclunopur.getLong("fbasedataid.id"); + exclunopur = BusinessDataServiceHelper.loadSingle(id, "tqq9_reggoodstype", "id,name,number"); + scfwslcpfl = scfwslcpfl + "," + exclunopur.getString("name"); + } + if(StringUtils.isNotBlank(scfwslcpfl)){ + scfwslcpfl = scfwslcpfl.substring(1); + } + String ylqxjyxkzbh = bill.getString("tqq9_textfield16"); + String qymc3 = bill.getString("tqq9_textfield17"); + String jyfs = bill.getString("tqq9_textfield27"); + String zs3 = bill.getString("tqq9_textfield28"); + String jycs3 = bill.getString("tqq9_jycs"); + String kfdz3 = bill.getString("tqq9_kfdz"); + String fddbr111 = bill.getString("tqq9_fddbr"); + String qyfzr111 = bill.getString("tqq9_textfield7"); + String qsrq111 = null; + Date tqq9_datefield20 = bill.getDate("tqq9_datefield20"); + if(tqq9_datefield20 != null){ + qsrq111 = sdf.format(tqq9_datefield20); + } + String sxrq111 = null; + Date tqq9_datefield21 = bill.getDate("tqq9_datefield21"); + if(tqq9_datefield21 != null){ + sxrq111 = sdf.format(tqq9_datefield21); + } + String scfwslcpfl111 = ""; + DynamicObjectCollection tqq9_jyfwslcpfl = bill.getDynamicObjectCollection("tqq9_jyfwslcpfl"); + for (DynamicObject exclunopur : tqq9_jyfwslcpfl) { + long id = exclunopur.getLong("fbasedataid.id"); + exclunopur = BusinessDataServiceHelper.loadSingle(id, "tqq9_reggoodstype", "id,name,number"); + scfwslcpfl111 = scfwslcpfl111 + "," + exclunopur.getString("name"); + } + if(StringUtils.isNotBlank(scfwslcpfl111)){ + scfwslcpfl111 = scfwslcpfl111.substring(1); + } + String delylqxjybah = bill.getString("tqq9_textfield26"); + String qymc4 = bill.getString("tqq9_textfield24"); + String jyfs4 = bill.getString("tqq9_textfield8"); + String zs4 = bill.getString("tqq9_textfield25"); + String jycs4 = bill.getString("tqq9_textfield23"); + String kfdz4 = bill.getString("tqq9_textfield9"); + String fddbr4 = bill.getString("tqq9_textfield10"); + String qyfzr4 = bill.getString("tqq9_textfield11"); + String scfwelcpfl4 = ""; + DynamicObjectCollection tqq9_jyfwelcpfl = bill.getDynamicObjectCollection("tqq9_jyfwelcpfl"); + for (DynamicObject exclunopur : tqq9_jyfwelcpfl) { + long id = exclunopur.getLong("fbasedataid.id"); + exclunopur = BusinessDataServiceHelper.loadSingle(id, "tqq9_reggoodstype", "id,name,number"); + scfwelcpfl4 = scfwelcpfl4 + "," + exclunopur.getString("name"); + } + if(StringUtils.isNotBlank(scfwelcpfl4)){ + scfwelcpfl4 = scfwelcpfl4.substring(1); + } + String barq = null; + Date tqq9_datefield4 = bill.getDate("tqq9_datefield4"); + if(tqq9_datefield4 != null){ + barq = sdf.format(tqq9_datefield4); + } + String yljgmc = bill.getString("tqq9_textfield29"); + String dz5 = bill.getString("tqq9_textfield30"); + String djh5 = bill.getString("tqq9_textfield31"); + String fddbr5 = bill.getString("tqq9_textfield32"); + String zyfzr5 = bill.getString("tqq9_zyfzr"); + String zlxm5 = bill.getString("tqq9_textfield12"); + String qsrq5 = null; + Date tqq9_datefield6 = bill.getDate("tqq9_datefield6"); + if(tqq9_datefield6 != null){ + qsrq5 = sdf.format(tqq9_datefield6); + } + String sxrq5 = null; + Date tqq9_datefield22 = bill.getDate("tqq9_datefield22"); + if(tqq9_datefield22 != null){ + sxrq5 = sdf.format(tqq9_datefield22); + } + String xkzh = bill.getString("tqq9_textxkzh"); + String xkzbfrq = null; + Date tqq9_licensestartdate = bill.getDate("tqq9_licensestartdate"); + if(tqq9_licensestartdate != null){ + xkzbfrq = sdf.format(tqq9_licensestartdate); + } + String xkzjzrq = null; + Date tqq9_licenseenddate = bill.getDate("tqq9_licenseenddate"); + if(tqq9_licenseenddate != null){ + xkzjzrq = sdf.format(tqq9_licenseenddate); + } + int syyxts = bill.getInt("tqq9_integerfield"); + String qymc6 = bill.getString("tqq9_qymc"); + String zlbzxyyxqz = null; + Date tqq9_zlbzxyyxqz = bill.getDate("tqq9_zlbzxyyxqz"); + if(tqq9_zlbzxyyxqz != null){ + xkzjzrq = sdf.format(tqq9_zlbzxyyxqz); + } + int syyxts5 = bill.getInt("tqq9_validdays_zlbz"); + String ryxm = bill.getString("tqq9_ryxm"); + String sfzh = bill.getString("tqq9_sfz"); + String qyrq6 = null; + Date tqq9_qyrq = bill.getDate("tqq9_qyrq"); + if(tqq9_qyrq != null){ + qyrq6 = sdf.format(tqq9_qyrq); + } + String tyrq6 = null; + Date tqq9_datefield7 = bill.getDate("tqq9_datefield7"); + if(tqq9_datefield7 != null){ + tyrq6 = sdf.format(tqq9_datefield7); + } + String sqcpx = bill.getString("tqq9_textfield37"); + String sqqy = bill.getString("tqq9_textfield41"); + String lxdh = bill.getString("tqq9_textfield42"); + int syyxts6 = bill.getInt("tqq9_validdays_frsq"); + + //联系人明细 + JSONObject detail1 = new JSONObject(); + JSONArray recordsArr1 = new JSONArray(); + DynamicObjectCollection entry_linkman = bill.getDynamicObjectCollection("entry_linkman"); + for (DynamicObject linkman : entry_linkman) { + String xxdz = linkman.getString("tqq9_textfield_xxdz"); + String lxr = linkman.getString("contactperson"); + String sj = linkman.getString("mobile"); + String dh = linkman.getString("phone"); + String yx = linkman.getString("email"); + int sfmr = 1; + boolean isdefault_linkman = linkman.getBoolean("isdefault_linkman"); + if(isdefault_linkman){ + sfmr = 0; + } + + + JSONObject e1 = new JSONObject(); + e1.put("fieldName", "xxdz"); + e1.put("fieldValue", xxdz); + JSONObject e2 = new JSONObject(); + e2.put("fieldName", "lxr"); + e2.put("fieldValue", lxr); + JSONObject e3 = new JSONObject(); + e3.put("fieldName", "sj"); + e3.put("fieldValue", sj); + JSONObject e4 = new JSONObject(); + e4.put("fieldName", "dh"); + e4.put("fieldValue", dh); + JSONObject e5 = new JSONObject(); + e5.put("fieldName", "yx"); + e5.put("fieldValue", yx); + JSONObject e6 = new JSONObject(); + e6.put("fieldName", "sfmr"); + e6.put("fieldValue", sfmr); + + List elist = Arrays.asList(e1,e2,e3,e4,e5,e6); + JSONArray recordsArr = new JSONArray(); + recordsArr.addAll(elist); + + JSONObject recordObj = new JSONObject(); + recordObj.put("recordOrder", 0); + recordObj.put("workflowRequestTableFields", recordsArr); + + recordsArr1.add(recordObj); + } + detail1.put("tableDBName", "formtable_main_103_dt1"); + detail1.put("workflowRequestTableRecords", recordsArr1); + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ + detail1.put("deleteAll", "1"); + } + + + //银行明细 + JSONObject detail12 = new JSONObject(); + JSONArray recordsArr2 = new JSONArray(); + DynamicObjectCollection entry_bank = bill.getDynamicObjectCollection("entry_bank"); + for (DynamicObject bank : entry_bank) { + String skfmc = bank.getString("accountname"); + String khyh = bank.getString("bank"); + String yhzh = bank.getString("bankaccount"); + int sfmr = 1; + boolean isdefault_bank = bank.getBoolean("isdefault_bank"); + if(isdefault_bank){ + sfmr = 0; + } + String bze = null; + DynamicObject currency = bank.getDynamicObject("currency"); + if(currency != null){ + bze = currency.getString("number"); + } + + JSONObject p1 = new JSONObject(); + p1.put("fieldName", "skfmc"); + p1.put("fieldValue", skfmc); + JSONObject p2 = new JSONObject(); + p2.put("fieldName", "khyh"); + p2.put("fieldValue", khyh); + JSONObject p3 = new JSONObject(); + p3.put("fieldName", "yhzh"); + p3.put("fieldValue", yhzh); + JSONObject p4 = new JSONObject(); + p4.put("fieldName", "sfmr"); + p4.put("fieldValue", sfmr); + JSONObject p5 = new JSONObject(); + p5.put("fieldName", "bz"); + p5.put("fieldValue", bz); + + List plist = Arrays.asList(p1,p2,p3,p4,p5); + JSONArray recordsArr = new JSONArray(); + recordsArr.addAll(plist); + JSONObject recordObj = new JSONObject(); + recordObj.put("recordOrder", 0); + recordObj.put("workflowRequestTableFields", recordsArr); + recordsArr2.add(recordObj); + } + detail12.put("tableDBName", "formtable_main_103_dt2"); + detail12.put("workflowRequestTableRecords", recordsArr2); + if(StringUtils.isNotBlank(tqq9_fwrequestid)){ + detail12.put("deleteAll", "1"); + } + JSONArray detailRootArr = new JSONArray(); + detailRootArr.add(detail1); + detailRootArr.add(detail12); + + //构建主表数据 + JSONObject m1 = new JSONObject(); + m1.put("fieldName", "KDBillType"); + m1.put("fieldValue", "bd_supplier"); + JSONObject m2 = new JSONObject(); + m2.put("fieldName", "lcbh"); + m2.put("fieldValue", gysbh); + JSONObject m3 = new JSONObject(); + m3.put("fieldName", "cjr"); + m3.put("fieldValue", cjr); + JSONObject m4 = new JSONObject(); + m4.put("fieldName", "cjbm"); + m4.put("fieldValue", cjbm); + JSONObject m5 = new JSONObject(); + m5.put("fieldName", "cjsj"); + m5.put("fieldValue", cjsj); + JSONObject m6 = new JSONObject(); + m6.put("fieldName", "ywgz"); + m6.put("fieldValue", ywgz); + JSONObject m7 = new JSONObject(); + m7.put("fieldName", "gysbh"); + m7.put("fieldValue", gysbh); + JSONObject m8 = new JSONObject(); + m8.put("fieldName", "gysmc"); + m8.put("fieldValue", gysmc); + JSONObject m9 = new JSONObject(); + m9.put("fieldName", "gysfl"); + m9.put("fieldValue", gysfl); + JSONObject m10 = new JSONObject(); + m10.put("fieldName", "cjlx"); + m10.put("fieldValue", cjlx); + JSONObject m11 = new JSONObject(); + m11.put("fieldName", "sfnbgys"); + m11.put("fieldValue", sfnbgys); + JSONObject m12 = new JSONObject(); + m12.put("fieldName", "nbywdy"); + m12.put("fieldValue", nbywdy); + JSONObject m13 = new JSONObject(); + m13.put("fieldName", "sfylqx"); + m13.put("fieldValue", sfylqx); + JSONObject m14 = new JSONObject(); + m14.put("fieldName", "oazt"); + m14.put("fieldValue", 0); + JSONObject m15 = new JSONObject(); + m15.put("fieldName", "sfcggys"); + m15.put("fieldValue", sfcggys); + JSONObject m16 = new JSONObject(); + m16.put("fieldName", "gysqyzz"); + m16.put("fieldValue", gysqyzz); + JSONObject m17 = new JSONObject(); + m17.put("fieldName", "zzsyzxyxts"); + m17.put("fieldValue", zzsyzxyxts); + JSONObject m18 = new JSONObject(); + m18.put("fieldName", "sfyyyzz"); + m18.put("fieldValue", sfyyyzz); + JSONObject m19 = new JSONObject(); + m19.put("fieldName", "sfyylqxscxkz"); + m19.put("fieldValue", sfyylqxscxkz); + JSONObject m20 = new JSONObject(); + m20.put("fieldName", "sfyylqxjyxkz"); + m20.put("fieldValue", sfyylqxjyxkz); + JSONObject m21 = new JSONObject(); + m21.put("fieldName", "sfydelylqxjybapz"); + m21.put("fieldValue", sfydelylqxjybapz); + JSONObject m22 = new JSONObject(); + m22.put("fieldName", "sfyyljgzhxkz"); + m22.put("fieldValue", sfyyljgzhxkz); + JSONObject m23 = new JSONObject(); + m23.put("fieldName", "sfyhzpxkz"); + m23.put("fieldValue", sfyhzpxkz); + JSONObject m24 = new JSONObject(); + m24.put("fieldName", "sfyzlbzs"); + m24.put("fieldValue", sfyzlbzs); + JSONObject m25 = new JSONObject(); + m25.put("fieldName", "sfyfrwtsqs"); + m25.put("fieldValue", sfyfrwtsqs); + JSONObject m27 = new JSONObject(); + m27.put("fieldName", "bz"); + m27.put("fieldValue", bz); + JSONObject m29 = new JSONObject(); + m29.put("fieldName", "tyshxydm"); + m29.put("fieldValue", tyshxydm); + JSONObject m30 = new JSONObject(); + m30.put("fieldName", "yyzzbh"); + m30.put("fieldValue", yyzzbh); + + JSONObject m40 = new JSONObject(); + m40.put("fieldName", "fddbr"); + m40.put("fieldValue", fddbr); + JSONObject m41 = new JSONObject(); + m41.put("fieldName", "clrq"); + m41.put("fieldValue", clrq); + JSONObject m42 = new JSONObject(); + m42.put("fieldName", "qsrq"); + m42.put("fieldValue", qsrq); + JSONObject m43 = new JSONObject(); + m43.put("fieldName", "sxrq"); + m43.put("fieldValue", sxrq); + JSONObject m44 = new JSONObject(); + m44.put("fieldName", "zczb"); + m44.put("fieldValue", zczb); + JSONObject m45 = new JSONObject(); + m45.put("fieldName", "zs"); + m45.put("fieldValue", zs); + JSONObject m46 = new JSONObject(); + m46.put("fieldName", "ylxs"); + m46.put("fieldValue", ylxs); + JSONObject m47 = new JSONObject(); + m47.put("fieldName", "ylqxscxkzbh"); + m47.put("fieldValue", ylqxscxkzbh); + JSONObject m48 = new JSONObject(); + m48.put("fieldName", "qymc2"); + m48.put("fieldValue", qymc2); + JSONObject m49 = new JSONObject(); + m49.put("fieldName", "fddbr2"); + m49.put("fieldValue", fddbr2); + JSONObject m50 = new JSONObject(); + m50.put("fieldName", "qyfzr2"); + m50.put("fieldValue", qyfzr2); + JSONObject m51 = new JSONObject(); + m51.put("fieldName", "zs2"); + m51.put("fieldValue", zs2); + JSONObject m52 = new JSONObject(); + m52.put("fieldName", "scdz2"); + m52.put("fieldValue", scdz2); + JSONObject m53 = new JSONObject(); + m53.put("fieldName", "qsrq2"); + m53.put("fieldValue", qsrq2); + JSONObject m54 = new JSONObject(); + m54.put("fieldName", "sxrq2"); + m54.put("fieldValue", sxrq2); + JSONObject m55 = new JSONObject(); + m55.put("fieldName", "scfwelcpfl"); + m55.put("fieldValue", scfwelcpfl); + JSONObject m56 = new JSONObject(); + m56.put("fieldName", "scfwslcpfl"); + m56.put("fieldValue", scfwslcpfl); + JSONObject m57 = new JSONObject(); + m57.put("fieldName", "ylqxjyxkzbh"); + m57.put("fieldValue", ylqxjyxkzbh); + JSONObject m58 = new JSONObject(); + m58.put("fieldName", "qymc3"); + m58.put("fieldValue", qymc3); + JSONObject m59 = new JSONObject(); + m59.put("fieldName", "jyfs"); + m59.put("fieldValue", jyfs); + JSONObject m60 = new JSONObject(); + m60.put("fieldName", "zs3"); + m60.put("fieldValue", zs3); + JSONObject m61 = new JSONObject(); + m61.put("fieldName", "jycs3"); + m61.put("fieldValue", jycs3); + JSONObject m62 = new JSONObject(); + m62.put("fieldName", "kfdz3"); + m62.put("fieldValue", kfdz3); + JSONObject m63 = new JSONObject(); + m63.put("fieldName", "fddbr111"); + m63.put("fieldValue", fddbr111); + JSONObject m64 = new JSONObject(); + m64.put("fieldName", "qyfzr111"); + m64.put("fieldValue", qyfzr111); + JSONObject m65 = new JSONObject(); + m65.put("fieldName", "qsrq111"); + m65.put("fieldValue", qsrq111); + JSONObject m66 = new JSONObject(); + m66.put("fieldName", "sxrq111"); + m66.put("fieldValue", sxrq111); + JSONObject m67 = new JSONObject(); + m67.put("fieldName", "scfwslcpfl111"); + m67.put("fieldValue", scfwslcpfl111); + JSONObject m68 = new JSONObject(); + m68.put("fieldName", "delylqxjybah"); + m68.put("fieldValue", delylqxjybah); + JSONObject m69 = new JSONObject(); + m69.put("fieldName", "qymc4"); + m69.put("fieldValue", qymc4); + JSONObject m70 = new JSONObject(); + m70.put("fieldName", "jyfs4"); + m70.put("fieldValue", jyfs4); + JSONObject m71 = new JSONObject(); + m71.put("fieldName", "zs4"); + m71.put("fieldValue", zs4); + JSONObject m72 = new JSONObject(); + m72.put("fieldName", "jycs4"); + m72.put("fieldValue", jycs4); + JSONObject m73 = new JSONObject(); + m73.put("fieldName", "kfdz4"); + m73.put("fieldValue", kfdz4); + JSONObject m74 = new JSONObject(); + m74.put("fieldName", "fddbr4"); + m74.put("fieldValue", fddbr4); + JSONObject m75 = new JSONObject(); + m75.put("fieldName", "qyfzr4"); + m75.put("fieldValue", qyfzr4); + JSONObject m76 = new JSONObject(); + m76.put("fieldName", "scfwelcpfl4"); + m76.put("fieldValue", scfwelcpfl4); + JSONObject m77 = new JSONObject(); + m77.put("fieldName", "barq"); + m77.put("fieldValue", barq); + JSONObject m78 = new JSONObject(); + m78.put("fieldName", "yljgmc"); + m78.put("fieldValue", yljgmc); + JSONObject m79 = new JSONObject(); + m79.put("fieldName", "dz5"); + m79.put("fieldValue", dz5); + JSONObject m80 = new JSONObject(); + m80.put("fieldName", "djh5"); + m80.put("fieldValue", djh5); + JSONObject m81 = new JSONObject(); + m81.put("fieldName", "fddbr5"); + m81.put("fieldValue", fddbr5); + JSONObject m82 = new JSONObject(); + m82.put("fieldName", "zyfzr5"); + m82.put("fieldValue", zyfzr5); + JSONObject m83 = new JSONObject(); + m83.put("fieldName", "zlxm5"); + m83.put("fieldValue", zlxm5); + JSONObject m84 = new JSONObject(); + m84.put("fieldName", "qsrq5"); + m84.put("fieldValue", qsrq5); + JSONObject m85 = new JSONObject(); + m85.put("fieldName", "sxrq5"); + m85.put("fieldValue", sxrq5); + JSONObject m89 = new JSONObject(); + m89.put("fieldName", "xkzh"); + m89.put("fieldValue", xkzh); + JSONObject m90 = new JSONObject(); + m90.put("fieldName", "xkzbfrq"); + m90.put("fieldValue", xkzbfrq); + JSONObject m91 = new JSONObject(); + m91.put("fieldName", "xkzjzrq"); + m91.put("fieldValue", xkzjzrq); + JSONObject m92 = new JSONObject(); + m92.put("fieldName", "syyxts"); + m92.put("fieldValue", syyxts); + JSONObject m93 = new JSONObject(); + m93.put("fieldName", "qymc6"); + m93.put("fieldValue", qymc6); + JSONObject m94 = new JSONObject(); + m94.put("fieldName", "zlbzxyyxqz"); + m94.put("fieldValue", zlbzxyyxqz); + JSONObject m95 = new JSONObject(); + m95.put("fieldName", "syyxts5"); + m95.put("fieldValue", syyxts5); + JSONObject m96 = new JSONObject(); + m96.put("fieldName", "ryxm"); + m96.put("fieldValue", ryxm); + JSONObject m97 = new JSONObject(); + m97.put("fieldName", "sfzh"); + m97.put("fieldValue", sfzh); + JSONObject m98 = new JSONObject(); + m98.put("fieldName", "qyrq6"); + m98.put("fieldValue", qyrq6); + JSONObject m99 = new JSONObject(); + m99.put("fieldName", "tyrq6"); + m99.put("fieldValue", tyrq6); + JSONObject m100 = new JSONObject(); + m100.put("fieldName", "sqcpx"); + m100.put("fieldValue", sqcpx); + JSONObject m101 = new JSONObject(); + m101.put("fieldName", "sqqy"); + m101.put("fieldValue", sqqy); + JSONObject m102 = new JSONObject(); + m102.put("fieldName", "lxdh"); + m102.put("fieldValue", lxdh); + JSONObject m103 = new JSONObject(); + m103.put("fieldName", "syyxts6"); + m103.put("fieldValue", syyxts6); + + List mlist = new ArrayList<>(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,m27,m29,m30,m40,m41,m42,m43,m44,m45,m46,m47,m48,m49,m50,m51,m52, + m53,m54,m55,m56,m57,m58,m59,m60,m61,m62,m63,m64,m65,m66,m67,m68,m69,m70,m71,m72,m73,m74,m75,m76,m77, + m78,m79,m80,m81,m82,m83,m84,m85,m89,m90, + m91,m92,m93,m94,m95,m96,m97,m98,m99,m100,m101,m102,m103)); + // 附件 + List fjList = new ArrayList<>(); + List> attachments = AttachmentServiceHelper.getAttachments("bd_supplier", bill.getPkValue(), "tqq9_attachmentpanelap"); + for (Map attachment : attachments) { + String filePath = (String) attachment.get("url"); + String fileName = (String) attachment.get("name"); + byte[] bytes = HttpUtil.downloadBytes(filePath); + String str = "base64:" + cn.hutool.core.codec.Base64.encode(bytes); + JSONObject fj = new JSONObject(); + fj.put("filePath", str); + fj.put("fileName", fileName); + fjList.add(fj); + } + + if(fjList.size() > 0){ + JSONObject fjObj = new JSONObject(); + fjObj.put("fieldName", "htfj"); + fjObj.put("fieldValue", fjList); + mlist.add(fjObj); + } + // TODO 企业名称、企业类型 + JSONArray mainArr = new JSONArray(); + mainArr.addAll(mlist); + + String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_GYS"); + //如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口 + FWRestfulUtils fwRestfulUtils = new FWRestfulUtils(); + return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "新增供应商流程", fw_wfid_xzcgdd, gysbh, tqq9_fwrequestid); + } }