1.将按经销商放款逻辑改为合同放款。

This commit is contained in:
zhangbb 2019-03-27 11:05:20 +08:00
parent 5ac96643e2
commit 31feaea7c5
5 changed files with 89 additions and 30 deletions

View File

@ -48,7 +48,7 @@
}
dwTemp.setPageSize(pageSize == null?10:Integer.parseInt(pageSize));
ASDataObject ado = dwTemp.getDataObject();
ado.setLockCount(2);
ado.setLockCount(3);
ado.setReadOnly("PAYMENT_NUMBER", true);
ado.setReadOnly("PROJECT_NAME", true);
ado.setReadOnly("PLAN_ID", true);
@ -83,29 +83,61 @@
};
}else if("0010".equals(phaseNo)){
sButtons = new String[][]{
/* {"true","","Button","保存","保存","as_save(0,'setColRequired()')","","","","btn_icon_saveNew",""},
{"true","","Button","批量修改","批量修改","batchModify()","","","","btn_icon_detail",""}, */
{"true","","Button","删除","删除","doDelete()","","","","btn_icon_delete",""}, };
}else if("0020".equals(phaseNo)){
sButtons = new String[][]{
{"true","","Button","保存","保存","as_save(0,'setColRequired()')","","","","btn_icon_saveNew",""} ,
{"true","","Button","批量修改","批量修改","batchModify()","","","","btn_icon_detail",""}
{"true","","Button","批量修改","批量修改","batchModify()","","","","btn_icon_detail",""},
{"true","","Button","发起付款申请","保存","cmb_tp_pay()","","","","btn_icon_save",""}
};
}else if("0030".equals(phaseNo)){
sButtons = new String[][]{
{"true","","Button","付款结果回盘","付款结果回盘","cmb_tp_callback()","","","","btn_icon_delete",""},
};
}else{
sButtons = new String[][]{
// {"true","","Button","保存","保存","as_save(0,'setColRequired()')","","","","btn_icon_saveNew",""},
// {"true","","Button","批量修改","批量修改","batchModify()","","","","btn_icon_detail",""},
// {"true","","Button","导出付款明细","导出付款明细","createFundIncomeExcel()","","","","btn_icon_up",""},
};
// {"true","","Button","保存","保存","as_save(0,'setColRequired()')","","","","btn_icon_saveNew",""},
// {"true","","Button","批量修改","批量修改","batchModify()","","","","btn_icon_detail",""},
// {"true","","Button","导出付款明细","导出付款明细","createFundIncomeExcel()","","","","btn_icon_up",""},
};
}
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
$(function(){
setColRequired();
})
function afterSearch(){
/* var rows = getRowCount(0);
function cmb_tp_pay(){
var plist = getItemValueArray(0,"CONTRACT_ID")+"";
if(typeof(plist)=="undefined" || plist.length==0 ){
alert("请至少选择一条记录!");
return ;
}
if(confirm("确认要发起付款申请吗?")){
ids=plist.replace(/\,/g,"@");
var sParams = "CurUserID=<%=CurUser.getUserID()%>,contract_ids="+ids+",FLOWUNID=<%=flowunid%>";
var sReturn = RunJavaMethodTrans("com.tenwa.sdk.controller.CmbToPayController", "action",sParams );
if(typeof(sReturn)=="undefined" || sReturn=="") return;
if(sReturn.code==1){
alert(sReturn.msg);
}else{
alert(sReturn.msg);
reloadSelf();
}
}
}
function cmb_tp_callback(){
var sParams = "CurUserID=<%=CurUser.getUserID()%>,FLOWUNID=<%=flowunid%>";
var sReturn = RunJavaMethodTrans("com.tenwa.sdk.controller.CmbToCallbackController", "action",sParams );
if(typeof(sReturn)=="undefined" || sReturn=="") return;
if(sReturn.code==1){
alert(sReturn.msg);
}else{
alert(sReturn.msg);
reloadSelf();
}
}
/*function afterSearch(){
var rows = getRowCount(0);
for(var i=0;i<rows;i++){
var CONTRACT_ID = getItemValue(0,i,"CONTRACT_ID");
var result = RunJavaMethodTrans("com.tenwa.flow.fund.fundcollection.FundIncomeMethod","getContactId","CONTRACT_ID="+CONTRACT_ID);
@ -114,8 +146,8 @@
sPars=result.split("@"); //字符分割
sRun = "<a style='color:blue;font-size:15px;font-family:宋体;' onclick='opeTrigger("+ps+")'>" +sPars[1]+ "</a>";
getObj(0,i,"CONTRACT_ID").innerHTML = sRun;
} */
}
}
} */
function createFundIncomeExcel(){
var rows = getCheckedRows(0);
if(rows.length == 0){

View File

@ -7,6 +7,8 @@
*/
String phaseNo = CurPage.getParameter("PhaseNo");
String rightType = CurPage.getParameter("RightType");
//此页面以后只作为显示页面。
rightType="ReadOnly";
String flowunid = CurPage.getParameter("FlowUnid");
String ishistory = CurPage.getParameter("IsHistory");
ASObjectModel doTemp = new ASObjectModel("LC_FUND_INCOME_TEMP_HXM");

View File

@ -97,6 +97,7 @@ public class CmbToCallbackController extends BaseFlowStartAction {
*/
//安鹏要求采用固定写死值
//String LGNNAM = accountBo.getAttribute("OWN_NAME").toString();
String LGNNAM = "安鹏经办";
// String LGNNAM = "银企直连测试用户113";
String FUNNAM = "NTSTLINF";

View File

@ -37,7 +37,17 @@ import net.sf.json.JSONObject;
public class CmbToPayController extends BaseFlowStartAction {
private String distributor_ids; //获取选择的 经销商ID
private String FLOWUNID ; //流程号
private String contract_ids; //获取选择的合同ID
private String FLOWUNID ; //流程号
public String getContract_ids() {
return contract_ids;
}
public void setContract_ids(String contract_ids) {
this.contract_ids = contract_ids;
}
public String getFLOWUNID() {
return FLOWUNID;
@ -73,12 +83,20 @@ public class CmbToPayController extends BaseFlowStartAction {
JSONObject jsonObj = JSONObject.fromObject(map);
return jsonObj.toString();
}
List<String> distributor_id_list = java.util.Arrays.asList(distributor_ids.split("@"));
//按经销商改为按合同
/*List<String> distributor_id_list = java.util.Arrays.asList(distributor_ids.split("@"));
if(distributor_id_list==null || distributor_id_list.size()<=0) {
map.put("code", "1") ;
map.put("msg", "尚未选择经销商,请检查") ;
JSONObject jsonObj = JSONObject.fromObject(map);
return jsonObj.toString();
}*/
List<String> contract_id_list = java.util.Arrays.asList(contract_ids.split("@"));
if(contract_id_list==null || contract_id_list.size()<=0) {
map.put("code", "1") ;
map.put("msg", "尚未选择合同,请检查") ;
JSONObject jsonObj = JSONObject.fromObject(map);
return jsonObj.toString();
}
/*
* 基本参数检查######开始
@ -114,6 +132,7 @@ public class CmbToPayController extends BaseFlowStartAction {
//安鹏要求采用固定写死值
//String LGNNAM = accountBo.getAttribute("OWN_NAME").toString();
String LGNNAM = "安鹏经办";
// String LGNNAM = "银企直连测试用户113";
String FUNNAM = "DCPAYREQ";
int DATTYP = 2;
String BUSMOD = "00001"; //默认参数 请按照实际情况谨慎修改
@ -198,7 +217,7 @@ public class CmbToPayController extends BaseFlowStartAction {
String error_null_tips = ""; //定义错误信息 是否为空
if(distributor_id_list.size() > 30){ //招行文档规定 单次批量申请不能超过30条
if(contract_id_list.size() > 30){ //招行文档规定 单次批量申请不能超过30条
map.put("code", "1") ;
map.put("msg", "单次处理不能超过30条,请检查") ;
JSONObject jsonObj = JSONObject.fromObject(map);
@ -219,7 +238,7 @@ public class CmbToPayController extends BaseFlowStartAction {
String date = df.format(new Date());
BigDecimal all_money = new BigDecimal("0");
List<BizObject> income_all_list = bankBo.createQuery("select o.CMB_PAY_NO,o.FACT_MONEY,o.FLOWUNID,contract_info.CONTRACT_NO,distributor.distributor_id,distributor.acc_number,distributor.open_bank,distributor.account,distributor.district,distributor.provinceInfo from o join jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO contract_info on o.CONTRACT_ID = contract_info.id join jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT distributor on contract_info.distributor_id = distributor.distributor_id and distributor.is_main='Y' where FLOWUNID=:FLOWUNID and o.PAY_TYPE = 'pay_type_out' ").setParameter("FLOWUNID", FLOWUNID).getResultList(false);
List<BizObject> income_all_list = bankBo.createQuery("select o.CMB_PAY_NO,o.FACT_MONEY,o.FLOWUNID,contract_info.ID,contract_info.CONTRACT_NO,distributor.distributor_id,distributor.acc_number,distributor.open_bank,distributor.account,distributor.district,distributor.provinceInfo from o join jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO contract_info on o.CONTRACT_ID = contract_info.id join jbo.app.tenwa.customer.DISTRIBUTOR_ACCOUNT distributor on contract_info.distributor_id = distributor.distributor_id and distributor.is_main='Y' where FLOWUNID=:FLOWUNID and o.PAY_TYPE = 'pay_type_out' ").setParameter("FLOWUNID", FLOWUNID).getResultList(false);
if(income_all_list==null) {
map.put("code", "1") ;
map.put("msg", "资金收付数据不存在,请检查") ;
@ -227,18 +246,18 @@ public class CmbToPayController extends BaseFlowStartAction {
return jsonObj.toString();
}
int index = 1 ;
for (String distributor_id : distributor_id_list) {
for (String contract_id : contract_id_list) {
infoOne = null ;
BigDecimal distributor_all_money = new BigDecimal("0");
BigDecimal contract_all_money = new BigDecimal("0");
for(BizObject income_one : income_all_list) {
String income_one_distributor_id = income_one.getAttribute("distributor_id").toString();
if(distributor_id.equals(income_one_distributor_id)) {
String income_one_contract_id = income_one.getAttribute("ID").toString();
if(contract_id.equals(income_one_contract_id)) {
BigDecimal income_one_fact_money = new BigDecimal(income_one.getAttribute("FACT_MONEY").toString());
distributor_all_money = distributor_all_money.add(income_one_fact_money);
contract_all_money = contract_all_money.add(income_one_fact_money);
infoOne = income_one ;
}
}
all_money=all_money.add(distributor_all_money);
all_money=all_money.add(contract_all_money);
if(infoOne==null) {
map.put("code", "1") ;
map.put("msg", "第["+index+"]笔数据不存在,请检查") ;
@ -248,6 +267,7 @@ public class CmbToPayController extends BaseFlowStartAction {
String FLOWUNID = this.FLOWUNID ;
String DISTRIBUTOR_ID = infoOne.getAttribute("distributor_id").toString();
String CONTRACT_ID = infoOne.getAttribute("ID").toString();
String CRTACC = infoOne.getAttribute("acc_number").toString();
String BANK_NAME = infoOne.getAttribute("open_bank").toString();
String CRTNAM = infoOne.getAttribute("account").toString();
@ -281,9 +301,9 @@ public class CmbToPayController extends BaseFlowStartAction {
* 检查当前付款信息是否存在######结束
*/
int check=distributor_all_money.compareTo(BigDecimal.ZERO);
int check=contract_all_money.compareTo(BigDecimal.ZERO);
if( DISTRIBUTOR_ID==null || "".equals( DISTRIBUTOR_ID )
if( CONTRACT_ID==null || "".equals( CONTRACT_ID )
|| CRTACC==null || "".equals( CRTACC )
|| BANK_NAME==null || "".equals( BANK_NAME )
|| CRTNAM==null || "".equals( CRTNAM )
@ -315,11 +335,11 @@ public class CmbToPayController extends BaseFlowStartAction {
YURREF_INDEX = String.format("%02d", index);
}
String TRSAMT = distributor_all_money.toPlainString();
String TRSAMT = contract_all_money.toPlainString();
String YURREF = YURREF_INDEX + date+ temp_str;
String BNKFLG = checkCMB(BANK_NAME);
NUSAGE = "经销商["+CRTACC+"]发起申请";
String BUSNAR = "[实际付款][经销商:"+CRTACC+"][支付金额:"+TRSAMT+"]";
NUSAGE = "客户["+CRTACC+"]发起申请";
String BUSNAR = "[实际付款][客户:"+CRTACC+"][支付金额:"+TRSAMT+"]";
pay_detail = new SDKDcPayReqxVO();
pay_detail.setYURREF(YURREF);
@ -346,6 +366,7 @@ public class CmbToPayController extends BaseFlowStartAction {
pay_detail_bo.setAttributeValue("ID", UUID.randomUUID().toString().replaceAll("-", ""));
pay_detail_bo.setAttributeValue("CMB_PAY_NO", CMB_PAY_NO);
pay_detail_bo.setAttributeValue("DISTRIBUTOR_ID", DISTRIBUTOR_ID);
pay_detail_bo.setAttributeValue("CONTRACT_ID", CONTRACT_ID);
pay_detail_bo.setAttributeValue("FLOWUNID", FLOWUNID);
pay_detail_bo.setAttributeValue("YURREF", YURREF);
pay_detail_bo.setAttributeValue("DBTACC", DBTACC);
@ -409,7 +430,6 @@ public class CmbToPayController extends BaseFlowStartAction {
return jsonObj.toString();
}
if(result.getInfo().getSTATUS()==1) {
if("0".equals( result.getInfo().getRETCOD() )) {
pay_info_bo.setAttributeValue("FACT_MONEY",all_money.toPlainString());
@ -424,9 +444,10 @@ public class CmbToPayController extends BaseFlowStartAction {
if(pay_detail_list!=null && pay_detail_list.size()>0)
for (BizObject pay_detail_one : pay_detail_list) {
BizObjectQuery income_boo= income_bom.createQuery("update o join jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO lcf on o.contract_id = lcf.id set o.CMB_PAY_NO=:CMB_PAY_NO where o.PAY_TYPE = 'pay_type_out' and FLOWUNID=:FLOWUNID and lcf.distributor_id=:DISTRIBUTOR_ID");
BizObjectQuery income_boo= income_bom.createQuery("update o join jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO lcf on o.contract_id = lcf.id set o.CMB_PAY_NO=:CMB_PAY_NO where o.PAY_TYPE = 'pay_type_out' and o.FLOWUNID=:FLOWUNID and lcf.ID=:CONTRACT_ID");
income_boo.setParameter("CMB_PAY_NO",CMB_PAY_NO) ;
income_boo.setParameter("FLOWUNID",pay_detail_one.getAttribute("FLOWUNID").toString()) ;
income_boo.setParameter("CONTRACT_ID",pay_detail_one.getAttribute("CONTRACT_ID").toString()) ;
income_boo.setParameter("DISTRIBUTOR_ID",pay_detail_one.getAttribute("DISTRIBUTOR_ID").toString()) ;
income_boo.executeUpdate();//更新资金收付表
pay_detail_bom.saveObject(pay_detail_one); //插入支付详情表
@ -478,6 +499,7 @@ public class CmbToPayController extends BaseFlowStartAction {
if(pay_detail_list!=null && pay_detail_list.size()>0) {
for (BizObject pay_detail_one : pay_detail_list) {
if(DETAIL_YURREF.equals( pay_detail_one.getAttribute("YURREF").toString() )) {
callback_detail_bo.setAttributeValue("CONTRACT_ID",pay_detail_one.getAttribute("CONTRACT_ID").toString());
callback_detail_bo.setAttributeValue("DISTRIBUTOR_ID",pay_detail_one.getAttribute("DISTRIBUTOR_ID").toString());
}
}

View File

@ -108,6 +108,7 @@ public class PayController extends BaseFlowStartAction {
//安鹏要求采用固定写死值
//String LGNNAM = accountBo.getAttribute("OWN_NAME").toString();
String LGNNAM = "安鹏经办";
// String LGNNAM = "银企直连测试用户113";
String FUNNAM = "NTSTLINF";
int DATTYP = 2;
@ -236,6 +237,7 @@ public class PayController extends BaseFlowStartAction {
//安鹏要求采用固定写死值
//String LGNNAM = accountBo.getAttribute("OWN_NAME").toString();
String LGNNAM = "安鹏经办";
// String LGNNAM = "银企直连测试用户113";
String FUNNAM = "DCPAYREQ";
int DATTYP = 2;
String BUSMOD = "00001"; //默认参数 请按照实际情况谨慎修改