修改业务申请接口校验

This commit is contained in:
tangfutang 2018-11-16 18:24:01 +08:00
parent 7d40f9fd40
commit a1e1f7301f
5 changed files with 141 additions and 31 deletions

View File

@ -6,6 +6,7 @@
History Log:
*/
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
String customertype = CurPage.getParameter("CustomerType");
String orgName = CurUser.getOrgName();
String userName = CurUser.getUserName();
ASObjectModel doTemp = new ASObjectModel("VI_LB_IDENTITY_CHECK");
@ -13,6 +14,7 @@
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.MultiSelect = true; //添加多选框
dwTemp.genHTMLObjectWindow(sFlowUnid);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
@ -26,15 +28,25 @@
var flowunid = "<%=sFlowUnid%>";
var username = "<%=userName%>";
var orgname = "<%=orgName%>";
var customertype = "<%=customertype%>";
var relations=getItemValueArray(0,"relation").toString().replace(/,/g,"@");
var fullNames=getItemValueArray(0,"fullName").toString().replace(/,/g,"@");
if(relations.length==0){
alert("请先选择数据!!!");
return;
}
var result =
RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.IdentityVerification","doIdentityVerification","FlowUnid="+flowunid+",UserName="+username+",OrgName="+orgname);
RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.IdentityVerification","doIdentityVerification","FlowUnid="+flowunid+",UserName="+username+",OrgName="+orgname+",relations="+relations+",fullNames="+fullNames+",customertype="+customertype);
if(result == 'ERROR'){
alert("调用数据失败");
reloadSelf();
}else if(result == 'SUCCESS'){
alert('校验成功,请点击详情查看!');
reloadSelf();
}else{
alert(result);
reloadSelf();
}
}
function viewAndEdit(){

View File

@ -14,6 +14,7 @@
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.MultiSelect = true; //添加多选框
dwTemp.genHTMLObjectWindow(ProjectId);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
@ -25,7 +26,12 @@
<script type="text/javascript">
function checkPhoneNumberOnLine(){
var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.OnlineClient","getTelOnLine","flowunid=<%=flowunid%>,projectId=<%=ProjectId%>,userId=<%=userId%>");
var certids=getItemValueArray(0,"certid").toString().replace(/,/g,"@");
if(certids.length==0){
alert("请先选择数据!!!");
return;
}
var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.OnlineClient","getTelOnLine","flowunid=<%=flowunid%>,projectId=<%=ProjectId%>,userId=<%=userId%>,certids="+certids);
if(result=="true"){
window.location.reload();
}else{
@ -33,14 +39,39 @@
}
}
function retry(){
var onLineId = getItemValue(0,getRow(0),'online_id');
var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.OnlineClient","getTelOnLineReTry","onLineId="+onLineId+",userId=<%=userId%>");
if(result=="true"){
debugger;
// var onLineId = getItemValue(0,getRow(0),'online_id');
// var certids=getItemValueArray(0,"certid");
var online_ids=getItemValueArray(0,"online_id");
var NAMEs=getItemValueArray(0,"NAME");
var magess="";
var number=0;
for(var i=0;i<online_ids.length;i++){
if(online_ids[i]==""||"undefined"==online_ids[i]||null=="undefined"==online_ids[i]){
alert(NAMEs[i]+" : 没有进行手机时长校验,不能重发,请重新选择!!");
window.location.reload();
return;
};
}
for(var i=0;i<online_ids.length;i++){
<%-- var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.OnlineClient","getTelOnLineReTry","onLineId="+online_ids[i]+",userId=<%=userId%>"); --%>
var result = RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.OnlineClient","getTelOnLineReTry","onLineId="+1111+",userId=<%=userId%>");
if(result=="true"){
number++;
}else{
magess=magess+NAMEs[i]+":"+result+"! ";
AsDebug.showMessage('提示',result,'','',true);
}
}
if(online_ids.length==number){
alert("重发成功!!!");
window.location.reload();
}else{
AsDebug.showMessage('Ìáʾ',result,'','',true);
AsDebug.showMessage('提示',magess,'','',true);
window.location.reload();
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -3075,5 +3075,22 @@
</managerProperties>
</manager>
</class>
<class name="VI_CUSTOMER_INFO" label="客户信息" keyAttributes="">
<attributes>
<attribute name="certid" label="certid" type="STRING"/>
<attribute name="NAME" label="NAME" type="STRING"/>
<attribute name="phone" label="phone" type="STRING"/>
<attribute name="custtype" label="custtype" type="STRING"/>
<attribute name="typename" label="typename" type="STRING"/>
<attribute name="flowunid" label="flowunid" type="STRING"/>
<attribute name="projectid" label="projectid" type="STRING"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="vi_customer_info" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
</jbo>

View File

@ -30,6 +30,9 @@ public class IdentityVerification {
private String FlowUnid;
private String UserName;
private String OrgName;
private String relations;
private String fullNames;
private String customertype;
public String getFlowUnid() {
return FlowUnid;
@ -54,6 +57,30 @@ public class IdentityVerification {
public void setOrgName(String orgName) {
OrgName = orgName;
}
public String getRelations() {
return relations;
}
public void setRelations(String relations) {
this.relations = relations;
}
public String getFullNames() {
return fullNames;
}
public void setFullNames(String fullNames) {
this.fullNames = fullNames;
}
public String getCustomertype() {
return customertype;
}
public void setCustomertype(String customertype) {
this.customertype = customertype;
}
public String doIdentityVerification(JBOTransaction tx){
System.err.println(UserName+"@"+OrgName+"@"+FlowUnid);
@ -62,41 +89,56 @@ public class IdentityVerification {
BizObjectManager bom2 = JBOFactory.getBizObjectManager(CUSTOMER_FAMILY_TEMP.CLASS_NAME, tx);
BizObjectManager bom3 = JBOFactory.getBizObjectManager(LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, tx);
BizObjectManager bom4 = JBOFactory.getBizObjectManager(LC_IDENTITY_CHECK_RESULT_TEMP.CLASS_NAME,tx);
BizObject queryResult = bom4.createQuery("select result from O where flowunid=:FLOWUNID").setParameter("FLOWUNID",FlowUnid).getSingleResult(false);
String newfullName = fullNames.replace("@", "','");
System.out.println(newfullName);
BizObject queryResult = bom4.createQuery("select result from O where flowunid=:FLOWUNID and name in ('"+newfullName+"')").setParameter("FLOWUNID",FlowUnid).getSingleResult(false);
if(queryResult!=null){
return "身份证校验已执行过,不可重复执行";
}else{
//查询共同借款人
BizObject coborrowerResult = bom2.createQuery("SELECT "+
"name,"+
"certid "+
"FROM "+
"O WHERE flowunid=:FLOWUNID AND Partner_ = 'Y'").setParameter("FLOWUNID", FlowUnid).getSingleResult(false);
//查询担保人
@SuppressWarnings("unchecked")
List<BizObject> guarantorResultList = bom3.createQuery("SELECT "+
"fullname,"+
"certid "+
"FROM "+
"O WHERE flowunid=:FLOWUNID "
).setParameter("FLOWUNID",FlowUnid).getResultList(false);
//查询借款人
BizObject borrowerResult = bom1.createQuery("SELECT "+
return "数据中已有身份证校验已校验过,不可重复执行!!!";
}else{
String[] NewRelations = relations.split("@");
BizObject coborrowerResult = null;
@SuppressWarnings("unchecked")
List<BizObject> guarantorResultList = null ;
BizObject borrowerResult = null;
for(int i=0;i<NewRelations.length;i++){
if("共同申请人".equals(NewRelations[i])){
//查询共同借款人
coborrowerResult = bom2.createQuery("SELECT "+
"name,"+
"certid "+
"FROM "+
"O WHERE flowunid=:FLOWUNID AND Partner_ = 'Y'").setParameter("FLOWUNID", FlowUnid).getSingleResult(false);
}else if("担保人".equals(NewRelations[i])){
//查询担保人
guarantorResultList = bom3.createQuery("SELECT "+
"fullname,"+
"certid "+
"FROM "+
"O WHERE flowunid=:FLOWUNID and FULLNAME in ('"+newfullName+"')"
).setParameter("FLOWUNID",FlowUnid).getResultList(false);
}else if("申请人".equals(NewRelations[i])){
//查询借款人
borrowerResult = bom1.createQuery("SELECT "+
"O.fullname,"+
"O.certid,"+
"O.BalancesHEET,"+
"O.BalancesHEET,"+
"ci.customertype "+
" FROM "+
"O left join jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP ci "+
" ON O.customerid = ci.customerid "+
" WHERE O.flowunid=:FLOWUNID "+
"AND O.BALANCESHEET = '申请人' ").setParameter("FLOWUNID",FlowUnid).getSingleResult(false);
}
}
//判断用户是自然人还是法人
//将申请人,共同申请人,担保人等信息传入该类构建xml入参参数
String inConditions = "";
if("03".equals(borrowerResult.getAttribute("customertype").toString())){
//if("03".equals(borrowerResult.getAttribute("customertype").toString())){
if("03".equals(customertype)){
inConditions = SoapRequest.FirstXMLConfiguration(borrowerResult,coborrowerResult,guarantorResultList);
}else if("01".equals(borrowerResult.getAttribute("customertype").toString())){
//}else if("01".equals(borrowerResult.getAttribute("customertype").toString())){
}else if("01".equals(customertype)){
if(coborrowerResult == null && guarantorResultList.size()<=0 ){
return "共同申请人与担保人信息都为空!";
}else{

View File

@ -48,6 +48,7 @@ public class OnlineClient {
private String flowunid;
private String projectId;
private String userId;
private String certids;
private String onLineId;
public static void main(String[] org0) throws ClientProtocolException, IOException, URISyntaxException{
@ -169,9 +170,10 @@ public class OnlineClient {
//业务申请流程中获取包括 承租人共同申请人担保人的手机号
public String getTelOnLine(JBOTransaction tx){
String sql = "select certid,FULLNAME as name,MOBILE as phone,'assuror' as custtype,'担保人' as typename from LB_GUARANTEE_UNIT_TEMP where flowunid='"+flowunid+"' and CERTTYPE='Ind01' "
+ "union select certid,name,tel as phone,'unionlessee' as custtype,'共同申请人' as typename from CUSTOMER_FAMILY_TEMP where flowunid='"+flowunid+"' "//AND Partner_='Y'
+ "union select certid,fullname as name,mobile as phone,'lessee' as custtype,'承租人' as typename from customer_person_temp where flowunid='"+flowunid+"'";
String newcertids = certids.replace("@", "','");
String sql = "select certid,FULLNAME as name,MOBILE as phone,'assuror' as custtype,'担保人' as typename from LB_GUARANTEE_UNIT_TEMP where flowunid='"+flowunid+"' and CERTTYPE='Ind01' and certid in ('"+newcertids+"') "
+ "union select certid,name,tel as phone,'unionlessee' as custtype,'共同申请人' as typename from CUSTOMER_FAMILY_TEMP where flowunid='"+flowunid+" 'and certid in ('"+newcertids+"') "//AND Partner_='Y'
+ "union select certid,fullname as name,mobile as phone,'lessee' as custtype,'承租人' as typename from customer_person_temp where flowunid='"+flowunid+"' and certid in ('"+newcertids+"')";
try {
List<Map<String,String>> ds = DataOperatorUtil.getDataBySql(tx, sql, null);
if(ds.size()>0){
@ -258,6 +260,12 @@ public class OnlineClient {
public void setUserId(String userId) {
this.userId = userId;
}
public String getCertids() {
return certids;
}
public void setCertids(String certids) {
this.certids = certids;
}