Merge branch 'release20200521' of http://git2.tenwa.com.cn/ApzlDev/apzl_leasing.git into release20200521
This commit is contained in:
commit
8bade4e753
37
WebContent/AppFresh/AppVersion/APPFeedbackOpinion.jsp
Normal file
37
WebContent/AppFresh/AppVersion/APPFeedbackOpinion.jsp
Normal file
@ -0,0 +1,37 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2020-07-24
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("APPFeedbackOpinionList");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(10);
|
||||
dwTemp.genHTMLObjectWindow("");
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
/* {"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
|
||||
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""}, */
|
||||
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'')","","","","btn_icon_delete"},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function newRecord(){
|
||||
var sUrl = "";
|
||||
AsControl.OpenView(sUrl,'','_self','');
|
||||
}
|
||||
function viewAndEdit(){
|
||||
var sUrl = "";
|
||||
var sPara = getItemValue(0,getRow(0),'SerialNo');
|
||||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||||
alert("参数不能为空!");
|
||||
return ;
|
||||
}
|
||||
AsControl.OpenView(sUrl,'SerialNo=' +sPara ,'_self','');
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -3370,5 +3370,64 @@
|
||||
</class>
|
||||
|
||||
|
||||
<class name="LC_OVERDUE_RENT_PLAN" label="" keyAttributes="">
|
||||
<attributes>
|
||||
<attribute name="ID" label="ID" type="STRING" length="96"/>
|
||||
<attribute name="QUOT_ID" label="QUOT_ID" type="STRING" length="96"/>
|
||||
<attribute name="CUST_ID" label="CUST_ID" type="STRING" length="96"/>
|
||||
<attribute name="PROJECT_ID" label="PROJECT_ID" type="STRING" length="96"/>
|
||||
<attribute name="PROJECT_PLAN_NUMBER" label="PROJECT_PLAN_NUMBER" type="STRING" length="96"/>
|
||||
<attribute name="CONTRACT_ID" label="CONTRACT_ID" type="STRING" length="96"/>
|
||||
<attribute name="CONTRACT_PLAN_NUMBER" label="CONTRACT_PLAN_NUMBER" type="STRING" length="96"/>
|
||||
<attribute name="PAYMENT_NUMBER" label="PAYMENT_NUMBER" type="STRING" length="96"/>
|
||||
<attribute name="PLAN_LIST" label="PLAN_LIST" type="STRING" length="60"/>
|
||||
<attribute name="PLAN_DATE" label="PLAN_DATE" type="STRING" length="60"/>
|
||||
<attribute name="RENT" label="RENT" type="STRING" length="60"/>
|
||||
<attribute name="CORPUS" label="CORPUS" type="STRING" length="60"/>
|
||||
<attribute name="HIRE_DATE" label="HIRE_DATE" type="STRING" length="60"/>
|
||||
<attribute name="fact_rent" label="fact_rent" type="STRING" length="60"/>
|
||||
<attribute name="fact_corpus" label="fact_corpus" type="STRING" length="60"/>
|
||||
<attribute name="fact_penalty" label="fact_penalty" type="STRING" length="60"/>
|
||||
<attribute name="overduerent" label="overduerent" type="STRING" length="60"/>
|
||||
<attribute name="overinterest" label="overinterest" type="STRING" length="60"/>
|
||||
<attribute name="penalty" label="penalty" type="STRING" length="60"/>
|
||||
<attribute name="Overdue_days" label="Overdue_days" type="STRING" length="60"/>
|
||||
<attribute name="PLAN_STATUS" label="PLAN_STATUS" type="STRING" length="60"/>
|
||||
<attribute name="inputtime" label="inputtime" type="STRING" length="60"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="lc_overdue_rent_plan" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="VI_CSAN" label="" keyAttributes="">
|
||||
<attributes>
|
||||
<attribute name="TYPENO" label="TYPENO" type="STRING"/>
|
||||
<attribute name="SORTNO" label="SORTNO" type="STRING"/>
|
||||
<attribute name="TYPENAME" label="TYPENAME" type="STRING"/>
|
||||
<attribute name="ATTRIBUTE2" label="ATTRIBUTE2" type="STRING"/>
|
||||
<attribute name="PRODUCTID" label="PRODUCTID" type="STRING"/>
|
||||
<attribute name="VERSIONID" label="VERSIONID" type="STRING"/>
|
||||
<attribute name="LeasForm" label="LeasForm" type="STRING"/>
|
||||
<attribute name="equip_type" label="equip_type" type="STRING"/>
|
||||
<attribute name="IS_ALL_DEALER" label="IS_ALL_DEALER" type="STRING"/>
|
||||
<attribute name="IS_ALL_CAR" label="IS_ALL_CAR" type="STRING"/>
|
||||
<attribute name="orgid" label="orgid" type="STRING"/>
|
||||
<attribute name="id" label="id" type="STRING"/>
|
||||
<attribute name="DISTRIBUTOR_NAME" label="DISTRIBUTOR_NAME" type="STRING"/>
|
||||
<attribute name="modelid" label="modelid" type="STRING"/>
|
||||
<attribute name="modelname" label="modelname" type="STRING"/>
|
||||
<attribute name="operationType" label="operationType" type="STRING"/>
|
||||
<attribute name="ManySubject" label="ManySubject" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="vi_csan" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
</jbo>
|
||||
|
||||
@ -116,7 +116,7 @@ public class BusinessDataServiceImpl implements BusinessDataService {
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String brandid = fieldMap.get("brandid") == null ? "" : fieldMap.get("brandid").toString();
|
||||
String carseriesid = fieldMap.get("carseriesid") == null ? "" : fieldMap.get("carseriesid").toString();
|
||||
|
||||
String frame_number = fieldMap.get("frame_number") == null ? "" : fieldMap.get("frame_number").toString();
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
ASUser asUser = new ASUser(userid);
|
||||
BizObjectManager lbacm = JBOFactory.getBizObjectManager(LB_BEFORE_APPLICATION_CONFIG.CLASS_NAME);
|
||||
@ -201,7 +201,8 @@ public class BusinessDataServiceImpl implements BusinessDataService {
|
||||
lba.setAttributeValue("modelId", modelId);
|
||||
lba.setAttributeValue("carseries", carseries);
|
||||
lba.setAttributeValue("mile", mile);
|
||||
lba.setAttributeValue("frame_number", age_limit);
|
||||
lba.setAttributeValue("age_limit", age_limit);
|
||||
lba.setAttributeValue("frame_number", frame_number);
|
||||
lba.setAttributeValue("price", price);
|
||||
lba.setAttributeValue("carattributes", carattributes);
|
||||
lba.setAttributeValue("liter", liter);
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package apx.com.amarsoft.als.apzl.apply.business.doc.detail.service.impl;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -293,7 +296,7 @@ public class BusinessDocDetailServiceImpl implements BusinessDocDetailService {
|
||||
public Map<String, Object> doc(String objectNo, String docName,
|
||||
HttpServletRequest request, HttpServletResponse response,
|
||||
JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil,String userId)
|
||||
throws JBOException {
|
||||
throws Exception {
|
||||
|
||||
// String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get(
|
||||
// "objectno").toString(); // Á÷³ÌºÅ
|
||||
@ -323,8 +326,8 @@ public class BusinessDocDetailServiceImpl implements BusinessDocDetailService {
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
BizObjectManager ftM = JBOFactory.getBizObjectManager(FLOW_TASK.CLASS_NAME);
|
||||
List ftList = ftM.createQuery(" objectno=:flow_unid AND phaseno='0010'").setParameter("flow_unid", objectNo).getResultList(false);
|
||||
|
||||
BizObject ft = ftM.createQuery(" objectno=:flow_unid AND phaseno='0010' AND (endtime IS NULL OR endtime='') ").setParameter("flow_unid", objectNo).getSingleResult(false);
|
||||
String begintime = ft == null? null :ft.getAttribute("begintime").toString();
|
||||
|
||||
String proj_id = fbo.getAttribute("proj_id").getString();
|
||||
BizObjectManager relaManage = JBOFactory
|
||||
@ -409,17 +412,29 @@ public class BusinessDocDetailServiceImpl implements BusinessDocDetailService {
|
||||
: att.getAttribute("objecttype").toString();
|
||||
String inputuserid = att.getAttribute("inputuserid") == null ? ""
|
||||
: att.getAttribute("inputuserid").toString();
|
||||
|
||||
String inputtime = att.getAttribute("inputtime") == null ? null
|
||||
: att.getAttribute("inputtime").toString();
|
||||
attMap.put("attId", attId);
|
||||
attMap.put("fileName", fileName);
|
||||
attMap.put("fileSize", fileSize);
|
||||
attMap.put("fileType", fileType);
|
||||
attMap.put("attRemark", attRemark);
|
||||
if( "0010".equals(phaseno) && applyFlow.equals(objecttype) && userId.equals(inputuserid)&& ftList.size()<=1){
|
||||
attMap.put("isDelete", "Y");
|
||||
if(begintime != null && inputtime != null ){
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
Date date1 = format.parse(begintime);
|
||||
Date date2 = format.parse(inputtime);
|
||||
boolean before = date1.before(date2);
|
||||
if( "0010".equals(phaseno) && userId.equals(inputuserid)&& before){
|
||||
attMap.put("isDelete", "Y");
|
||||
}else{
|
||||
attMap.put("isDelete", "N");
|
||||
}
|
||||
}else{
|
||||
attMap.put("isDelete", "N");
|
||||
}
|
||||
|
||||
|
||||
attList.add(attMap);
|
||||
}
|
||||
libraryMap.put("fileList", attList);
|
||||
@ -431,5 +446,4 @@ public class BusinessDocDetailServiceImpl implements BusinessDocDetailService {
|
||||
RestfullConstant.baseProperty.get("SUCCESS").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -183,4 +183,24 @@ public class ContractMakeController {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ɾ³ýºÏͬ
|
||||
*/
|
||||
@Path("/delete/contract")
|
||||
@POST
|
||||
public Map<String, Object> deleteContract(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog()
|
||||
.info("[CONTROLLER] BusinessDataController run .................");
|
||||
ARE.getLog().info(
|
||||
"[Path] /contract/make/deleteContract/contract" + " run .................");
|
||||
try {
|
||||
return service.deleteContract(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,6 +46,10 @@ public interface ContractMakeService {
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> deleteContract(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
|
||||
import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST;
|
||||
import jbo.com.tenwa.entity.comm.officetempalte.BF_TEMPLATE;
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_TEMPLATE;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
@ -48,17 +50,24 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String globaltext = fieldMap.get("globaltext") == null ? "" : fieldMap.get("globaltext").toString();
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
ASUser asUser = new ASUser(userId);
|
||||
String orgID = asUser.getOrgID();
|
||||
String sql = "";
|
||||
if("8006011".equals(orgID)){
|
||||
sql = "SELECT lpi.END_DATE AS startdate,lpi.id projectid, lpi.product_id, lpi.project_no, lpi.project_name, ci.customername, getItemName ('CertType', ci.certtype) certtype, ci.certid, getUserName (lpi.project_manage) AS project_manage, getOrgLevelName (lpi.project_dept) project_dept, ci.customertype,lpi.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.signType,psl.sealType,lpi.subjectid,lpi.subjectname,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_PROJECT_INFO lpi LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id LEFT JOIN LB_CONTRACT_INFO lci ON lpi.id=lci.project_id LEFT JOIN LC_CONTRACT_CONDITION lcc ON lci.id=lcc.contract_id LEFT JOIN LB_UNION_LESSEE lult ON lpi.id = lult.project_id AND (lult.contract_id = '' OR lult.contract_id IS NULL) LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id = ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' WHERE lult.is_main = 'y' AND lpi.project_status = '13' AND((lci.contract_status = '21' AND lpc.equip_amt>lcc.equip_amt) OR ((lult.CONTRACT_ID='' OR lult.CONTRACT_ID IS NULL)AND (SELECT COUNT(*) FROM lb_contract_info WHERE project_id=lpi.id)=0)) AND lpi.INPUTORGID='"+orgID+"' AND lpi.businesstype='1' ORDER BY lpi.END_DATE DESC";
|
||||
sql = "SELECT lpi.END_DATE AS startdate,lpi.id projectid, lpi.product_id, lpi.project_no, lpi.project_name, ci.customername, getItemName ('CertType', ci.certtype) certtype, ci.certid, getUserName (lpi.project_manage) AS project_manage, getOrgLevelName (lpi.project_dept) project_dept, ci.customertype,lpi.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.signType,psl.sealType,lpi.subjectid,lpi.subjectname,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_PROJECT_INFO lpi LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id LEFT JOIN LB_CONTRACT_INFO lci ON lpi.id=lci.project_id LEFT JOIN LC_CONTRACT_CONDITION lcc ON lci.id=lcc.contract_id LEFT JOIN LB_UNION_LESSEE lult ON lpi.id = lult.project_id AND (lult.contract_id = '' OR lult.contract_id IS NULL) LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id = ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' WHERE lult.is_main = 'y' AND lpi.project_status = '13' AND((lci.contract_status = '21' AND lpc.equip_amt>lcc.equip_amt) OR ((lult.CONTRACT_ID='' OR lult.CONTRACT_ID IS NULL)AND (SELECT COUNT(*) FROM lb_contract_info WHERE project_id=lpi.id)=0)) AND lpi.INPUTORGID='"+orgID+"'";
|
||||
}else{
|
||||
sql="SELECT lpi.END_DATE AS startdate,lpi.id projectid, lpi.product_id, lpi.project_no, lpi.project_name, ci.customername, getItemName ('CertType', ci.certtype) certtype, ci.certid, getUserName (lpi.project_manage) AS project_manage, getOrgLevelName (lpi.project_dept) project_dept, ci.customertype,lpi.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.signType,psl.sealType,lpi.subjectid,lpi.subjectname,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_PROJECT_INFO lpi LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id LEFT JOIN LB_CONTRACT_INFO lci ON lpi.id=lci.project_id LEFT JOIN LC_CONTRACT_CONDITION lcc ON lci.id=lcc.contract_id LEFT JOIN LB_UNION_LESSEE lult ON lpi.id = lult.project_id AND (lult.contract_id = '' OR lult.contract_id IS NULL) LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id = ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' WHERE lult.is_main = 'y' AND lpi.project_status = '13' AND((lci.contract_status = '21' AND lpc.equip_amt>lcc.equip_amt) OR ((lult.CONTRACT_ID='' OR lult.CONTRACT_ID IS NULL)AND (SELECT COUNT(*) FROM lb_contract_info WHERE project_id=lpi.id)=0)) AND lpi.PROJECT_MANAGE='"+userId+"' AND lpi.businesstype='1' ORDER BY lpi.END_DATE DESC";
|
||||
sql="SELECT lpi.END_DATE AS startdate,lpi.id projectid, lpi.product_id, lpi.project_no, lpi.project_name, ci.customername, getItemName ('CertType', ci.certtype) certtype, ci.certid, getUserName (lpi.project_manage) AS project_manage, getOrgLevelName (lpi.project_dept) project_dept, ci.customertype,lpi.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.signType,psl.sealType,lpi.subjectid,lpi.subjectname,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_PROJECT_INFO lpi LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id LEFT JOIN LB_CONTRACT_INFO lci ON lpi.id=lci.project_id LEFT JOIN LC_CONTRACT_CONDITION lcc ON lci.id=lcc.contract_id LEFT JOIN LB_UNION_LESSEE lult ON lpi.id = lult.project_id AND (lult.contract_id = '' OR lult.contract_id IS NULL) LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id = ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' WHERE lult.is_main = 'y' AND lpi.project_status = '13' AND((lci.contract_status = '21' AND lpc.equip_amt>lcc.equip_amt) OR ((lult.CONTRACT_ID='' OR lult.CONTRACT_ID IS NULL)AND (SELECT COUNT(*) FROM lb_contract_info WHERE project_id=lpi.id)=0)) AND lpi.PROJECT_MANAGE='"+userId+"'";
|
||||
}
|
||||
if(globaltext.length() ==0 ){
|
||||
sql = sql+ " AND lpi.businesstype='1' ORDER BY lpi.END_DATE DESC ";
|
||||
}else{
|
||||
sql = sql+ " and (lpi.project_no like '%"+globaltext+"%' or ci.customername like '%"+globaltext+"%') AND lpi.businesstype='1' ORDER BY lpi.END_DATE DESC ";
|
||||
}
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
body.put("datas", dataList);
|
||||
body.put("filters", "申请编号,客户名称");
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
@ -72,16 +81,21 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String subjectId = fieldMap.get("SubjectId") == null ? "" : fieldMap.get("SubjectId").toString();
|
||||
String leasform = fieldMap.get("leasform") == null ? "" : fieldMap.get("leasform").toString();
|
||||
String operationType = fieldMap.get("operationType") == null ? "" : fieldMap.get("operationType").toString();
|
||||
String FlowUnid = fieldMap.get("FlowUnid") == null ? "" : fieldMap.get("FlowUnid").toString();
|
||||
//String subjectId = fieldMap.get("SubjectId") == null ? "" : fieldMap.get("SubjectId").toString();
|
||||
//String leasform = fieldMap.get("leasform") == null ? "" : fieldMap.get("leasform").toString();
|
||||
//String operationType = fieldMap.get("operationType") == null ? "" : fieldMap.get("operationType").toString();
|
||||
String flowUnid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
Map<String, String> flowParms = ContractMakeControllerUtil.getFlowParms(flowUnid);
|
||||
if(flowParms == null){
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "没有查询到对应的流程实例!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
body.put("FlowUnid", FlowUnid);
|
||||
body.put("FlowUnid", flowUnid);
|
||||
FileTemplateUtil ftu = new FileTemplateUtil();
|
||||
ftu.setSubjectId(subjectId);
|
||||
ftu.setLeasform(leasform);
|
||||
ftu.setOperationType(operationType);
|
||||
ftu.setSubjectId(flowParms.get("SubjectId"));
|
||||
ftu.setLeasform(flowParms.get("leasform"));
|
||||
ftu.setOperationType(flowParms.get("operationType"));
|
||||
String templateData = ftu.getContractClass(sqlca);
|
||||
templateData = templateData.replace("[", "");
|
||||
templateData = templateData.replace("]", "");
|
||||
@ -102,6 +116,9 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
System.out.println("==============合同文件生成参数=====================");
|
||||
System.out.println(fieldMap);
|
||||
System.out.println("==============");
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
@ -116,7 +133,6 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
String projectId = flowParms.get("ProjectId");
|
||||
String contractNo = flowParms.get("FlowKey");
|
||||
|
||||
|
||||
body.put("FlowUnid", flowUnid);
|
||||
String message = this.CheckCar(flowUnid, templateId, contractId);
|
||||
String projectSignStatus = this.ProjectSignStatus(projectId);
|
||||
@ -125,7 +141,7 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
if(templateId == null || templateId.length() == 0){
|
||||
body.put("status", "01");
|
||||
body.put("message", "模板编号不能为空!");
|
||||
}else if(message == null && !"success".equals(message)){
|
||||
}else if(!"success".equals(message)){
|
||||
body.put("status", "01");
|
||||
body.put("message", message);
|
||||
}else if("error".equals(projectSignStatus)){
|
||||
@ -175,7 +191,7 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
message = message+ "发动机号、";
|
||||
}
|
||||
}
|
||||
if(message.length()>0){
|
||||
if(!"success".equals(message) && message.length()>0){
|
||||
return "请先填写:"+message.substring(0,message.length() - 1)+"!";
|
||||
}
|
||||
String docName="";
|
||||
@ -186,7 +202,7 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
BizObject templatename = btManager.createQuery("select templatename from O where id=:id").setParameter("id", templateId).getSingleResult(false);
|
||||
for(BizObject ldcl:ldcls){
|
||||
if((templatename.getAttribute("templatename").toString()).equals(ldcl.getAttribute("doc_name").getString())){
|
||||
docName=docName+templatename.getAttribute("templatename").toString()+";";
|
||||
docName=docName+templatename.getAttribute("templatename").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,17 +407,25 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String globaltext = fieldMap.get("globaltext") == null ? "" : fieldMap.get("globaltext").toString();
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
ASUser asUser = new ASUser(userId);
|
||||
String orgID = asUser.getOrgID();
|
||||
String sql = "";
|
||||
if("8006011".equals(orgID)){
|
||||
sql = "SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid,lci.product_id,lci.contract_no flowkey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.sealType,psl.signType,lci.subjectid,lci.subjectname,lci.inputorgid,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN LB_PROJECT_INFO lpi ON lpi.id = lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid = lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id WHERE lult.is_main='y' AND lci.businesstype='1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.inputorgid='"+orgID+"' ORDER BY lci.contract_number DESC";
|
||||
sql = "SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid,lci.product_id,lci.contract_no flowkey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.sealType,psl.signType,lci.subjectid,lci.subjectname,lci.inputorgid,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN LB_PROJECT_INFO lpi ON lpi.id = lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid = lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id WHERE lult.is_main='y' AND lci.businesstype='1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.inputorgid='"+orgID+"' ";
|
||||
}else{
|
||||
sql="SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid,lci.product_id,lci.contract_no flowkey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.sealType,psl.signType,lci.subjectid,lci.subjectname,lci.inputuserid,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN LB_PROJECT_INFO lpi ON lpi.id = lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid = lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id WHERE lult.is_main='y' AND lci.businesstype='1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.inputuserid='"+userId+"' ORDER BY lci.contract_number DESC ";
|
||||
sql="SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid,lci.product_id,lci.contract_no flowkey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.leas_form,lpi.CAR_TYPE,lpi.IS_NETCAR,psl.operationType,psl.sealType,psl.signType,lci.subjectid,lci.subjectname,lci.inputuserid,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN LB_PROJECT_INFO lpi ON lpi.id = lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid = lpi.product_id LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id WHERE lult.is_main='y' AND lci.businesstype='1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.inputuserid='"+userId+"' ";
|
||||
}
|
||||
if(globaltext.length() ==0 ){
|
||||
sql = sql+ " ORDER BY lci.contract_number DESC ";
|
||||
}else{
|
||||
sql = sql+ " and (lci.contract_number like '%"+globaltext+"%' or lpi.project_no like '%"+globaltext+"%' or ci.customername like '%"+globaltext+"%') ORDER BY lci.contract_number DESC ";
|
||||
}
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
body.put("datas", dataList);
|
||||
body.put("filters", "合同编号,申请编号,客户名称");
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
@ -415,19 +439,50 @@ public class ContractMakeServiceImpl implements ContractMakeService{
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
String userId = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
String globaltext = fieldMap.get("globaltext") == null ? "" : fieldMap.get("globaltext").toString();
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
ASUser asUser = new ASUser(userId);
|
||||
String orgID = asUser.getOrgID();
|
||||
String sql = "";
|
||||
if("8006011".equals(orgID)){
|
||||
sql = "SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid ,lci.product_id,lci.contract_no FlowKey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) as project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.car_type,lci.leas_form,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id LEFT JOIN LB_UNION_LESSEE lult on lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci on lult.customer_id=ci.customerid LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id where lult.is_main='y' and lci.businesstype = '1' and not EXISTS (select 1 from LC_CALC_CONDITION_STATUS ccs where ccs.contract_id=lci.id) and contract_status='21' and lci.inputorgid='"+orgID+"' order by lci.contract_number desc";
|
||||
sql = "SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid ,lci.product_id,lci.contract_no FlowKey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) as project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.car_type,lci.leas_form,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id LEFT JOIN LB_UNION_LESSEE lult on lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci on lult.customer_id=ci.customerid LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id where lult.is_main='y' and lci.businesstype = '1' and not EXISTS (select 1 from LC_CALC_CONDITION_STATUS ccs where ccs.contract_id=lci.id) and contract_status='21' and lci.inputorgid='"+orgID+"' ";
|
||||
}else{
|
||||
sql="SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid, lci.product_id,lci.contract_no FlowKey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.car_type,lci.leas_form,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id WHERE lult.is_main='y' AND lci.businesstype = '1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.PROJECT_MANAGE='"+userId+"' ORDER BY lci.contract_number DESC";
|
||||
sql="SELECT lpi.END_DATE AS startdate,lci.id as contractid,lult.project_id as projectid, lci.product_id,lci.contract_no FlowKey,lci.contract_number,lci.project_name,ci.customername,getItemName('CertType',ci.certtype) certtype,ci.certid,getUserName(lci.project_manage) AS project_manage,getOrgLevelName(lci.project_dept) project_dept,ci.customertype,lci.car_type,lci.leas_form,lpi.project_no as project_no,lpc.CLEAN_LEASE_MONEY AS clean_lease_money,lpc.INCOME_NUMBER AS income_number,lec.MODEL AS model,lprp.RENT AS rent FROM LB_CONTRACT_INFO lci LEFT JOIN lb_project_info lpi ON lpi.id=lci.project_id LEFT JOIN LB_UNION_LESSEE lult ON lci.id=lult.contract_id LEFT JOIN CUSTOMER_INFO ci ON lult.customer_id=ci.customerid LEFT JOIN LB_EQUIPMENT_CAR lec ON lec.project_id=lpi.id LEFT JOIN LC_PROJ_RENT_PLAN lprp ON lprp.project_id=lpi.id AND lprp.plan_list='1' LEFT JOIN LC_PROJ_CONDITION lpc ON lpi.id=lpc.project_id WHERE lult.is_main='y' AND lci.businesstype = '1' AND NOT EXISTS (SELECT 1 FROM LC_CALC_CONDITION_STATUS ccs WHERE ccs.contract_id=lci.id) AND contract_status='21' AND lci.PROJECT_MANAGE='"+userId+"' ";
|
||||
}
|
||||
if(globaltext.length() ==0 ){
|
||||
sql = sql+ " order by lci.contract_number desc ";
|
||||
}else{
|
||||
sql = sql+ " and (lci.contract_number like '%"+globaltext+"%' or lpi.project_no like '%"+globaltext+"%' or ci.customername like '%"+globaltext+"%') ORDER BY lci.contract_number DESC ";
|
||||
}
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
body.put("datas", dataList);
|
||||
body.put("filters", "合同编号,申请编号,客户名称");
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
@Override
|
||||
public Map<String, Object> deleteContract(HttpServletRequest request,
|
||||
HttpServletResponse response, JBOTransaction tx, Transaction sqlca,
|
||||
ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // 参数
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
Map<String, String> flowParms = ContractMakeControllerUtil.getFlowParms(flowunid);
|
||||
if(flowParms == null){
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "没有查询到对应的流程实例!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
String projectId = flowParms.get("ProjectId");
|
||||
BizObjectManager lclManager=JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME,tx);
|
||||
BizObjectManager lpiManager=JBOFactory.getBizObjectManager(LB_PROJECT_INFO.CLASS_NAME,tx);
|
||||
BizObjectManager lctManager=JBOFactory.getBizObjectManager(LB_CONTRACT_TEMPLATE.CLASS_NAME,tx);
|
||||
lclManager.createQuery("update O set file_flag='no',message='1' where flow_unid=:flow_unid").setParameter("flow_unid",flowunid).executeUpdate();
|
||||
lpiManager.createQuery("update O set PROJECT_STATUS=13 where id=:id").setParameter("id",projectId).executeUpdate();
|
||||
lctManager.createQuery("delete from O where flowunid=:flowunid ").setParameter("flowunid", flowunid).executeUpdate();
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,18 @@
|
||||
package apx.com.amarsoft.als.apzl.flow.data.service.Impl;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@ -12,6 +20,8 @@ import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_HIS;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_INFO_TEMP;
|
||||
import jbo.app.tenwa.doc.LB_DOCLIBRARY;
|
||||
import jbo.app.tenwa.doc.LB_DOCRELATIVE;
|
||||
import jbo.app.tenwa.doc.LB_DOC_CONTRACT_LIST;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_UNION_LESSEE;
|
||||
@ -22,6 +32,8 @@ 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.util.StringFunction;
|
||||
import com.amarsoft.awe.Configure;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.amarsoft.dict.als.manage.NameManager;
|
||||
@ -60,6 +72,10 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
body.put("mobile", map.get("mobile")+"");
|
||||
body.put("certid", map.get("certid")+"");
|
||||
}
|
||||
//获取扣款文件id
|
||||
String fileSql = "select lda.id as fileid from LB_DOCRELATIVE ldra left join LB_DOCLIBRARY ldc on ldc.RELATIVE_ID=ldra.id and ldc.DOC_NAME='还款卡(正反面)' left join LB_DOCATTRIBUTE lda on lda.library_id=ldc.id where ldra.objecttype='BusinessApplyFlow' and ldra.proj_id='"+dataList.get(0).get("project_id")+"' and lda.deleteed is null limit 0,2 ";
|
||||
List<Map<String, String>> fileList = DataOperatorUtil.getDataBySql(fileSql);
|
||||
body.put("attributeid", fileList);
|
||||
}else{
|
||||
BizObject lult = this.getLult(flowunid);
|
||||
if(lult!=null){
|
||||
@ -87,11 +103,23 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil.readRequestParam(request, "UTF-8");
|
||||
BizObjectManager catManage = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME,sqlca);
|
||||
System.out.println("============业务申请扣款卡信息保存参数=====================");
|
||||
System.out.println(testMap);
|
||||
System.out.println("===================================================");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
|
||||
List<Map<String, Object>> fileList = (List<Map<String, Object>>) testMap.get("fileList");
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("acc_number") == null ? "" : fieldMap.get("acc_number").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
ASUser CurUser = new ASUser(userid, sqlca);
|
||||
|
||||
//保存扣款卡对应的图片信息
|
||||
if(fileList!=null&&fileList.size()>0){
|
||||
Map<String, String> flowParms = ContractMakeControllerUtil.getFlowParms(flowunid);
|
||||
if(flowParms == null){
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "没有查询到对应的流程实例!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
this.savaBankCardFile(flowParms.get("ProjectId"), flowParms.get("ApplyType"), fileList, CurUser, tx);
|
||||
}
|
||||
BizObject cat = catManage.createQuery(" flowunid =:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
if( cat == null ){
|
||||
cat = catManage.newObject();
|
||||
@ -165,6 +193,10 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
data.put("mobile", dataList.get(0).get("mobile")+"");
|
||||
data.put("certid", dataList.get(0).get("certid")+"");
|
||||
body.put("statusCode", "00");
|
||||
//获取扣款文件id
|
||||
String fileSql = "select lda.id as fileid from LB_DOCRELATIVE ldra left join LB_DOCLIBRARY ldc on ldc.RELATIVE_ID=ldra.id and ldc.DOC_NAME='还款卡(正反面)' left join LB_DOCATTRIBUTE lda on lda.library_id=ldc.id where ldra.objecttype='BusinessApplyFlow' and ldra.proj_id='"+dataList.get(0).get("project_id")+"' and lda.deleteed is null limit 0,2 ";
|
||||
List<Map<String, String>> fileList = DataOperatorUtil.getDataBySql(fileSql);
|
||||
body.put("attributeid", fileList);
|
||||
}else{
|
||||
data.put("id", "");
|
||||
data.put("acc_number", "");
|
||||
@ -195,6 +227,8 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
System.out.println(testMap);
|
||||
System.out.println("====================");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
|
||||
List<Map<String, Object>> fileList = (List<Map<String, Object>>) testMap.get("fileList");
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String projectId = fieldMap.get("project_id") == null ? "" : fieldMap.get("project_id").toString();
|
||||
String ContractId = fieldMap.get("contract_id") == null ? "" : fieldMap.get("contract_id").toString();
|
||||
@ -204,6 +238,17 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
String account = fieldMap.get("account") == null ? "" : fieldMap.get("account").toString();
|
||||
String mobile = fieldMap.get("mobile") == null ? "" : fieldMap.get("mobile").toString();
|
||||
String certid = fieldMap.get("certid") == null ? "" : fieldMap.get("certid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
ASUser CurUser = new ASUser(userid, sqlca);
|
||||
if(fileList!=null&&fileList.size()>0){
|
||||
Map<String, String> flowParms = ContractMakeControllerUtil.getFlowParms(FlowUnid);
|
||||
if(flowParms == null){
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "没有查询到对应的流程实例!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
this.savaBankCardFile(flowParms.get("ProjectId"), flowParms.get("ApplyType"), fileList, CurUser, tx);
|
||||
}
|
||||
|
||||
BizObjectManager ldclManager = JBOFactory.getBizObjectManager(LB_DOC_CONTRACT_LIST.CLASS_NAME);
|
||||
List<BizObject> ldcls = ldclManager.createQuery("select * from O where file_flag='yes' and ( flow_unid=:flowunid or contract_id=:contractid ) ").setParameter("flowunid", FlowUnid).setParameter("contractid", ContractId).getResultList(false);
|
||||
body.put("FlowUnid", FlowUnid);
|
||||
@ -248,7 +293,7 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
BizObjectManager cahManage = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT_HIS.CLASS_NAME);
|
||||
BizObject cah = cahManage.createQuery(" account=:account and acc_number=:acc_number and bank_name=:bank_name and mobile=:mobile and sign_status='Y'")
|
||||
.setParameter("account", account).setParameter("acc_number", acc_number).setParameter("bank_name", bank_name).setParameter("mobile", mobile).getSingleResult(false);
|
||||
if(cah == null ){
|
||||
if(cah != null ){
|
||||
return "Y";
|
||||
}else{
|
||||
return "N";
|
||||
@ -336,6 +381,7 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
|
||||
}
|
||||
body.put("flowunid", flowunid);//Á÷³Ìid
|
||||
System.out.println("GPS返回参数"+body);
|
||||
ReturnMapUtil.setReturnMap(body,
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
@ -349,6 +395,9 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap"); // ²ÎÊý
|
||||
System.out.println("=======GPS保存==============");
|
||||
System.out.println(fieldMap);
|
||||
System.out.println("=====================");
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
String flowunid = fieldMap.get("flowunid") == null ? "" : fieldMap.get("flowunid").toString();
|
||||
String userid = fieldMap.get("userid") == null ? "" : fieldMap.get("userid").toString();
|
||||
@ -625,4 +674,87 @@ public class FlowDataServiceImpl implements FlowDataService{
|
||||
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
public void savaBankCardFile(String projectId,String applyFlow,List<Map<String, Object>> fileList,ASUser user,JBOTransaction tx) throws Exception{
|
||||
BizObjectManager relaManage = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME);
|
||||
BizObject rela = null;
|
||||
if("BusinessApplyApply".equals(applyFlow)||"BusinessChangeApply".equals(applyFlow)||"BusinessCancelApply".equals(applyFlow)||"BContractApproveApply".equals(applyFlow)||"BContractCancelApply".equals(applyFlow)||"BContractChangeApply".equals(applyFlow)){
|
||||
rela = relaManage.createQuery(" objecttype='BusinessApplyFlow' AND proj_id=:projectId ").setParameter("projectId", projectId).getSingleResult(false);
|
||||
|
||||
}else{
|
||||
rela = relaManage.createQuery(" objecttype=:objecttype AND proj_id=:projectId ").setParameter("objecttype", applyFlow).setParameter("projectId", projectId).getSingleResult(false);
|
||||
}
|
||||
String relaId = "";
|
||||
if (null == rela) {
|
||||
return;
|
||||
} else {
|
||||
relaId = rela.getAttribute("ID") == null ? "" : rela.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
|
||||
BizObjectManager libraryManage = JBOFactory.getBizObjectManager(LB_DOCLIBRARY.CLASS_NAME);
|
||||
BizObject library = libraryManage.createQuery("RELATIVE_ID=:RELATIVE_ID AND DOC_NAME='还款卡(正反面)' ").setParameter("RELATIVE_ID", relaId).getSingleResult(true);
|
||||
String libraryId = "";
|
||||
if (null == library) {
|
||||
return ;
|
||||
} else {
|
||||
libraryId = library.getAttribute("ID") == null ? "" : library.getAttribute(
|
||||
"ID").toString();
|
||||
}
|
||||
Configure CurConfig = Configure.getInstance();
|
||||
BizObjectManager attrBm=JBOFactory.getBizObjectManager("jbo.app.tenwa.doc.LB_DOCATTRIBUTE");
|
||||
for (Map<String, Object> file : fileList) {
|
||||
BizObject attr=attrBm.newObject();
|
||||
attr.setAttributeValue("Library_Id", libraryId);
|
||||
attr.setAttributeValue("FileName", file.get("fileName"));
|
||||
attr.setAttributeValue("InputUserId", user.getUserID());
|
||||
attr.setAttributeValue("InputOrgId", user.getOrgID());
|
||||
attr.setAttributeValue("InputTime",StringFunction.getTodayNow());
|
||||
attr.setAttributeValue("objectType", applyFlow);
|
||||
|
||||
//得到不带路径的文件名
|
||||
String sFileName = StringFunction.getFileName(file.get("fileName").toString());
|
||||
sFileName = URLDecoder.decode(URLDecoder.decode(sFileName,"UTF-8"),"UTF-8");
|
||||
|
||||
//定义数据库操作变量
|
||||
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
|
||||
|
||||
String uuid=java.util.UUID.randomUUID().toString().replaceAll("-", "");
|
||||
String sFullPath =com.tenwa.officetempalte.util.FileOperatorUtil.getuploadFileDir(sFileSavePath) +uuid+"_"+sFileName;
|
||||
InputStream is = (InputStream) file.get("file");
|
||||
File f = new File(sFullPath);
|
||||
DataOutputStream fileout = new DataOutputStream(
|
||||
new FileOutputStream(f));
|
||||
String sFileSize = file.get("fileSize") == null ? "" : file.get("fileSize").toString();
|
||||
byte b[] = new byte[Integer.valueOf(sFileSize)];
|
||||
@SuppressWarnings("unused")
|
||||
int i = is.read(b, 0, Integer.valueOf(sFileSize) - 1);
|
||||
fileout.write(b, 0, b.length); // 将文件数据存盘
|
||||
fileout.close();
|
||||
|
||||
//得到带相对路径的文件名
|
||||
String sFilePath = sFullPath.replace(sFileSavePath, "");
|
||||
attr.setAttributeValue("FilePath",sFilePath);
|
||||
attr.setAttributeValue("FullPath",sFullPath);
|
||||
attr.setAttributeValue("Content_Type", isImage(f,file.get("fileContentType")));
|
||||
attr.setAttributeValue("FileSize", file.get("fileSize"));
|
||||
tx.join(attrBm);
|
||||
attrBm.saveObject(attr);
|
||||
tx.commit();
|
||||
}
|
||||
}
|
||||
|
||||
public Object isImage(File file,Object object) throws Exception{
|
||||
String reg = "(mp4|flv|avi|rm|rmvb|wmv)";
|
||||
Pattern p = Pattern.compile(reg);
|
||||
boolean boo = p.matcher(file.getName()).find();
|
||||
if(boo){
|
||||
return "video";
|
||||
}
|
||||
BufferedImage bi = ImageIO.read(file);
|
||||
if(bi==null){
|
||||
return object;
|
||||
}
|
||||
return "image/jpeg";
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ public class bondsmanDoManage extends AbstractAweDoQueryManage {
|
||||
String id = fieldMap.get("id") == null ? "" : fieldMap.get("id").toString();
|
||||
|
||||
String num = sqlca.getString("select count(1) AS num from lb_guarantee_unit_temp where FLOWUNID = '" + flowUnid + "'");
|
||||
if (num != null && Integer.valueOf(num) > 2 && id == null || "".equals(id)) {
|
||||
if (num != null && Integer.valueOf(num) > 2 && (id == null || "".equals(id))) {
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "担保人信息不能超过三个!!!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
@ -82,4 +82,9 @@ public interface ApplyArchiveService {
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
Map<String, Object> LiveTesting(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca, ReturnMapUtil ReturnMapUtil)
|
||||
throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@ -39,6 +39,7 @@ import jbo.app.tenwa.doc.LM_APPROVALOPINION_DOC;
|
||||
import jbo.app.tenwa.doc.LM_APPROVALOPINION_DOC_TEMP;
|
||||
import jbo.app.tenwa.doc.LM_MAILONLINE_DOC_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
|
||||
import jbo.prd.PRD_SPECIFIC_LIBRARY;
|
||||
//APP获取邮寄归档
|
||||
public class ApplyArchiveServiceImpl implements ApplyArchiveService{
|
||||
|
||||
@ -265,7 +266,7 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
|
||||
String customerid = fieldMap.get("customer_id") == null ? "" : fieldMap.get("customer_id").toString();
|
||||
String sql = "";
|
||||
//sql = "select lrp.contract_id,lci.contract_number,lul.customer_name as lessee_name,lec.frame_number,lec.model,ifnull(sum(lrp.rent),0) - ifnull(sum(lri.rent),0) as residue_rent,lrp.rent,lcc.defaultdueday,lcc.lease_term,lrp.plan_list,lrp.penalty from lb_contract_info lci left join lc_calc_condition lcc on lcc.contract_id = lci.id left join lb_union_lessee lul on lcc.contract_id = lul.contract_id and lul.is_main = 'y' left join lb_equipment_car lec on lec.contract_id = lcc.contract_id left join lc_rent_plan lrp on lrp.contract_id=lci.id left join lc_rent_income lri on lri.plan_id=lrp.id where lul.customer_id='"+customerid+"' group by lrp.contract_id ";
|
||||
sql = "SELECT lrp.project_plan_number as plannumber,'project_plan_number' AS planCName,lul.flowunid as objectNo,lrp.contract_id,lrp.contract_plan_number AS contract_number,lul.customer_name AS lessee_name,lec.frame_number,lec.model,lrp.overinterest AS residue_rent,lrp.rent,SUBSTRING(lrp.plan_date,-2) AS defaultdueday,lcc.lease_term,COUNT(*) AS plan_list,SUM(lrp.penalty) AS penalty FROM lc_overdue_rent_plan lrp LEFT JOIN lb_union_lessee lul ON lul.contract_id=lrp.contract_id AND lul.is_main = 'y' LEFT JOIN lb_equipment_car lec ON lec.contract_id = lrp.contract_id LEFT JOIN lc_calc_condition lcc ON lcc.contract_id = lrp.contract_id WHERE plan_status='未结清' AND lul.customer_id='"+customerid+"' GROUP BY lrp.contract_id ";
|
||||
sql = "SELECT lrp.project_plan_number as plannumber,'project_plan_number' AS planCName,lul.flowunid as objectNo,lrp.contract_id,lrp.contract_plan_number AS contract_number,lul.customer_name AS lessee_name,lec.frame_number,lec.model,lrp.overinterest AS residue_rent,lrp.rent,SUBSTRING(lrp.plan_date,-2) AS defaultdueday,lcc.lease_term,COUNT(*) AS plan_list,SUM(lrp.penalty) AS penalty,ldcl.filename AS filename,ldcl.attribute_id AS fileId FROM lc_overdue_rent_plan lrp LEFT JOIN lb_union_lessee lul ON lul.contract_id=lrp.contract_id AND lul.is_main = 'y' LEFT JOIN lb_equipment_car lec ON lec.contract_id = lrp.contract_id LEFT JOIN lc_calc_condition lcc ON lcc.contract_id = lrp.contract_id LEFT JOIN lb_doc_contract_list ldcl ON ldcl.contract_id=lrp.contract_id AND ldcl.file_flag='yes' WHERE plan_status='未结清' AND lul.customer_id='"+customerid+"' GROUP BY lrp.contract_id ";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
@ -299,7 +300,7 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
|
||||
.readRequestParam(request, "UTF-8");
|
||||
String sql = "";
|
||||
//sql = "select sum(lf.fact_money) lfitmoney,count(di.F_I_TYPE) lfitnumber from distributor_info di left join lb_project_info lpi on lpi.distributor_id=di.distributor_no left join PRD_SPECIFIC_LIBRARY ps on ps.productid = lpi.product_id left join LC_FUND_INCOME_TEMP lf on lf.project_id=lpi.id left join FLOW_task ft on ft.objectno=lf.flowunid left join FLOW_OBJECT fo on fo.objectno=lf.flowunid where lf.EBANK_STATUS='05' and fo.flowname='实际付款流程(汽车)' and fo.phasename='结束' and ft.phasename='结束' group by date(lf.fact_date),di.F_I_TYPE,di.PROVINCES,di.DISTRIBUTOR_ADDRESS,di.distributor_name,ps.specificname";
|
||||
sql = "SELECT lf.fact_date,lf.contract_id,sum(lf.fact_money) as lfitmoney,count(*) as lfitnumber FROM lc_fund_income lf left join lb_contract_info lc on lc.id=lf.contract_id WHERE lf.pay_status='have_paid' AND lf.ebank_status='05' and lf.fact_date between DATE_ADD(now(),INTERVAL -12 month ) and now() group by lc.distributor_id ";
|
||||
sql = "SELECT lf.fact_date,lf.contract_id,sum(lf.fact_money) as lfitmoney,count(*) as lfitnumber FROM lc_fund_income lf left join lb_contract_info lc on lc.id=lf.contract_id WHERE lf.pay_status='have_paid' AND lf.ebank_status='05' and lf.fact_date between DATE_ADD(now(),INTERVAL -12 month ) and now() group by lc.distributor_id ORDER BY lf.fact_date ASC ";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
@ -395,7 +396,7 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
|
||||
String sql = "";
|
||||
//sql = "select flowno,ifnull(max(apply),0) as applyNum,ifnull(max(audit),0) as auditNum from (select flowno, count(1) as apply, null as audit from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') group by flowno union all select flowno, null as apply , count(1) as audit from flow_object where inputdate = date_format(now(), '%Y/%m/%d') and flowno in ('BusinessApplyFlow', 'FundPaymentCarFlow', 'BContractApproveFlow') and phaseno = '1000' group by flowno ) t group by t.flowno; ";
|
||||
//sql = "select ved.every_day,IFNULL(FBO1.INPUT_NUM ,0) inputnum,IFNULL(FT1.SP_NUM,0) spnum FROM vi_every_day ved LEFT JOIN (SELECT DATE_FORMAT(ft.begintime,'%Y/%m/%d') TIME_DAY,COUNT(FBO.INPUTTIME) AS INPUT_NUM FROM FLOW_BUSSINESS_OBJECT FBO LEFT JOIN (SELECT MIN(begintime) as begintime, objectno, phaseno FROM flow_task WHERE flowname='业务申请流程' AND phaseno ='0030' GROUP BY objectno) as ft ON FBO.flow_unid=ft.objectno WHERE FBO.FLOW_NAME='业务申请流程' AND ft.phaseno ='0030' GROUP BY TIME_DAY)FBO1 ON FBO1.TIME_DAY=VED.EVERY_DAY LEFT JOIN (SELECT LEFT(ENDTIME,10) AS ENDTIME ,COUNT(ENDTIME) SP_NUM FROM FLOW_TASK WHERE FLOWNAME='业务申请流程' AND (PHASENAME='否决' OR PHASENAME='结束') GROUP BY LEFT(ENDTIME,10))FT1 ON FT1.ENDTIME=VED.EVERY_DAY where every_day between DATE_ADD(now(),INTERVAL -30 DAY ) and now();";
|
||||
sql = "select ved.every_day,IFNULL(FBO1.INPUT_NUM ,0) inputnum,IFNULL(FT1.SP_NUM,0) spnum FROM vi_every_day ved LEFT JOIN (SELECT DATE_FORMAT(ft.begintime,'%Y/%m/%d') TIME_DAY,COUNT(FBO.INPUTTIME) AS INPUT_NUM FROM FLOW_BUSSINESS_OBJECT FBO LEFT JOIN (SELECT MIN(begintime) as begintime, objectno, phaseno FROM flow_task WHERE flowname='业务申请流程' AND phaseno ='0030' GROUP BY objectno) as ft ON FBO.flow_unid=ft.objectno WHERE FBO.FLOW_NAME='业务申请流程' AND ft.phaseno ='0030' GROUP BY TIME_DAY)FBO1 ON FBO1.TIME_DAY=VED.EVERY_DAY LEFT JOIN (SELECT LEFT(ENDTIME,10) AS ENDTIME ,COUNT(ENDTIME) SP_NUM FROM FLOW_TASK WHERE FLOWNAME='业务申请流程' AND (PHASENAME='否决' OR PHASENAME='结束') GROUP BY LEFT(ENDTIME,10))FT1 ON FT1.ENDTIME=VED.EVERY_DAY where every_day between DATE_ADD(now(),INTERVAL -30 DAY ) and now(); ";
|
||||
sql = "select ved.every_day,IFNULL(FBO1.INPUT_NUM ,0) inputnum,IFNULL(FT1.SP_NUM,0) spnum FROM vi_every_day ved LEFT JOIN (SELECT DATE_FORMAT(ft.begintime,'%Y/%m/%d') TIME_DAY,COUNT(FBO.INPUTTIME) AS INPUT_NUM FROM FLOW_BUSSINESS_OBJECT FBO LEFT JOIN (SELECT MIN(begintime) as begintime, objectno, phaseno FROM flow_task WHERE flowname='业务申请流程' AND phaseno ='0030' GROUP BY objectno) as ft ON FBO.flow_unid=ft.objectno WHERE FBO.FLOW_NAME='业务申请流程' AND ft.phaseno ='0030' GROUP BY TIME_DAY)FBO1 ON FBO1.TIME_DAY=VED.EVERY_DAY LEFT JOIN (SELECT LEFT(ENDTIME,10) AS ENDTIME ,COUNT(ENDTIME) SP_NUM FROM FLOW_TASK WHERE FLOWNAME='业务申请流程' AND (PHASENAME='否决' OR PHASENAME='结束') GROUP BY LEFT(ENDTIME,10))FT1 ON FT1.ENDTIME=VED.EVERY_DAY where every_day between DATE_ADD(now(),INTERVAL -30 DAY ) and now() ORDER BY ved.every_day DESC; ";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
if(dataList.size()>0){
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
@ -417,7 +418,7 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
String sql = "";
|
||||
sql = "select t.plan_date,t.rent,t.contract_id,sum(t.residue_rent) as residue_rent from (select lrp.plan_date,lrp.rent,lrp.contract_id,ifnull(sum(lrp.rent),0) - ifnull(sum(lri.rent),0) as residue_rent from lc_rent_plan lrp left join lc_rent_income lri on lri.plan_id=lrp.id WHERE lrp.plan_date <NOW() group by lrp.id ) t where t.residue_rent>=0 group by t.plan_date order by t.plan_date desc limit 0,30 ";
|
||||
sql = "select t.plan_date,t.rent,t.contract_id,sum(t.residue_rent) as residue_rent from (select lrp.plan_date,lrp.rent,lrp.contract_id,ifnull(sum(lrp.rent),0) - ifnull(sum(lri.rent),0) as residue_rent from lc_rent_plan lrp left join lc_rent_income lri on lri.plan_id=lrp.id WHERE lrp.plan_date <NOW() group by lrp.id ) t where t.residue_rent>=0 group by t.plan_date order by t.plan_date asc limit 0,30 ";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
if(dataList.size()>0){
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
@ -446,4 +447,29 @@ public class ApplyArchiveServiceImpl implements ApplyArchiveService{
|
||||
RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
|
||||
//活体检测接口查询
|
||||
@Override
|
||||
public Map<String, Object> LiveTesting(HttpServletRequest request, HttpServletResponse response, JBOTransaction tx,
|
||||
Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception {
|
||||
Map<String, Object> testMap = (Map<String, Object>) MultipartDataUtil
|
||||
.readRequestParam(request, "UTF-8");
|
||||
fieldMap = (Map<String, Object>) testMap.get("fieldMap");
|
||||
String SerialNo = fieldMap.get("serialno") == null ? "" : fieldMap.get("serialno").toString();
|
||||
String sql = "SELECT serialno,whether FROM PRD_SPECIFIC_LIBRARY WHERE SerialNo='"+SerialNo+"' ";
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql(sql);
|
||||
Map<String, Object> body = new HashMap<String, Object>();
|
||||
if(dataList.size()>0){
|
||||
for (Map<String, String> map : dataList) {
|
||||
body.put("serialno", map.get("serialno")+"");
|
||||
body.put("whether", map.get("whether")+"");
|
||||
}
|
||||
ReturnMapUtil.setReturnMap(body,RestfullConstant.baseProperty.get("success").toString(), "");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}else{
|
||||
ReturnMapUtil.setReturnMap(null,RestfullConstant.baseProperty.get("fail").toString(), "未查到信息!!!");
|
||||
return ReturnMapUtil.getReturnMap();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -683,4 +683,23 @@ public class ApplyChangeController {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
|
||||
//»îÌå¼ì²â
|
||||
@Path("/live/testing")
|
||||
@POST
|
||||
public Map<String, Object> LiveTesting(@Context HttpServletRequest request,
|
||||
@Context HttpServletResponse response, @Context JBOTransaction tx,
|
||||
@Context Transaction sqlca) throws Exception {
|
||||
ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca);
|
||||
ARE.getLog().info(
|
||||
"[CONTROLLER] ApplyChangeController run .................");
|
||||
ARE.getLog().info("[Path] /change/live/testing" + " run .................");
|
||||
|
||||
ApplyArchiveService service = new ApplyArchiveServiceImpl();
|
||||
try {
|
||||
return service.LiveTesting(request, response, tx, sqlca, ReturnMapUtil);
|
||||
} catch (Exception e) {
|
||||
return ReturnMapUtil.rollback(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ public class AppUserLoginServiceImpl implements AppUserLoginService {
|
||||
sMsg += userMap.get("USERNAME".toLowerCase()) + "!";
|
||||
//获取菜单列表
|
||||
try {
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql("SELECT menuid,displayname,sortno FROM app_menu_info WHERE menuid IN (SELECT menuid FROM app_role_menu WHERE roleid=(SELECT ROLEID FROM USER_ROLE WHERE userid='"+body.get("userid")+"'))");
|
||||
List<Map<String, String>> dataList = DataOperatorUtil.getDataBySql("SELECT menuid,displayname,sortno FROM app_menu_info WHERE menuid IN (SELECT menuid FROM app_role_menu WHERE roleid in (SELECT ROLEID FROM USER_ROLE WHERE userid='"+body.get("userid")+"'))");
|
||||
body.put("menu", dataList);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -336,7 +336,7 @@ public class AppUserLoginServiceImpl implements AppUserLoginService {
|
||||
private void userLoginBefreBusiness(JBOTransaction tx, String sUserId)
|
||||
throws JBOException {
|
||||
// 强踢已登录设备同ID用户下线
|
||||
// SessionHelper.removerByUserId(tx, sUserId);
|
||||
//SessionHelper.removerByUserId(tx, sUserId);
|
||||
}
|
||||
|
||||
private String getMD5Hex(byte[] buf) {
|
||||
|
||||
84
src_jbo/jbo/app/tenwa/customer/VI_CSAN.java
Normal file
84
src_jbo/jbo/app/tenwa/customer/VI_CSAN.java
Normal file
@ -0,0 +1,84 @@
|
||||
package jbo.app.tenwa.customer;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
/**
|
||||
* - JBO命名常量类<br><br>
|
||||
* Note: This file is generated by ADE tools, <em>dont</em> modify it.<br>
|
||||
|
||||
*/
|
||||
public interface VI_CSAN{
|
||||
/**
|
||||
* <br><br>
|
||||
* 代表本类映射的BizObjectClass
|
||||
*/
|
||||
public static final String CLASS_NAME = "jbo.app.tenwa.customer.VI_CSAN";
|
||||
/**
|
||||
* TYPENO STRING(20)<br>
|
||||
*/
|
||||
public static final String TYPENO = "TYPENO";
|
||||
/**
|
||||
* SORTNO STRING(20)<br>
|
||||
*/
|
||||
public static final String SORTNO = "SORTNO";
|
||||
/**
|
||||
* TYPENAME STRING(20)<br>
|
||||
*/
|
||||
public static final String TYPENAME = "TYPENAME";
|
||||
/**
|
||||
* ATTRIBUTE2 STRING(20)<br>
|
||||
*/
|
||||
public static final String ATTRIBUTE2 = "ATTRIBUTE2";
|
||||
/**
|
||||
* PRODUCTID STRING(20)<br>
|
||||
*/
|
||||
public static final String PRODUCTID = "PRODUCTID";
|
||||
/**
|
||||
* VERSIONID STRING(20)<br>
|
||||
*/
|
||||
public static final String VERSIONID = "VERSIONID";
|
||||
/**
|
||||
* LeasForm STRING(20)<br>
|
||||
*/
|
||||
public static final String LeasForm = "LeasForm";
|
||||
/**
|
||||
* equip_type STRING(20)<br>
|
||||
*/
|
||||
public static final String equip_type = "equip_type";
|
||||
/**
|
||||
* IS_ALL_DEALER STRING(20)<br>
|
||||
*/
|
||||
public static final String IS_ALL_DEALER = "IS_ALL_DEALER";
|
||||
/**
|
||||
* IS_ALL_CAR STRING(20)<br>
|
||||
*/
|
||||
public static final String IS_ALL_CAR = "IS_ALL_CAR";
|
||||
/**
|
||||
* orgid STRING(20)<br>
|
||||
*/
|
||||
public static final String orgid = "orgid";
|
||||
/**
|
||||
* id STRING(20)<br>
|
||||
*/
|
||||
public static final String id = "id";
|
||||
/**
|
||||
* DISTRIBUTOR_NAME STRING(20)<br>
|
||||
*/
|
||||
public static final String DISTRIBUTOR_NAME = "DISTRIBUTOR_NAME";
|
||||
/**
|
||||
* modelid STRING(20)<br>
|
||||
*/
|
||||
public static final String modelid = "modelid";
|
||||
/**
|
||||
* modelname STRING(20)<br>
|
||||
*/
|
||||
public static final String modelname = "modelname";
|
||||
/**
|
||||
* operationType STRING(20)<br>
|
||||
*/
|
||||
public static final String operationType = "operationType";
|
||||
/**
|
||||
* ManySubject STRING(20)<br>
|
||||
*/
|
||||
public static final String ManySubject = "ManySubject";
|
||||
}
|
||||
@ -133,4 +133,8 @@ public interface PRD_SPECIFIC_LIBRARY{
|
||||
* Ö÷Ìå STRING(32)<br>
|
||||
*/
|
||||
public static final String ManySubject = "ManySubject";
|
||||
/**
|
||||
* 是否活体检测 STRING(32)<br>
|
||||
*/
|
||||
public static final String whether = "whether";
|
||||
}
|
||||
2206
src_sql/投产SQL/V20200521/zhj_20200521.sql
Normal file
2206
src_sql/投产SQL/V20200521/zhj_20200521.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,27 +1,5 @@
|
||||
package com.tenwa.lease.flow.project.commbusiness;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
|
||||
import jbo.sys.PF_CALC_CONDITION;
|
||||
import jbo.sys.PF_CUSTOMER_ACCOUNT;
|
||||
import jbo.sys.PF_CUSTOMER_ADDRESS;
|
||||
import jbo.sys.PF_CUSTOMER_FAMILY;
|
||||
import jbo.sys.PF_CUSTOMER_PERSON;
|
||||
import jbo.sys.PF_EQUIPMENT_CAR;
|
||||
import jbo.sys.PF_GUARANTEE_UNIT;
|
||||
import jbo.sys.PF_PROJECT_INFO;
|
||||
import com.amarsoft.app.als.sys.tools.DateUtil;
|
||||
import com.amarsoft.app.util.ProductParamUtil;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
@ -37,428 +15,447 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.flow.baseBussion.BaseBussiness;
|
||||
import com.tenwa.reckon.executor.CreateTransactionExecutor;
|
||||
import com.tenwa.util.SerialNumberUtil;
|
||||
import jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ADDRESS_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_FAMILY_TEMP;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_PERSON_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_EQUIPMENT_CAR_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_GUARANTEE_UNIT_TEMP;
|
||||
import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP;
|
||||
import jbo.sys.*;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 业务申请阶段接口平台数据拷入临时表
|
||||
* 业务申请阶段接口平台数据拷入临时表
|
||||
*/
|
||||
public class PlatformDataToTemp extends BaseBussiness {
|
||||
|
||||
@Override
|
||||
public Object run(Transaction Sqlca) throws Exception {
|
||||
this.initBussinessParam(Sqlca);
|
||||
if(this.getAttribute("serial")==null) return "true";
|
||||
|
||||
ASUser asUser=new ASUser(this.getAttribute("CurUserID").toString());
|
||||
String serial = this.getAttribute("serial").toString();
|
||||
String flowunid = this.getAttribute("ObjectNo").toString();
|
||||
String customerId = Sqlca.getString("SELECT customerid FROM customer_info_temp WHERE flowunid='"+flowunid+"'");
|
||||
String projectId = this.getAttribute("ProjectId").toString();
|
||||
String customerType = this.getAttribute("CustomerType").toString();
|
||||
String productId = this.getAttribute( "ProductId" ).toString();
|
||||
String planNumber = null;
|
||||
String calType = "proj_process";
|
||||
|
||||
Map<String,String> fromCondtion = new HashMap<String,String>();
|
||||
Map<String,String> toCondtion = new HashMap<String,String>();
|
||||
toCondtion.put("customerid",customerId);
|
||||
toCondtion.put("flowunid",flowunid);
|
||||
|
||||
Map<String,String> otherProperty = new HashMap<String,String>();
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("PROJECT_ID",projectId);
|
||||
|
||||
int number = Integer.valueOf(Sqlca.getString("select count(1) from PF_CUSTOMER_ACCOUNT where flowunid='"+flowunid+"'"));
|
||||
|
||||
String bowhere = null;
|
||||
String boKey = null;
|
||||
String boValue = null;
|
||||
|
||||
/**判断是新增业务申请还是修改业务申请*/
|
||||
if(number==0){
|
||||
boKey="SERIAL";
|
||||
boValue=serial;
|
||||
bowhere=boKey+"=:"+boKey;
|
||||
}else{
|
||||
//修改业务申请
|
||||
boKey="FLOWUNID";
|
||||
boValue=flowunid;
|
||||
bowhere=boKey+"=:"+boKey;
|
||||
}
|
||||
|
||||
fromCondtion.put(boKey,boValue);
|
||||
/**判断客户类型*/
|
||||
if("03".equals(customerType)){
|
||||
/**配偶信息拷表*/
|
||||
String marriage = Sqlca.getString("select MARRIAGE from PF_CUSTOMER_PERSON where "+boKey+"='"+boValue+"'");
|
||||
/**判断是否已婚*/
|
||||
if("01".equals(marriage)){
|
||||
fromCondtion.put("Spouse_","Y");
|
||||
toCondtion.put("Spouse_","Y");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
}else{
|
||||
Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_FAMILY_TEMP where flowunid='"+flowunid+"' and Spouse_='Y'"));
|
||||
}
|
||||
|
||||
/**自然人基本信息拷表*/
|
||||
fromCondtion.remove("Spouse_");
|
||||
toCondtion.remove("Spouse_");
|
||||
otherProperty.remove("PROJECT_ID");
|
||||
otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID",this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID",asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID",asUser.getOrgID());
|
||||
otherProperty.put("inputtime",StringFunction.getTodayNow());
|
||||
otherProperty.put("FULLNAME",this.getAttribute("custname").toString());
|
||||
otherProperty.put("BALANCESHEET","申请人");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME,fromCondtion,CUSTOMER_PERSON_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
@Override
|
||||
public Object run(Transaction Sqlca) throws Exception {
|
||||
this.initBussinessParam(Sqlca);
|
||||
if (this.getAttribute("serial") == null) return "true";
|
||||
if (this.getAttribute("channel") != null && this.getAttribute("channel").toString().equals("KAER"))
|
||||
return "true";
|
||||
|
||||
/**自然人客户居住地址信息拷表*/
|
||||
String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where "+boKey+"='"+boValue+"'");
|
||||
String itemname = Sqlca.getString("SELECT cl.itemname FROM PF_CUSTOMER_ADDRESS pca INNER JOIN CODE_LIBRARY cl ON pca.province=cl.itemno WHERE codeno='AreaCode' AND "+boKey+"='"+boValue+"'");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("addtype","0060");
|
||||
otherProperty.put("isadd","yes");
|
||||
otherProperty.put("isnew","yes");
|
||||
otherProperty.put("country","CHN");
|
||||
otherProperty.put("FULLADDRESS",itemname+dressdetail);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
}else{
|
||||
/**法人客户基本信息拷表*/
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("CERTTYPE",this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID",this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID",asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID",asUser.getOrgID());
|
||||
otherProperty.put("inputtime",StringFunction.getTodayNow());
|
||||
otherProperty.put("company_name",this.getAttribute("custname").toString());
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME,fromCondtion,CUSTOMER_ADDRESS_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
}
|
||||
|
||||
/**共同申请人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("DELETE FROM CUSTOMER_FAMILY_TEMP WHERE flowunid='"+flowunid+"' AND Spouse_='N'"));
|
||||
fromCondtion.clear();
|
||||
fromCondtion.put(boKey,boValue);
|
||||
fromCondtion.put("Spouse_","N");
|
||||
toCondtion.clear();
|
||||
toCondtion.put("customerid",customerId);
|
||||
toCondtion.put("flowunid",flowunid);
|
||||
toCondtion.put("Spouse_","N");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid",customerId);
|
||||
otherProperty.put("flowunid",flowunid);
|
||||
otherProperty.put("PROJECT_ID",projectId);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME,fromCondtion,CUSTOMER_FAMILY_TEMP.CLASS_NAME,toCondtion,otherProperty,Sqlca);
|
||||
|
||||
/**担保人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("delete from LB_GUARANTEE_UNIT_TEMP where flowunid='"+flowunid+"'"));
|
||||
fromCondtion.clear();
|
||||
otherProperty.clear();
|
||||
otherProperty.put("FLOWUNID",flowunid);
|
||||
otherProperty.put("PROJECT_ID",projectId);
|
||||
ASResultSet res = Sqlca.getASResultSet(new SqlObject("select id from PF_GUARANTEE_UNIT where "+boKey+"='"+boValue+"'"));
|
||||
while(res.next()){
|
||||
fromCondtion.put("id",res.getString("id"));
|
||||
DataOperatorUtil.copySingleJBO(PF_GUARANTEE_UNIT.CLASS_NAME,fromCondtion,LB_GUARANTEE_UNIT_TEMP.CLASS_NAME,null,otherProperty,Sqlca);
|
||||
}
|
||||
res.close();
|
||||
fromCondtion.remove("id");
|
||||
|
||||
/**扣款卡信息*/
|
||||
BizObjectManager catBm = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject catBo = catBm.createQuery("flowunid=:flowunid and customerid=:customerid").setParameter("flowunid",flowunid).setParameter("customerid",customerId).getSingleResult(true);
|
||||
BizObject pcaBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_ACCOUNT.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
if(catBo==null){
|
||||
catBo = catBm.newObject();
|
||||
catBo.setAttributeValue("flowunid",flowunid);
|
||||
catBo.setAttributeValue("customerid",customerId);
|
||||
catBo.setAttributeValue("project_id",projectId);
|
||||
catBo.setAttributeValue("acc_info","Debit");
|
||||
catBo.setAttributeValue("acc_type","Debit");
|
||||
catBo.setAttributeValue("CUSTTYPE","lessee");
|
||||
}
|
||||
catBo.setAttributeValue("acc_number",pcaBo.getAttribute("acc_number"));
|
||||
catBo.setAttributeValue("bank_name",pcaBo.getAttribute("bank_name"));
|
||||
catBo.setAttributeValue("account",pcaBo.getAttribute("account"));
|
||||
catBo.setAttributeValue("MOBILE",pcaBo.getAttribute("MOBILE"));
|
||||
catBo.setAttributeValue("certid",pcaBo.getAttribute("CERTID"));
|
||||
catBm.saveObject(catBo);
|
||||
|
||||
/**租赁物信息拷表*/
|
||||
BizObject pecBo = JBOFactory.createBizObjectQuery(PF_EQUIPMENT_CAR.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
if(pecBo!=null){
|
||||
BizObjectManager lectBm = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject lectBo = lectBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true);
|
||||
lectBo.setAttributeValue("DEVICE_TYPE",pecBo.getAttribute("DEVICE_TYPE"));
|
||||
lectBo.setAttributeValue("DRIVE_TYPE",pecBo.getAttribute("DRIVE_TYPE"));
|
||||
lectBo.setAttributeValue("FRAME_NUMBER",pecBo.getAttribute("FRAME_NUMBER"));
|
||||
lectBo.setAttributeValue("CAR_COLOUR",pecBo.getAttribute("CAR_COLOUR"));
|
||||
lectBo.setAttributeValue("ENGINE_NUMBER",pecBo.getAttribute("ENGINE_NUMBER"));
|
||||
lectBo.setAttributeValue("LICENSE_PLATE_NUMBER",pecBo.getAttribute("LICENSE_PLATE_NUMBER"));
|
||||
lectBo.setAttributeValue("EXPIRYDATE",pecBo.getAttribute("EXPIRYDATE"));
|
||||
lectBo.setAttributeValue("regDate",pecBo.getAttribute("regDate"));
|
||||
lectBo.setAttributeValue("zone",pecBo.getAttribute("zone"));
|
||||
lectBo.setAttributeValue("mile",pecBo.getAttribute("mile"));
|
||||
lectBo.setAttributeValue("MEMO",pecBo.getAttribute("MEMO"));
|
||||
lectBm.saveObject(lectBo);
|
||||
}
|
||||
|
||||
/**项目基本信息拷表*/
|
||||
BizObjectManager lpitBm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject lpitBo = lpitBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true);
|
||||
BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
String distributorNo = Sqlca.getString("SELECT distributor_no FROM distributor_info di WHERE EXISTS (SELECT 1 FROM user_info ui LEFT JOIN org_info oi ON ui.belongorg=oi.orgid WHERE oi.orgname=di.distributor_name AND ui.userid='"+asUser.getUserID()+"')");
|
||||
|
||||
lpitBo.setAttributeValue("distributor_id",distributorNo);
|
||||
lpitBo.setAttributeValue("inputName",ppiBo.getAttribute("inputName"));
|
||||
lpitBo.setAttributeValue("inputTel",ppiBo.getAttribute("inputTel"));
|
||||
lpitBo.setAttributeValue("IS_NETCAR",ppiBo.getAttribute("IS_NETCAR"));
|
||||
lpitBo.setAttributeValue("source_type",ppiBo.getAttribute("source_type"));
|
||||
lpitBo.setAttributeValue("APPLICATION_NO",ppiBo.getAttribute("APPLICATION_NO"));
|
||||
lpitBo.setAttributeValue("PROJECT_NAME",lpitBo.getAttribute("project_no")+"-"+this.getAttribute("custname").toString());
|
||||
if(!"0".equals(ppiBo.getAttribute("IS_NETCAR").toString())){
|
||||
lpitBo.setAttributeValue("IS_OPERATION",ppiBo.getAttribute("IS_OPERATION"));
|
||||
lpitBo.setAttributeValue("IS_AFFILIATED",ppiBo.getAttribute("IS_AFFILIATED"));
|
||||
lpitBo.setAttributeValue("IS_OPERATION_QUALIFICATION",ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString());
|
||||
lpitBo.setAttributeValue("AFFILIATEDNAME",ppiBo.getAttribute("AFFILIATEDNAME"));
|
||||
lpitBo.setAttributeValue("TRANSPORTCERTID",ppiBo.getAttribute("TRANSPORTCERTID"));
|
||||
lpitBo.setAttributeValue("TRANSPORTDATE",ppiBo.getAttribute("TRANSPORTDATE"));
|
||||
lpitBo.setAttributeValue("NETCERTID",ppiBo.getAttribute("NETCERTID"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONNAME",ppiBo.getAttribute("LEGALPERSONNAME"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONID",ppiBo.getAttribute("LEGALPERSONID"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDDATE",ppiBo.getAttribute("AFFILIATEDDATE"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDENDDATE",ppiBo.getAttribute("AFFILIATEDENDDATE"));
|
||||
lpitBo.setAttributeValue("REGISTEREDMONEY",ppiBo.getAttribute("REGISTEREDMONEY"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDACTUALADDRESS",ppiBo.getAttribute("AFFILIATEDACTUALADDRESS"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDADDRESS",ppiBo.getAttribute("AFFILIATEDADDRESS"));
|
||||
}
|
||||
lpitBm.saveObject(lpitBo);
|
||||
|
||||
/**商务条件*/
|
||||
BizObjectManager lcctBm = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME,Sqlca);
|
||||
BizObject lcctBo = lcctBm.createQuery("flowunid=:flowunid").setParameter("flowunid",flowunid).getSingleResult(true);
|
||||
BizObject pccBo = JBOFactory.createBizObjectQuery(PF_CALC_CONDITION.CLASS_NAME,bowhere).setParameter(boKey,boValue).getSingleResult(false);
|
||||
|
||||
/**计算综合融资额*/
|
||||
BigDecimal totalAll = new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString());
|
||||
/**购置税是否参融*/
|
||||
String purchaseTaxFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","PURCHASE_TAX","FINAN");
|
||||
if("Y".equals(purchaseTaxFinan)&&pccBo.getAttribute("PURCHASE_TAX").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()));
|
||||
}
|
||||
/**GPS设备费是否参融*/
|
||||
BigDecimal gpsFee = new BigDecimal(pccBo.getAttribute("GPS_FEE").toString());
|
||||
String gpsFeeFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","GPS_FEE","FINAN");
|
||||
if("Y".equals(gpsFeeFinan)&&pccBo.getAttribute("GPS_FEE").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("GPS_FEE").toString()));
|
||||
}
|
||||
/**加装费是否参融*/
|
||||
String tablewareFeeFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","TABLEWARE_FEE","FINAN");
|
||||
if("Y".equals(tablewareFeeFinan)&&pccBo.getAttribute("TABLEWARE_FEE").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()));
|
||||
}
|
||||
/**保险费是否参融*/
|
||||
String insurancePremiumFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","INSURANCE_PREMIUM","FINAN");
|
||||
if("Y".equals(insurancePremiumFinan)&&pccBo.getAttribute("INSURANCE_PREMIUM").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()));
|
||||
}
|
||||
/**杂费是否参融*/
|
||||
String incidentalFinan = ProductParamUtil.getProductParameterValue(productId,"PRD0315","INCIDENTAL","FINAN");
|
||||
if("Y".equals(incidentalFinan)&&pccBo.getAttribute("INCIDENTAL").toString().length()>0){
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()));
|
||||
}
|
||||
|
||||
/**首付款比例*/
|
||||
String firstPaymentRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","FIRST_PAYMENT","CostType07");
|
||||
BigDecimal firstPaymentReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("FIRST_PAYMENT").toString().length()>0)
|
||||
if("EquipAmt".equals(firstPaymentRefer)){
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(firstPaymentRefer)){
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保证金比例*/
|
||||
String cautionMoneyRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","CAUTION_MONEY","CostType07");
|
||||
BigDecimal cautionMoneyReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("CAUTION_MONEY").toString().length()>0)
|
||||
if("EquipAmt".equals(cautionMoneyRefer)){
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(cautionMoneyRefer)){
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**手续费比例*/
|
||||
String handlingChargeMoneyRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","HANDLING_CHARGE_MONEY","CostType07");
|
||||
BigDecimal handlingChargeMoneyReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString().length()>0)
|
||||
if("EquipAmt".equals(handlingChargeMoneyRefer)){
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(handlingChargeMoneyRefer)){
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**加装费比例*/
|
||||
String tablewareFeeRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","TABLEWARE_FEE","CostType07");
|
||||
BigDecimal tablewareFeeReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("TABLEWARE_FEE").toString().length()>0)
|
||||
if("EquipAmt".equals(tablewareFeeRefer)){
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(tablewareFeeRefer)){
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
|
||||
/**购置锐比例*/
|
||||
String purchaseTaxRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","PURCHASE_TAX","CostType07");
|
||||
BigDecimal purchaseTaxReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("PURCHASE_TAX").toString().length()>0)
|
||||
if("EquipAmt".equals(purchaseTaxRefer)){
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(purchaseTaxRefer)){
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保险费比例*/
|
||||
String insurancePremiumRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","INSURANCE_PREMIUM","CostType07");
|
||||
BigDecimal insurancePremiumReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("INSURANCE_PREMIUM").toString().length()>0)
|
||||
if("EquipAmt".equals(insurancePremiumRefer)){
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(insurancePremiumRefer)){
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**杂费比例*/
|
||||
String incidentalRefer=ProductParamUtil.getProductParameterValue(productId,"PRD0315","INCIDENTAL","CostType07");
|
||||
BigDecimal incidentalReferB = new BigDecimal(0.00);
|
||||
if(pccBo.getAttribute("INCIDENTAL").toString().length()>0)
|
||||
if("EquipAmt".equals(incidentalRefer)){
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}else if ("TOTAL_ALL".equals(incidentalRefer)){
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(totalAll,4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
if(lcctBo==null){
|
||||
lcctBo = lcctBm.newObject();
|
||||
}
|
||||
|
||||
lcctBo.setAttributeValue("FLOWUNID",flowunid);
|
||||
lcctBo.setAttributeValue("PROJECT_ID",projectId);
|
||||
planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(),calType,Sqlca);
|
||||
lcctBo.setAttributeValue("PROJECT_PLAN_NUMBER",planNumber);
|
||||
// 调息方式
|
||||
setProductAdjustRules(otherProperty,productId);
|
||||
lcctBo.setAttributeValue("ADJUST_TYPE",otherProperty.get("ADJUST_TYPE"));
|
||||
lcctBo.setAttributeValue("ADJUST_STYLE",otherProperty.get("ADJUST_STYLE"));
|
||||
// 投放日
|
||||
lcctBo.setAttributeValue("LEASE_AMT_DATE",DateUtil.getToday());
|
||||
lcctBo.setAttributeValue("START_DATE",DateUtil.getToday());
|
||||
// 租金推算方式
|
||||
lcctBo.setAttributeValue("RENT_OR_RATE","rate");
|
||||
// 设置年利率
|
||||
setYearRate(otherProperty,productId);
|
||||
lcctBo.setAttributeValue("PERIOD_TYPE",otherProperty.get("PERIOD_TYPE"));
|
||||
lcctBo.setAttributeValue("YEAR_RATE",otherProperty.get("YEAR_RATE"));
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR","income_12");
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH","1");
|
||||
lcctBo.setAttributeValue("GPS_FEE",gpsFee.toString());
|
||||
lcctBo.setAttributeValue("LEASE_TERM",pccBo.getAttribute( "INCOME_NUMBER" ));
|
||||
// 计算第一,第二期租金支付日
|
||||
setFirstSecondPlan(otherProperty,productId,pccBo);
|
||||
lcctBo.setAttributeValue("FIRST_PLAN_DATE",otherProperty.get("FIRST_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("SECOND_PLAN_DATE",otherProperty.get("SECOND_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("EQUIP_AMT",pccBo.getAttribute("EQUIP_AMT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT",pccBo.getAttribute("FIRST_PAYMENT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT_RATIO",firstPaymentReferB);
|
||||
lcctBo.setAttributeValue("FINAL_PAYMENT",pccBo.getAttribute("FINAL_PAYMENT"));
|
||||
lcctBo.setAttributeValue("NOMINAL_PRICE",pccBo.getAttribute("NOMINAL_PRICE"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY",pccBo.getAttribute("HANDLING_CHARGE_MONEY"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY_RATIO",handlingChargeMoneyReferB);
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY",pccBo.getAttribute("CAUTION_MONEY"));
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY_RATIO",cautionMoneyReferB);
|
||||
lcctBo.setAttributeValue("GPS_FEE_FINA",pccBo.getAttribute("GPS_FEE_FINA"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX",pccBo.getAttribute("PURCHASE_TAX"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX_RATIO",purchaseTaxReferB);
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM",pccBo.getAttribute("INSURANCE_PREMIUM"));
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM_RATIO",insurancePremiumReferB);
|
||||
lcctBo.setAttributeValue("SETTLE_METHOD",pccBo.getAttribute("SETTLE_METHOD"));
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER",pccBo.getAttribute("INCOME_NUMBER"));
|
||||
lcctBo.setAttributeValue("DefaultDueDay",pccBo.getAttribute("DefaultDueDay"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE",pccBo.getAttribute("TABLEWARE_FEE"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE_RATIO",tablewareFeeReferB);
|
||||
lcctBo.setAttributeValue("INCIDENTAL",pccBo.getAttribute("INCIDENTAL"));
|
||||
lcctBo.setAttributeValue("INCIDENTAL_RATIO",incidentalReferB);
|
||||
lcctBo.setAttributeValue("TOTAL_ALL",totalAll);
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT",pccBo.getAttribute("FIRST_PAYMENT").toString());
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT_RATIO",new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).multiply(new BigDecimal("100")).divide(totalAll,6, BigDecimal.ROUND_HALF_UP));
|
||||
lcctBo.setAttributeValue("CLEAN_LEASE_MONEY",totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())));
|
||||
lcctBo.setAttributeValue("RENT_RATIO",totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()),4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2,BigDecimal.ROUND_DOWN).toString());
|
||||
lcctBo.setAttributeValue("DISCOUNT","");
|
||||
lcctBm.saveObject(lcctBo);
|
||||
|
||||
// 自动测算
|
||||
autoCalc(flowunid,calType,planNumber,productId,Sqlca);
|
||||
|
||||
return "true";
|
||||
}
|
||||
|
||||
public void setProductAdjustRules( Map<String, String> otherProperty, String productId ) throws Exception {
|
||||
Map<String,Map<String,String>> map = ProductParamUtil.getProductComponentType(productId,"PRD0320");
|
||||
if ( map.containsKey( "ADJUST_INTEREST" ) ){
|
||||
Map<String,String> rule=map.get( "ADJUST_INTEREST" );
|
||||
if ( null != rule.get( "rate_float_type" ) && null != rule.get( "adjust_style" ) ) {
|
||||
//调息方式
|
||||
otherProperty.put( "ADJUST_TYPE", rule.get("rate_float_type") );
|
||||
otherProperty.put( "ADJUST_STYLE", rule.get("adjust_style") );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setYearRate( Map<String, String> otherProperty, String productId ) throws Exception {
|
||||
Map<String, Map<String, String>> productRates = ProductParamUtil.getProductComponentType( productId, "PRD0350" );
|
||||
Map<String, String> productRate = productRates.get( "product_rate" );
|
||||
String periodType = ProductParamUtil.getProductParameterValue( productId, "PRD0350", "period_type", "begin_end" );
|
||||
periodType = periodType == null ? "period_type_0" : periodType;
|
||||
otherProperty.put( "PERIOD_TYPE", periodType );
|
||||
if ( productRate != null ) {
|
||||
String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate");
|
||||
otherProperty.put( "YEAR_RATE", yearRate );
|
||||
}
|
||||
}
|
||||
|
||||
public void setFirstSecondPlan( Map<String, String> otherProperty, String productId, BizObject fcc ) throws Exception {
|
||||
String periodType = otherProperty.get( "PERIOD_TYPE" );
|
||||
String leaseAmtDate = DateUtil.getToday();
|
||||
String incomeIntervalMonth = "1";
|
||||
String defaultDueDay = fcc.getAttribute( "DefaultDueDay" ).toString();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
|
||||
Date lad = sdf.parse( leaseAmtDate );
|
||||
lad = DateUtils.setDays( lad, Integer.parseInt( defaultDueDay ) );
|
||||
String firstPlanDate = "";
|
||||
String secondPlanDate = "";
|
||||
if ( "period_type_1".equals( periodType ) ) {
|
||||
firstPlanDate = leaseAmtDate;
|
||||
secondPlanDate = sdf.format( DateUtils.addMonths( lad, Integer.parseInt( incomeIntervalMonth ) ) );
|
||||
} else {
|
||||
firstPlanDate = sdf.format( DateUtils.addMonths( lad, Integer.parseInt( incomeIntervalMonth ) ) );
|
||||
secondPlanDate = sdf.format( DateUtils.addMonths( lad, Integer.parseInt( incomeIntervalMonth ) * 2 ) );
|
||||
}
|
||||
otherProperty.put( "FIRST_PLAN_DATE", firstPlanDate );
|
||||
otherProperty.put( "SECOND_PLAN_DATE", secondPlanDate );
|
||||
}
|
||||
|
||||
public void autoCalc( String flowunid, String calType, String planNumber, String productId, JBOTransaction tx ) throws Exception {
|
||||
CreateTransactionExecutor cte = new CreateTransactionExecutor();
|
||||
cte.setCalType( calType );
|
||||
cte.setFlowunid( flowunid );
|
||||
cte.setPlannumber( planNumber );
|
||||
cte.setProductId( productId );
|
||||
System.out.println("===========================自动测算开始===============================");
|
||||
cte.runTrans( tx );
|
||||
System.out.println("===========================自动测算结束===============================");
|
||||
}
|
||||
ASUser asUser = new ASUser(this.getAttribute("CurUserID").toString());
|
||||
String serial = this.getAttribute("serial").toString();
|
||||
String flowunid = this.getAttribute("ObjectNo").toString();
|
||||
String customerId = Sqlca.getString("SELECT customerid FROM customer_info_temp WHERE flowunid='" + flowunid + "'");
|
||||
String projectId = this.getAttribute("ProjectId").toString();
|
||||
String customerType = this.getAttribute("CustomerType").toString();
|
||||
String productId = this.getAttribute("ProductId").toString();
|
||||
String planNumber = null;
|
||||
String calType = "proj_process";
|
||||
|
||||
Map<String, String> fromCondtion = new HashMap<String, String>();
|
||||
Map<String, String> toCondtion = new HashMap<String, String>();
|
||||
toCondtion.put("customerid", customerId);
|
||||
toCondtion.put("flowunid", flowunid);
|
||||
|
||||
Map<String, String> otherProperty = new HashMap<String, String>();
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("PROJECT_ID", projectId);
|
||||
|
||||
int number = Integer.valueOf(Sqlca.getString("select count(1) from PF_CUSTOMER_ACCOUNT where flowunid='" + flowunid + "'"));
|
||||
|
||||
String bowhere = null;
|
||||
String boKey = null;
|
||||
String boValue = null;
|
||||
|
||||
/**判断是新增业务申请还是修改业务申请*/
|
||||
if (number == 0) {
|
||||
boKey = "SERIAL";
|
||||
boValue = serial;
|
||||
bowhere = boKey + "=:" + boKey;
|
||||
} else {
|
||||
//修改业务申请
|
||||
boKey = "FLOWUNID";
|
||||
boValue = flowunid;
|
||||
bowhere = boKey + "=:" + boKey;
|
||||
}
|
||||
|
||||
fromCondtion.put(boKey, boValue);
|
||||
/**判断客户类型*/
|
||||
if ("03".equals(customerType)) {
|
||||
/**配偶信息拷表*/
|
||||
String marriage = Sqlca.getString("select MARRIAGE from PF_CUSTOMER_PERSON where " + boKey + "='" + boValue + "'");
|
||||
/**判断是否已婚*/
|
||||
if ("01".equals(marriage)) {
|
||||
fromCondtion.put("Spouse_", "Y");
|
||||
toCondtion.put("Spouse_", "Y");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
} else {
|
||||
Sqlca.executeSQL(new SqlObject("delete from CUSTOMER_FAMILY_TEMP where flowunid='" + flowunid + "' and Spouse_='Y'"));
|
||||
}
|
||||
|
||||
/**自然人基本信息拷表*/
|
||||
fromCondtion.remove("Spouse_");
|
||||
toCondtion.remove("Spouse_");
|
||||
otherProperty.remove("PROJECT_ID");
|
||||
otherProperty.put("CERTTYPE", this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID", this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID", asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID", asUser.getOrgID());
|
||||
otherProperty.put("inputtime", StringFunction.getTodayNow());
|
||||
otherProperty.put("FULLNAME", this.getAttribute("custname").toString());
|
||||
otherProperty.put("BALANCESHEET", "申请人");
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_PERSON.CLASS_NAME, fromCondtion, CUSTOMER_PERSON_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
|
||||
/**自然人客户居住地址信息拷表*/
|
||||
String dressdetail = Sqlca.getString("select dressdetail from PF_CUSTOMER_ADDRESS where " + boKey + "='" + boValue + "'");
|
||||
String itemname = Sqlca.getString("SELECT cl.itemname FROM PF_CUSTOMER_ADDRESS pca INNER JOIN CODE_LIBRARY cl ON pca.province=cl.itemno WHERE codeno='AreaCode' AND " + boKey + "='" + boValue + "'");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("addtype", "0060");
|
||||
otherProperty.put("isadd", "yes");
|
||||
otherProperty.put("isnew", "yes");
|
||||
otherProperty.put("country", "CHN");
|
||||
otherProperty.put("FULLADDRESS", itemname + dressdetail);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
} else {
|
||||
/**法人客户基本信息拷表*/
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("CERTTYPE", this.getAttribute("certtype").toString());
|
||||
otherProperty.put("CERTID", this.getAttribute("certid").toString());
|
||||
otherProperty.put("INPUTUSERID", asUser.getUserID());
|
||||
otherProperty.put("INPUTORGID", asUser.getOrgID());
|
||||
otherProperty.put("inputtime", StringFunction.getTodayNow());
|
||||
otherProperty.put("company_name", this.getAttribute("custname").toString());
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_ADDRESS.CLASS_NAME, fromCondtion, CUSTOMER_ADDRESS_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
}
|
||||
|
||||
/**共同申请人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("DELETE FROM CUSTOMER_FAMILY_TEMP WHERE flowunid='" + flowunid + "' AND Spouse_='N'"));
|
||||
fromCondtion.clear();
|
||||
fromCondtion.put(boKey, boValue);
|
||||
fromCondtion.put("Spouse_", "N");
|
||||
toCondtion.clear();
|
||||
toCondtion.put("customerid", customerId);
|
||||
toCondtion.put("flowunid", flowunid);
|
||||
toCondtion.put("Spouse_", "N");
|
||||
otherProperty.clear();
|
||||
otherProperty.put("customerid", customerId);
|
||||
otherProperty.put("flowunid", flowunid);
|
||||
otherProperty.put("PROJECT_ID", projectId);
|
||||
DataOperatorUtil.copySingleJBO(PF_CUSTOMER_FAMILY.CLASS_NAME, fromCondtion, CUSTOMER_FAMILY_TEMP.CLASS_NAME, toCondtion, otherProperty, Sqlca);
|
||||
|
||||
/**担保人信息拷表*/
|
||||
Sqlca.executeSQL(new SqlObject("delete from LB_GUARANTEE_UNIT_TEMP where flowunid='" + flowunid + "'"));
|
||||
fromCondtion.clear();
|
||||
otherProperty.clear();
|
||||
otherProperty.put("FLOWUNID", flowunid);
|
||||
otherProperty.put("PROJECT_ID", projectId);
|
||||
ASResultSet res = Sqlca.getASResultSet(new SqlObject("select id from PF_GUARANTEE_UNIT where " + boKey + "='" + boValue + "'"));
|
||||
while (res.next()) {
|
||||
fromCondtion.put("id", res.getString("id"));
|
||||
DataOperatorUtil.copySingleJBO(PF_GUARANTEE_UNIT.CLASS_NAME, fromCondtion, LB_GUARANTEE_UNIT_TEMP.CLASS_NAME, null, otherProperty, Sqlca);
|
||||
}
|
||||
res.close();
|
||||
fromCondtion.remove("id");
|
||||
|
||||
/**扣款卡信息*/
|
||||
BizObjectManager catBm = JBOFactory.getBizObjectManager(CUSTOMER_ACCOUNT_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject catBo = catBm.createQuery("flowunid=:flowunid and customerid=:customerid").setParameter("flowunid", flowunid).setParameter("customerid", customerId).getSingleResult(true);
|
||||
BizObject pcaBo = JBOFactory.createBizObjectQuery(PF_CUSTOMER_ACCOUNT.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
if (catBo == null) {
|
||||
catBo = catBm.newObject();
|
||||
catBo.setAttributeValue("flowunid", flowunid);
|
||||
catBo.setAttributeValue("customerid", customerId);
|
||||
catBo.setAttributeValue("project_id", projectId);
|
||||
catBo.setAttributeValue("acc_info", "Debit");
|
||||
catBo.setAttributeValue("acc_type", "Debit");
|
||||
catBo.setAttributeValue("CUSTTYPE", "lessee");
|
||||
}
|
||||
catBo.setAttributeValue("acc_number", pcaBo.getAttribute("acc_number"));
|
||||
catBo.setAttributeValue("bank_name", pcaBo.getAttribute("bank_name"));
|
||||
catBo.setAttributeValue("account", pcaBo.getAttribute("account"));
|
||||
catBo.setAttributeValue("MOBILE", pcaBo.getAttribute("MOBILE"));
|
||||
catBo.setAttributeValue("certid", pcaBo.getAttribute("CERTID"));
|
||||
catBm.saveObject(catBo);
|
||||
|
||||
/**租赁物信息拷表*/
|
||||
BizObject pecBo = JBOFactory.createBizObjectQuery(PF_EQUIPMENT_CAR.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
if (pecBo != null) {
|
||||
BizObjectManager lectBm = JBOFactory.getBizObjectManager(LB_EQUIPMENT_CAR_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lectBo = lectBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
lectBo.setAttributeValue("DEVICE_TYPE", pecBo.getAttribute("DEVICE_TYPE"));
|
||||
lectBo.setAttributeValue("DRIVE_TYPE", pecBo.getAttribute("DRIVE_TYPE"));
|
||||
lectBo.setAttributeValue("FRAME_NUMBER", pecBo.getAttribute("FRAME_NUMBER"));
|
||||
lectBo.setAttributeValue("CAR_COLOUR", pecBo.getAttribute("CAR_COLOUR"));
|
||||
lectBo.setAttributeValue("ENGINE_NUMBER", pecBo.getAttribute("ENGINE_NUMBER"));
|
||||
lectBo.setAttributeValue("LICENSE_PLATE_NUMBER", pecBo.getAttribute("LICENSE_PLATE_NUMBER"));
|
||||
lectBo.setAttributeValue("EXPIRYDATE", pecBo.getAttribute("EXPIRYDATE"));
|
||||
lectBo.setAttributeValue("regDate", pecBo.getAttribute("regDate"));
|
||||
lectBo.setAttributeValue("zone", pecBo.getAttribute("zone"));
|
||||
lectBo.setAttributeValue("mile", pecBo.getAttribute("mile"));
|
||||
lectBo.setAttributeValue("MEMO", pecBo.getAttribute("MEMO"));
|
||||
lectBm.saveObject(lectBo);
|
||||
}
|
||||
|
||||
/**项目基本信息拷表*/
|
||||
BizObjectManager lpitBm = JBOFactory.getBizObjectManager(LB_PROJECT_INFO_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lpitBo = lpitBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
BizObject ppiBo = JBOFactory.createBizObjectQuery(PF_PROJECT_INFO.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
String distributorNo = Sqlca.getString("SELECT distributor_no FROM distributor_info di WHERE EXISTS (SELECT 1 FROM user_info ui LEFT JOIN org_info oi ON ui.belongorg=oi.orgid WHERE oi.orgname=di.distributor_name AND ui.userid='" + asUser.getUserID() + "')");
|
||||
|
||||
lpitBo.setAttributeValue("distributor_id", distributorNo);
|
||||
lpitBo.setAttributeValue("inputName", ppiBo.getAttribute("inputName"));
|
||||
lpitBo.setAttributeValue("inputTel", ppiBo.getAttribute("inputTel"));
|
||||
lpitBo.setAttributeValue("IS_NETCAR", ppiBo.getAttribute("IS_NETCAR"));
|
||||
lpitBo.setAttributeValue("source_type", ppiBo.getAttribute("source_type"));
|
||||
lpitBo.setAttributeValue("APPLICATION_NO", ppiBo.getAttribute("APPLICATION_NO"));
|
||||
lpitBo.setAttributeValue("PROJECT_NAME", lpitBo.getAttribute("project_no") + "-" + this.getAttribute("custname").toString());
|
||||
if (!"0".equals(ppiBo.getAttribute("IS_NETCAR").toString())) {
|
||||
lpitBo.setAttributeValue("IS_OPERATION", ppiBo.getAttribute("IS_OPERATION"));
|
||||
lpitBo.setAttributeValue("IS_AFFILIATED", ppiBo.getAttribute("IS_AFFILIATED"));
|
||||
lpitBo.setAttributeValue("IS_OPERATION_QUALIFICATION", ppiBo.getAttribute("IS_OPERATION_QUALIFICATION").toString());
|
||||
lpitBo.setAttributeValue("AFFILIATEDNAME", ppiBo.getAttribute("AFFILIATEDNAME"));
|
||||
lpitBo.setAttributeValue("TRANSPORTCERTID", ppiBo.getAttribute("TRANSPORTCERTID"));
|
||||
lpitBo.setAttributeValue("TRANSPORTDATE", ppiBo.getAttribute("TRANSPORTDATE"));
|
||||
lpitBo.setAttributeValue("NETCERTID", ppiBo.getAttribute("NETCERTID"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONNAME", ppiBo.getAttribute("LEGALPERSONNAME"));
|
||||
lpitBo.setAttributeValue("LEGALPERSONID", ppiBo.getAttribute("LEGALPERSONID"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDDATE", ppiBo.getAttribute("AFFILIATEDDATE"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDENDDATE", ppiBo.getAttribute("AFFILIATEDENDDATE"));
|
||||
lpitBo.setAttributeValue("REGISTEREDMONEY", ppiBo.getAttribute("REGISTEREDMONEY"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDACTUALADDRESS", ppiBo.getAttribute("AFFILIATEDACTUALADDRESS"));
|
||||
lpitBo.setAttributeValue("AFFILIATEDADDRESS", ppiBo.getAttribute("AFFILIATEDADDRESS"));
|
||||
}
|
||||
lpitBm.saveObject(lpitBo);
|
||||
|
||||
/**商务条件*/
|
||||
BizObjectManager lcctBm = JBOFactory.getBizObjectManager(LC_CALC_CONDITION_TEMP.CLASS_NAME, Sqlca);
|
||||
BizObject lcctBo = lcctBm.createQuery("flowunid=:flowunid").setParameter("flowunid", flowunid).getSingleResult(true);
|
||||
BizObject pccBo = JBOFactory.createBizObjectQuery(PF_CALC_CONDITION.CLASS_NAME, bowhere).setParameter(boKey, boValue).getSingleResult(false);
|
||||
|
||||
/**计算综合融资额*/
|
||||
BigDecimal totalAll = new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString());
|
||||
/**购置税是否参融*/
|
||||
String purchaseTaxFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "PURCHASE_TAX", "FINAN");
|
||||
if ("Y".equals(purchaseTaxFinan) && pccBo.getAttribute("PURCHASE_TAX").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()));
|
||||
}
|
||||
/**GPS设备费是否参融*/
|
||||
BigDecimal gpsFee = new BigDecimal(pccBo.getAttribute("GPS_FEE").toString());
|
||||
String gpsFeeFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "GPS_FEE", "FINAN");
|
||||
if ("Y".equals(gpsFeeFinan) && pccBo.getAttribute("GPS_FEE").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("GPS_FEE").toString()));
|
||||
}
|
||||
/**加装费是否参融*/
|
||||
String tablewareFeeFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "TABLEWARE_FEE", "FINAN");
|
||||
if ("Y".equals(tablewareFeeFinan) && pccBo.getAttribute("TABLEWARE_FEE").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()));
|
||||
}
|
||||
/**保险费是否参融*/
|
||||
String insurancePremiumFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INSURANCE_PREMIUM", "FINAN");
|
||||
if ("Y".equals(insurancePremiumFinan) && pccBo.getAttribute("INSURANCE_PREMIUM").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()));
|
||||
}
|
||||
/**杂费是否参融*/
|
||||
String incidentalFinan = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INCIDENTAL", "FINAN");
|
||||
if ("Y".equals(incidentalFinan) && pccBo.getAttribute("INCIDENTAL").toString().length() > 0) {
|
||||
totalAll = totalAll.add(new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()));
|
||||
}
|
||||
|
||||
/**首付款比例*/
|
||||
String firstPaymentRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "FIRST_PAYMENT", "CostType07");
|
||||
BigDecimal firstPaymentReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("FIRST_PAYMENT").toString().length() > 0)
|
||||
if ("EquipAmt".equals(firstPaymentRefer)) {
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(firstPaymentRefer)) {
|
||||
firstPaymentReferB = new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保证金比例*/
|
||||
String cautionMoneyRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "CAUTION_MONEY", "CostType07");
|
||||
BigDecimal cautionMoneyReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("CAUTION_MONEY").toString().length() > 0)
|
||||
if ("EquipAmt".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(cautionMoneyRefer)) {
|
||||
cautionMoneyReferB = new BigDecimal(pccBo.getAttribute("CAUTION_MONEY").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**手续费比例*/
|
||||
String handlingChargeMoneyRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "HANDLING_CHARGE_MONEY", "CostType07");
|
||||
BigDecimal handlingChargeMoneyReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString().length() > 0)
|
||||
if ("EquipAmt".equals(handlingChargeMoneyRefer)) {
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(handlingChargeMoneyRefer)) {
|
||||
handlingChargeMoneyReferB = new BigDecimal(pccBo.getAttribute("HANDLING_CHARGE_MONEY").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**加装费比例*/
|
||||
String tablewareFeeRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "TABLEWARE_FEE", "CostType07");
|
||||
BigDecimal tablewareFeeReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("TABLEWARE_FEE").toString().length() > 0)
|
||||
if ("EquipAmt".equals(tablewareFeeRefer)) {
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(tablewareFeeRefer)) {
|
||||
tablewareFeeReferB = new BigDecimal(pccBo.getAttribute("TABLEWARE_FEE").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
|
||||
/**购置锐比例*/
|
||||
String purchaseTaxRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "PURCHASE_TAX", "CostType07");
|
||||
BigDecimal purchaseTaxReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("PURCHASE_TAX").toString().length() > 0)
|
||||
if ("EquipAmt".equals(purchaseTaxRefer)) {
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(purchaseTaxRefer)) {
|
||||
purchaseTaxReferB = new BigDecimal(pccBo.getAttribute("PURCHASE_TAX").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**保险费比例*/
|
||||
String insurancePremiumRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INSURANCE_PREMIUM", "CostType07");
|
||||
BigDecimal insurancePremiumReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("INSURANCE_PREMIUM").toString().length() > 0)
|
||||
if ("EquipAmt".equals(insurancePremiumRefer)) {
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(insurancePremiumRefer)) {
|
||||
insurancePremiumReferB = new BigDecimal(pccBo.getAttribute("INSURANCE_PREMIUM").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
/**杂费比例*/
|
||||
String incidentalRefer = ProductParamUtil.getProductParameterValue(productId, "PRD0315", "INCIDENTAL", "CostType07");
|
||||
BigDecimal incidentalReferB = new BigDecimal(0.00);
|
||||
if (pccBo.getAttribute("INCIDENTAL").toString().length() > 0)
|
||||
if ("EquipAmt".equals(incidentalRefer)) {
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
} else if ("TOTAL_ALL".equals(incidentalRefer)) {
|
||||
incidentalReferB = new BigDecimal(pccBo.getAttribute("INCIDENTAL").toString()).divide(totalAll, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
}
|
||||
|
||||
if (lcctBo == null) {
|
||||
lcctBo = lcctBm.newObject();
|
||||
}
|
||||
|
||||
lcctBo.setAttributeValue("FLOWUNID", flowunid);
|
||||
lcctBo.setAttributeValue("PROJECT_ID", projectId);
|
||||
planNumber = SerialNumberUtil.getPlannumber(this.getAttribute("ProjectNo").toString(), calType, Sqlca);
|
||||
lcctBo.setAttributeValue("PROJECT_PLAN_NUMBER", planNumber);
|
||||
// 调息方式
|
||||
setProductAdjustRules(otherProperty, productId);
|
||||
lcctBo.setAttributeValue("ADJUST_TYPE", otherProperty.get("ADJUST_TYPE"));
|
||||
lcctBo.setAttributeValue("ADJUST_STYLE", otherProperty.get("ADJUST_STYLE"));
|
||||
// 投放日
|
||||
lcctBo.setAttributeValue("LEASE_AMT_DATE", DateUtil.getToday());
|
||||
lcctBo.setAttributeValue("START_DATE", DateUtil.getToday());
|
||||
// 租金推算方式
|
||||
lcctBo.setAttributeValue("RENT_OR_RATE", "rate");
|
||||
// 设置年利率
|
||||
setYearRate(otherProperty, productId);
|
||||
lcctBo.setAttributeValue("PERIOD_TYPE", otherProperty.get("PERIOD_TYPE"));
|
||||
lcctBo.setAttributeValue("YEAR_RATE", otherProperty.get("YEAR_RATE"));
|
||||
// 设置还款间隔
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER_YEAR", "income_12");
|
||||
lcctBo.setAttributeValue("INCOME_INTERVAL_MONTH", "1");
|
||||
lcctBo.setAttributeValue("GPS_FEE", gpsFee.toString());
|
||||
lcctBo.setAttributeValue("LEASE_TERM", pccBo.getAttribute("INCOME_NUMBER"));
|
||||
// 计算第一,第二期租金支付日
|
||||
setFirstSecondPlan(otherProperty, productId, pccBo);
|
||||
lcctBo.setAttributeValue("FIRST_PLAN_DATE", otherProperty.get("FIRST_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("SECOND_PLAN_DATE", otherProperty.get("SECOND_PLAN_DATE"));
|
||||
lcctBo.setAttributeValue("EQUIP_AMT", pccBo.getAttribute("EQUIP_AMT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT", pccBo.getAttribute("FIRST_PAYMENT"));
|
||||
lcctBo.setAttributeValue("FIRST_PAYMENT_RATIO", firstPaymentReferB);
|
||||
lcctBo.setAttributeValue("FINAL_PAYMENT", pccBo.getAttribute("FINAL_PAYMENT"));
|
||||
lcctBo.setAttributeValue("NOMINAL_PRICE", pccBo.getAttribute("NOMINAL_PRICE"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY", pccBo.getAttribute("HANDLING_CHARGE_MONEY"));
|
||||
lcctBo.setAttributeValue("HANDLING_CHARGE_MONEY_RATIO", handlingChargeMoneyReferB);
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY", pccBo.getAttribute("CAUTION_MONEY"));
|
||||
lcctBo.setAttributeValue("CAUTION_MONEY_RATIO", cautionMoneyReferB);
|
||||
lcctBo.setAttributeValue("GPS_FEE_FINA", pccBo.getAttribute("GPS_FEE_FINA"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX", pccBo.getAttribute("PURCHASE_TAX"));
|
||||
lcctBo.setAttributeValue("PURCHASE_TAX_RATIO", purchaseTaxReferB);
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM", pccBo.getAttribute("INSURANCE_PREMIUM"));
|
||||
lcctBo.setAttributeValue("INSURANCE_PREMIUM_RATIO", insurancePremiumReferB);
|
||||
lcctBo.setAttributeValue("SETTLE_METHOD", pccBo.getAttribute("SETTLE_METHOD"));
|
||||
lcctBo.setAttributeValue("INCOME_NUMBER", pccBo.getAttribute("INCOME_NUMBER"));
|
||||
lcctBo.setAttributeValue("DefaultDueDay", pccBo.getAttribute("DefaultDueDay"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE", pccBo.getAttribute("TABLEWARE_FEE"));
|
||||
lcctBo.setAttributeValue("TABLEWARE_FEE_RATIO", tablewareFeeReferB);
|
||||
lcctBo.setAttributeValue("INCIDENTAL", pccBo.getAttribute("INCIDENTAL"));
|
||||
lcctBo.setAttributeValue("INCIDENTAL_RATIO", incidentalReferB);
|
||||
lcctBo.setAttributeValue("TOTAL_ALL", totalAll);
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT", pccBo.getAttribute("FIRST_PAYMENT").toString());
|
||||
lcctBo.setAttributeValue("ALL_FIRST_PAYMENT_RATIO", new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString()).multiply(new BigDecimal("100")).divide(totalAll, 6, BigDecimal.ROUND_HALF_UP));
|
||||
lcctBo.setAttributeValue("CLEAN_LEASE_MONEY", totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())));
|
||||
lcctBo.setAttributeValue("RENT_RATIO", totalAll.subtract(new BigDecimal(pccBo.getAttribute("FIRST_PAYMENT").toString())).divide(new BigDecimal(pccBo.getAttribute("EQUIP_AMT").toString()), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_DOWN).toString());
|
||||
lcctBo.setAttributeValue("DISCOUNT", "");
|
||||
lcctBm.saveObject(lcctBo);
|
||||
|
||||
// 自动测算
|
||||
autoCalc(flowunid, calType, planNumber, productId, Sqlca);
|
||||
|
||||
return "true";
|
||||
}
|
||||
|
||||
public void setProductAdjustRules(Map<String, String> otherProperty, String productId) throws Exception {
|
||||
Map<String, Map<String, String>> map = ProductParamUtil.getProductComponentType(productId, "PRD0320");
|
||||
if (map.containsKey("ADJUST_INTEREST")) {
|
||||
Map<String, String> rule = map.get("ADJUST_INTEREST");
|
||||
if (null != rule.get("rate_float_type") && null != rule.get("adjust_style")) {
|
||||
//调息方式
|
||||
otherProperty.put("ADJUST_TYPE", rule.get("rate_float_type"));
|
||||
otherProperty.put("ADJUST_STYLE", rule.get("adjust_style"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setYearRate(Map<String, String> otherProperty, String productId) throws Exception {
|
||||
Map<String, Map<String, String>> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350");
|
||||
Map<String, String> productRate = productRates.get("product_rate");
|
||||
String periodType = ProductParamUtil.getProductParameterValue(productId, "PRD0350", "period_type", "begin_end");
|
||||
periodType = periodType == null ? "period_type_0" : periodType;
|
||||
otherProperty.put("PERIOD_TYPE", periodType);
|
||||
if (productRate != null) {
|
||||
String yearRate = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate");
|
||||
otherProperty.put("YEAR_RATE", yearRate);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFirstSecondPlan(Map<String, String> otherProperty, String productId, BizObject fcc) throws Exception {
|
||||
String periodType = otherProperty.get("PERIOD_TYPE");
|
||||
String leaseAmtDate = DateUtil.getToday();
|
||||
String incomeIntervalMonth = "1";
|
||||
String defaultDueDay = fcc.getAttribute("DefaultDueDay").toString();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
|
||||
Date lad = sdf.parse(leaseAmtDate);
|
||||
lad = DateUtils.setDays(lad, Integer.parseInt(defaultDueDay));
|
||||
String firstPlanDate = "";
|
||||
String secondPlanDate = "";
|
||||
if ("period_type_1".equals(periodType)) {
|
||||
firstPlanDate = leaseAmtDate;
|
||||
secondPlanDate = sdf.format(DateUtils.addMonths(lad, Integer.parseInt(incomeIntervalMonth)));
|
||||
} else {
|
||||
firstPlanDate = sdf.format(DateUtils.addMonths(lad, Integer.parseInt(incomeIntervalMonth)));
|
||||
secondPlanDate = sdf.format(DateUtils.addMonths(lad, Integer.parseInt(incomeIntervalMonth) * 2));
|
||||
}
|
||||
otherProperty.put("FIRST_PLAN_DATE", firstPlanDate);
|
||||
otherProperty.put("SECOND_PLAN_DATE", secondPlanDate);
|
||||
}
|
||||
|
||||
public void autoCalc(String flowunid, String calType, String planNumber, String productId, JBOTransaction tx) throws Exception {
|
||||
CreateTransactionExecutor cte = new CreateTransactionExecutor();
|
||||
cte.setCalType(calType);
|
||||
cte.setFlowunid(flowunid);
|
||||
cte.setPlannumber(planNumber);
|
||||
cte.setProductId(productId);
|
||||
System.out.println("===========================自动测算开始===============================");
|
||||
cte.runTrans(tx);
|
||||
System.out.println("===========================自动测算结束===============================");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user