添加app预审批功能和鹏元接口

This commit is contained in:
tangfutang 2020-07-14 19:25:15 +08:00
parent 7888ab0a78
commit d284d160c7
7 changed files with 286 additions and 14 deletions

View File

@ -10,6 +10,7 @@
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setHtmlEvent("IS_MILE","onChange","changeMile");
doTemp.setHtmlEvent("IS_AGE_LIMIT","onChange","changeAgeLimit");
doTemp.setHtmlEvent("IS_PENGYUAN","onChange","changePengyuanDay");
//doTemp.setColTips("", "²âÊÔ");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
@ -17,12 +18,15 @@
dwTemp.genHTMLObjectWindow(CurPage.getParameter("id"));
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","as_save(0)","","","",""},
{"true","All","Button","±£´æ","±£´æËùÓÐÐÞ¸Ä","save()","","","",""},
{"true","All","Button","·µ»Ø","·µ»ØÁбí","returnList()","","","",""}
};
//sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function save(){
as_save("0","returnList()");
}
function returnList(){
AsControl.OpenView("/Tenwa/beforeApplication/BeforeApplicationConfigList.jsp", "","_self","");
}
@ -35,6 +39,10 @@
if("Y"==isAgeLimit){
setItemRequired(0, "AGE_LIMIT", true);
}
var isPengyuan = getItemValue(0,getRow(),"IS_PENGYUAN");
if("Y"==isPengyuan){
setItemRequired(0, "PENGYUANDAY", true);
}
})
function changeMile(){
@ -54,5 +62,14 @@
setItemRequired(0, "AGE_LIMIT", false);
}
}
function changePengyuanDay(){
var isPengyuan = getItemValue(0,getRow(),"IS_PENGYUAN");
if("Y" == isPengyuan){
setItemRequired(0, "PENGYUANDAY", true);
}else{
setItemRequired(0, "PENGYUANDAY", false);
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -157,7 +157,8 @@
<attribute name="mile" label="公里数" type="STRING" length="32"/>
<attribute name="is_age_limit" label="年限是否校验" type="STRING" length="8"/>
<attribute name="age_limit" label="年限" type="STRING" length="8"/>
<attribute name="is_pengyuan" label="鹏元大数据是否校验" type="STRING" length="8"/>
<attribute name="is_pengyuan" label="鹏元大数据是否校验" type="STRING" length="8"/>
<attribute name="pengyuanday" label="重新查询天数" type="STRING" length="8"/>
<attribute name="inputuserid" label="登记人" type="STRING" length="100"/>
<attribute name="inputorgid" label="登记部门" type="STRING" length="100"/>
<attribute name="inputtime" label="登记时间" type="STRING" length="100"/>
@ -172,6 +173,46 @@
</managerProperties>
</manager>
</class>
<class name="LB_BEFORE_APPLICATION" label="预审批表" keyAttributes="id">
<attributes>
<attribute name="id" label="唯一标识" type="STRING" length="32"/>
<attribute name="fullname" label="承租人姓名" type="STRING" length="32"/>
<attribute name="fullcertid" label="承租人身份证号" type="STRING" length="32"/>
<attribute name="fullphone" label="承租人电话号" type="STRING" length="32"/>
<attribute name="fullsex" label="承租人性别1标识男。2标识女" type="STRING" length="32"/>
<attribute name="brand" label="车品牌" type="STRING" length="32"/>
<attribute name="model" label="车型" type="STRING" length="32"/>
<attribute name="modelId" label="车型ID" type="STRING" length="32"/>
<attribute name="carseries" label="车系" type="STRING" length="32"/>
<attribute name="mile" label="公里数" type="STRING" length="32"/>
<attribute name="frame_number" label="车架号" type="STRING" length="100"/>
<attribute name="age_limit" label="年限" type="STRING" length="8"/>
<attribute name="price" label="车辆指导价" type="STRING" length="16"/>
<attribute name="carattributes" label="租赁类型new_car标识新车used_car二手车" type="STRING" length="10"/>
<attribute name="liter" label="排量" type="STRING" length="32"/>
<attribute name="geartype" label="档位" type="STRING" length="32"/>
<attribute name="attributeid1" label="文件1" type="STRING" length="200"/>
<attribute name="attributeid2" label="文件1" type="STRING" length="200"/>
<attribute name="result" label="结果" type="STRING" length="32"/>
<attribute name="reason" label="原因" type="STRING" length="200"/>
<attribute name="ispengyuan" label="鹏元数据是否调用" type="STRING" length="2"/>
<attribute name="pengyuanresult" label="鹏元结果" type="STRING" length="10"/>
<attribute name="pengyuanreason" label="鹏元原因" type="STRING" length="200"/>
<attribute name="pengyuantime" label="鹏元查询时间" type="STRING" length="100"/>
<attribute name="inputuserid" label="登记人" type="STRING" length="100"/>
<attribute name="inputorgid" label="登记部门" type="STRING" length="100"/>
<attribute name="inputtime" label="登记时间" type="STRING" length="100"/>
<attribute name="updateuserid" label="登记人" type="STRING" length="100"/>
<attribute name="updateorgid" label="登记部门" type="STRING" length="100"/>
<attribute name="updatetime" label="登记时间" type="STRING" length="100"/>
</attributes>
<manager>
<managerProperties>
<property name="table" value="lb_before_application" />
<property name="createKey" value="true" />
</managerProperties>
</manager>
</class>
</package>
<package name="jbo.com.tenwa.entity.comm.own" >
<class name="OWN_ACCOUNT" label="" keyAttributes="id">

View File

@ -8,12 +8,15 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jbo.com.tenwa.entity.comm.serialutil.LB_BEFORE_APPLICATION;
import jbo.com.tenwa.entity.comm.serialutil.LB_BEFORE_APPLICATION_CONFIG;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.lang.DataElement;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.base.constant.RestfullConstant;
@ -111,6 +114,7 @@ public class BusinessDataServiceImpl implements BusinessDataService {
String liter = fieldMap.get("liter") == null ? "" : fieldMap.get("liter").toString();
String geartype = fieldMap.get("geartype") == null ? "" : fieldMap.get("geartype").toString();
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
Map<String, Object> body = new HashMap<String, Object>();
ASUser asUser = new ASUser(userid);
BizObjectManager lbacm = JBOFactory.getBizObjectManager(LB_BEFORE_APPLICATION_CONFIG.CLASS_NAME);
@ -148,18 +152,62 @@ public class BusinessDataServiceImpl implements BusinessDataService {
if(message==null && "Y".equals(isCard)){
//message = BeforeApplicationCheckUtil.checkCertid(fullname, fullcertid, subjectid, message);
}
//±£´æÊý¾Ý
BizObjectManager lbam = JBOFactory.getBizObjectManager(LB_BEFORE_APPLICATION.CLASS_NAME);
BizObject lba = lbam.newObject();
//ÅôÔª½Ó¿ÚУÑé
String isPengyuan = lbac.getAttribute("is_pengyuan").getString();
if(message==null && "Y".equals(isPengyuan)){
//message = BeforeApplicationCheckUtil.checkPengYuan(fullname, fullcertid,fullphone, subjectid,asUser,null,sqlca,tx);
String pengyuanday = lbac.getAttribute("pengyuanday").getString();
BizObject lbat = lbam.createQuery(" fullcertid=:fullcertid and ispengyuan='Y' and v.TIMESTAMPDIFF(v.DAY ,pengyuantime,v.NOW())<:pengyuanday")
.setParameter("fullcertid", fullcertid).setParameter("pengyuanday", pengyuanday).getSingleResult(false);
if(lbat == null){
message = BeforeApplicationCheckUtil.checkPengYuan(fullname, fullcertid,fullphone, subjectid,asUser,null,sqlca,tx);
lba.setAttributeValue("ispengyuan", "Y");
lba.setAttributeValue("pengyuantime", StringFunction.getTodayNow());
if(message==null){
lba.setAttributeValue("pengyuanresult", "Y");
}else{
lba.setAttributeValue("pengyuanresult", "N");
lba.setAttributeValue("pengyuanreason", message);
}
}else{
String pengyuanresult = lbat.getAttribute("pengyuanresult").getString();
if("N".equals(pengyuanresult)){
message = lbat.getAttribute("pengyuanrreason").getString();
}
}
}
if(message==null){
body.put("status", "Y");
body.put("message", "");
lba.setAttributeValue("result", "Y");
}else{
body.put("status", "N");
body.put("message", message);
lba.setAttributeValue("result", "N");
lba.setAttributeValue("reason", message);
}
lba.setAttributeValue("fullname", fullname);
lba.setAttributeValue("fullcertid", fullcertid);
lba.setAttributeValue("fullphone",fullphone );
lba.setAttributeValue("fullsex", fullsex);
lba.setAttributeValue("brand",brand );
lba.setAttributeValue("model", model);
lba.setAttributeValue("modelId", modelId);
lba.setAttributeValue("carseries", carseries);
lba.setAttributeValue("mile", mile);
lba.setAttributeValue("frame_number", age_limit);
lba.setAttributeValue("price", price);
lba.setAttributeValue("carattributes", carattributes);
lba.setAttributeValue("liter", liter);
lba.setAttributeValue("geartype", geartype);
lba.setAttributeValue("inputuserid",userid );
lba.setAttributeValue("inputorgid", asUser.getOrgID() );
lba.setAttributeValue("inputtime", StringFunction.getTodayNow());
lbam.saveObject(lba);
ReturnMapUtil.setReturnMap(body,
RestfullConstant.baseProperty.get("success").toString(), "");
return ReturnMapUtil.getReturnMap();

View File

@ -0,0 +1,136 @@
package jbo.com.tenwa.entity.comm.serialutil;
import java.lang.String;
/**
* 预审批表 - JBO命名常量类<br><br>
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
*/
public interface LB_BEFORE_APPLICATION{
/**
* 预审批表<br><br>
* 代表本类映射的BizObjectClass
*/
public static final String CLASS_NAME = "jbo.com.tenwa.entity.comm.serialutil.LB_BEFORE_APPLICATION";
/**
* 唯一标识 STRING(32)<br>
*/
public static final String id = "id";
/**
* 承租人姓名 STRING(32)<br>
*/
public static final String fullname = "fullname";
/**
* 承租人身份证号 STRING(32)<br>
*/
public static final String fullcertid = "fullcertid";
/**
* 承租人电话号 STRING(32)<br>
*/
public static final String fullphone = "fullphone";
/**
* 承租人性别1标识男2标识女 STRING(32)<br>
*/
public static final String fullsex = "fullsex";
/**
* 车品牌 STRING(32)<br>
*/
public static final String brand = "brand";
/**
* 车型 STRING(32)<br>
*/
public static final String model = "model";
/**
* 车型ID STRING(32)<br>
*/
public static final String modelId = "modelId";
/**
* 车系 STRING(32)<br>
*/
public static final String carseries = "carseries";
/**
* 公里数 STRING(32)<br>
*/
public static final String mile = "mile";
/**
* 车架号 STRING(100)<br>
*/
public static final String frame_number = "frame_number";
/**
* 年限 STRING(8)<br>
*/
public static final String age_limit = "age_limit";
/**
* 车辆指导价 STRING(16)<br>
*/
public static final String price = "price";
/**
* 租赁类型new_car标识新车used_car二手车 STRING(10)<br>
*/
public static final String carattributes = "carattributes";
/**
* 排量 STRING(32)<br>
*/
public static final String liter = "liter";
/**
* 档位 STRING(32)<br>
*/
public static final String geartype = "geartype";
/**
* 文件1 STRING(200)<br>
*/
public static final String attributeid1 = "attributeid1";
/**
* 文件1 STRING(200)<br>
*/
public static final String attributeid2 = "attributeid2";
/**
* 结果 STRING(32)<br>
*/
public static final String result = "result";
/**
* 原因 STRING(200)<br>
*/
public static final String reason = "reason";
/**
* 鹏元数据是否调用 STRING(2)<br>
*/
public static final String ispengyuan = "ispengyuan";
/**
* 鹏元结果 STRING(10)<br>
*/
public static final String pengyuanresult = "pengyuanresult";
/**
* 鹏元原因 STRING(200)<br>
*/
public static final String pengyuanreason = "pengyuanreason";
/**
* 鹏元查询时间 STRING(100)<br>
*/
public static final String pengyuantime = "pengyuantime";
/**
* 登记人 STRING(100)<br>
*/
public static final String inputuserid = "inputuserid";
/**
* 登记部门 STRING(100)<br>
*/
public static final String inputorgid = "inputorgid";
/**
* 登记时间 STRING(100)<br>
*/
public static final String inputtime = "inputtime";
/**
* 登记人 STRING(100)<br>
*/
public static final String updateuserid = "updateuserid";
/**
* 登记部门 STRING(100)<br>
*/
public static final String updateorgid = "updateorgid";
/**
* 登记时间 STRING(100)<br>
*/
public static final String updatetime = "updatetime";
}

View File

@ -46,6 +46,10 @@ public interface LB_BEFORE_APPLICATION_CONFIG{
*/
public static final String is_pengyuan = "is_pengyuan";
/**
* 重新查询天数 STRING(8)<br>
*/
public static final String pengyuanday = "pengyuanday";
/**
* 登记人 STRING(100)<br>
*/
public static final String inputuserid = "inputuserid";

View File

@ -15,6 +15,7 @@ import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
import jbo.app.tenwa.customer.CUSTOMER_TYPE;
import jbo.app.tenwa.customer.CUSTOMER_TYPE_TEMP;
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO;
import jbo.com.tenwa.entity.comm.serialutil.LB_BEFORE_APPLICATION;
import jbo.com.tenwa.lease.carbrand.BUSINESS_STATUS;
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
@ -22,13 +23,16 @@ import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE;
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE_TEMP;
import jbo.prd.PRD_SPECIFIC_LIBRARY;
import java.util.*;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
@ -49,9 +53,23 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
if(this.getAttribute("serial")!=null)
serial = this.getAttribute("serial").toString();
ASUser asUser=new ASUser(this.getAttribute("CurUserID").toString());
return initBusinessApply(Sqlca,asUser);
String certId = this.getAttribute("certid").toString();
String ProjectId = this.getAttribute("ProjectId").toString();
String custname = this.getAttribute("custname").toString();
BizObjectManager lbam = JBOFactory.getBizObjectManager(LB_BEFORE_APPLICATION.CLASS_NAME);
BizObject lbat = lbam.createQuery("select * from O where O.fullcertid=:fullcertid and O.inputtime=(SELECT MAX(lba.inputtime) FROM jbo.com.tenwa.entity.comm.serialutil.LB_BEFORE_APPLICATION lba WHERE lba.fullcertid=O.fullcertid)").setParameter("fullcertid", certId).getSingleResult(false);
if(lbat!=null){
String ispengyuan = lbat.getAttribute("ispengyuan").getString();
if("Y".equals(ispengyuan)){
SqlObject sql = new SqlObject("UPDATE bigdata_pengyuan_af SET keyword1='"+ProjectId+"' WHERE fullname='"+custname+"' AND fullcertId='"+certId+"'");
Sqlca.executeSQL(sql);
}
}
return initBusinessApply(Sqlca,asUser,lbat);
}
public String initBusinessApply(JBOTransaction tx,ASUser asUser) throws Exception {
public String initBusinessApply(JBOTransaction tx,ASUser asUser,BizObject lbat) throws Exception {
String className = "";
String colName = "";
String certId = this.getAttribute("certid").toString();
@ -64,6 +82,7 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
className = CUSTOMER_COMPANY_TEMP.CLASS_NAME;
colName = "company_name";
}
BizObjectManager bmCTT =JBOFactory.getBizObjectManager(CUSTOMER_TYPE_TEMP.CLASS_NAME,tx);
BizObjectManager bomC = JBOFactory.getBizObjectManager(className); //自然人表或者法人信息表
BizObjectManager bm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,tx);
@ -157,7 +176,7 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
//无论是不是存量客户都在 项目表 客户和项目关联表 中都新增一条数据客户和项目是一对多的
this.saveProjInfo(bm, tx, asUser,distributoIid,lpi == null ? null : lpi.getAttribute("is_netcar").toString());
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName); //车辆租赁物信息表
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName,lbat); //车辆租赁物信息表
this.saveUnionLessee(bmLULT,tx,customerId,asUser);
this.saveBusinessStatus(bsbom, tx, asUser);//项目进度表
}else{
@ -176,8 +195,8 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
BizObject bmC = this.saveCustomerInfo(bmCI, tx, asUser,distributoIid);//新增主表客户信息
customerId = bmC.getAttribute("customerid").getString();
this.saveCustomerType(bmCTT, tx, customerId,asUser);//证件类型临时表
this.savePersonOrCompany(bomC, tx, colName,customerId,asUser);//自然人||法人
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName); //车辆租赁物信息表
this.savePersonOrCompany(bomC, tx, colName,customerId,asUser,lbat);//自然人||法人
this.saveEquipmentCar(bmLECT, tx, asUser,vndrName,lbat); //车辆租赁物信息表
this.saveUnionLessee(bmLULT, tx, customerId, asUser);//union表
this.saveProjInfo(bm, tx, asUser,distributoIid,null);//保存项目信息表
this.saveBusinessStatus(bsbom, tx, asUser);//项目进度表
@ -215,7 +234,7 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
}
return bmC;
}
private void savePersonOrCompany(BizObjectManager bomC,JBOTransaction tx,String colName,String customerId,ASUser asUser)throws JBOException{
private void savePersonOrCompany(BizObjectManager bomC,JBOTransaction tx,String colName,String customerId,ASUser asUser,BizObject lbat)throws JBOException{
BizObject boCRT = bomC.newObject();//新建自然人||法人
try {
boCRT.setAttributeValue("flowunid", this.getAttribute("FlowUnid"));//流程ID
@ -228,6 +247,9 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
boCRT.setAttributeValue("inputtime", StringFunction.getTodayNow());//登记时间,系统当前时间
if("03".equals(this.getAttribute("CustomerType"))){
boCRT.setAttributeValue("BALANCESHEET", "申请人");
if(lbat != null){
boCRT.setAttributeValue("mobile", lbat.getAttribute("fullphone")+"");
}
}
bomC.saveObject(boCRT);
} catch (Exception e) {
@ -255,7 +277,7 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
e.printStackTrace();
}
}
private void saveEquipmentCar(BizObjectManager bomCI,JBOTransaction tx,ASUser asUser,String vndrName)throws JBOException{
private void saveEquipmentCar(BizObjectManager bomCI,JBOTransaction tx,ASUser asUser,String vndrName,BizObject lbat)throws JBOException{
BizObject bmLEC = bomCI.newObject();//保存客户信息
try {
//客户信息表
@ -273,6 +295,10 @@ public class LBProjectIntoTempInitCarBusiness extends BaseBussiness {
bmLEC.setAttributeValue("INPUTUSERID", asUser.getUserID());//登记人
bmLEC.setAttributeValue("INPUTORGID", asUser.getOrgID());//登记部门
bmLEC.setAttributeValue("INPUTTIME", StringFunction.getTodayNow());//登记时间,系统当前时间
if(lbat!=null){
bmLEC.setAttributeValue("FRAME_NUMBER", lbat.getAttribute("frame_number")+"");//车架号
bmLEC.setAttributeValue("mile", lbat.getAttribute("mile")+"");//公里数
}
bomCI.saveObject(bmLEC);
} catch (Exception e) {
tx.rollback();

View File

@ -217,7 +217,7 @@ public class BeforeApplicationCheckUtil {
StringBuffer keyword = new StringBuffer();
StringBuffer keywordValue = new StringBuffer();
/* for(int i = 1; i <= 5; i ++) {
/*for(int i = 1; i <= 5; i ++) {
String key = BigDataPropertiesUtil.get("keyword" + i);
String keyValue = CurPage.getParameter(key);
if(key == null || keyValue == null) {
@ -234,8 +234,8 @@ public class BeforeApplicationCheckUtil {
keyword.append(",keyword3");
keywordValue.append(",'"+FlowNo+"'");
}*/
SqlObject sql = new SqlObject(("insert into bigdata_pengyuan_af (id," + keyword.toString() + ",xml_data,html_data,"
+ "inputuserid,inputorgid,inputtime,fullName,fullcertId,fullphone,fullcardNo) values('" + applyId + "'," + keywordValue.toString() + ",'"
SqlObject sql = new SqlObject(("insert into bigdata_pengyuan_af (id,keyword1,xml_data,html_data,"
+ "inputuserid,inputorgid,inputtime,fullName,fullcertId,fullphone,fullcardNo) values('" + applyId + "','','"
+ xmlResult + "','" + htmlFile.split("@")[1] + "','" +asUser.getUserID() + "','" + asUser.getOrgID()+ "','" + StringFunction.getTodayNow() +"','"
+fullname+"','"+fullcertid+"','"+fullPhone+"','"+fullcardNo+"')").replaceAll(":", "¡÷"));
sql.setDebugSql(sql.getDebugSql().replaceAll("¡÷", ":"));
@ -304,7 +304,7 @@ public class BeforeApplicationCheckUtil {
String message = null ;
System.out.println("Ö´ÐÐ");
SAXReader reader = new SAXReader();
File file = new File("xmlPath");
File file = new File(xmlPath);
try {
Document document = reader.read(file);
Element root = document.getRootElement();