Merge branch 'develop' of http://git2.tenwa.com.cn/ApzlDev/apzl_leasing.git into linxiaoping
This commit is contained in:
commit
78550cd8a9
@ -1,435 +1,444 @@
|
||||
<%@page import="com.sun.org.apache.xalan.internal.xsltc.compiler.sym"%>
|
||||
<%@page import="jbo.app.tenwa.customer.CUSTOMER_TYPE"%>
|
||||
<%@page import="jbo.app.tenwa.customer.CUSTOMER_INFO"%>
|
||||
<%@page import="java.util.Date"%>
|
||||
<%@page import="java.text.SimpleDateFormat"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
||||
|
||||
Date curdate = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
|
||||
String dateString = formatter.format(curdate);
|
||||
|
||||
String flowunid = CurPage.getParameter("FlowUnid");
|
||||
String customerid = Sqlca.getString("select customer_id from lb_union_lessee_temp where flowunid='"+flowunid+"'");
|
||||
String sTempletNo = "BusinessCustomerInfo";//--模板号--
|
||||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||||
String custname=CurPage.getParameter("custname");
|
||||
doTemp.setHtmlEvent("CERTID","onChange","changeCertid");
|
||||
doTemp.setHtmlEvent("MARRIAGE","onChange","changeChildrensNumber");
|
||||
String rightType = CurPage.getParameter("RightType");//页面只读与否
|
||||
if(rightType==null)rightType="";
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||||
doTemp.setDefaultValue("CERTTYPE", "Ind01");
|
||||
if(rightType.equals("ReadOnly")){
|
||||
doTemp.setColInnerBtEvent("fulladdress", "");//设置地址按钮
|
||||
}
|
||||
dwTemp.Style = "2";//freeform
|
||||
dwTemp.genHTMLObjectWindow(flowunid + "," + customerid);
|
||||
CurPage.getCurComp().setAttribute("RightType", rightType);
|
||||
if(rightType.equals("ReadOnly")){
|
||||
dwTemp.ReadOnly = "1";//只读模式
|
||||
}
|
||||
String customerType = "03";
|
||||
String compClientID = request.getParameter("CompClientID");
|
||||
//自然人标识
|
||||
String person = "person";
|
||||
dwTemp.replaceColumn("family", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"200px\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp?CompClientID="+compClientID+"&customerid="+customerid+"\"></iframe>", CurPage.getObjectWindowOutput());
|
||||
String sButtons[][] = {
|
||||
};
|
||||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
<script type="text/javascript">
|
||||
|
||||
function changeChildrensNumber(){
|
||||
var marriage = getItemValue(0,0,"MARRIAGE");
|
||||
if("02" == marriage){
|
||||
setItemValue(0,0,"childrens_number","");
|
||||
$("#CHILDRENS_NUMBER").attr("ReadOnly","true");
|
||||
// hideItem(0,'family');
|
||||
$("#A_Group_0030").attr("style","display:none;");
|
||||
}else{
|
||||
$("#CHILDRENS_NUMBER").removeAttr("ReadOnly");
|
||||
$("#A_Group_0030").attr("style","display:block;");
|
||||
}
|
||||
}
|
||||
|
||||
if(getItemValue(0,0,"CERTTYPE") == null || getItemValue(0,0,"CERTTYPE") == ""){
|
||||
setItemValue(0,0,"CERTTYPE","Ind01");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
//init();
|
||||
$("#FULLADDRESS").css("width",$("#FULLADDRESS").parent().parent().parent().parent()[0].clientWidth/2+200+"px");
|
||||
$("#FULLADDRESS").attr("ReadOnly","true");
|
||||
$("#ENTRYTIME").attr("ReadOnly","true");
|
||||
$("#WORKCORP")[0].width = $("#WORKCORP").parent().parent().parent()[0].clientWidth/2+200;
|
||||
$("#WORKADD")[0].width = $("#WORKADD").parent().parent().parent()[0].clientWidth/2+200;
|
||||
$("#WORKTEL")[0].width = $("#WORKTEL").parent().parent().parent()[0].clientWidth/2+200;
|
||||
if("ReadOnly" != "<%=rightType%>"){
|
||||
checkDriver();
|
||||
//ValidityCheck();
|
||||
}
|
||||
//changeOtherRequired();
|
||||
})
|
||||
var flag=false;//标记是否复制过客户
|
||||
function changeCertid(){
|
||||
var certid=getItemValue(0,0,"CERTID");
|
||||
var result=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","checkCustomerByCertID",'certid='+certid);
|
||||
if(result.length>0){
|
||||
var newInput='<input type="button" id="copyCust" value="复制" onclick="copyCustomer(\''+result+'\',\'<%=flowunid%>\')"/>';
|
||||
$("#CERTID").parent().append(newInput);
|
||||
}else{
|
||||
$("#copyCust").remove();
|
||||
}
|
||||
//判断是否承租人租赁车辆数量
|
||||
var res0=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","checkCustomerCarByCertid",'certid='+certid);
|
||||
if(res0 != "0"){
|
||||
alert(res0);
|
||||
}
|
||||
|
||||
}
|
||||
function copyCustomer(custid,flowunid){
|
||||
RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","copyCustomerInfo",'customerid='+custid+',flowunid='+flowunid);
|
||||
alert("复制成功!");
|
||||
reloadSelf();
|
||||
}
|
||||
function init(){
|
||||
var status = getItemValue(0, getRow(), "status");
|
||||
var certtype=getItemValue(0, getRow(), "certtype");
|
||||
var certid=getItemValue(0, getRow(), "certid");
|
||||
if(status!='status02'){
|
||||
setItemRequired(0,"certtype",false);
|
||||
setItemRequired(0,"certid",false);
|
||||
}
|
||||
var custtypes = $("input[name='CUSTTYPE']").length;
|
||||
for(var i=0;i<custtypes;i++){
|
||||
$("input[name='CUSTTYPE']").get(i).checked=true;
|
||||
}
|
||||
}
|
||||
function changeOtherRequired(){
|
||||
var status = getItemValue(0,getRow(),"status");
|
||||
var country = getItemValue(0,getRow(),"COUNTRY");
|
||||
if(status == "status02"){
|
||||
setItemRequired(0,"CUSTSOURCE",true);//客户来源
|
||||
setItemRequired(0,"CUSTKIND",true);//内部行业
|
||||
setItemRequired(0,"BIRTHDAY",true);//出生日期
|
||||
setItemRequired(0,"MARRIAGE",true);//婚姻状况
|
||||
setItemRequired(0,"OCCUPATION",true);//职业
|
||||
setItemRequired(0,"UNITKIND",true);//单位所属行业
|
||||
setItemRequired(0,"HEADSHIP",true);//职务
|
||||
setItemRequired(0,"title",true);//职称
|
||||
setItemRequired(0,"WORKCORP",true);//单位名称
|
||||
setItemRequired(0,"certtype",true);
|
||||
setItemRequired(0,"certid",true);
|
||||
}else{
|
||||
setItemRequired(0,"CUSTSOURCE",false);
|
||||
setItemRequired(0,"CUSTKIND",false);
|
||||
setItemRequired(0,"BIRTHDAY",false);
|
||||
setItemRequired(0,"MARRIAGE",false);
|
||||
setItemRequired(0,"OCCUPATION",false);
|
||||
setItemRequired(0,"UNITKIND",false);
|
||||
setItemRequired(0,"HEADSHIP",false);
|
||||
setItemRequired(0,"title",false);
|
||||
setItemRequired(0,"WORKCORP",false);
|
||||
setItemRequired(0,"certtype",false);
|
||||
setItemRequired(0,"certid",false);
|
||||
}
|
||||
if(status == "status02" && country=='CHN'){
|
||||
setItemRequired(0,"provincename",true);
|
||||
setItemRequired(0,"cityname",true);
|
||||
}else{
|
||||
setItemRequired(0,"provincename",false);
|
||||
setItemRequired(0,"cityname",false);
|
||||
}
|
||||
}
|
||||
|
||||
function CheckDate(){
|
||||
var idexpiry=getItemValue(0,getRow(),"IDEXPIRY");
|
||||
var date1 = "<%=dateString%>";
|
||||
|
||||
if(date1>=idexpiry){
|
||||
setErrorTips("IDEXPIRY","证件到期日必须晚于当前日期!");
|
||||
return false;
|
||||
}else{
|
||||
setErrorTips("IDEXPIRY","");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function saveRecord(leasfrom,projectSource){
|
||||
<%-- var idexpiry=getItemValue(0,getRow(),"IDEXPIRY");
|
||||
var date1 = "<%=dateString%>";
|
||||
if(date1>=idexpiry){
|
||||
alert("基本信息中的证件到期日的日期必须晚于当前日期");
|
||||
return false;
|
||||
} --%>
|
||||
var idexpiry=getItemValue(0,getRow(),"IDEXPIRY");
|
||||
if(idexpiry!=undefined&&idexpiry!=null&&idexpiry!=""){
|
||||
if(!CheckDate()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
ValidityCheck();
|
||||
setItemValue(0,0,"flowunid","<%=flowunid%>");
|
||||
if(!checkCertInfo(true)) return ;
|
||||
if(frame_list.window.save()){
|
||||
var certid=getItemValue(0,0,"CERTID");
|
||||
var customerid=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","updateCustomerId",'certid='+certid+',flowunid=<%=flowunid%>');
|
||||
setItemValue(0,0,"customerid",customerid);
|
||||
//as_save("myiframe0","frame_list.window.save(0);");
|
||||
as_save("0","saveCertInfo("+leasfrom+",'"+projectSource+"')");
|
||||
};
|
||||
}
|
||||
|
||||
function saveCertInfo(leasfrom,projectSource){
|
||||
|
||||
var sResult = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoManage","saveCertInfo",'project_source='+projectSource+',leas_from='+leasfrom+',idexpiry='+getItemValue(0,0,"idexpiry")+',certtype='+getItemValue(0,0,"certtype")+',customerid='+getItemValue(0,0,"customerid")+',flowunid=<%=flowunid%>,certid='+getItemValue(0,0,"certid")+',name='+getItemValue(0,0,"name")+',userid=<%=CurUser.getUserID()%>,orgid=<%=CurUser.getOrgID()%>');
|
||||
if(sResult == "SUCCESS"){
|
||||
reloadSelf();
|
||||
}
|
||||
}
|
||||
|
||||
function selectHomeAddress(){
|
||||
if(getItemValue(0,0,"fulladdress") == ""){
|
||||
newRecord();
|
||||
}else{
|
||||
edit();
|
||||
}
|
||||
}
|
||||
|
||||
//新增
|
||||
function newRecord(){
|
||||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerAddress.jsp";
|
||||
var fulladdress = getItemValue(0,getRow(0),'fulladdress');
|
||||
var country = getItemValue(0,getRow(0),'country');
|
||||
var province = getItemValue(0,getRow(0),'province');
|
||||
var dressdetail = getItemValue(0,getRow(0),'dressdetail');
|
||||
var zipcode = getItemValue(0,getRow(0),'zipcode');
|
||||
var provincename = getItemValue(0,getRow(0),'provincename');
|
||||
AsDialog.PopView(sUrl,'customer_id='+getItemValue(0,0,"ASSUROR")+"&flowunid=<%=flowunid%>&fulladdress="+fulladdress+"&country="+country+"&province="+province+"&dressdetail="+dressdetail+"&zipcode="+zipcode+"&provincename="+provincename,"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(result){
|
||||
if(result == "cancel"){
|
||||
return;
|
||||
}
|
||||
if(result !== ""){
|
||||
setItemValue(0,0,"addressid",result.split("@")[0]);
|
||||
setItemValue(0,0,"fulladdress",result.split("@")[1]);
|
||||
setItemValue(0,0,"country",result.split("@")[2]);
|
||||
setItemValue(0,0,"province",result.split("@")[3]);
|
||||
setItemValue(0,0,"dressdetail",result.split("@")[4]);
|
||||
setItemValue(0,0,"zipcode",result.split("@")[5]);
|
||||
setItemValue(0,0,"provincename",result.split("@")[6]);
|
||||
}
|
||||
},"新增地址信息");
|
||||
}
|
||||
//详情
|
||||
function view(){
|
||||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerAddress.jsp";
|
||||
var id = getItemValue(0,getRow(0),'addressid');
|
||||
if(typeof(id)=="undefined" || id.length==0 ){
|
||||
alert("请选择一条信息!");
|
||||
return ;
|
||||
}
|
||||
AsDialog.PopView(sUrl,'id=' +id+'&rightType=ReadOnly&flowunid=<%=flowunid%>',"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(result){
|
||||
if(result == "cancel"){
|
||||
return;
|
||||
}
|
||||
if(result !== ""){
|
||||
setItemValue(0,0,"addressid",result.split("@")[0]);
|
||||
setItemValue(0,0,"fulladdress",result.split("@")[1]);
|
||||
setItemValue(0,0,"country",result.split("@")[2]);
|
||||
setItemValue(0,0,"province",result.split("@")[3]);
|
||||
setItemValue(0,0,"dressdetail",result.split("@")[4]);
|
||||
setItemValue(0,0,"zipcode",result.split("@")[5]);
|
||||
setItemValue(0,0,"provincename",result.split("@")[6]);
|
||||
}
|
||||
},"地址详细信息");
|
||||
}
|
||||
//修改
|
||||
function edit(){
|
||||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerAddress.jsp";
|
||||
var id = getItemValue(0,getRow(0),'addressid');
|
||||
var fulladdress = getItemValue(0,getRow(0),'fulladdress');
|
||||
var country = getItemValue(0,getRow(0),'country');
|
||||
var province = getItemValue(0,getRow(0),'province');
|
||||
var dressdetail = getItemValue(0,getRow(0),'dressdetail');
|
||||
var zipcode = getItemValue(0,getRow(0),'zipcode');
|
||||
var provincename = getItemValue(0,getRow(0),'provincename');
|
||||
var flag = "edit";
|
||||
if(typeof(id)=="undefined" || id.length==0){
|
||||
if(fulladdress.length == 0){
|
||||
alert("请选择一条信息!");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
AsDialog.PopView(sUrl,"id="+id+"&customer_id="+getItemValue(0,0,"ASSUROR")+"&flowunid=<%=flowunid%>"+"&flag="+flag+"&fulladdress="+fulladdress+"&country="+country+"&province="+province+"&dressdetail="+dressdetail+"&zipcode="+zipcode+"&provincename="+provincename,"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(result){
|
||||
if(result == "cancel"){
|
||||
return;
|
||||
}
|
||||
if(result !== ""){
|
||||
setItemValue(0,0,"addressid",result.split("@")[0]);
|
||||
setItemValue(0,0,"fulladdress",result.split("@")[1]);
|
||||
setItemValue(0,0,"country",result.split("@")[2]);
|
||||
setItemValue(0,0,"province",result.split("@")[3]);
|
||||
setItemValue(0,0,"dressdetail",result.split("@")[4]);
|
||||
setItemValue(0,0,"zipcode",result.split("@")[5]);
|
||||
setItemValue(0,0,"provincename",result.split("@")[6]);
|
||||
}
|
||||
},"修改地址信息");
|
||||
}
|
||||
|
||||
function selectProviceCode(){//选择省份
|
||||
var countrycode = getItemValue(0,getRow(),"country");
|
||||
if(typeof(countrycode)!=undefined && countrycode == 'CHN'){
|
||||
var provincecode = getItemValue(0,getRow(),"province");
|
||||
var provincecodename = getItemValue(0,getRow(),"provincename");
|
||||
AsDialog.SetTreeValue("SelectProvice", "__0000", "province=itemno@provincename=itemname","itemno","itemname", [provincecode,provincecodename], false, true,"",function(sReturn){
|
||||
sReturn = sReturn.split("@");
|
||||
if(sReturn[0]!=provincecode){
|
||||
setItemValue(0,getRow(),"city","");
|
||||
setItemValue(0,getRow(),"cityname","");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function selectCityCode(){//选择城市
|
||||
var provincecode = getItemValue(0,getRow(),"province");
|
||||
if(typeof(provincecode)!=undefined && provincecode != ''){
|
||||
var citycode = getItemValue(0,getRow(),"city");
|
||||
var citycodename = getItemValue(0,getRow(),"cityname");
|
||||
var param = provincecode.substr(0,2);
|
||||
AsDialog.SetTreeValue("SelectCity", param+'0000,'+param+'__00', "city=itemno@cityname=itemname","itemno","itemname", [citycode,citycodename], false, true);
|
||||
}
|
||||
}
|
||||
function selectOrgnature(){//选择机构类型
|
||||
var orgnature = getItemValue(0,getRow(),"orgnature");
|
||||
var orgnaturename = getItemValue(0,getRow(),"orgnaturename");
|
||||
AsDialog.SetTreeValue("SelectOrgnature", '_0', "orgnature=itemno@orgnaturename=itemname","itemno","itemname", [orgnature,orgnaturename], false, true);
|
||||
}
|
||||
function ValidityCheck(){
|
||||
|
||||
if(<%=customerType%> == '03'){ //个人客户
|
||||
//校验证件类型为身份证或临时身份证时,出生日期是否同证件编号中的日期一致
|
||||
var certType = getItemValue(0,getRow(),"CERTTYPE");
|
||||
var certID = getItemValue(0,getRow(),"CERTID");
|
||||
|
||||
if(certType == 'Ind01' || certType == 'Ind08'){
|
||||
|
||||
//将身份证中的日期自动赋给出生日期,把身份证中的性别赋给性别
|
||||
if(certID.length == 15){
|
||||
sex = certID.substring(14);
|
||||
sex = parseInt(sex);
|
||||
certID = certID.substring(6,12);
|
||||
certID = "19"+certID.substring(0,2)+"/"+certID.substring(2,4)+"/"+certID.substring(4,6);
|
||||
setItemValue(0,getRow(),"BIRTHDAY",certID);
|
||||
if(sex%2==0){//奇男偶女
|
||||
setItemValue(0,getRow(),"SEX","2");
|
||||
|
||||
}else{
|
||||
setItemValue(0,getRow(),"SEX","1");
|
||||
|
||||
}
|
||||
}
|
||||
if(certID.length == 18){
|
||||
sex = certID.substring(16,17);
|
||||
sex = parseInt(sex);
|
||||
certID = certID.substring(6,14);
|
||||
certID = certID.substring(0,4)+"/"+certID.substring(4,6)+"/"+certID.substring(6,8);
|
||||
setItemValue(0,getRow(),"BIRTHDAY",certID);
|
||||
if(sex%2==0){//奇男偶女
|
||||
setItemValue(0,getRow(),"SEX","2");
|
||||
|
||||
|
||||
}else{
|
||||
setItemValue(0,getRow(),"SEX","1");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* function setErrorTips(colName,tips){
|
||||
if(tips==""){
|
||||
setItemUnit(0,getRow(),colName,"");
|
||||
return ;
|
||||
}
|
||||
setItemUnit(0,getRow(),colName,"<font color=red>"+tips+"</font>");
|
||||
} */
|
||||
|
||||
//校验驾驶证(是/否)
|
||||
function checkDriver(){
|
||||
var driverLicense = getItemValue(0,getRow(),"DRIVERLICENSE");
|
||||
if(driverLicense=='2'){
|
||||
setItemValue(0,getRow(),"LICENSENAME","");
|
||||
setItemReadOnly(0, getRow(), "LICENSENAME", true);
|
||||
setItemRequired(0, "LICENSENAME", false);
|
||||
}else{
|
||||
setItemReadOnly(0, getRow(), "LICENSENAME", false);
|
||||
setItemRequired(0, "LICENSENAME", true);
|
||||
}
|
||||
}
|
||||
|
||||
function setIdexpiry(){
|
||||
var date = document.getElementById("IDEXPIRY");
|
||||
var dateValue = "";
|
||||
dateValue = date.value;
|
||||
AsDialog.OpenCalender(date,"yyyy/MM/dd","1900/01/01","2100/12/31",function(dateValue){
|
||||
var myNewValue = "",myValue="";
|
||||
myValue = this.dayValue;
|
||||
if(typeof(myValue)!="undefined" && myValue!="undefined"){
|
||||
myNewValue = myValue;
|
||||
if(dateValue!=amarsoft2Real(myNewValue)){
|
||||
date.value = amarsoft2Real(myNewValue);
|
||||
setItemValue(0,getRow(0),"idexpiry",date.value);
|
||||
}
|
||||
}
|
||||
},0,document.getElementById("DWTR").offsetTop);
|
||||
}
|
||||
|
||||
function checkCertInfo(flag){
|
||||
if(typeof(flag)=="undefined") flag=false;
|
||||
var certType = getItemValue(0,getRow(),"certtype");
|
||||
var certid = getItemValue(0,getRow(),"certid");
|
||||
|
||||
//检查自然人证件
|
||||
if(certType == 'Ind01'){
|
||||
if (!checkIdCard(certid)){
|
||||
setErrorTips("certid",getBusinessMessage('156'));
|
||||
return false;
|
||||
}else{
|
||||
setErrorTips("certid","");
|
||||
}
|
||||
}
|
||||
// 护照验证
|
||||
if(certType == 'Ind03'){
|
||||
if (!checkCard(certid)){
|
||||
setErrorTips("certid","护照格式有误!");
|
||||
return false;
|
||||
}else{
|
||||
setErrorTips("certid","");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 护照验证
|
||||
function checkCard(value) {
|
||||
var re1 = /^[a-zA-Z]{5,17}$/;
|
||||
var re2 = /^[a-zA-Z0-9]{5,17}$/;
|
||||
return (re2.test(value)) || re1.test(value);
|
||||
}
|
||||
|
||||
function checkIdCard(value) {
|
||||
var re = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
return re.test(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
<%@page import="com.sun.org.apache.xalan.internal.xsltc.compiler.sym"%>
|
||||
<%@page import="jbo.app.tenwa.customer.CUSTOMER_TYPE"%>
|
||||
<%@page import="jbo.app.tenwa.customer.CUSTOMER_INFO"%>
|
||||
<%@page import="java.util.Date"%>
|
||||
<%@page import="java.text.SimpleDateFormat"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
|
||||
|
||||
Date curdate = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
|
||||
String dateString = formatter.format(curdate);
|
||||
|
||||
String flowunid = CurPage.getParameter("FlowUnid");
|
||||
String customerid = Sqlca.getString("select customer_id from lb_union_lessee_temp where flowunid='"+flowunid+"'");
|
||||
String sTempletNo = "BusinessCustomerInfo";//--模板号--
|
||||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||||
String custname=CurPage.getParameter("custname");
|
||||
System.out.print(custname+"=====================");
|
||||
doTemp.setHtmlEvent("CERTID","onChange","changeCertid");
|
||||
doTemp.setHtmlEvent("MARRIAGE","onChange","changeChildrensNumber");
|
||||
String rightType = CurPage.getParameter("RightType");//页面只读与否
|
||||
if(rightType==null)rightType="";
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
|
||||
doTemp.setDefaultValue("CERTTYPE", "Ind01");
|
||||
if(rightType.equals("ReadOnly")){
|
||||
doTemp.setColInnerBtEvent("fulladdress", "");//设置地址按钮
|
||||
}
|
||||
dwTemp.Style = "2";//freeform
|
||||
dwTemp.genHTMLObjectWindow(flowunid + "," + customerid);
|
||||
CurPage.getCurComp().setAttribute("RightType", rightType);
|
||||
if(rightType.equals("ReadOnly")){
|
||||
dwTemp.ReadOnly = "1";//只读模式
|
||||
}
|
||||
String customerType = "03";
|
||||
String compClientID = request.getParameter("CompClientID");
|
||||
//自然人标识
|
||||
String person = "person";
|
||||
dwTemp.replaceColumn("family", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"200px\" frameborder=\"0\" src=\""+sWebRootPath+"/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerFamilyTempInfo.jsp?CompClientID="+compClientID+"&customerid="+customerid+"\"></iframe>", CurPage.getObjectWindowOutput());
|
||||
String sButtons[][] = {
|
||||
{"true","","Button","身份校验","身份校验","identityVerification()","","","","btn_icon_check",""}
|
||||
};
|
||||
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function identityVerification(){
|
||||
var id = getItemValue(0,0,'ID');
|
||||
var result=RunJavaMethodTrans("com.tenwa.lease.flow.project.validate.IdentityVerification","doIdentityVerification",'id='+id);
|
||||
if(result == 'ERROR'){
|
||||
alert('验证失败');
|
||||
}else{
|
||||
alert(result);
|
||||
}
|
||||
}
|
||||
function changeChildrensNumber(){
|
||||
var marriage = getItemValue(0,0,"MARRIAGE");
|
||||
if("02" == marriage){
|
||||
setItemValue(0,0,"childrens_number","");
|
||||
$("#CHILDRENS_NUMBER").attr("ReadOnly","true");
|
||||
// hideItem(0,'family');
|
||||
$("#A_Group_0030").attr("style","display:none;");
|
||||
}else{
|
||||
$("#CHILDRENS_NUMBER").removeAttr("ReadOnly");
|
||||
$("#A_Group_0030").attr("style","display:block;");
|
||||
}
|
||||
}
|
||||
|
||||
if(getItemValue(0,0,"CERTTYPE") == null || getItemValue(0,0,"CERTTYPE") == ""){
|
||||
setItemValue(0,0,"CERTTYPE","Ind01");
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
//init();
|
||||
$("#FULLADDRESS").css("width",$("#FULLADDRESS").parent().parent().parent().parent()[0].clientWidth/2+200+"px");
|
||||
$("#FULLADDRESS").attr("ReadOnly","true");
|
||||
$("#ENTRYTIME").attr("ReadOnly","true");
|
||||
$("#WORKCORP")[0].width = $("#WORKCORP").parent().parent().parent()[0].clientWidth/2+200;
|
||||
$("#WORKADD")[0].width = $("#WORKADD").parent().parent().parent()[0].clientWidth/2+200;
|
||||
$("#WORKTEL")[0].width = $("#WORKTEL").parent().parent().parent()[0].clientWidth/2+200;
|
||||
if("ReadOnly" != "<%=rightType%>"){
|
||||
checkDriver();
|
||||
//ValidityCheck();
|
||||
}
|
||||
//changeOtherRequired();
|
||||
})
|
||||
var flag=false;//标记是否复制过客户
|
||||
function changeCertid(){
|
||||
var certid=getItemValue(0,0,"CERTID");
|
||||
var result=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","checkCustomerByCertID",'certid='+certid);
|
||||
if(result.length>0){
|
||||
var newInput='<input type="button" id="copyCust" value="复制" onclick="copyCustomer(\''+result+'\',\'<%=flowunid%>\')"/>';
|
||||
$("#CERTID").parent().append(newInput);
|
||||
}else{
|
||||
$("#copyCust").remove();
|
||||
}
|
||||
//判断是否承租人租赁车辆数量
|
||||
var res0=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","checkCustomerCarByCertid",'certid='+certid);
|
||||
if(res0 != "0"){
|
||||
alert(res0);
|
||||
}
|
||||
|
||||
}
|
||||
function copyCustomer(custid,flowunid){
|
||||
RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","copyCustomerInfo",'customerid='+custid+',flowunid='+flowunid);
|
||||
alert("复制成功!");
|
||||
reloadSelf();
|
||||
}
|
||||
function init(){
|
||||
var status = getItemValue(0, getRow(), "status");
|
||||
var certtype=getItemValue(0, getRow(), "certtype");
|
||||
var certid=getItemValue(0, getRow(), "certid");
|
||||
if(status!='status02'){
|
||||
setItemRequired(0,"certtype",false);
|
||||
setItemRequired(0,"certid",false);
|
||||
}
|
||||
var custtypes = $("input[name='CUSTTYPE']").length;
|
||||
for(var i=0;i<custtypes;i++){
|
||||
$("input[name='CUSTTYPE']").get(i).checked=true;
|
||||
}
|
||||
}
|
||||
function changeOtherRequired(){
|
||||
var status = getItemValue(0,getRow(),"status");
|
||||
var country = getItemValue(0,getRow(),"COUNTRY");
|
||||
if(status == "status02"){
|
||||
setItemRequired(0,"CUSTSOURCE",true);//客户来源
|
||||
setItemRequired(0,"CUSTKIND",true);//内部行业
|
||||
setItemRequired(0,"BIRTHDAY",true);//出生日期
|
||||
setItemRequired(0,"MARRIAGE",true);//婚姻状况
|
||||
setItemRequired(0,"OCCUPATION",true);//职业
|
||||
setItemRequired(0,"UNITKIND",true);//单位所属行业
|
||||
setItemRequired(0,"HEADSHIP",true);//职务
|
||||
setItemRequired(0,"title",true);//职称
|
||||
setItemRequired(0,"WORKCORP",true);//单位名称
|
||||
setItemRequired(0,"certtype",true);
|
||||
setItemRequired(0,"certid",true);
|
||||
}else{
|
||||
setItemRequired(0,"CUSTSOURCE",false);
|
||||
setItemRequired(0,"CUSTKIND",false);
|
||||
setItemRequired(0,"BIRTHDAY",false);
|
||||
setItemRequired(0,"MARRIAGE",false);
|
||||
setItemRequired(0,"OCCUPATION",false);
|
||||
setItemRequired(0,"UNITKIND",false);
|
||||
setItemRequired(0,"HEADSHIP",false);
|
||||
setItemRequired(0,"title",false);
|
||||
setItemRequired(0,"WORKCORP",false);
|
||||
setItemRequired(0,"certtype",false);
|
||||
setItemRequired(0,"certid",false);
|
||||
}
|
||||
if(status == "status02" && country=='CHN'){
|
||||
setItemRequired(0,"provincename",true);
|
||||
setItemRequired(0,"cityname",true);
|
||||
}else{
|
||||
setItemRequired(0,"provincename",false);
|
||||
setItemRequired(0,"cityname",false);
|
||||
}
|
||||
}
|
||||
|
||||
function CheckDate(){
|
||||
var idexpiry=getItemValue(0,getRow(),"IDEXPIRY");
|
||||
var date1 = "<%=dateString%>";
|
||||
|
||||
if(date1>=idexpiry){
|
||||
setErrorTips("IDEXPIRY","证件到期日必须晚于当前日期!");
|
||||
return false;
|
||||
}else{
|
||||
setErrorTips("IDEXPIRY","");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function saveRecord(leasfrom,projectSource){
|
||||
<%-- var idexpiry=getItemValue(0,getRow(),"IDEXPIRY");
|
||||
var date1 = "<%=dateString%>";
|
||||
if(date1>=idexpiry){
|
||||
alert("基本信息中的证件到期日的日期必须晚于当前日期");
|
||||
return false;
|
||||
} --%>
|
||||
var idexpiry=getItemValue(0,getRow(),"IDEXPIRY");
|
||||
if(idexpiry!=undefined&&idexpiry!=null&&idexpiry!=""){
|
||||
if(!CheckDate()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
ValidityCheck();
|
||||
setItemValue(0,0,"flowunid","<%=flowunid%>");
|
||||
if(!checkCertInfo(true)) return ;
|
||||
if(frame_list.window.save()){
|
||||
var certid=getItemValue(0,0,"CERTID");
|
||||
var customerid=RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerAction","updateCustomerId",'certid='+certid+',flowunid=<%=flowunid%>');
|
||||
setItemValue(0,0,"customerid",customerid);
|
||||
as_save("0","saveCertInfo("+leasfrom+",'"+projectSource+"')");
|
||||
};
|
||||
}
|
||||
|
||||
function saveCertInfo(leasfrom,projectSource){
|
||||
|
||||
var sResult = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoManage","saveCertInfo",'project_source='+projectSource+',leas_from='+leasfrom+',idexpiry='+getItemValue(0,0,"idexpiry")+',certtype='+getItemValue(0,0,"certtype")+',customerid='+getItemValue(0,0,"customerid")+',flowunid=<%=flowunid%>,certid='+getItemValue(0,0,"certid")+',name='+getItemValue(0,0,"name")+',userid=<%=CurUser.getUserID()%>,orgid=<%=CurUser.getOrgID()%>');
|
||||
if(sResult == "SUCCESS"){
|
||||
reloadSelf();
|
||||
}
|
||||
}
|
||||
|
||||
function selectHomeAddress(){
|
||||
if(getItemValue(0,0,"fulladdress") == ""){
|
||||
newRecord();
|
||||
}else{
|
||||
edit();
|
||||
}
|
||||
}
|
||||
|
||||
//新增
|
||||
function newRecord(){
|
||||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerAddress.jsp";
|
||||
var fulladdress = getItemValue(0,getRow(0),'fulladdress');
|
||||
var country = getItemValue(0,getRow(0),'country');
|
||||
var province = getItemValue(0,getRow(0),'province');
|
||||
var dressdetail = getItemValue(0,getRow(0),'dressdetail');
|
||||
var zipcode = getItemValue(0,getRow(0),'zipcode');
|
||||
var provincename = getItemValue(0,getRow(0),'provincename');
|
||||
AsDialog.PopView(sUrl,'customer_id='+getItemValue(0,0,"ASSUROR")+"&flowunid=<%=flowunid%>&fulladdress="+fulladdress+"&country="+country+"&province="+province+"&dressdetail="+dressdetail+"&zipcode="+zipcode+"&provincename="+provincename,"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(result){
|
||||
if(result == "cancel"){
|
||||
return;
|
||||
}
|
||||
if(result !== ""){
|
||||
setItemValue(0,0,"addressid",result.split("@")[0]);
|
||||
setItemValue(0,0,"fulladdress",result.split("@")[1]);
|
||||
setItemValue(0,0,"country",result.split("@")[2]);
|
||||
setItemValue(0,0,"province",result.split("@")[3]);
|
||||
setItemValue(0,0,"dressdetail",result.split("@")[4]);
|
||||
setItemValue(0,0,"zipcode",result.split("@")[5]);
|
||||
setItemValue(0,0,"provincename",result.split("@")[6]);
|
||||
}
|
||||
},"新增地址信息");
|
||||
}
|
||||
//详情
|
||||
function view(){
|
||||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerAddress.jsp";
|
||||
var id = getItemValue(0,getRow(0),'addressid');
|
||||
if(typeof(id)=="undefined" || id.length==0 ){
|
||||
alert("请选择一条信息!");
|
||||
return ;
|
||||
}
|
||||
AsDialog.PopView(sUrl,'id=' +id+'&rightType=ReadOnly&flowunid=<%=flowunid%>',"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(result){
|
||||
if(result == "cancel"){
|
||||
return;
|
||||
}
|
||||
if(result !== ""){
|
||||
setItemValue(0,0,"addressid",result.split("@")[0]);
|
||||
setItemValue(0,0,"fulladdress",result.split("@")[1]);
|
||||
setItemValue(0,0,"country",result.split("@")[2]);
|
||||
setItemValue(0,0,"province",result.split("@")[3]);
|
||||
setItemValue(0,0,"dressdetail",result.split("@")[4]);
|
||||
setItemValue(0,0,"zipcode",result.split("@")[5]);
|
||||
setItemValue(0,0,"provincename",result.split("@")[6]);
|
||||
}
|
||||
},"地址详细信息");
|
||||
}
|
||||
//修改
|
||||
function edit(){
|
||||
var sUrl = "/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerAddress.jsp";
|
||||
var id = getItemValue(0,getRow(0),'addressid');
|
||||
var fulladdress = getItemValue(0,getRow(0),'fulladdress');
|
||||
var country = getItemValue(0,getRow(0),'country');
|
||||
var province = getItemValue(0,getRow(0),'province');
|
||||
var dressdetail = getItemValue(0,getRow(0),'dressdetail');
|
||||
var zipcode = getItemValue(0,getRow(0),'zipcode');
|
||||
var provincename = getItemValue(0,getRow(0),'provincename');
|
||||
var flag = "edit";
|
||||
if(typeof(id)=="undefined" || id.length==0){
|
||||
if(fulladdress.length == 0){
|
||||
alert("请选择一条信息!");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
AsDialog.PopView(sUrl,"id="+id+"&customer_id="+getItemValue(0,0,"ASSUROR")+"&flowunid=<%=flowunid%>"+"&flag="+flag+"&fulladdress="+fulladdress+"&country="+country+"&province="+province+"&dressdetail="+dressdetail+"&zipcode="+zipcode+"&provincename="+provincename,"resizable=yes;dialogWidth=600px;dialogHeight=355px;center:yes;status:no;statusbar:no",function(result){
|
||||
if(result == "cancel"){
|
||||
return;
|
||||
}
|
||||
if(result !== ""){
|
||||
setItemValue(0,0,"addressid",result.split("@")[0]);
|
||||
setItemValue(0,0,"fulladdress",result.split("@")[1]);
|
||||
setItemValue(0,0,"country",result.split("@")[2]);
|
||||
setItemValue(0,0,"province",result.split("@")[3]);
|
||||
setItemValue(0,0,"dressdetail",result.split("@")[4]);
|
||||
setItemValue(0,0,"zipcode",result.split("@")[5]);
|
||||
setItemValue(0,0,"provincename",result.split("@")[6]);
|
||||
}
|
||||
},"修改地址信息");
|
||||
}
|
||||
|
||||
function selectProviceCode(){//选择省份
|
||||
var countrycode = getItemValue(0,getRow(),"country");
|
||||
if(typeof(countrycode)!=undefined && countrycode == 'CHN'){
|
||||
var provincecode = getItemValue(0,getRow(),"province");
|
||||
var provincecodename = getItemValue(0,getRow(),"provincename");
|
||||
AsDialog.SetTreeValue("SelectProvice", "__0000", "province=itemno@provincename=itemname","itemno","itemname", [provincecode,provincecodename], false, true,"",function(sReturn){
|
||||
sReturn = sReturn.split("@");
|
||||
if(sReturn[0]!=provincecode){
|
||||
setItemValue(0,getRow(),"city","");
|
||||
setItemValue(0,getRow(),"cityname","");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function selectCityCode(){//选择城市
|
||||
var provincecode = getItemValue(0,getRow(),"province");
|
||||
if(typeof(provincecode)!=undefined && provincecode != ''){
|
||||
var citycode = getItemValue(0,getRow(),"city");
|
||||
var citycodename = getItemValue(0,getRow(),"cityname");
|
||||
var param = provincecode.substr(0,2);
|
||||
AsDialog.SetTreeValue("SelectCity", param+'0000,'+param+'__00', "city=itemno@cityname=itemname","itemno","itemname", [citycode,citycodename], false, true);
|
||||
}
|
||||
}
|
||||
function selectOrgnature(){//选择机构类型
|
||||
var orgnature = getItemValue(0,getRow(),"orgnature");
|
||||
var orgnaturename = getItemValue(0,getRow(),"orgnaturename");
|
||||
AsDialog.SetTreeValue("SelectOrgnature", '_0', "orgnature=itemno@orgnaturename=itemname","itemno","itemname", [orgnature,orgnaturename], false, true);
|
||||
}
|
||||
function ValidityCheck(){
|
||||
|
||||
if(<%=customerType%> == '03'){ //个人客户
|
||||
//校验证件类型为身份证或临时身份证时,出生日期是否同证件编号中的日期一致
|
||||
var certType = getItemValue(0,getRow(),"CERTTYPE");
|
||||
var certID = getItemValue(0,getRow(),"CERTID");
|
||||
|
||||
if(certType == 'Ind01' || certType == 'Ind08'){
|
||||
|
||||
//将身份证中的日期自动赋给出生日期,把身份证中的性别赋给性别
|
||||
if(certID.length == 15){
|
||||
sex = certID.substring(14);
|
||||
sex = parseInt(sex);
|
||||
certID = certID.substring(6,12);
|
||||
certID = "19"+certID.substring(0,2)+"/"+certID.substring(2,4)+"/"+certID.substring(4,6);
|
||||
setItemValue(0,getRow(),"BIRTHDAY",certID);
|
||||
if(sex%2==0){//奇男偶女
|
||||
setItemValue(0,getRow(),"SEX","2");
|
||||
|
||||
}else{
|
||||
setItemValue(0,getRow(),"SEX","1");
|
||||
|
||||
}
|
||||
}
|
||||
if(certID.length == 18){
|
||||
sex = certID.substring(16,17);
|
||||
sex = parseInt(sex);
|
||||
certID = certID.substring(6,14);
|
||||
certID = certID.substring(0,4)+"/"+certID.substring(4,6)+"/"+certID.substring(6,8);
|
||||
setItemValue(0,getRow(),"BIRTHDAY",certID);
|
||||
if(sex%2==0){//奇男偶女
|
||||
setItemValue(0,getRow(),"SEX","2");
|
||||
|
||||
|
||||
}else{
|
||||
setItemValue(0,getRow(),"SEX","1");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* function setErrorTips(colName,tips){
|
||||
if(tips==""){
|
||||
setItemUnit(0,getRow(),colName,"");
|
||||
return ;
|
||||
}
|
||||
setItemUnit(0,getRow(),colName,"<font color=red>"+tips+"</font>");
|
||||
} */
|
||||
|
||||
//校验驾驶证(是/否)
|
||||
function checkDriver(){
|
||||
var driverLicense = getItemValue(0,getRow(),"DRIVERLICENSE");
|
||||
if(driverLicense=='2'){
|
||||
setItemValue(0,getRow(),"LICENSENAME","");
|
||||
setItemReadOnly(0, getRow(), "LICENSENAME", true);
|
||||
setItemRequired(0, "LICENSENAME", false);
|
||||
}else{
|
||||
setItemReadOnly(0, getRow(), "LICENSENAME", false);
|
||||
setItemRequired(0, "LICENSENAME", true);
|
||||
}
|
||||
}
|
||||
|
||||
function setIdexpiry(){
|
||||
var date = document.getElementById("IDEXPIRY");
|
||||
var dateValue = "";
|
||||
dateValue = date.value;
|
||||
AsDialog.OpenCalender(date,"yyyy/MM/dd","1900/01/01","2100/12/31",function(dateValue){
|
||||
var myNewValue = "",myValue="";
|
||||
myValue = this.dayValue;
|
||||
if(typeof(myValue)!="undefined" && myValue!="undefined"){
|
||||
myNewValue = myValue;
|
||||
if(dateValue!=amarsoft2Real(myNewValue)){
|
||||
date.value = amarsoft2Real(myNewValue);
|
||||
setItemValue(0,getRow(0),"idexpiry",date.value);
|
||||
}
|
||||
}
|
||||
},0,document.getElementById("DWTR").offsetTop);
|
||||
}
|
||||
|
||||
function checkCertInfo(flag){
|
||||
if(typeof(flag)=="undefined") flag=false;
|
||||
var certType = getItemValue(0,getRow(),"certtype");
|
||||
var certid = getItemValue(0,getRow(),"certid");
|
||||
|
||||
//检查自然人证件
|
||||
if(certType == 'Ind01'){
|
||||
if (!checkIdCard(certid)){
|
||||
setErrorTips("certid",getBusinessMessage('156'));
|
||||
return false;
|
||||
}else{
|
||||
setErrorTips("certid","");
|
||||
}
|
||||
}
|
||||
// 护照验证
|
||||
if(certType == 'Ind03'){
|
||||
if (!checkCard(certid)){
|
||||
setErrorTips("certid","护照格式有误!");
|
||||
return false;
|
||||
}else{
|
||||
setErrorTips("certid","");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 护照验证
|
||||
function checkCard(value) {
|
||||
var re1 = /^[a-zA-Z]{5,17}$/;
|
||||
var re2 = /^[a-zA-Z0-9]{5,17}$/;
|
||||
return (re2.test(value)) || re1.test(value);
|
||||
}
|
||||
|
||||
function checkIdCard(value) {
|
||||
var re = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
return re.test(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
|
||||
BIN
WebContent/WEB-INF/lib/commons-discovery-0.2.jar
Normal file
BIN
WebContent/WEB-INF/lib/commons-discovery-0.2.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/jaxen-1.1-beta-9.jar
Normal file
BIN
WebContent/WEB-INF/lib/jaxen-1.1-beta-9.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/wsdl4j.jar
Normal file
BIN
WebContent/WEB-INF/lib/wsdl4j.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/wstx-asl-3.2.0.jar
Normal file
BIN
WebContent/WEB-INF/lib/wstx-asl-3.2.0.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/xfire-all-1.2.6.jar
Normal file
BIN
WebContent/WEB-INF/lib/xfire-all-1.2.6.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/xfire-ws-security-1.2.6.jar
Normal file
BIN
WebContent/WEB-INF/lib/xfire-ws-security-1.2.6.jar
Normal file
Binary file not shown.
BIN
WebContent/WEB-INF/lib/xml-apis.jar
Normal file
BIN
WebContent/WEB-INF/lib/xml-apis.jar
Normal file
Binary file not shown.
1
config/license.properties
Normal file
1
config/license.properties
Normal file
@ -0,0 +1 @@
|
||||
key=JTNGdiUzRnpVJTNEJTVDWCU1Q1olM0YlNUIlNUM5ZHgrJTI0JTVDJTIwMyUyM0IlM0RLNCUzRmMlM0ZvJTNGZyUzRmslM0ZoJTNGb2JTN19SS0gwY2Q3JTI5MSUyNUQ5RyU1RCUzRmMlM0ZvYjRLL1J0ZEUlM0Z6JTNGeCUyNi0lM0Z2JTVDakAvUmthM0piJTYwVkR4JTNGeCUzRnZNciU1Q2glNUJwR3FVaSU1QnFFdkBoJTNGeCUzRnYlNUR3Tm1PbU0vL2slM0ZnKnklM0ZkJTNBcyUzRnM2ZyUzRnYlMjYvJTVCaiU1QiUzQkdnQm0lM0Z4JTNGdk93Tm1JekpnJTNGeDViKnklM0ZkJTNGZiUzRmQyYSUzRnYyb1h4RWZPbU9zJTNGeCUzRnZKal9lTWJjNiUzRnhVQiUzQVVBNSU1QlhGLSU1RCUyMFQlNjAvQS9yJTNGZCUzRC4lM0ZnJTNEZjluMm9VaFRpYjBacCUyNnIlM0Z2TnAlNjAlNUNZYSU1RGdUdk1jT29EeiUzRnhNdiUzRmclM0ZnJTNGZyUzRmclM0ZnJTNGdi54TnBPZyU1RGclNUVmVnhQJTVCTmklNjAzJTNGeCUzRnZJelkvNnQlM0Z4JTNGdiUzRmpOdWNaJTVCcCU1Qi8lNUNxTnpJaCU1RWslM0Z4JTNGdmNaJTYwNCU1Q2dWeiU1Q3FBY0tnVWlZZVNxJTYwJTIwMWglM0Z2RnpIJTVCQS5HdiUzRng3diUzRG4lM0YvJTNGcyUzRnYlM0ZqJTVCb015ViU1QmI1JTNGeCUzRnYlM0ZqQCUzQmI2UXZHa0ZoQHZfeVolM0JUeUJiUCU1QiUzRnhkJTI1JTNGaiU2MC0lNUVlTGhWJTNCQ2ZhQ2I2JTNGeA==
|
||||
@ -0,0 +1,52 @@
|
||||
package com.tenwa.lease.flow.project.validate;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class FileObjectSetPhone implements Serializable {
|
||||
|
||||
//授权文件内容
|
||||
private String license=null;
|
||||
//上传的条件excel文件
|
||||
private byte[] file=null;
|
||||
//接收信息
|
||||
private String info=null;
|
||||
//文件类型:xls
|
||||
private String type=null;
|
||||
|
||||
public FileObjectSetPhone() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String getLicense() {
|
||||
return license;
|
||||
}
|
||||
|
||||
public void setLicense(String license) {
|
||||
this.license = license;
|
||||
}
|
||||
|
||||
public byte[] getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(byte[] file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.tenwa.lease.flow.project.validate;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.Element;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
|
||||
public class IdentityVerification {
|
||||
|
||||
private String id;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String doIdentityVerification(JBOTransaction tx){
|
||||
try {
|
||||
BizObjectManager bom1 = JBOFactory.getBizObjectManager(CUSTOMER_PERSON_TEMP.CLASS_NAME,tx);
|
||||
BizObject identityObject = bom1.createQuery("ID=:id").setParameter("id", id).getSingleResult(false);
|
||||
//读取授权文件,因为其他方法都读取不到,只能通过此方法
|
||||
Properties prop = new Properties();
|
||||
InputStream in= IdentityVerification.class.getClassLoader().getResourceAsStream("license.properties");
|
||||
prop.load(in);
|
||||
String property = prop.getProperty("key");
|
||||
Base64 base64 = new Base64();
|
||||
String msg = new String(base64.decode(property.getBytes("utf-8")),"utf-8");
|
||||
String decode = URLDecoder.decode(msg,"utf-8");
|
||||
char[] charArray = decode.toCharArray();
|
||||
charArray[16]='+';
|
||||
decode = new String(charArray);
|
||||
String inConditions = SoapRequest.XMLConfiguration(identityObject.getAttribute("CERTID").getString(),identityObject.getAttribute("FULLNAME").getString());
|
||||
String result = NciicClient.executeClient("NciicServices",decode,inConditions);
|
||||
Document document = DocumentHelper.parseText(result);
|
||||
Element rootElement = document.getRootElement();
|
||||
String finalResult = "";
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if("RESPONSE".equals(rootElement.getName())){
|
||||
Element rowElement = rootElement.element("ROWS").element("ROW");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Element> elements = rowElement.elements();
|
||||
for(Element element:elements){
|
||||
sb.append(element.getText()+",");
|
||||
}
|
||||
String message = sb.toString().split(",")[1];
|
||||
finalResult = "验证失败:"+message;
|
||||
}else if("ROWS".equals(rootElement.getName())){
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Element> itemElement = rootElement.element("ROW").element("OUTPUT").elements("ITEM");
|
||||
@SuppressWarnings("unchecked")
|
||||
List <Element>resultElement1 = itemElement.get(0).elements();
|
||||
@SuppressWarnings("unchecked")
|
||||
List <Element>resultElement2= itemElement.get(1).elements();
|
||||
if("errormesage".equals(resultElement1.get(0).getName())){
|
||||
finalResult = "错误信息:"+ resultElement1.get(0).getText()+",错误字段:"
|
||||
+ resultElement2.get(0).getText();
|
||||
}else if("gmsfhm".equals(resultElement1.get(0).getName())){
|
||||
finalResult = "身份证号码对比结果:"+ resultElement1.get(1).getText()+",姓名对比结果:"
|
||||
+ resultElement2.get(1).getText();
|
||||
}
|
||||
}
|
||||
return finalResult;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "ERROR";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.tenwa.lease.flow.project.validate;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import org.apache.commons.httpclient.protocol.Protocol;
|
||||
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
|
||||
import org.codehaus.xfire.client.Client;
|
||||
import org.codehaus.xfire.client.XFireProxy;
|
||||
import org.codehaus.xfire.client.XFireProxyFactory;
|
||||
import org.codehaus.xfire.service.Service;
|
||||
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
|
||||
import org.codehaus.xfire.transport.http.CommonsHttpMessageSender;
|
||||
import org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory;
|
||||
import org.codehaus.xfire.util.dom.DOMOutHandler;
|
||||
|
||||
public class NciicClient {
|
||||
|
||||
public static final String SERVICE_URL = "https://ws.nciic.org.cn/nciic_ws/services/";
|
||||
/*public NciicClient() {
|
||||
}*/
|
||||
public static void main(String[] args) throws MalformedURLException {
|
||||
|
||||
try{
|
||||
|
||||
String IDNo = "140225199408171330";
|
||||
|
||||
String username = "张磊";
|
||||
|
||||
String license = ReadFile.ReadLine("D://app//license.txt");
|
||||
System.out.println(license);
|
||||
String inConditions = SoapRequest.XMLConfiguration(IDNo, username);
|
||||
|
||||
new NciicClient().executeClient("NciicServices", license , inConditions);
|
||||
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
public static String executeClient(String serviceName, String license, String condition)
|
||||
throws MalformedURLException {
|
||||
long time = System.currentTimeMillis();
|
||||
//调用生产环境接口时,需要采用https
|
||||
ProtocolSocketFactory easy = new EasySSLProtocolSocketFactory();
|
||||
Protocol protocol = new Protocol("https", easy, 443);
|
||||
Protocol.registerProtocol("https", protocol);
|
||||
//--核心服务NciicServices
|
||||
Service serviceModel = new ObjectServiceFactory().create(ServiceInf.class, serviceName, null, null);
|
||||
ServiceInf service = (ServiceInf) new XFireProxyFactory().create(serviceModel, SERVICE_URL + serviceName);
|
||||
Client client = ((XFireProxy) Proxy.getInvocationHandler(service)).getClient();
|
||||
client.addOutHandler(new DOMOutHandler());
|
||||
client.setProperty(CommonsHttpMessageSender.GZIP_ENABLED, Boolean.TRUE);
|
||||
// 忽略超时
|
||||
client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, "0");
|
||||
String result = null;
|
||||
try {
|
||||
|
||||
/**
|
||||
* 调用方法,针对不同的方法记得修改此处。否则报错
|
||||
*/
|
||||
result = service.nciicCheck(license, condition);
|
||||
|
||||
System.out.println( result);
|
||||
} catch (FileNotFoundException e){
|
||||
e.printStackTrace();
|
||||
} catch (IOException e){
|
||||
e.printStackTrace();
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
time = System.currentTimeMillis() - time;
|
||||
System.out.println("------out time -----"+time);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
112
src_tenwa/com/tenwa/lease/flow/project/validate/ServLtVO.java
Normal file
112
src_tenwa/com/tenwa/lease/flow/project/validate/ServLtVO.java
Normal file
@ -0,0 +1,112 @@
|
||||
package com.tenwa.lease.flow.project.validate;
|
||||
/**
|
||||
*
|
||||
* 属性类
|
||||
* @author zhangjieying
|
||||
*
|
||||
*/
|
||||
public class ServLtVO {
|
||||
/**
|
||||
* 任务序列号
|
||||
*/
|
||||
private String xlh;
|
||||
/**
|
||||
* 条件文件或结果文件
|
||||
*/
|
||||
private byte[] fileBytes;
|
||||
/**
|
||||
* 文件状态
|
||||
*/
|
||||
private String wjzt;
|
||||
|
||||
String bh = null;//原编号
|
||||
String mc = null;//原单位名称
|
||||
String dz = null;//原地址
|
||||
String dh = null;//原电话
|
||||
String dwmc = null;//单位名称
|
||||
String dwdz = null;//单位地址
|
||||
String ppbz = null;//匹配标志
|
||||
String dhbz = null;//电话标志
|
||||
String xltbz = null;//小灵通标志
|
||||
String xsmc = null;//显示名称
|
||||
|
||||
public byte[] getFileBytes() {
|
||||
return fileBytes;
|
||||
}
|
||||
public void setFileBytes(byte[] fileBytes) {
|
||||
this.fileBytes = fileBytes;
|
||||
}
|
||||
public String getWjzt() {
|
||||
return wjzt;
|
||||
}
|
||||
public void setWjzt(String wjzt) {
|
||||
this.wjzt = wjzt;
|
||||
}
|
||||
public String getXlh() {
|
||||
return xlh;
|
||||
}
|
||||
public void setXlh(String xlh) {
|
||||
this.xlh = xlh;
|
||||
}
|
||||
public String getBh() {
|
||||
return bh;
|
||||
}
|
||||
public void setBh(String bh) {
|
||||
this.bh = bh;
|
||||
}
|
||||
public String getMc() {
|
||||
return mc;
|
||||
}
|
||||
public void setMc(String mc) {
|
||||
this.mc = mc;
|
||||
}
|
||||
public String getDz() {
|
||||
return dz;
|
||||
}
|
||||
public void setDz(String dz) {
|
||||
this.dz = dz;
|
||||
}
|
||||
public String getDh() {
|
||||
return dh;
|
||||
}
|
||||
public void setDh(String dh) {
|
||||
this.dh = dh;
|
||||
}
|
||||
public String getDwmc() {
|
||||
return dwmc;
|
||||
}
|
||||
public void setDwmc(String dwmc) {
|
||||
this.dwmc = dwmc;
|
||||
}
|
||||
public String getDwdz() {
|
||||
return dwdz;
|
||||
}
|
||||
public void setDwdz(String dwdz) {
|
||||
this.dwdz = dwdz;
|
||||
}
|
||||
public String getPpbz() {
|
||||
return ppbz;
|
||||
}
|
||||
public void setPpbz(String ppbz) {
|
||||
this.ppbz = ppbz;
|
||||
}
|
||||
public String getDhbz() {
|
||||
return dhbz;
|
||||
}
|
||||
public void setDhbz(String dhbz) {
|
||||
this.dhbz = dhbz;
|
||||
}
|
||||
public String getXltbz() {
|
||||
return xltbz;
|
||||
}
|
||||
public void setXltbz(String xltbz) {
|
||||
this.xltbz = xltbz;
|
||||
}
|
||||
public String getXsmc() {
|
||||
return xsmc;
|
||||
}
|
||||
public void setXsmc(String xsmc) {
|
||||
this.xsmc = xsmc;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.tenwa.lease.flow.project.validate;
|
||||
|
||||
import javax.tools.FileObject;
|
||||
/**
|
||||
* <p>
|
||||
* Title: 核心服务web service 接口
|
||||
* </p>
|
||||
* <p>
|
||||
* Description: 升级改造项目
|
||||
* </p>
|
||||
* <p>
|
||||
* Copyright: 2008-2010
|
||||
* </p>
|
||||
* <p>
|
||||
* Company: NCIIC
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author ZJS
|
||||
* @version 2008年
|
||||
*/
|
||||
public interface ServiceInf {
|
||||
//住址模糊截取
|
||||
public String nciicAddrExactSearch(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 核查
|
||||
public String nciicCheck(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 比对
|
||||
public String nciicCompare(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 组合查询
|
||||
public String nciicExactSearch(String inLicense, String inConditions)throws Exception;
|
||||
/*“nciicCourt” 组合多项核查方法,主要是高法院的姓名批量查询,根据需要的查询年限范围,大于1年时,则调用此方法。
|
||||
*目前未使用此方法,因为高法院的协议查询年限范围是1年,年限范围可以登录nciic系统【服务管理】——>【系统参数】——>【姓名多项核查出生日期年限范围】代码07
|
||||
*/
|
||||
public String nciicCourt(String inLicense,String inConditions) throws Exception;
|
||||
// 精确查询
|
||||
public String nciicCombineSearch(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 统计分析
|
||||
public String nciicStat(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 二代证读卡器调用方法
|
||||
public String nciicDiscern(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 取得条件文件模板
|
||||
public String nciicGetCondition(String inLicense) throws Exception;
|
||||
|
||||
//中国银行--流水号
|
||||
public String nciicCheckChina(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 天创旅客身份核查
|
||||
public String nciicCheckHotel(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
//籍贯比对
|
||||
public String nciicBirthplaceCompare(String inLicense, String inConditions) throws Exception;
|
||||
|
||||
// 网闸特殊接口
|
||||
public String nciicCheckFile(FileObject fileObject) throws Exception;
|
||||
// 网闸特殊接口获取结果文件接口
|
||||
public FileObject nciicGetFile(String inLicense, String id) throws Exception;
|
||||
|
||||
//同名同性
|
||||
public String tmtx(java.lang.String licensecode, java.lang.String condition) throws Exception;
|
||||
|
||||
//--天创便携式手机核查
|
||||
public String nciicCheckMobile(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
//网民认证
|
||||
public String wmrzCheck(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
// 联通数据特殊接口
|
||||
public FileObjectSetPhone nciicCheckSetPhone(FileObjectSetPhone fileObject) throws Exception;
|
||||
public FileObjectSetPhone nciicCheckGetPhone(String inLicense, String id) throws Exception;
|
||||
|
||||
//扫描仪
|
||||
public String nciicCheckScan(String inLicense, String inConditions,String keys)throws Exception;
|
||||
|
||||
public ServLtVO chinaUnicomGetPhone(ServLtVO vo) throws Exception;
|
||||
|
||||
public String faceProxy(int compressFlag,String galleryBase64Image,
|
||||
int galleryMaxHeight,int galleryMaxSize,
|
||||
String probeBase64Image,int probeImgType,
|
||||
int probeMaxHeight,int probeMaxSize)throws Exception;
|
||||
|
||||
public String nciicDateCollection(String inLicense, String inConditions)throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.tenwa.lease.flow.project.validate;
|
||||
|
||||
public class SoapRequest {
|
||||
|
||||
public static String XMLConfiguration(String IDNo,String username) throws Exception {
|
||||
//WebService接口地址?
|
||||
//String wsdl = "https://ws.nciic.org.cn/nciic_ws/services/NciicServices";
|
||||
//int timeout = 10000;
|
||||
StringBuffer sb = new StringBuffer("");
|
||||
//拼接soap请求的xml
|
||||
//sb.append("<![CDATA[");
|
||||
//sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
|
||||
/*sb.append("<soapenv:Envelope "
|
||||
+ "xmlns:nci='https://api.nciic.org.cn/NciicServices' "
|
||||
+ "xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>");
|
||||
sb.append("<soapenv:Header>");
|
||||
sb.append("<soapenv:Body>");
|
||||
sb.append("<nci:nciicCompare>");
|
||||
sb.append("<nci:inLicense><![CDATA[");
|
||||
//入参授权文件
|
||||
sb.append(inLicense);
|
||||
sb.append("]]></nci:inLicense>");*/
|
||||
//sb.append("<![CDATA[");
|
||||
sb.append("<?xml version='1.0' encoding='UTF-8'?>");
|
||||
sb.append("<ROWS>");
|
||||
sb.append("<INFO>");
|
||||
sb.append("<SBM>安鹏国际融资租赁有限公司</SBM>");
|
||||
sb.append("</INFO>");
|
||||
sb.append("<ROW>");
|
||||
sb.append("<GMSFHM>公民身份号码</GMSFHM>");
|
||||
sb.append("<XM>姓名</XM>");
|
||||
sb.append("</ROW>");
|
||||
sb.append("<ROW FSD='000000' YWLX='身份认证'>");
|
||||
//入参身份证号码
|
||||
sb.append("<GMSFHM>"+IDNo+"</GMSFHM>");
|
||||
//入参姓名
|
||||
sb.append("<XM>"+username+"</XM>");
|
||||
sb.append("</ROW>");
|
||||
sb.append("</ROWS>");
|
||||
//sb.append("]]>");
|
||||
/* sb.append("</nci:nciicCompare>");
|
||||
sb.append("</soapenv:Body>");
|
||||
sb.append("</soapenv:Envelope>");*/
|
||||
|
||||
//System.out.println(sb);
|
||||
//HttpClient发送SOAP请求
|
||||
System.out.println("HttpClient 发送SOAP请求");
|
||||
|
||||
String xmldata = sb.toString();
|
||||
//System.out.println(xmldata);
|
||||
return xmldata;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user