diff --git a/main/java/shjh/jhzj7/fi/fi/webapi/ApplyBillControler.java b/main/java/shjh/jhzj7/fi/fi/webapi/ApplyBillControler.java index d654f50..4f774fa 100644 --- a/main/java/shjh/jhzj7/fi/fi/webapi/ApplyBillControler.java +++ b/main/java/shjh/jhzj7/fi/fi/webapi/ApplyBillControler.java @@ -185,6 +185,19 @@ public class ApplyBillControler { //汇率日期 Date exchangerateDate = applybill.getExchangerateDate(); ap_payapply.set("exratedate", exchangerateDate); + //二级部门 + String reqdept = applybill.getReqdept(); + if (reqdept == null || reqdept.isEmpty()) { + handleError("同步失败,费控单据编号:" + fkBillNum + "的申请部门为空", fkBillNum, Apimenthod,jsonBodyString); + return CustomApiResult.fail("400", "申请部门为空"); + } + QFilter q7 = new QFilter("number", QCP.equals, reqdept); + DynamicObject adminorg = BusinessDataServiceHelper.loadSingle("bos_adminorg", new QFilter[]{q7}); + if (null == adminorg) { + handleError("同步失败,费控单据编号:" + fkBillNum + "的申请部门不存在", fkBillNum, Apimenthod,jsonBodyString); + return CustomApiResult.fail("400", "申请部门不存在"); + } + ap_payapply.set("shjh_secondarydept", adminorg); //原因码 String causeNum = applybill.getCauseNum(); if (causeNum == null || causeNum.isEmpty()) { @@ -241,25 +254,25 @@ public class ApplyBillControler { } ap_payapply_entry.set("e_assacct", assacct); //往来银行 - String bebank = applybill.getBebank(); - if(bebank == null || bebank.isEmpty()){ - handleError("同步失败,费控单据编号:" + fkBillNum + "的往来银行为空", fkBillNum, Apimenthod,jsonBodyString); - return CustomApiResult.fail("400", "往来银行为空"); + String bebanknum = applybill.getBebankNum(); + if(bebanknum == null || bebanknum.isEmpty()){ + handleError("同步失败,费控单据编号:" + fkBillNum + "的联行号为空", fkBillNum, Apimenthod,jsonBodyString); + return CustomApiResult.fail("400", "联行号为空"); } - QFilter Q5 = new QFilter("name", QCP.equals, bebank); + QFilter Q5 = new QFilter("number", QCP.equals, bebanknum); DynamicObject bank = BusinessDataServiceHelper.loadSingle(BD_BEBANK, new QFilter[]{Q5}); if (null == bank) { - handleError("同步失败,费控单据编号:" + fkBillNum + "的往来银行不存在", fkBillNum, Apimenthod,jsonBodyString); - return CustomApiResult.fail("400", "往来银行不存在"); + handleError("同步失败,费控单据编号:" + fkBillNum + "的联行号对应往来银行不存在", fkBillNum, Apimenthod,jsonBodyString); + return CustomApiResult.fail("400", "联行号对应往来银行不存在"); } ap_payapply_entry.set("e_bebank", bank); //往来账户名称 - String asstactRealName = applybill.getAsstactRealName(); - if (asstactRealName == null || asstactRealName.isEmpty()) { - handleError("同步失败,费控单据编号:" + fkBillNum + "的往来账户名称为空", fkBillNum, Apimenthod,jsonBodyString); - return CustomApiResult.fail("400", "往来账户名称为空"); + String asstactname = applybill.getAsstactName(); + if (asstactname == null || asstactname.isEmpty()) { + handleError("同步失败,费控单据编号:" + fkBillNum + "的往来账户名称(实际收款账户名称)为空", fkBillNum, Apimenthod,jsonBodyString); + return CustomApiResult.fail("400", "往来账户名称(实际收款账户名称)为空"); } - ap_payapply_entry.set("shjh_asstactrealname", asstactRealName); + ap_payapply_entry.set("shjh_asstactrealname", asstactname); //到期日 Date duedate = applybill.getDuedate(); if (null == duedate) { diff --git a/main/java/shjh/jhzj7/fi/fi/webapi/model/ApplyBillModel.java b/main/java/shjh/jhzj7/fi/fi/webapi/model/ApplyBillModel.java index 91fcedc..eba97dc 100644 --- a/main/java/shjh/jhzj7/fi/fi/webapi/model/ApplyBillModel.java +++ b/main/java/shjh/jhzj7/fi/fi/webapi/model/ApplyBillModel.java @@ -32,23 +32,29 @@ public class ApplyBillModel { private String asstact; @ApiParam(value="往来账户",required=true,position=13) private String assacct; - @ApiParam(value="往来银行",required=true,position=14) + @ApiParam(value="往来银行",required=false,position=14) private String bebank; - @ApiParam(value="往来账户名称",required=true,position=15) + @ApiParam(value="联行号",required=true,position=15) + private String bebankNum; + @ApiParam(value="申请部门",required=true,position=16) + private String reqdept; + @ApiParam(value="往来账户名称(实际收款账户名称)",required=true,position=17) + private String asstactName; + @ApiParam(value="往来账户名称",required=true,position=18) private String asstactRealName; - @ApiParam(value="到期日",required=true,position=16) + @ApiParam(value="到期日",required=true,position=19) private Date duedate; - @ApiParam(value="结算方式",required=true,position=17) + @ApiParam(value="结算方式",required=true,position=20) private String settlementtype; - @ApiParam(value="原因码",required=true,position=18) + @ApiParam(value="原因码",required=true,position=21) private String causeNum; - @ApiParam(value="备注",required=false,position=19) + @ApiParam(value="备注",required=false,position=22) private String remark; - @ApiParam(value="费控表头ID",required=true,position=20) + @ApiParam(value="费控表头ID",required=true,position=23) private String fkBillID; - @ApiParam(value="费控分录ID",required=true,position=21) + @ApiParam(value="费控分录ID",required=true,position=24) private String fkEntryID; - @ApiParam(value="付款类型",required=true,position=22) + @ApiParam(value="付款类型",required=true,position=25) private String paymenttype; @@ -205,4 +211,27 @@ public class ApplyBillModel { return remark; } + public String getBebankNum() { + return bebankNum; + } + + public void setBebankNum(String bebankNum) { + this.bebankNum = bebankNum; + } + + public String getReqdept() { + return reqdept; + } + + public void setReqdept(String reqdept) { + this.reqdept = reqdept; + } + + public String getAsstactName() { + return asstactName; + } + + public void setAsstactName(String asstactName) { + this.asstactName = asstactName; + } } \ No newline at end of file