|
@@ -216,43 +216,75 @@ public class PayrequestService extends BaseService {
|
|
|
if (so != null) {
|
|
|
List<OapiProcessinstanceCreateRequest.FormComponentValueVo> formComponentValueVoList = new ArrayList<OapiProcessinstanceCreateRequest.FormComponentValueVo>();
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo formComponentValueVo = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- formComponentValueVo.setName("日期");
|
|
|
+ formComponentValueVo.setName("单据日期");
|
|
|
formComponentValueVo.setValue(so.getDvouchdate());
|
|
|
formComponentValueVo.setExtValue(data);
|
|
|
formComponentValueVoList.add(formComponentValueVo);
|
|
|
|
|
|
-
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo code = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ code.setName("单据编号");
|
|
|
+ if (so.getCvouchid() != null && !so.getCvouchid().equals("")) {
|
|
|
+ code.setValue(so.getCvouchid());
|
|
|
+ code.setExtValue(data);
|
|
|
+ } else {
|
|
|
+ code.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(code);
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cdwname= new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cdwname.setName("供应商名称");
|
|
|
+ if (so.getCvenname()!= null && !so.getCvenname().equals("")) {
|
|
|
+ cdwname.setValue(so.getCvenname());
|
|
|
+ } else {
|
|
|
+ cdwname.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(cdwname);
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cdwcode = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cdwcode.setName("供应商编码");
|
|
|
+ if (so.getCdwcode() != null && !so.getCdwcode().equals("")) {
|
|
|
+ cdwcode.setValue(so.getCdwcode());
|
|
|
+ } else {
|
|
|
+ cdwcode.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(cdwcode);
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cvenabbname = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cvenabbname.setName("供应商简称");
|
|
|
+ if (so.getCvenabbname() != null && !so.getCvenabbname().equals("")) {
|
|
|
+ cvenabbname.setValue(so.getCvenabbname());
|
|
|
+ } else {
|
|
|
+ cvenabbname.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(cvenabbname);
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc.setName("部门");
|
|
|
+ fc.setName("部门名称");
|
|
|
if (so.getCdepname() != null && !so.getCdepname().equals("")) {
|
|
|
fc.setValue(so.getCdepname());
|
|
|
} else {
|
|
|
fc.setValue("暂无");
|
|
|
}
|
|
|
-
|
|
|
formComponentValueVoList.add(fc);
|
|
|
|
|
|
- OapiProcessinstanceCreateRequest.FormComponentValueVo fc2 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc2.setName("供应商");
|
|
|
- if (so.getCvenname() != null && !so.getCvenname().equals("")) {
|
|
|
- fc2.setValue(so.getCvenname());
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo fcode = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ fcode.setName("部门编码");
|
|
|
+ if (so.getCdepcode() != null && !so.getCdepcode().equals("")) {
|
|
|
+ fcode.setValue(so.getCdepcode());
|
|
|
} else {
|
|
|
- fc2.setValue("暂无");
|
|
|
+ fcode.setValue("暂无");
|
|
|
}
|
|
|
|
|
|
- formComponentValueVoList.add(fc2);
|
|
|
+ formComponentValueVoList.add(fcode);
|
|
|
|
|
|
- OapiProcessinstanceCreateRequest.FormComponentValueVo fc3 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc3.setName("结算方式");
|
|
|
- if (so.getCssname() != null && !so.getCssname().equals("0E-10")) {
|
|
|
- fc3.setValue(so.getCssname());
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cperson = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cperson.setName("业务员编码");
|
|
|
+ if (so.getCperson() != null && !so.getCperson().equals("")) {
|
|
|
+ cperson.setValue(so.getCperson());
|
|
|
} else {
|
|
|
- fc3.setValue("暂无");
|
|
|
+ cperson.setValue("暂无");
|
|
|
}
|
|
|
- formComponentValueVoList.add(fc3);
|
|
|
+
|
|
|
+ formComponentValueVoList.add(cperson);
|
|
|
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc4 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc4.setName("申请人");
|
|
|
+ fc4.setName("业务员名称");
|
|
|
if (so.getCpersonname() != null && !so.getCpersonname().equals("")) {
|
|
|
fc4.setValue(so.getCpersonname());
|
|
|
} else {
|
|
@@ -260,22 +292,80 @@ public class PayrequestService extends BaseService {
|
|
|
}
|
|
|
formComponentValueVoList.add(fc4);
|
|
|
|
|
|
- OapiProcessinstanceCreateRequest.FormComponentValueVo fc6 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc6.setName("付款日期");
|
|
|
- if (so.getEntry().size() > 0 && !so.getEntry().get(0).getDprepaydate().equals("")) {
|
|
|
- fc6.setValue(so.getEntry().get(0).getDprepaydate());
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cexchname = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cexchname.setName("币种名称");
|
|
|
+ if (so.getCexch_name() != null && !so.getCexch_name().equals("")) {
|
|
|
+ cexchname.setValue(so.getCexch_name());
|
|
|
+ } else {
|
|
|
+ cexchname.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(cexchname);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cdigest = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cdigest.setName("备注");
|
|
|
+ if (so.getCdigest() != null && !so.getCdigest().equals("")) {
|
|
|
+ cdigest.setValue(so.getCdigest());
|
|
|
+ } else {
|
|
|
+ cdigest.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(cdigest);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo iexchrate = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ iexchrate.setName("汇率");
|
|
|
+ if (so.getIexchrate() != null && !so.getIexchrate().equals("")) {
|
|
|
+ iexchrate.setValue(so.getIexchrate());
|
|
|
+ } else {
|
|
|
+ iexchrate.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(iexchrate);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cop = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cop.setName("制单人");
|
|
|
+ if (so.getCoperator() != null && !so.getCoperator().equals("")) {
|
|
|
+ cop.setValue(so.getCoperator());
|
|
|
+ } else {
|
|
|
+ cop.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(cop);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo ccode = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ ccode.setName("结算科目编码");
|
|
|
+ if (so.getCcode() != null && !so.getCcode().equals("")) {
|
|
|
+ ccode.setValue(so.getCcode());
|
|
|
+ } else {
|
|
|
+ ccode.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(ccode);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo csscode = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ csscode.setName("结算方式编码");
|
|
|
+ if (so.getCsscode() != null && !so.getCsscode().equals("")) {
|
|
|
+ csscode.setValue(so.getCsscode());
|
|
|
+ } else {
|
|
|
+ csscode.setValue("暂无");
|
|
|
+ }
|
|
|
+ formComponentValueVoList.add(csscode);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo fc3 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ fc3.setName("结算方式名称");
|
|
|
+ if (so.getCssname() != null && !so.getCssname().equals("0E-10")) {
|
|
|
+ fc3.setValue(so.getCssname());
|
|
|
} else {
|
|
|
- fc6.setValue(so.getDvouchdate());
|
|
|
+ fc3.setValue("暂无");
|
|
|
}
|
|
|
- formComponentValueVoList.add(fc6);
|
|
|
+ formComponentValueVoList.add(fc3);
|
|
|
|
|
|
List<List<OapiProcessinstanceCreateRequest.FormComponentValueVo>> ls = new ArrayList<>();
|
|
|
BigDecimal a = new BigDecimal("0");
|
|
|
for (PayrequestMin s : so.getEntry()) {
|
|
|
List<OapiProcessinstanceCreateRequest.FormComponentValueVo> mingxilist = new ArrayList<>();
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo mingxi2 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- mingxi2.setName("来源单据号");
|
|
|
- mingxi2.setValue(so.getCvouchid());
|
|
|
+ mingxi2.setName("存货编码");
|
|
|
+ if (s.getCinvcode() != null && !s.getCinvcode().equals("")) {
|
|
|
+ mingxi2.setValue(s.getCinvcode());
|
|
|
+ } else {
|
|
|
+ mingxi2.setValue("暂无");
|
|
|
+ }
|
|
|
mingxilist.add(mingxi2);
|
|
|
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc7 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
@@ -287,43 +377,130 @@ public class PayrequestService extends BaseService {
|
|
|
}
|
|
|
mingxilist.add(fc7);
|
|
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cinvstd = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cinvstd.setName("规格型号");
|
|
|
+ if (s.getCinvstd() != null && !s.getCinvstd().equals("")) {
|
|
|
+ cinvstd.setValue(s.getCinvstd());
|
|
|
+ } else {
|
|
|
+ cinvstd.setValue("暂无");
|
|
|
+ }
|
|
|
+ mingxilist.add(cinvstd);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo dpdate = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ dpdate.setName("预付款时间");
|
|
|
+ dpdate.setValue(s.getDprepaydate());
|
|
|
+ mingxilist.add(dpdate);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo csname = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ csname.setName("币种名称");
|
|
|
+ if (s.getCsrcexchname() != null && !s.getCsrcexchname().equals("")) {
|
|
|
+ csname.setValue(s.getCsrcexchname());
|
|
|
+ } else {
|
|
|
+ csname.setValue("暂无");
|
|
|
+ }
|
|
|
+ mingxilist.add(csname);
|
|
|
+
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo depname = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ depname.setName("部门名称");
|
|
|
+ if (s.getCdepname() != null && !s.getCdepname().equals("")) {
|
|
|
+ depname.setValue(s.getCdepname());
|
|
|
+ } else {
|
|
|
+ depname.setValue("暂无");
|
|
|
+ }
|
|
|
+ mingxilist.add(depname);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo cpersonname = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ cpersonname.setName("业务员名称");
|
|
|
+ if (s.getCpersonname() != null && !s.getCpersonname().equals("")) {
|
|
|
+ cpersonname.setValue(s.getCpersonname());
|
|
|
+ } else {
|
|
|
+ cpersonname.setValue("暂无");
|
|
|
+ }
|
|
|
+ mingxilist.add(cpersonname);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo iappf = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ iappf.setName("原币申请金额");
|
|
|
+ if (s.getIapplyamt_f() != null && !s.getIapplyamt_f().equals("0E-10")) {
|
|
|
+ iappf.setValue(new BigDecimal(s.getIapplyamt_f()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ } else {
|
|
|
+ iappf.setValue("0");
|
|
|
+ }
|
|
|
+ mingxilist.add(iappf);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo iapp = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ iapp.setName("本币申请金额");
|
|
|
+ if (s.getIapplyamt() != null && !s.getIapplyamt().equals("0E-10")) {
|
|
|
+ iapp.setValue(new BigDecimal(s.getIapplyamt()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ } else {
|
|
|
+ iapp.setValue("0");
|
|
|
+ }
|
|
|
+ mingxilist.add(iapp);
|
|
|
+
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc8 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc8.setName("存货数量");
|
|
|
+ fc8.setName("数量");
|
|
|
if (s.getIapplyamt_s() != null && !s.getIapplyamt_s().equals("0E-10")) {
|
|
|
fc8.setValue(new BigDecimal(s.getIapplyamt_s()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
} else {
|
|
|
fc8.setValue("0");
|
|
|
}
|
|
|
mingxilist.add(fc8);
|
|
|
+
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo fc9 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc9.setName("单价");
|
|
|
- if (s.getInattaxprice() != null && !s.getInattaxprice().equals("0E-10")) {
|
|
|
- fc9.setValue(new BigDecimal(s.getInattaxprice()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ fc9.setName("原单原币申请金额");
|
|
|
+ if (s.getIsrcapplyamt_f() != null && !s.getIsrcapplyamt_f().equals("0E-10")) {
|
|
|
+ fc9.setValue(new BigDecimal(s.getIsrcapplyamt_f()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
} else {
|
|
|
fc9.setValue("0");
|
|
|
}
|
|
|
mingxilist.add(fc9);
|
|
|
|
|
|
- OapiProcessinstanceCreateRequest.FormComponentValueVo fc10 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc10.setName("金额");
|
|
|
- if (s.getIapplyamt() != null && !s.getIapplyamt().equals("0E-10")) {
|
|
|
- fc10.setValue(new BigDecimal(s.getIapplyamt()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
- BigDecimal b = new BigDecimal(s.getIapplyamt());
|
|
|
- BigDecimal add = a.add(b);
|
|
|
- a = add;
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo israpp = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ israpp.setName("原单本币申请金额");
|
|
|
+ if (s.getIsrcapplyamt() != null && !s.getIsrcapplyamt().equals("0E-10")) {
|
|
|
+ israpp.setValue(new BigDecimal(s.getIsrcapplyamt()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
} else {
|
|
|
- fc10.setValue("0");
|
|
|
+ israpp.setValue("0");
|
|
|
}
|
|
|
- mingxilist.add(fc10);
|
|
|
- ls.add(mingxilist);
|
|
|
- }
|
|
|
- OapiProcessinstanceCreateRequest.FormComponentValueVo fc5 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
- fc5.setName("申请金额");
|
|
|
- fc5.setValue(a.setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
-// fc5.setValue(so.getPersonname());
|
|
|
- formComponentValueVoList.add(fc5);
|
|
|
+ mingxilist.add(israpp);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo isum = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ isum.setName("原单本币金额");
|
|
|
+ if (s.getIsum() != null && !s.getIsum().equals("0E-10")) {
|
|
|
+ isum.setValue(new BigDecimal(s.getIsum()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ } else {
|
|
|
+ isum.setValue("0");
|
|
|
+ }
|
|
|
+ mingxilist.add(isum);
|
|
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo iorisum = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ iorisum.setName("原单原币金额");
|
|
|
+ if (s.getIorisum() != null && !s.getIorisum().equals("0E-10")) {
|
|
|
+ iorisum.setValue(new BigDecimal(s.getIorisum()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ } else {
|
|
|
+ iorisum.setValue("0");
|
|
|
+ }
|
|
|
+ mingxilist.add(iorisum);
|
|
|
+
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo iortax = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ iortax.setName("原币单价");
|
|
|
+ if (s.getIoritaxcost() != null && !s.getIoritaxcost().equals("0E-10")) {
|
|
|
+ iortax.setValue(new BigDecimal(s.getIoritaxcost()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ } else {
|
|
|
+ iortax.setValue("0");
|
|
|
+ }
|
|
|
+ mingxilist.add(iortax);
|
|
|
|
|
|
+ OapiProcessinstanceCreateRequest.FormComponentValueVo inatt = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
+ inatt.setName("本币单价");
|
|
|
+ if (s.getInattaxprice() != null && !s.getInattaxprice().equals("0E-10")) {
|
|
|
+ inatt.setValue(new BigDecimal(s.getInattaxprice()).setScale(2, BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ } else {
|
|
|
+ inatt.setValue("0");
|
|
|
+ }
|
|
|
+ mingxilist.add(inatt);
|
|
|
+ ls.add(mingxilist);
|
|
|
+ }
|
|
|
OapiProcessinstanceCreateRequest.FormComponentValueVo obj7 = new OapiProcessinstanceCreateRequest.FormComponentValueVo();
|
|
|
obj7.setName("表格");
|
|
|
obj7.setValue(JSON.toJSONString(ls));
|
|
@@ -332,9 +509,9 @@ public class PayrequestService extends BaseService {
|
|
|
req.setFormComponentValues(formComponentValueVoList);
|
|
|
OapiProcessinstanceCreateResponse rsp = client.execute(req, dingdingOpenInterface.gettoken);
|
|
|
System.out.println(rsp.getBody());
|
|
|
- String code = rsp.getErrorCode();
|
|
|
- if (code.equals("0") || code.equals(0)) {
|
|
|
- return code;
|
|
|
+ String codes = rsp.getErrorCode();
|
|
|
+ if (codes.equals("0") || codes.equals(0)) {
|
|
|
+ return codes;
|
|
|
}
|
|
|
}
|
|
|
}catch (Exception e){
|