From 574c49ba484bc5c20427fb2be1b1fe2a4fa3af13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E8=B1=86=E8=B1=86?= <13356128+sunandmoon60@user.noreply.gitee.com> Date: Sat, 25 Oct 2025 17:34:05 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B3=A8=E5=86=8C=E8=AF=81=E5=B8=A6=E5=87=BA?= =?UTF-8?q?=E8=AE=B8=E5=8F=AF=E8=AF=81=E5=8F=B7=E6=89=A9=E5=B1=95=202.?= =?UTF-8?q?=E4=BB=98=E6=AC=BE=E5=8D=95=E4=BD=BF=E7=94=A8=E8=BF=94=E5=88=A9?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/plugin/form/pm/BaseDataPlugin.java | 2 +- .../operate/im/ShortageBillSubmitToFwOp.java | 42 + lc123/cloud/app/plugin/trd/FWImpl.java | 868 +++++++++++------- 3 files changed, 590 insertions(+), 322 deletions(-) create mode 100644 lc123/cloud/app/plugin/operate/im/ShortageBillSubmitToFwOp.java diff --git a/lc123/cloud/app/plugin/form/pm/BaseDataPlugin.java b/lc123/cloud/app/plugin/form/pm/BaseDataPlugin.java index 7ea6a32..8d7e907 100644 --- a/lc123/cloud/app/plugin/form/pm/BaseDataPlugin.java +++ b/lc123/cloud/app/plugin/form/pm/BaseDataPlugin.java @@ -68,7 +68,7 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin { } } } - if (StringUtils.equals("tqq9_zczh", key)) { + if (StringUtils.equals("tqq9_zczh", key)) { StringBuilder stringBuilder = new StringBuilder(); ChangeData[] changeSet = e.getChangeSet(); ChangeData changeData = changeSet[0]; diff --git a/lc123/cloud/app/plugin/operate/im/ShortageBillSubmitToFwOp.java b/lc123/cloud/app/plugin/operate/im/ShortageBillSubmitToFwOp.java new file mode 100644 index 0000000..b27f9b9 --- /dev/null +++ b/lc123/cloud/app/plugin/operate/im/ShortageBillSubmitToFwOp.java @@ -0,0 +1,42 @@ +package tqq9.lc123.cloud.app.plugin.operate.im; + +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 kd.sdk.plugin.Plugin; +import org.apache.commons.lang3.StringUtils; +import tqq9.lc123.cloud.app.plugin.trd.FWImpl; + +import java.util.List; + +/** + * 单据操作插件 + */ +public class ShortageBillSubmitToFwOp extends AbstractOperationServicePlugIn implements Plugin { + 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, "tqq9_shortagebill"); + String resultStr = FWImpl.pushFwshortage(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}); + } + } + } + } + } + +} \ No newline at end of file diff --git a/lc123/cloud/app/plugin/trd/FWImpl.java b/lc123/cloud/app/plugin/trd/FWImpl.java index a4b916a..a198978 100644 --- a/lc123/cloud/app/plugin/trd/FWImpl.java +++ b/lc123/cloud/app/plugin/trd/FWImpl.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.AttachmentServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper; @@ -33,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"); } @@ -65,22 +66,22 @@ public class FWImpl { /** * 采购订单推送泛微 */ - public static String pushFwPurorder(DynamicObject pm_purorderbill){ + public static String pushFwPurorder(DynamicObject pm_purorderbill) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 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){ + 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){ + if (tqq9_dept != null) { String deptNumber = tqq9_dept.getString("number"); String fwOrgNumber = FWUtils.getFwOrgNumberByKdOrgNumber(deptNumber); - if(StringUtils.isNotBlank(fwOrgNumber)){ + if (StringUtils.isNotBlank(fwOrgNumber)) { cjbm = fwOrgNumber; } } @@ -88,10 +89,10 @@ public class FWImpl { String cjrq = sdf.format(createtime);//cjrq DynamicObject org = pm_purorderbill.getDynamicObject("org");//ywgz String ywgz = "4"; - if(org != null){ + if (org != null) { String orgNumber = org.getString("number"); String fwOrgNumber = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber); - if(StringUtils.isNotBlank(fwOrgNumber)){ + if (StringUtils.isNotBlank(fwOrgNumber)) { ywgz = fwOrgNumber; } } @@ -99,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 @@ -214,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"); @@ -239,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"); @@ -285,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); @@ -300,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); @@ -317,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"); } @@ -328,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 @@ -338,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 @@ -359,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); @@ -379,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(); @@ -389,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(); @@ -485,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"); @@ -508,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); } @@ -522,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"); } @@ -572,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"); } @@ -595,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"); } @@ -618,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"); @@ -631,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; } @@ -663,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); @@ -675,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(); @@ -761,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(); @@ -774,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(); @@ -812,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); } @@ -826,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"); } @@ -876,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"); } @@ -909,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; @@ -926,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"); @@ -943,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"); @@ -996,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); @@ -1007,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(); @@ -1093,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(); @@ -1138,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(); @@ -1161,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(); @@ -1199,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"); @@ -1208,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); } @@ -1220,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"); @@ -1229,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; @@ -1245,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; } } @@ -1279,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"); } @@ -1290,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; } } @@ -1326,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); @@ -1354,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(); @@ -1399,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); @@ -1423,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"); @@ -1469,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); @@ -1488,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"); @@ -1498,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); } @@ -1510,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"); @@ -1606,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"); @@ -1625,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"); @@ -1651,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; } @@ -1669,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); @@ -1711,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); @@ -1731,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"); } @@ -1743,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 = "采购订单"; } @@ -1779,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); @@ -1791,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"); @@ -1802,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(); @@ -1812,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(); @@ -1865,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); @@ -1915,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"); @@ -1930,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"); @@ -1939,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); } @@ -1952,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"); @@ -1974,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"); } @@ -1990,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"); @@ -2021,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); @@ -2043,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(); @@ -2082,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); @@ -2102,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"); @@ -2117,10 +2118,11 @@ 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"); @@ -2129,7 +2131,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); } @@ -2142,21 +2144,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"); @@ -2166,18 +2168,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"); @@ -2188,7 +2190,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); } @@ -2196,7 +2198,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"); @@ -2204,12 +2206,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"); } @@ -2218,13 +2220,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"); @@ -2240,7 +2242,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 = ""; @@ -2250,7 +2252,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 = ""; @@ -2260,7 +2262,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 = ""; @@ -2270,7 +2272,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 = ""; @@ -2280,67 +2282,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"); @@ -2354,7 +2356,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(); @@ -2371,10 +2373,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); @@ -2407,19 +2409,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); @@ -2434,22 +2436,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); @@ -2460,7 +2462,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(); @@ -2537,8 +2539,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); @@ -2553,10 +2555,11 @@ 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"); @@ -3170,4 +3173,227 @@ public class FWImpl { //如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口 return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "采购费用申请流程", fw_wfid_zgyfd, billno, tqq9_fwrequestid); } + + /** + * 短缺处理推送泛微 + */ + public static String pushFwshortage(DynamicObject bill) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");//泛微流程ID + String billno = bill.getString("billno"); + DynamicObject creator = bill.getDynamicObject("creator"); + creator = BusinessDataServiceHelper.loadSingle(creator.getPkValue(), "bos_user", "tqq9_fwuserid,id,number"); + //创建人 + String cjr = creator.getString("tqq9_fwuserid"); + //创建部门 + String cjbm = null; + DynamicObject tqq9_dept = bill.getDynamicObject("tqq9_dept"); + if (tqq9_dept != null) { + String number = tqq9_dept.getString("number"); + cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); + } + Date createtime = bill.getDate("createtime"); + //创建时间 + String cjsj = sdf.format(createtime); + DynamicObject org = bill.getDynamicObject("org"); + String orgNumber = org.getString("number"); + //业务归属 + String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber); + //业务类型 + int ywlx = 0; + //库存组织 + String kczz = ywgz; + //入库日期 + Date biztime = bill.getDate("biztime"); + String rkrq = sdf.format(biztime); + //供应商 + DynamicObject tqq9_supplier = bill.getDynamicObject("tqq9_supplier"); + String gys = null; + if (tqq9_supplier != null) { + gys = tqq9_supplier.getString("number"); + } + //单据状态 + int djzt = 0; + + //税额 + BigDecimal se = bill.getBigDecimal("tqq9_hzse"); + //价税合计 + BigDecimal jshj = bill.getBigDecimal("tqq9_hzjshj"); + + + JSONObject detail1 = new JSONObject(); + JSONArray recordsArr1 = new JSONArray(); + DynamicObjectCollection entries = bill.getDynamicObjectCollection("billentry"); + for (DynamicObject entry : entries) { + //规格型号 + String ggxh = null; + //品牌 + String pp = null; + DynamicObject material = entry.getDynamicObject("material"); + DynamicObject bd_material = BusinessDataServiceHelper.loadSingle("bd_material", new QFilter[]{new QFilter("id", QCP.equals, material.getLong("masterid.id"))}); + if (bd_material != null) { + ggxh = bd_material.getString("modelnum"); + pp = bd_material.getString("tqq9_brand.name"); + + } + //计量单位 + String jldw = null; + DynamicObject unit = entry.getDynamicObject("unit"); + if (unit != null) { + jldw = unit.getString("name"); + } + //批号 + String ph = entry.getString("lotnumber"); + //生产日期 + Date producedate = entry.getDate("producedate"); + String scrq = sdf.format(producedate); + //短缺数量 + BigDecimal dqsl = entry.getBigDecimal("qty"); + //短缺承担方 + String dqcdf = entry.getString("tqq9_combofield"); + //短缺原因 + String dqyy = entry.getString("tqq9_shortagereason"); + //责任承担方名称 + String zrcdfmc = null; + DynamicObject tqq9_asstact = entry.getDynamicObject("tqq9_asstact"); + if (tqq9_asstact != null) { + zrcdfmc = tqq9_asstact.getString("name"); + } + //税率 + BigDecimal sl = entry.getBigDecimal("tqq9_taxrateid.taxrate"); + //含税单价 + BigDecimal hsdj = entry.getBigDecimal("tqq9_priceandtax"); + //价税合计 + BigDecimal jshj_e = entry.getBigDecimal("tqq9_amountandtax"); + //来源单据编号 + String lydjbh = entry.getString("srcbillnumber"); + //物料编码 + String wlbm = bd_material.getString("number"); + //物料名称 + String wlmc = bd_material.getString("name"); + //责任承担方 + int zrcdf = 0; + String tqq9_asstacttype = entry.getString("tqq9_asstacttype"); + if (StringUtils.equals("bos_user", tqq9_asstacttype)){ + zrcdf = 1; + } + + + JSONObject e1 = new JSONObject(); + e1.put("fieldName", "ggxh"); + e1.put("fieldValue", ggxh); + JSONObject e2 = new JSONObject(); + e2.put("fieldName", "pp"); + e2.put("fieldValue", pp); + JSONObject e3 = new JSONObject(); + e3.put("fieldName", "jldw"); + e3.put("fieldValue", jldw); + JSONObject e4 = new JSONObject(); + e4.put("fieldName", "ph"); + e4.put("fieldValue", ph); + JSONObject e5 = new JSONObject(); + e5.put("fieldName", "scrq"); + e5.put("fieldValue", scrq); + JSONObject e6 = new JSONObject(); + e6.put("fieldName", "dqsl"); + e6.put("fieldValue", dqsl == null || dqsl.compareTo(BigDecimal.ZERO) == 0 ? 0 : dqsl); + JSONObject e7 = new JSONObject(); + e7.put("fieldName", "dqcdf"); + e7.put("fieldValue", dqcdf); + JSONObject e8 = new JSONObject(); + e8.put("fieldName", "dqyy"); + e8.put("fieldValue", dqyy); + JSONObject e9 = new JSONObject(); + e9.put("fieldName", "zrcdfmc"); + e9.put("fieldValue", zrcdfmc); + JSONObject e10 = new JSONObject(); + e10.put("fieldName", "sl"); + e10.put("fieldValue", sl == null || sl.compareTo(BigDecimal.ZERO) == 0 ? 0 : sl); + JSONObject e11 = new JSONObject(); + e11.put("fieldName", "hsdj"); + e11.put("fieldValue", hsdj == null || hsdj.compareTo(BigDecimal.ZERO) == 0 ? 0 : hsdj); + JSONObject e12 = new JSONObject(); + e12.put("fieldName", "jshj"); + e12.put("fieldValue", jshj_e == null || jshj_e.compareTo(BigDecimal.ZERO) == 0 ? 0 : jshj_e); + JSONObject e13 = new JSONObject(); + e13.put("fieldName", "lydjbh"); + e13.put("fieldValue", lydjbh); + JSONObject e14 = new JSONObject(); + e14.put("fieldName", "wlbm"); + e14.put("fieldValue", wlbm); + JSONObject e15 = new JSONObject(); + e15.put("fieldName", "wlmc"); + e15.put("fieldValue", wlbm); + JSONObject e16 = new JSONObject(); + e16.put("fieldName", "zrcdf"); + e16.put("fieldValue", zrcdf); + + List elist = Arrays.asList(e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16); + 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_106_dt1"); + detail1.put("workflowRequestTableRecords", recordsArr1); + if (StringUtils.isNotBlank(tqq9_fwrequestid)) { + detail1.put("deleteAll", "1"); + } + JSONArray detailRootArr = new JSONArray(); + detailRootArr.add(detail1); + + //构建主表数据 + JSONObject m1 = new JSONObject(); + m1.put("fieldName", "KDBillType"); + m1.put("fieldValue", "tqq9_shortagebill"); + JSONObject m2 = new JSONObject(); + m2.put("fieldName", "lcbh"); + m2.put("fieldValue", billno); + 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", "ywlx"); + m7.put("fieldValue", ywlx); + JSONObject m8 = new JSONObject(); + m8.put("fieldName", "kczz"); + m8.put("fieldValue", kczz); + JSONObject m9 = new JSONObject(); + m9.put("fieldName", "rkrq"); + m9.put("fieldValue", rkrq); + JSONObject m10 = new JSONObject(); + m10.put("fieldName", "gys"); + m10.put("fieldValue", gys); + JSONObject m11 = new JSONObject(); + m11.put("fieldName", "djzt"); + m11.put("fieldValue", djzt); + JSONObject m12 = new JSONObject(); + m12.put("fieldName", "se"); + m12.put("fieldValue", se == null || se.compareTo(BigDecimal.ZERO) == 0 ? 0 : se); + JSONObject m13 = new JSONObject(); + m13.put("fieldName", "jshj"); + m13.put("fieldValue", jshj == null || jshj.compareTo(BigDecimal.ZERO) == 0 ? 0 : jshj); + + List mlist = new ArrayList<>(Arrays.asList(m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13)); + + JSONArray mainArr = new JSONArray(); + mainArr.addAll(mlist); + + String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_CGDQ"); + FWRestfulUtils fwRestfulUtils = new FWRestfulUtils(); + //如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口 + return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "短缺处理单流程", fw_wfid_xzcgdd, billno, tqq9_fwrequestid); + } }