1.网银收款客户名称自动带值逻辑。(网银接口带过来的只读不能修改;否则可修改。租金收款时或资金收款时自动带出;两者都有时且为同一承租人也自动带出;客户名称一旦保存,则不会再根据租金收款或资金收款自动带值)

This commit is contained in:
zhangbb 2019-10-14 12:03:26 +08:00
parent 0c384bcede
commit 6bbadc38aa
2 changed files with 89 additions and 8 deletions

View File

@ -8,6 +8,7 @@
*/
String sPrevUrl = CurPage.getParameter("PrevUrl");
String ishistory = CurPage.getParameter("IsHistory");
String flowUnid = CurPage.getParameter("FlowUnid");
//FlowKey中存的是EBANK_SN网银流水号
String ebankSn = CurPage.getParameter("FlowKey");
if(sPrevUrl == null) sPrevUrl = "";
@ -18,10 +19,20 @@
dwTemp.Style = "2";//freeform
dwTemp.ReadOnly = "1";//只读模式
dwTemp.genHTMLObjectWindow(CurPage.getParameter("FlowUnid"));
dwTemp.genHTMLObjectWindow(flowUnid);
IsNullCheck inc = new IsNullCheck();
inc.setEBANK_SN(ebankSn);
inc.setFlowUnid(flowUnid);
String result = inc.CustomerIdIsNullCheck();
String resultTemp = inc.CustomerIdIsNullCheckTemp();
String customerId="";
String customerName="";
if(!"N".equals(inc.getCustomerId())){
String [] customer = inc.getCustomerId().split("@");
customerId = customer[0];
customerName = customer[1];
}
String flag;
if(result=="Y"){
flag="true";
@ -36,9 +47,19 @@
<script type="text/javascript">
$(function(){
//如果为空Y则非只读
debugger;
if("<%=result%>"=="Y"){
setItemReadOnly(0, 0, "CUSTOMER_NAME", false);
//如果LC_EBANK_TEMP临时表里CUSTOMER_ID为空才自动赋值.
if("<%=resultTemp%>"=="Y"){
if("<%=inc.getCustomerId()%>"!="N"){
setItemValue(0, 0, "CUSTOMER_ID", "<%=customerId%>");
setItemValue(0, 0, "CUSTOMER_NAME", "<%=customerName%>");
}
}
}
});
function saveRecord(){

View File

@ -1,6 +1,12 @@
package com.tenwa.flow.lease.check.contract;
import java.util.List;
import jbo.app.tenwa.calc.LC_EBANK;
import jbo.app.tenwa.calc.LC_EBANK_TEMP;
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOException;
@ -8,15 +14,40 @@ import com.amarsoft.are.jbo.JBOFactory;
public class IsNullCheck {
private String EBANK_SN;
private String flowUnid;
public String getEBANK_SN() {
return EBANK_SN;
public String getCustomerId() throws JBOException{
List<BizObject> boRent=JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME, "FLOWUNID='"+flowUnid+"' group by CONTRACT_ID").getResultList(false);
List<BizObject> boFund=JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "FLOWUNID='"+flowUnid+"' group by CONTRACT_ID").getResultList(false);
String contractId="";
if(boRent.size()==1&&boFund.size()==1){
contractId = boRent.get(0).getAttribute("CONTRACT_ID").toString();
String contractId2 = boFund.get(0).getAttribute("CONTRACT_ID").toString();
if(contractId!=""&&contractId!=null&&contractId.equals(contractId2)){
}else{
return "N";
}
}
if((boRent.size()+boFund.size())==1){
if(boRent.size()==1){
contractId = boRent.get(0).getAttribute("CONTRACT_ID").toString();
}
if(boFund.size()==1){
contractId = boRent.get(0).getAttribute("CONTRACT_ID").toString();
}
}
if(contractId!=""&&contractId!=null){
BizObject boC = JBOFactory.createBizObjectQuery(LB_UNION_LESSEE.CLASS_NAME, "CONTRACT_ID='"+contractId+"' and is_main='Y'").getSingleResult(false);
String customerId = boC.getAttribute("CUSTOMER_ID").toString();
String customerName = boC.getAttribute("CUSTOMER_NAME").toString();
return customerId+"@"+customerName;
}
return "N";
}
public void setEBANK_SN(String eBANK_SN) {
EBANK_SN = eBANK_SN;
}
public String CustomerIdIsNullCheck() throws JBOException{
BizObject bo=JBOFactory.createBizObjectQuery(LC_EBANK.CLASS_NAME, "EBANK_SN='"+EBANK_SN+"'").getSingleResult(false);
if(bo!=null&&bo.getAttribute("CUSTOMER_ID")!=null){
@ -29,4 +60,33 @@ public class IsNullCheck {
}
return "error";
}
public String CustomerIdIsNullCheckTemp() throws JBOException{
BizObject bo=JBOFactory.createBizObjectQuery(LC_EBANK_TEMP.CLASS_NAME, "FLOWUNID='"+flowUnid+"'").getSingleResult(false);
if(bo!=null&&bo.getAttribute("CUSTOMER_ID")!=null){
String customerId = bo.getAttribute("CUSTOMER_ID").toString();
if(customerId==null||"".equals(customerId)){
return "Y";
}else{
return "N";
}
}
return "error";
}
public String getFlowUnid() {
return flowUnid;
}
public void setFlowUnid(String flowUnid) {
this.flowUnid = flowUnid;
}
public String getEBANK_SN() {
return EBANK_SN;
}
public void setEBANK_SN(String eBANK_SN) {
EBANK_SN = eBANK_SN;
}
}