【泛微接口】实现类修改
This commit is contained in:
parent
3b6454d5fb
commit
848e51c5f8
|
|
@ -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.QFilter;
|
||||
import kd.bos.servicehelper.AttachmentServiceHelper;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -1506,7 +1507,6 @@ public class FWImpl {
|
|||
DynamicObject org = bill.getDynamicObject("org");
|
||||
String orgnumber = org.getString("number");
|
||||
String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgnumber);
|
||||
DynamicObject billtype = bill.getDynamicObject("billtype");
|
||||
String cglx = bill.getString("tqq9_cglx");
|
||||
int cgyt = 0;
|
||||
String tqq9_cgyt = bill.getString("tqq9_cgyt");
|
||||
|
|
@ -1927,4 +1927,928 @@ public class FWImpl {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 采购退货申请推送泛微
|
||||
*/
|
||||
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");
|
||||
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 changebizdate = bill.getDate("biztime");
|
||||
String cjrq = sdf.format(changebizdate);
|
||||
DynamicObject org = bill.getDynamicObject("org");
|
||||
String orgnumber = org.getString("number");
|
||||
String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgnumber);
|
||||
String cgddh = bill.getString("tqq9_purorderno");
|
||||
DynamicObject biztype = bill.getDynamicObject("biztype");
|
||||
String biztypenumber = biztype.getString("number");
|
||||
int ywlx = 0;
|
||||
if("1102".equals(biztypenumber)){
|
||||
ywlx = 1;
|
||||
}else if("1104".equals(biztypenumber)){
|
||||
ywlx = 2;
|
||||
}
|
||||
int sfxykhzsqd = 1;
|
||||
boolean tqq9_sfkhp = bill.getBoolean("tqq9_sfkhp");
|
||||
if(tqq9_sfkhp){
|
||||
sfxykhzsqd = 0;
|
||||
}
|
||||
String fplb = null;
|
||||
DynamicObject invoicebiztype = bill.getDynamicObject("invoicebiztype");
|
||||
if(invoicebiztype != null){
|
||||
fplb = invoicebiztype.getString("name");
|
||||
}
|
||||
BigDecimal se = bill.getBigDecimal("totaltaxamount");
|
||||
BigDecimal zkhjshj = bill.getBigDecimal("totalallamount");
|
||||
BigDecimal sjtkje = bill.getBigDecimal("tqq9_stje");
|
||||
String bz = bill.getString("comment");
|
||||
BigDecimal thslhz = bill.getBigDecimal("tqq9_allqty");
|
||||
String dhgys = null;
|
||||
DynamicObject supplier = bill.getDynamicObject("supplier");
|
||||
if(supplier != null){
|
||||
dhgys = supplier.getString("number");
|
||||
}
|
||||
|
||||
//明细
|
||||
JSONObject detail1 = new JSONObject();
|
||||
JSONArray recordsArr1 = new JSONArray();
|
||||
DynamicObjectCollection billentries = bill.getDynamicObjectCollection("billentry");
|
||||
for (DynamicObject billentry : billentries) {
|
||||
DynamicObject material = billentry.getDynamicObject("material");//物料采购信息
|
||||
DynamicObject masterid = material.getDynamicObject("masterid");
|
||||
masterid = BusinessDataServiceHelper.loadSingle(masterid.getPkValue(), masterid.getDynamicObjectType().getName());
|
||||
String wlmc = masterid.getString("number");
|
||||
String wlbm = masterid.getString("number");
|
||||
DynamicObject tqq9_brand = billentry.getDynamicObject("tqq9_brand");
|
||||
String pp = null;
|
||||
if(tqq9_brand != null){
|
||||
pp = tqq9_brand.getString("name");
|
||||
}
|
||||
String ggxh = masterid.getString("modelnum");
|
||||
DynamicObject unit = billentry.getDynamicObject("unit");
|
||||
String jldw = null;
|
||||
if(unit != null){
|
||||
jldw = unit.getString("name");
|
||||
}
|
||||
BigDecimal thsl = billentry.getBigDecimal("qty");
|
||||
BigDecimal hsdj = billentry.getBigDecimal("priceandtax");
|
||||
BigDecimal yhzkje = billentry.getBigDecimal("discountamount");
|
||||
BigDecimal zkhjshj_e = billentry.getBigDecimal("amountandtax");
|
||||
|
||||
JSONObject e0 = new JSONObject();
|
||||
e0.put("fieldName", "wlmc");
|
||||
e0.put("fieldValue", wlmc);
|
||||
JSONObject e1 = new JSONObject();
|
||||
e1.put("fieldName", "wlbm");
|
||||
e1.put("fieldValue", wlbm);
|
||||
JSONObject e2 = new JSONObject();
|
||||
e2.put("fieldName", "pp");
|
||||
e2.put("fieldValue", pp);
|
||||
JSONObject e3 = new JSONObject();
|
||||
e3.put("fieldName", "ggxh");
|
||||
e3.put("fieldValue", ggxh);
|
||||
JSONObject e4 = new JSONObject();
|
||||
e4.put("fieldName", "jldw");
|
||||
e4.put("fieldValue", jldw);
|
||||
JSONObject e5 = new JSONObject();
|
||||
e5.put("fieldName", "thsl");
|
||||
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);
|
||||
JSONObject e7 = new JSONObject();
|
||||
e7.put("fieldName", "yhzkje");
|
||||
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);
|
||||
|
||||
List<JSONObject> elist = Arrays.asList(e0,e1,e2,e3,e4,e5,e6,e7,e8);
|
||||
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_99_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", "pm_purrefundapplybill");
|
||||
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", "cjrq");
|
||||
m5.put("fieldValue", cjrq);
|
||||
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", "cgzz");
|
||||
m8.put("fieldValue", ywgz);
|
||||
JSONObject m9 = new JSONObject();
|
||||
m9.put("fieldName", "sfxykhzsqd");
|
||||
m9.put("fieldValue", sfxykhzsqd);
|
||||
JSONObject m10 = new JSONObject();
|
||||
m10.put("fieldName", "fplb");
|
||||
m10.put("fieldValue", fplb);
|
||||
JSONObject m11 = new JSONObject();
|
||||
m11.put("fieldName", "se");
|
||||
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);
|
||||
JSONObject m13 = new JSONObject();
|
||||
m13.put("fieldName", "sjtkje");
|
||||
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);
|
||||
JSONObject m16 = new JSONObject();
|
||||
m16.put("fieldName", "dhgys");
|
||||
m16.put("fieldValue", dhgys);
|
||||
JSONObject m17 = new JSONObject();
|
||||
m17.put("fieldName", "cgddh");
|
||||
m17.put("fieldValue", cgddh);
|
||||
|
||||
List<JSONObject> 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");
|
||||
FWRestfulUtils fwRestfulUtils = new FWRestfulUtils();
|
||||
|
||||
//如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口
|
||||
return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "采购退货申请流程", fw_wfid_xzcgdd, billno, tqq9_fwrequestid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 采购合同推送泛微
|
||||
* @param bill
|
||||
* @return
|
||||
*/
|
||||
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");
|
||||
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 biztime = bill.getDate("biztime");
|
||||
String cjsj = sdf.format(biztime);
|
||||
DynamicObject org = bill.getDynamicObject("org");
|
||||
String orgNumber = org.getString("number");
|
||||
String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber);
|
||||
String htmc = bill.getString("billname");
|
||||
int htlx = 0;
|
||||
DynamicObject type = bill.getDynamicObject("type");
|
||||
String typeNumber = type.getString("number");
|
||||
if("FLHT".equals(typeNumber)){
|
||||
htlx = 1;
|
||||
}else if("KJFLHT".equals(typeNumber)){
|
||||
htlx = 2;
|
||||
}
|
||||
int htmb = 0;
|
||||
String tqq9_htmb = bill.getString("tqq9_htmb");
|
||||
if("FLCMB".equals(tqq9_htmb)){
|
||||
htmb = 1;
|
||||
}
|
||||
int ywms = 0;
|
||||
String bizmode = bill.getString("bizmode");
|
||||
if ("B".equals(bizmode)){
|
||||
ywms = 1;
|
||||
}else if ("C".equals(bizmode)){
|
||||
ywms = 2;
|
||||
}
|
||||
Date biztimebegin = bill.getDate("biztimebegin");
|
||||
String htksrq = sdf.format(biztimebegin);
|
||||
Date biztimeend = bill.getDate("biztimeend");
|
||||
String htjsrq = sdf.format(biztimeend);
|
||||
int htzt = 0;
|
||||
DynamicObject contparties = bill.getDynamicObject("contparties");
|
||||
String contpartiesNumber = contparties.getString("number");
|
||||
if("02".equals(contpartiesNumber)){
|
||||
htzt = 1;
|
||||
}else if("03".equals(contpartiesNumber)){
|
||||
htzt = 2;
|
||||
}
|
||||
int fktj = 0;
|
||||
String tqq9_jsfs = bill.getString("tqq9_jsfs");
|
||||
if("kdfh".equals(tqq9_jsfs)){
|
||||
fktj = 1;
|
||||
}else if("yfhf".equals(tqq9_jsfs)){
|
||||
fktj = 2;
|
||||
}else if("ymjz".equals(tqq9_jsfs)){
|
||||
fktj = 3;
|
||||
}
|
||||
int zq = bill.getInt("tqq9_zq");
|
||||
String pp = "";
|
||||
DynamicObjectCollection tqq9_dxpp = bill.getDynamicObjectCollection("tqq9_dxpp");
|
||||
for (DynamicObject dxpp : tqq9_dxpp) {
|
||||
long id = dxpp.getLong("fbasedataid.id");
|
||||
DynamicObject tqq9_brand = BusinessDataServiceHelper.loadSingle(id, "tqq9_brand", "id,name,number");
|
||||
pp = pp + "," + tqq9_brand.getString("name");
|
||||
}
|
||||
if(StringUtils.isNotBlank(pp)){
|
||||
pp = pp.substring(1);
|
||||
}
|
||||
|
||||
String bz = bill.getString("comment");
|
||||
String dhlxr = null;
|
||||
String dhlxrdh = null;
|
||||
DynamicObject providerlinkman = bill.getDynamicObject("providerlinkman");
|
||||
if(providerlinkman != null){
|
||||
providerlinkman = BusinessDataServiceHelper.loadSingle(providerlinkman.getPkValue(), providerlinkman.getDynamicObjectType().getName());
|
||||
dhlxr = providerlinkman.getString("name");
|
||||
dhlxrdh = providerlinkman.getString("phone");
|
||||
}
|
||||
String dhlxdz = bill.getString("provideraddress");
|
||||
String dhgys = null;
|
||||
DynamicObject supplier = bill.getDynamicObject("supplier");
|
||||
if(supplier != null){
|
||||
dhgys = supplier.getString("number");
|
||||
}
|
||||
String dsf = null;
|
||||
DynamicObject partc = bill.getDynamicObject("partc");
|
||||
if(partc != null){
|
||||
dsf = partc.getString("number");
|
||||
}
|
||||
|
||||
//返利规则
|
||||
JSONObject detail1 = new JSONObject();
|
||||
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});
|
||||
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)){
|
||||
gzlx = 1;
|
||||
}
|
||||
Date tqq9_startdate = rule.getDate("tqq9_startdate");
|
||||
String flkssj = sdf.format(tqq9_startdate);
|
||||
Date tqq9_enddate = rule.getDate("tqq9_enddate");
|
||||
String fljssj = sdf.format(tqq9_enddate);
|
||||
BigDecimal ygbl = rule.getBigDecimal("tqq9_estimatepro");
|
||||
BigDecimal mbcgje = rule.getBigDecimal("tqq9_targetamount");
|
||||
String flpp = "";
|
||||
DynamicObjectCollection tqq9_rebatebrand = rule.getDynamicObjectCollection("tqq9_rebatebrand");
|
||||
for (DynamicObject rebatebrand : tqq9_rebatebrand) {
|
||||
long id = rebatebrand.getLong("fbasedataid.id");
|
||||
DynamicObject tqq9_brand = BusinessDataServiceHelper.loadSingle(id, "tqq9_brand", "id,name,number");
|
||||
flpp = flpp + "," + tqq9_brand.getString("name");
|
||||
}
|
||||
if(StringUtils.isNotBlank(flpp)){
|
||||
flpp = flpp.substring(1);
|
||||
}
|
||||
String flsp = "";
|
||||
DynamicObjectCollection tqq9_rebategoods = rule.getDynamicObjectCollection("tqq9_rebategoods");
|
||||
for (DynamicObject rebategoods : tqq9_rebategoods) {
|
||||
long id = rebategoods.getLong("fbasedataid.id");
|
||||
rebategoods = BusinessDataServiceHelper.loadSingle(id, "bd_material", "id,name,number");
|
||||
flsp = flsp + "," + rebategoods.getString("name");
|
||||
}
|
||||
if(StringUtils.isNotBlank(flsp)){
|
||||
flsp = flsp.substring(1);
|
||||
}
|
||||
String zdcgddbh = "";
|
||||
DynamicObjectCollection tqq9_purchaseorder = rule.getDynamicObjectCollection("tqq9_purchaseorder");
|
||||
for (DynamicObject purchaseorder : tqq9_purchaseorder) {
|
||||
long id = purchaseorder.getLong("fbasedataid.id");
|
||||
purchaseorder = BusinessDataServiceHelper.loadSingle(id, "pm_purorderbill", "id,name,billno");
|
||||
zdcgddbh = zdcgddbh + "," + purchaseorder.getString("billno");
|
||||
}
|
||||
if(StringUtils.isNotBlank(zdcgddbh)){
|
||||
zdcgddbh = zdcgddbh.substring(1);
|
||||
}
|
||||
String pccgddbh = "";
|
||||
DynamicObjectCollection tqq9_exclupur = rule.getDynamicObjectCollection("tqq9_exclupur");
|
||||
for (DynamicObject exclupur : tqq9_exclupur) {
|
||||
long id = exclupur.getLong("fbasedataid.id");
|
||||
exclupur = BusinessDataServiceHelper.loadSingle(id, "pm_purorderbill", "id,name,billno");
|
||||
pccgddbh = pccgddbh + "," + exclupur.getString("billno");
|
||||
}
|
||||
if(StringUtils.isNotBlank(pccgddbh)){
|
||||
pccgddbh = pccgddbh.substring(1);
|
||||
}
|
||||
String pcsjdbpcddbh = "";
|
||||
DynamicObjectCollection tqq9_exclunopur = rule.getDynamicObjectCollection("tqq9_exclunopur");
|
||||
for (DynamicObject exclunopur : tqq9_exclunopur) {
|
||||
long id = exclunopur.getLong("fbasedataid.id");
|
||||
exclunopur = BusinessDataServiceHelper.loadSingle(id, "pm_purorderbill", "id,name,billno");
|
||||
pcsjdbpcddbh = pcsjdbpcddbh + "," + exclunopur.getString("billno");
|
||||
}
|
||||
if(StringUtils.isNotBlank(pcsjdbpcddbh)){
|
||||
pcsjdbpcddbh = pcsjdbpcddbh.substring(1);
|
||||
}
|
||||
int pchjs = 1;
|
||||
boolean tqq9_excludnum = rule.getBoolean("tqq9_excludnum");
|
||||
if (tqq9_excludnum){
|
||||
pchjs = 0;
|
||||
}
|
||||
String pckssj = null;
|
||||
Date tqq9_startexcludate = rule.getDate("tqq9_startexcludate");
|
||||
if(tqq9_startexcludate != null){
|
||||
pckssj = sdf.format(tqq9_startexcludate);
|
||||
}
|
||||
String pcjssj = null;
|
||||
Date tqq9_endexcludate = rule.getDate("tqq9_endexcludate");
|
||||
if(tqq9_endexcludate != null){
|
||||
pcjssj = sdf.format(tqq9_endexcludate);
|
||||
}
|
||||
int flzt = 0;
|
||||
String tqq9_rebatesub = rule.getString("tqq9_rebatesub");
|
||||
if ("1".equals(tqq9_rebatesub)){
|
||||
flzt = 1;
|
||||
}
|
||||
int gzlc = 1;
|
||||
boolean tqq9_guangzhoulici = rule.getBoolean("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){
|
||||
shlc = 0;
|
||||
}
|
||||
BigDecimal shlcbl = rule.getBigDecimal("tqq9_shlcbl");
|
||||
int bjlc = 1;
|
||||
boolean tqq9_beijinglichi = rule.getBoolean("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){
|
||||
sfhs = 0;
|
||||
}
|
||||
int fljstl = 0;
|
||||
String tqq9_rebatesettlespe = rule.getString("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)){
|
||||
jsjezb = 1;
|
||||
}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)){
|
||||
jscgzb = 1;
|
||||
}
|
||||
BigDecimal ksjsjsbbh = rule.getBigDecimal("tqq9_excl_start_base");
|
||||
BigDecimal jsjsjsbbh = rule.getBigDecimal("tqq9_excl_end_base");
|
||||
BigDecimal bl = rule.getBigDecimal("tqq9_proportion");
|
||||
BigDecimal flje = rule.getBigDecimal("tqq9_rebateamount");
|
||||
String flgys = "";
|
||||
DynamicObjectCollection tqq9_supplier = rule.getDynamicObjectCollection("tqq9_supplier");
|
||||
for (DynamicObject exclunopur : tqq9_supplier) {
|
||||
long id = exclunopur.getLong("fbasedataid.id");
|
||||
exclunopur = BusinessDataServiceHelper.loadSingle(id, "bd_supplier", "id,name,number");
|
||||
flgys = flgys + "," + exclunopur.getString("number");
|
||||
}
|
||||
if(StringUtils.isNotBlank(flgys)){
|
||||
flgys = flgys.substring(1);
|
||||
}
|
||||
JSONObject e0 = new JSONObject();
|
||||
e0.put("fieldName", "flgzdjh");
|
||||
e0.put("fieldValue", flgzdjh);
|
||||
JSONObject e1 = new JSONObject();
|
||||
e1.put("fieldName", "gzlx");
|
||||
e1.put("fieldValue", gzlx);
|
||||
JSONObject e2 = new JSONObject();
|
||||
e2.put("fieldName", "flkssj");
|
||||
e2.put("fieldValue", flkssj);
|
||||
JSONObject e3 = new JSONObject();
|
||||
e3.put("fieldName", "fljssj");
|
||||
e3.put("fieldValue", fljssj);
|
||||
JSONObject e4 = new JSONObject();
|
||||
e4.put("fieldName", "ygbl");
|
||||
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);
|
||||
JSONObject e6 = new JSONObject();
|
||||
e6.put("fieldName", "flpp");
|
||||
e6.put("fieldValue", flpp);
|
||||
JSONObject e7 = new JSONObject();
|
||||
e7.put("fieldName", "flsp");
|
||||
e7.put("fieldValue", flsp);
|
||||
JSONObject e8 = new JSONObject();
|
||||
e8.put("fieldName", "zdcgddbh");
|
||||
e8.put("fieldValue", zdcgddbh);
|
||||
JSONObject e9 = new JSONObject();
|
||||
e9.put("fieldName", "pchjs");
|
||||
e9.put("fieldValue", pchjs);
|
||||
JSONObject e10 = new JSONObject();
|
||||
e10.put("fieldName", "pckssj");
|
||||
e10.put("fieldValue", pckssj);
|
||||
JSONObject e11 = new JSONObject();
|
||||
e11.put("fieldName", "pcjssj");
|
||||
e11.put("fieldValue", pcjssj);
|
||||
JSONObject e12 = new JSONObject();
|
||||
e12.put("fieldName", "pccgddbh");
|
||||
e12.put("fieldValue", pccgddbh);
|
||||
JSONObject e13 = new JSONObject();
|
||||
e13.put("fieldName", "pcsjdbpcddbh");
|
||||
e13.put("fieldValue", pcsjdbpcddbh);
|
||||
JSONObject e14 = new JSONObject();
|
||||
e14.put("fieldName", "flzt");
|
||||
e14.put("fieldValue", flzt);
|
||||
JSONObject e15 = new JSONObject();
|
||||
e15.put("fieldName", "gzlc");
|
||||
e15.put("fieldValue", gzlc);
|
||||
JSONObject e16 = new JSONObject();
|
||||
e16.put("fieldName", "gzlcbl");
|
||||
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);
|
||||
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);
|
||||
JSONObject e21 = new JSONObject();
|
||||
e21.put("fieldName", "sfhs");
|
||||
e21.put("fieldValue", sfhs);
|
||||
JSONObject e22 = new JSONObject();
|
||||
e22.put("fieldName", "fljstl");
|
||||
e22.put("fieldValue", fljstl);
|
||||
JSONObject e23 = new JSONObject();
|
||||
e23.put("fieldName", "jsjezb");
|
||||
e23.put("fieldValue", jsjezb);
|
||||
JSONObject e24 = new JSONObject();
|
||||
e24.put("fieldName", "jscgzb");
|
||||
e24.put("fieldValue", jscgzb);
|
||||
JSONObject e25 = new JSONObject();
|
||||
e25.put("fieldName", "ksjsjsbbh");
|
||||
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);
|
||||
JSONObject e27 = new JSONObject();
|
||||
e27.put("fieldName", "bl");
|
||||
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);
|
||||
JSONObject e29 = new JSONObject();
|
||||
e29.put("fieldName", "flgys");
|
||||
e29.put("fieldValue", flgys);
|
||||
|
||||
List<JSONObject> 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);
|
||||
|
||||
JSONObject recordObj = new JSONObject();
|
||||
recordObj.put("recordOrder", 0);
|
||||
recordObj.put("workflowRequestTableFields", recordsArr);
|
||||
recordsArr1.add(recordObj);
|
||||
}
|
||||
detail1.put("tableDBName", "formtable_main_101_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", "conm_purcontract");
|
||||
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", "htbh");
|
||||
m7.put("fieldValue", billno);
|
||||
JSONObject m8 = new JSONObject();
|
||||
m8.put("fieldName", "htmc");
|
||||
m8.put("fieldValue", htmc);
|
||||
JSONObject m9 = new JSONObject();
|
||||
m9.put("fieldName", "htlx");
|
||||
m9.put("fieldValue", htlx);
|
||||
JSONObject m10 = new JSONObject();
|
||||
m10.put("fieldName", "htmb");
|
||||
m10.put("fieldValue", htmb);
|
||||
JSONObject m11 = new JSONObject();
|
||||
m11.put("fieldName", "ywms");
|
||||
m11.put("fieldValue", ywms);
|
||||
JSONObject m12 = new JSONObject();
|
||||
m12.put("fieldName", "htksrq");
|
||||
m12.put("fieldValue", htksrq);
|
||||
JSONObject m13 = new JSONObject();
|
||||
m13.put("fieldName", "htjsrq");
|
||||
m13.put("fieldValue", htjsrq);
|
||||
JSONObject m14 = new JSONObject();
|
||||
m14.put("fieldName", "htzt");
|
||||
m14.put("fieldValue", htzt);
|
||||
JSONObject m15 = new JSONObject();
|
||||
m15.put("fieldName", "fktj");
|
||||
m15.put("fieldValue", fktj);
|
||||
JSONObject m16 = new JSONObject();
|
||||
m16.put("fieldName", "zq");
|
||||
m16.put("fieldValue", zq);
|
||||
JSONObject m17 = new JSONObject();
|
||||
m17.put("fieldName", "pp");
|
||||
m17.put("fieldValue", pp);
|
||||
JSONObject m18 = new JSONObject();
|
||||
m18.put("fieldName", "bz");
|
||||
m18.put("fieldValue", bz);
|
||||
JSONObject m19 = new JSONObject();
|
||||
m19.put("fieldName", "dhlxr");
|
||||
m19.put("fieldValue", dhlxr);
|
||||
JSONObject m20 = new JSONObject();
|
||||
m20.put("fieldName", "dhlxrdh");
|
||||
m20.put("fieldValue", dhlxrdh);
|
||||
JSONObject m21 = new JSONObject();
|
||||
m21.put("fieldName", "dhlxdz");
|
||||
m21.put("fieldValue", dhlxdz);
|
||||
JSONObject m22 = new JSONObject();
|
||||
m22.put("fieldName", "dhgys");
|
||||
m22.put("fieldValue", dhgys);
|
||||
JSONObject m23 = new JSONObject();
|
||||
m23.put("fieldName", "dsf");
|
||||
m23.put("fieldValue", dsf);
|
||||
|
||||
List<JSONObject> 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);
|
||||
|
||||
String fw_wfid_xzcgdd = ConfigUtils.getThirdConfigByNumber("FW_WFID_CGHT");
|
||||
FWRestfulUtils fwRestfulUtils = new FWRestfulUtils();
|
||||
|
||||
//如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口
|
||||
return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "采购合同流程", fw_wfid_xzcgdd, billno, tqq9_fwrequestid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 采购合同变更单
|
||||
* @param bill
|
||||
* @return
|
||||
*/
|
||||
public static String pushFwPurconmChange(DynamicObject bill){
|
||||
/*
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String billno = bill.getString("billno");
|
||||
String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");
|
||||
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 biztime = bill.getDate("biztime");
|
||||
String cjsj = sdf.format(biztime);
|
||||
DynamicObject org = bill.getDynamicObject("org");
|
||||
String orgNumber = org.getString("number");
|
||||
String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber);
|
||||
String htmc = bill.getString("billname");
|
||||
int htlx = 0;
|
||||
DynamicObject type = bill.getDynamicObject("type");
|
||||
String typeNumber = type.getString("number");
|
||||
if("FLHT".equals(typeNumber)){
|
||||
htlx = 1;
|
||||
}else if("KJFLHT".equals(typeNumber)){
|
||||
htlx = 2;
|
||||
}
|
||||
int htmb = 0;
|
||||
String tqq9_htmb = bill.getString("tqq9_htmb");
|
||||
if("FLCMB".equals(tqq9_htmb)){
|
||||
htmb = 1;
|
||||
}
|
||||
int ywms = 0;
|
||||
String bizmode = bill.getString("bizmode");
|
||||
if ("B".equals(bizmode)){
|
||||
ywms = 1;
|
||||
}else if ("C".equals(bizmode)){
|
||||
ywms = 2;
|
||||
}
|
||||
Date biztimebegin = bill.getDate("biztimebegin");
|
||||
String htksrq = sdf.format(biztimebegin);
|
||||
Date biztimeend = bill.getDate("biztimeend");
|
||||
String htjsrq = sdf.format(biztimeend);
|
||||
int htzt = 0;
|
||||
DynamicObject contparties = bill.getDynamicObject("contparties");
|
||||
String contpartiesNumber = contparties.getString("number");
|
||||
if("02".equals(contpartiesNumber)){
|
||||
htzt = 1;
|
||||
}else if("03".equals(contpartiesNumber)){
|
||||
htzt = 2;
|
||||
}
|
||||
int fktj = 0;
|
||||
DynamicObject tqq9_jsfs = bill.getDynamicObject("tqq9_jsfs");
|
||||
if("kdfh".equals(tqq9_jsfs)){
|
||||
fktj = 1;
|
||||
}else if("yfhf".equals(tqq9_jsfs)){
|
||||
fktj = 2;
|
||||
}else if("ymjz".equals(tqq9_jsfs)){
|
||||
fktj = 3;
|
||||
}
|
||||
int zq = bill.getInt("tqq9_zq");
|
||||
String pp = null;
|
||||
DynamicObject tqq9_dxpp = bill.getDynamicObject("tqq9_dxpp");
|
||||
if(tqq9_dxpp != null){
|
||||
pp = tqq9_dxpp.getString("name");
|
||||
}
|
||||
String bz = bill.getString("comment");
|
||||
String dhlxr = null;
|
||||
String dhlxrdh = null;
|
||||
DynamicObject providerlinkman = bill.getDynamicObject("providerlinkman");
|
||||
if(providerlinkman != null){
|
||||
providerlinkman = BusinessDataServiceHelper.loadSingle(providerlinkman.getPkValue(), providerlinkman.getDynamicObjectType().getName());
|
||||
dhlxr = providerlinkman.getString("name");
|
||||
dhlxrdh = providerlinkman.getString("phone");
|
||||
}
|
||||
String dhlxdz = bill.getString("provideraddress");
|
||||
String dhgys = null;
|
||||
DynamicObject supplier = bill.getDynamicObject("supplier");
|
||||
if(supplier != null){
|
||||
dhgys = supplier.getString("number");
|
||||
}
|
||||
String dsf = null;
|
||||
DynamicObject partc = bill.getDynamicObject("partc");
|
||||
if(partc != null){
|
||||
dsf = partc.getString("number");
|
||||
}
|
||||
|
||||
//返利规则
|
||||
JSONObject detail1 = new JSONObject();
|
||||
JSONArray recordsArr1 = new JSONArray();
|
||||
|
||||
QFilter f1 = new QFilter("tqq9_conm_purcontract.id", "=", bill.getPkValue());
|
||||
QFilter f2 = new QFilter("enable", "=", "1");
|
||||
QFilter f3 = new QFilter("status", "=", "B");
|
||||
DynamicObject[] ruleArr = BusinessDataServiceHelper.load("tqq9_pur_rebate", "id", new QFilter[]{f1,f2,f3});
|
||||
for (DynamicObject rule : ruleArr) {
|
||||
rule = BusinessDataServiceHelper.loadSingle(rule.getPkValue(), "tqq9_pur_rebate");
|
||||
String tqq9_rulestype = rule.getString("tqq9_rulestype");
|
||||
int gzlx = 0;
|
||||
if("1".equals(tqq9_rulestype)){
|
||||
gzlx = 1;
|
||||
}
|
||||
Date tqq9_startdate = rule.getDate("tqq9_startdate");
|
||||
String flkssj = sdf.format(tqq9_startdate);
|
||||
Date tqq9_enddate = rule.getDate("tqq9_enddate");
|
||||
String fljssj = sdf.format(tqq9_enddate);
|
||||
BigDecimal ygbl = rule.getBigDecimal("tqq9_estimatepro");
|
||||
BigDecimal mbcgje = rule.getBigDecimal("tqq9_targetamount");
|
||||
String flpp = null;
|
||||
DynamicObject tqq9_rebatebrand = bill.getDynamicObject("tqq9_rebatebrand");
|
||||
if(tqq9_rebatebrand != null){
|
||||
flpp = tqq9_rebatebrand.getString("name");
|
||||
}
|
||||
DynamicObjectCollection tqq9_rebategoods = bill.getDynamicObjectCollection("tqq9_rebategoods");
|
||||
// TODO 返利商品,指定采购订单编号,排除采购订单编号,排除时间段不排除订单编号
|
||||
String flsp;
|
||||
String zdcgddbh;
|
||||
String pccgddbh;
|
||||
String pcsjdbpcddbh;
|
||||
int pchjs = 1;
|
||||
boolean tqq9_excludnum = rule.getBoolean("tqq9_excludnum");
|
||||
if (tqq9_excludnum){
|
||||
pchjs = 0;
|
||||
}
|
||||
Date tqq9_startexcludate = rule.getDate("tqq9_startexcludate");
|
||||
String pckssj = sdf.format(tqq9_startexcludate);
|
||||
Date tqq9_endexcludate = rule.getDate("tqq9_endexcludate");
|
||||
String pcjssj = sdf.format(tqq9_endexcludate);
|
||||
int flzt = 0;
|
||||
String tqq9_rebatesub = rule.getString("tqq9_rebatesub");
|
||||
if ("1".equals(tqq9_rebatesub)){
|
||||
flzt = 1;
|
||||
}
|
||||
int gzlc = 1;
|
||||
boolean tqq9_guangzhoulici = rule.getBoolean("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){
|
||||
gzlc = 0;
|
||||
}
|
||||
BigDecimal shlcbl = rule.getBigDecimal("tqq9_shlcbl");
|
||||
int bjlc = 1;
|
||||
boolean tqq9_beijinglichi = rule.getBoolean("tqq9_beijinglichi");
|
||||
if(tqq9_beijinglichi){
|
||||
gzlc = 0;
|
||||
}
|
||||
BigDecimal bjlcbl = rule.getBigDecimal("tqq9_bjlcbl");
|
||||
int sfhs = 1;
|
||||
boolean tqq9_istax = rule.getBoolean("tqq9_istax");
|
||||
if (tqq9_istax){
|
||||
sfhs = 0;
|
||||
}
|
||||
int fljstl = 0;
|
||||
String tqq9_rebatesettlespe = rule.getString("tqq9_rebatesettlespe");
|
||||
if ("1".equals(tqq9_rebatesettlespe)){
|
||||
sfhs = 1;
|
||||
}
|
||||
int jsjezb = 0;
|
||||
String tqq9_cal_amt = rule.getString("tqq9_cal_amt");
|
||||
if("1".equals(tqq9_cal_amt)){
|
||||
jsjezb = 1;
|
||||
}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)){
|
||||
jscgzb = 1;
|
||||
}
|
||||
BigDecimal ksjsjsbbh = rule.getBigDecimal("tqq9_excl_start_base");
|
||||
BigDecimal jsjsjsbbh = rule.getBigDecimal("tqq9_excl_end_base");
|
||||
BigDecimal bl = rule.getBigDecimal("tqq9_proportion");
|
||||
BigDecimal flje = rule.getBigDecimal("tqq9_rebateamount");
|
||||
String flgys = null;
|
||||
DynamicObject tqq9_supplier = rule.getDynamicObject("tqq9_supplier");
|
||||
if(tqq9_supplier != null){
|
||||
flgys = tqq9_supplier.getString("number");
|
||||
}
|
||||
JSONObject e0 = new JSONObject();
|
||||
e0.put("fieldName", "wlmc");
|
||||
e0.put("fieldValue", wlmc);
|
||||
JSONObject e1 = new JSONObject();
|
||||
e1.put("fieldName", "wlbm");
|
||||
e1.put("fieldValue", wlbm);
|
||||
JSONObject e2 = new JSONObject();
|
||||
e2.put("fieldName", "pp");
|
||||
e2.put("fieldValue", pp);
|
||||
JSONObject e3 = new JSONObject();
|
||||
e3.put("fieldName", "ggxh");
|
||||
e3.put("fieldValue", ggxh);
|
||||
JSONObject e4 = new JSONObject();
|
||||
e4.put("fieldName", "jldw");
|
||||
e4.put("fieldValue", jldw);
|
||||
JSONObject e5 = new JSONObject();
|
||||
e5.put("fieldName", "thsl");
|
||||
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);
|
||||
JSONObject e7 = new JSONObject();
|
||||
e7.put("fieldName", "yhzkje");
|
||||
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);
|
||||
|
||||
List<JSONObject> elist = Arrays.asList(e0,e1,e2,e3,e4,e5,e6,e7,e8);
|
||||
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_99_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", "conm_xpurcontract");
|
||||
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", "cjrq");
|
||||
m5.put("fieldValue", cjrq);
|
||||
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", "cgzz");
|
||||
m8.put("fieldValue", ywgz);
|
||||
JSONObject m9 = new JSONObject();
|
||||
m9.put("fieldName", "sfxykhzsqd");
|
||||
m9.put("fieldValue", sfxykhzsqd);
|
||||
JSONObject m10 = new JSONObject();
|
||||
m10.put("fieldName", "fplb");
|
||||
m10.put("fieldValue", fplb);
|
||||
JSONObject m11 = new JSONObject();
|
||||
m11.put("fieldName", "se");
|
||||
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);
|
||||
JSONObject m13 = new JSONObject();
|
||||
m13.put("fieldName", "sjtkje");
|
||||
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);
|
||||
JSONObject m16 = new JSONObject();
|
||||
m16.put("fieldName", "dhgys");
|
||||
m16.put("fieldValue", dhgys);
|
||||
JSONObject m17 = new JSONObject();
|
||||
m17.put("fieldName", "cgddh");
|
||||
m17.put("fieldValue", cgddh);
|
||||
|
||||
List<JSONObject> 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_CGHT");
|
||||
FWRestfulUtils fwRestfulUtils = new FWRestfulUtils();
|
||||
|
||||
//如果单据上纯在泛微流程id,重新提交调用泛微提交接口,如果没有泛微流程id,就调用新增接口
|
||||
return fwRestfulUtils.doBillAction(mainArr, detailRootArr, "采购合同流程", fw_wfid_xzcgdd, billno, tqq9_fwrequestid);
|
||||
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue