diff --git a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml
index 6ef06ae79..04c7712f4 100644
--- a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml
+++ b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml
@@ -2288,5 +2288,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java b/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java
index c6cdc98bb..3c35a4007 100644
--- a/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java
+++ b/src_app_fresh/apx/com/amarsoft/als/base/awe/util/AweDoCommUtil.java
@@ -8,26 +8,101 @@ import com.amarsoft.are.util.SpecialTools;
public class AweDoCommUtil {
public static void main(String[] args) throws Exception {
- System.out.println(SpecialTools.real2Amarsoft("123 "));
- String str = "((EXISTS( SELECT * FROM jbo.com .tenwa.lease.comm.LB_GUARANTEE_UNIT lgu "
- + "WHERE lgu.CONTRACT_ID=O.CONTRACT_ID AND lgu.ASSUROR=:customerid) "
- + "OR EXISTS( SELECT * FROM jbo.com .tenwa.lease.comm.LB_UNION_LESSEE lul "
- + "WHERE lul.CONTRACT_ID=O.CONTRACT_ID AND lul.CUSTOMER_ID=:customerid)))";
-
+ String str = "id=:id1 and (ida>=:id2 or idb<=:id3) and idc >: id4 (idd <: id5 and ide <>:id6)";
+ System.out.println(str);
Map map = new HashMap();
- map.put("ASSUROR", "123");
- map.put("ASSUROR".toLowerCase(), "123");
- map.put("CUSTOMER_ID", "123");
- map.put("CUSTOMER_ID".toLowerCase(), "123");
- System.out.println(whereHandle(str, map));
+ map.put("id", "1");
+ map.put("ida", "2");
+ map.put("idb", "3");
+ map.put("idc", "4");
+ map.put("idd", "5");
+ map.put("ide", "6");
+
+// map.put("ASSUROR".toLowerCase(), "123");
+// map.put("CUSTOMER_ID", "123");
+// map.put("CUSTOMER_ID".toLowerCase(), "123");
+// System.out.println(whereHandle(str, map));
+ whereHandle(str, map);
}
public static String whereHandle(String sJboWhere,
Map paramMap) {
- return whereHandle1(sJboWhere, paramMap);
+ return whereHandle2(sJboWhere, paramMap);
+ }
+
+ private static String whereHandle2(String sJboWhere,
+ Map paramMap) {
+ while (sJboWhere.contains(" ")) {
+ sJboWhere = sJboWhere.replace(" ", " ");
+ }
+ String where = sJboWhere;
+ String operation = "=";
+ if (where.contains(":")) {
+ String [] array = where.split(":");
+ String oldStr = "", newStr = "";
+ for (int i = 1; i < array.length; i++) {
+
+ String key = array[i - 1].trim();
+ String value = array[i].trim();
+
+ if (value.endsWith(")")) {
+ value = value.substring(0, value.length() - 1).trim();
+ }
+ String sKey = "", sKeyStr = "";
+ if (key.endsWith("==") || key.endsWith("!=") || key.endsWith("<>") || key.endsWith(">=") || key.endsWith("<=")
+ || key.equals("!<") || key.equals("!>")) {
+ sKey = key.substring(0, key.length() - 2).trim();
+ operation = key.substring(key.length() - 2, key.length()).trim();
+ } else if (key.endsWith("=") || key.endsWith(">") || key.endsWith("<")) {
+ sKey = key.substring(0, key.length() - 1).trim();
+ operation = key.substring(key.length() - 1, key.length()).trim();
+ }
+
+ String [] keyArray = sKey.split(" ");
+
+ if (keyArray.length > 0) {
+ sKeyStr = keyArray[keyArray.length - 1].trim();
+ } else {
+ sKeyStr = sKey.trim();
+ }
+
+ if (sKeyStr.startsWith("(")) {
+ sKeyStr = sKeyStr.substring(1, sKeyStr.length());
+ }
+
+ if (sKeyStr.contains(".")) {
+ String [] keyArray2 = sKeyStr.split("\\.");
+
+ sKeyStr = keyArray2[keyArray2.length - 1].trim();
+
+ }
+ if (value.contains(" ")) {
+ value = value.substring(0, value.indexOf(" "));
+ }
+ value = value.trim();
+ if (value.endsWith(")")) {
+ value = value.substring(0, value.indexOf(")"));
+ }
+ oldStr = array[i - 1] + ":" + value;
+// System.out.println("old: " + oldStr);
+
+ newStr = sKeyStr + operation + "'" + paramMap.get(sKeyStr) + "'";
+ System.out.println(sKeyStr + operation + ":" + value + " 替换成 " + newStr);
+ oldStr = sKeyStr + operation + ":" + value;
+ sJboWhere = sJboWhere.replace(oldStr, newStr);
+ oldStr = sKeyStr + " " + operation + ": " + value;
+ sJboWhere = sJboWhere.replace(oldStr, newStr);
+ oldStr = sKeyStr + operation + ": " + value;
+ sJboWhere = sJboWhere.replace(oldStr, newStr);
+ oldStr = sKeyStr + " " + operation + ":" + value;
+ sJboWhere = sJboWhere.replace(oldStr, newStr);
+ }
+ }
+ System.out.println(sJboWhere);
+ return sJboWhere;
}
private static String whereHandle1(String sJboWhere,
@@ -36,24 +111,23 @@ public class AweDoCommUtil {
where = where.replace(" AND ", " and ");
where = where.replace(" OR ", " or ");
String[] array = where.split("and");
+ String[] array1 = null;
+ String sKey = "";
+ String newStr = "";
for (String str : array) {
if (str.contains(":")) {
+ array1 = str.split(":");
String[] orArray = str.split("or");
if (orArray.length >= 2) {
- // [ (O.INPUTORGID=:inputOrgId , O.INPUTORGID like :inputOrgId1)]
for (String orStr : orArray) {
- // O.contract_id = :contract_id
- String[] array1 = orStr.split(":");
- // O.contract_id = > 0
- // contract_id> 1
- if (array1.length != 2)
- continue;
+// if (array1.length != 2)
+// continue;
if (!array1[0].contains(".")) {
- String sKey = array1[0].toLowerCase();
+ sKey = array1[0].toLowerCase();
sKey = sKey.trim();
sKey = sKey.substring(0, sKey.length() - 1);
sKey = sKey.trim();
- String newStr = array1[0] + "'"
+ newStr = array1[0] + "'"
+ paramMap.get(sKey) + "' ";
sJboWhere = sJboWhere.replace(orStr, newStr);
continue;
@@ -61,47 +135,42 @@ public class AweDoCommUtil {
String[] array2 = array1[0].split("\\.");
if (array2.length < 2)
continue;
- String sKey = array2[1].toLowerCase();
- // inputorgid like
+ sKey = array2[array2.length - 1].toLowerCase().trim();
+
if (sKey.contains("like") || sKey.contains("LIKE")) {
- String newStr = array1[0] + "'" + paramMap.get(sKey.trim().replaceAll("like", "").trim()) + "' ";
- String sStr = array1[1];
- while (sStr.endsWith(")")) {
- newStr += ")";
- sStr = sStr.substring(0, sStr.length() - 1);
- }
- sJboWhere = sJboWhere.replace(orStr, newStr);
+ newStr = array1[0] + "'" + paramMap.get(sKey.trim().replaceAll("like", "").trim()) + "' ".trim();
+ } else if (sKey.contains(" in ") || sKey.contains(" IN ")) {
+ newStr = array1[0] + "'" + paramMap.get(sKey.trim().replaceAll(" in ", "").trim()) + "' ".trim();
} else {
- sKey = sKey.trim();
- sKey = sKey.substring(0, sKey.length() - 1);
- sKey = sKey.trim();
- String newStr = array1[0] + "'"
- + paramMap.get(sKey) + "' ";
- String sStr = array1[1];
- while (sStr.endsWith(")")) {
- newStr += ")";
- sStr = sStr.substring(0, sStr.length() - 1);
- }
- sJboWhere = sJboWhere.replace(orStr, newStr);
+ sKey = sKey.substring(0, sKey.length() - 1).trim();
+ newStr = array1[0] + "'"
+ + paramMap.get(sKey) + "' ".trim();
+
}
+ String sStr = orStr.trim();
+ while (sStr.endsWith(")")) {
+// newStr += ")";
+ sStr = sStr.substring(0, sStr.length()-1);
+ }
+ sJboWhere = sJboWhere.replace(sStr, newStr);
sJboWhere += " ";
}
- sJboWhere = sJboWhere.substring(0, sJboWhere.length() - 1);
- } else {
- // O.contract_id = :contract_id
- String[] array1 = str.split(":");
- // O.contract_id = > 0
- // contract_id> 1
+ } else { // 没有 or
if (array1.length != 2)
continue;
- if (!array1[0].contains(".")) {
- String sKey = array1[0].toLowerCase();
- sKey = sKey.trim();
- sKey = sKey.substring(0, sKey.length() - 1);
- sKey = sKey.trim();
- String newStr = array1[0] + "'"
- + paramMap.get(sKey) + "' ";
- String sStr = array1[1];
+ if (!array1[0].contains(".")) { // 没有 O. xx.
+ sKey = array1[0].toLowerCase().trim();
+ newStr = "";
+ if (sKey.contains(" like ") || sKey.contains(" LIKE ")) { // flowUnid like : flowUnid
+ newStr = array1[0] + "'" + paramMap.get(sKey.replaceAll(" like ", "").trim()) + "'".trim();
+ } else if (sKey.contains(" in ") || sKey.contains(" IN ")) { // flowUnid in : flowUnid
+ newStr = array1[0] + "'" + paramMap.get(sKey.replaceAll(" in ", "").trim()) + "'".trim();
+ } else { // flowUnid = || > || < : flowUnid
+ sKey = sKey.substring(0, sKey.length() - 1).trim();
+ newStr = array1[0] + "'" + paramMap.get(sKey) + "' ".trim();
+ }
+
+ String sStr = array1[1].trim();
while (sStr.endsWith(")")) {
newStr += ")";
sStr = sStr.substring(0, sStr.length() - 1);
@@ -112,19 +181,25 @@ public class AweDoCommUtil {
String[] array2 = array1[0].split("\\.");
if (array2.length < 2)
continue;
- String sKey = array2[1].toLowerCase();
- sKey = sKey.trim();
- sKey = sKey.substring(0, sKey.length() - 1);
- sKey = sKey.trim();
- String newStr = array1[0] + "'"
- + paramMap.get(sKey) + "' ";
- String sStr = array1[1];
- while (sStr.endsWith(")")) {
- newStr += ")";
- sStr = sStr.substring(0, sStr.length() - 1);
+ sKey = array2[array2.length - 1].toLowerCase().trim();
+ newStr = "";
+ if (sKey.contains(" like ") || sKey.contains(" LIKE ")) { // flowUnid like : flowUnid
+ newStr = array1[0] + "'" + paramMap.get(sKey.replaceAll(" like ", "").trim()) + "'".trim();
+ } else if (sKey.contains(" in ") || sKey.contains(" IN ")) { // flowUnid in : flowUnid
+ newStr = array1[0] + "'" + paramMap.get(sKey.replaceAll(" in ", "").trim()) + "'".trim();
+ } else { // flowUnid = || > || < : flowUnid
+ sKey = sKey.substring(0, sKey.length() - 1).trim();
+ newStr = array1[0] + "'" + paramMap.get(sKey) + "' ".trim();
}
- sJboWhere = sJboWhere.replace(str, newStr);
}
+ newStr = newStr.trim();
+ String sStr = array1[1].trim();
+ while (sStr.endsWith(")")) {
+ newStr += ")";
+ sStr = sStr.substring(0, sStr.length() - 1);
+ }
+ newStr = " " + newStr + " ";
+ sJboWhere = sJboWhere.replace(str, newStr);
}
}
return sJboWhere;
diff --git a/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java b/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java
index 3c126c0ed..3b6606f74 100644
--- a/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java
+++ b/src_tenwa/com/tenwa/collectaudit/cache/CollectAuditInfoCache.java
@@ -1,635 +1,1451 @@
-package com.tenwa.collectaudit.cache;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-
-
-
-
-
-
-
-
-import jbo.app.tenwa.calc.LC_RENT_INCOME;
-import jbo.app.tenwa.calc.LC_RENT_PLAN;
-import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
-import jbo.com.tenwa.lease.comm.COLLECT_RECORD_LOG;
-import jbo.com.tenwa.lease.comm.COLLECT_RECORD_STATUS;
-import jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN;
-import jbo.sys.CODE_LIBRARY;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.amarsoft.app.awe.config.InitCollectConfig;
-import com.amarsoft.are.jbo.BizObject;
-import com.amarsoft.are.jbo.BizObjectManager;
-import com.amarsoft.are.jbo.JBOException;
-import com.amarsoft.are.jbo.JBOFactory;
-import com.amarsoft.are.jbo.JBOTransaction;
-import com.amarsoft.awe.util.SqlObject;
-import com.amarsoft.awe.util.Transaction;
-import com.tenwa.comm.util.date.DateAssistant;
-import com.tenwa.util.SerialNumberUtil;
-import com.zhongan.scorpoin.biz.common.CommonRequest;
-import com.zhongan.scorpoin.biz.common.CommonResponse;
-import com.zhongan.scorpoin.common.ZhongAnApiClient;
-import com.zhongan.scorpoin.common.ZhongAnOpenException;
-
-public class CollectAuditInfoCache {
-
-
- private String id;
- private String inputuserid;
- private String inputorgid;
-
- //校验是否已经收款
- public String checkRentIsIncome(JBOTransaction tx) throws JBOException{
- String[] ids = id.split("@");
- StringBuffer parms = new StringBuffer();
- for (String str : ids) {
- if (parms.length()==0) {
- parms.append("'"+str+"'");
- }else{
- parms.append(",'"+str+"'");
- }
- }
- BizObjectManager bm = JBOFactory.getFactory().getManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME);
- List bolist = bm.createQuery("select v.getCustomerName(O.customer_id) as v.customer_name,O.contract_id,O.plan_list,O.plan_date,O.rent_over,crs.deduct_stata from O LEFT JOIN jbo.com.tenwa.lease.comm.COLLECT_RECORD_STATUS crs ON crs.contract_id = O.contract_id AND crs.rent_plan_id = O.id where O.id in ("+parms.toString()+")").getResultList(false);
- for (BizObject bo : bolist) {
- String name = bo.getAttribute("customer_name").toString().trim();
- String plan_list = bo.getAttribute("plan_list").toString().trim();
- String plan_date = bo.getAttribute("plan_date").toString().trim();
- String deductstata = bo.getAttribute("deduct_stata").toString().trim();
- String rent = bo.getAttribute("rent_over").toString();
- if ("processing".equals(deductstata)) {//判断是否在批量处理中
- return "error@"+name+"的"+plan_list+"日期为"+plan_date+"的租金正在进行扣款处理中".trim();
- }
- if ("".equals(rent) || "0".equals(rent) || "0.0".equals(rent)) {//判断剩余收款金额
- return "error@"+name+"的"+plan_list+"日期为"+plan_date+"的租金已经全部收取,无法再次扣款".trim();
- }
- }
- return "sucess";
- }
-
- //初审
- public String fristCollectAudit(JBOTransaction tx) throws JBOException{
- String[] ids = id.split("@");
- StringBuffer buff = new StringBuffer();
- for (String str : ids) {
- if (buff.length() == 0) {
- buff.append("'"+str+"'");
- }else{
- buff.append(",'"+str+"'");
- }
- }
- String parm = buff.toString();
- BizObjectManager bm = JBOFactory.getFactory().getManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME);
- BizObjectManager acc = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT.CLASS_NAME);
- List bolist = bm.createQuery("select v.getCustomerName(O.customer_id) as v.customer_name,O.account,O.acc_number,O.mobile,O.contract_id,O.plan_list,O.plan_date,O.COLLECT_STATUS,O.rent from O where O.id in ("+parm.toString()+")").getResultList(false);
- for (BizObject bo : bolist) {
- String name = bo.getAttribute("customer_name").toString().trim();
- BizObject ac = acc.createQuery("O.account=:account and O.acc_info = 'Debit' and O.acc_number=:acc_number and O.mobile=:mobile and O.contract_id=:contract_id")
- .setParameter("account", bo.getAttribute("account").toString())
- .setParameter("acc_number", bo.getAttribute("acc_number").toString())
- .setParameter("mobile", bo.getAttribute("mobile").toString())
- .setParameter("contract_id", bo.getAttribute("contract_id").toString())
- .getSingleResult(false);
- /*if (ac == null) {
- return "error@客户"+name+"尚未签约,请先进行签约".trim();
- }*/
- }
- BizObjectManager bmr = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME);
- bmr.createQuery("update O set O.AUDIT_STATE = 'Y' where id in ("+parm+")").executeUpdate();
-
- return "success";
- }
-
- //复审退回
- public String rebackCollectAudit(JBOTransaction tx) throws JBOException{
- String[] ids = id.split("@");
- StringBuffer parms = new StringBuffer();
- for (String str : ids) {
- if (parms.length() == 0) {
- parms.append("'"+str+"'");
- }else{
- parms.append(",'"+str+"'");
- }
- }
- BizObjectManager bm = JBOFactory.getFactory().getManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME);
- List bolist = bm.createQuery("select v.getCustomerName(O.customer_id) as v.customer_name,O.fact_rent,O.account,O.acc_number,O.mobile,O.contract_id,O.plan_list,O.plan_date,O.COLLECT_STATUS,O.BATCH_STATUS,O.rent from O where O.id in ("+parms.toString()+")").getResultList(false);
- for (BizObject bo : bolist) {
- String name = bo.getAttribute("customer_name").toString().trim();
- String plan_list = bo.getAttribute("plan_list").toString();
- String plan_date = bo.getAttribute("plan_date").toString();
- String batchstatus = bo.getAttribute("BATCH_STATUS").toString();
- String rent = bo.getAttribute("rent").toString();
- double fact_rent = bo.getAttribute("fact_rent").getDouble();//实际租金
- double income_rent = bo.getAttribute("rent").getDouble();//已收租金
- if ("process".equals(batchstatus)) {//判断是否在批量处理中
- return "error@"+name+"的"+plan_list+"日期为"+plan_date+"的租金正在进行批量扣款处理中,无法退回初审".trim();
- }
- if ("".equals(rent) || "0".equals(rent) || "0.0".equals(rent)) {//判断剩余收款金额
- return "error@"+name+"的"+plan_list+"日期为"+plan_date+"的租金已经全部收取,无法退回初审".trim();
- }
- if (income_rent > 0 && (fact_rent > income_rent)) {//部分收款
- return "error@"+name+"的"+plan_list+"日期为"+plan_date+"的租金已经部分收取,无法退回初审".trim();
- }
- }
- BizObjectManager bmlrp = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME);
- bmlrp.createQuery("update O set O.AUDIT_STATE = 'N' where id in ("+parms.toString()+")").executeUpdate();
-
- return "success";
- }
-
- /**
- * 代收-发送请求
- * @param tx
- * @return
- * @throws Exception
- */
- public String batchCollectManage(JBOTransaction tx) throws Exception{
- String[] ids = id.split("@");
- StringBuffer parms = new StringBuffer();
- for (String str : ids) {
- if (parms.length()==0) {
- parms.append("'"+str+"'");
- }else{
- parms.append(",'"+str+"'");
- }
- }
- BizObjectManager bm = JBOFactory.getFactory().getManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME);
- BizObjectManager lrpbm = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME);
- List bolist = bm.createQuery("select O.contract_id,O.plan_date,O.id,ci.certid,ca.ACC_NUMBER,ca.mobile,ca.ACCOUNT,ca.BANK_NAME,O.rent from O , jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca,jbo.app.tenwa.customer.CUSTOMER_INFO ci where ci.customerid=ca.customerid and ca.customerid=O.customer_id and O.contract_id=ca.contract_id and ca.acc_type = 'Debit' and O.id in ("+parms.toString()+")").getResultList(false);
- for (BizObject biz : bolist) {
- String contract_id = biz.getAttribute("contract_id").toString();
- String plan_id = biz.getAttribute("id").toString();
- String bankname = biz.getAttribute("bank_name").toString();
- String customer_name = biz.getAttribute("account").toString();
- String certid = biz.getAttribute("certid").toString();
- String mobile = biz.getAttribute("mobile").toString();
- String acc_number = biz.getAttribute("ACC_NUMBER").toString();
- String account = biz.getAttribute("ACCOUNT").toString();
- String rent = biz.getAttribute("rent").toString();
- BigDecimal rent_over = new BigDecimal(rent).setScale(2);
- List codelist = JBOFactory.getFactory().getBizObjectManager(CODE_LIBRARY.CLASS_NAME).createQuery("O.codeno = 'selectCollectBank' and O.isinuse = '1' and O.itemattribute is not null ").getResultList(false);
- for (BizObject code : codelist) {
- String itemname = code.getAttribute("itemname").toString().trim();
- BigDecimal quota = new BigDecimal(code.getAttribute("itemattribute").toString()).setScale(2);
- String collect_sn = "";//代扣流水号
- if (bankname.indexOf(itemname) !=-1 && rent_over.compareTo(quota) == 1) {
- int index_z = rent_over.divide(quota).intValue();
- int index_y = rent_over.divideAndRemainder(quota)[1].compareTo(new BigDecimal(0)) == 1 ? 1 : 0;
- for (int i = 0; i < index_z; i++) {
- JBOTransaction tx1 = JBOFactory.createJBOTransaction();
- collect_sn = SerialNumberUtil.getBatchSerialNumber(tx1);
- //发起代扣
- Map result = singleBatchCollectMoeny(tx, collect_sn,certid, bankname, acc_number, account, quota.toString());
- if (result.containsKey("transStatus") && "3".equals(result.get("transStatus"))) {
- archiveRedcodeStatus(tx1, collect_sn, contract_id, plan_id, quota.toString());
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- lrpbm.createQuery("update O set O.collect_status = '1' where O.id =:plan_id ").setParameter("plan_id", plan_id).executeUpdate();
- }else if (result.containsKey("transStatus") && "9".equals(result.get("transStatus"))) {
- //不做任何操作
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- lrpbm.createQuery("update O set O.collect_msg =:collect_msg where O.id =:plan_id ").setParameter("collect_msg", result.get("resMsg").toString()).setParameter("plan_id", plan_id).executeUpdate();
- }else{
- //其他情况均认为是 处理中 状态
- archiveRedcodeStatus(tx1, collect_sn, contract_id, plan_id, quota.toString());
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- lrpbm.createQuery("update O set O.collect_status = '1' where O.id =:plan_id ").setParameter("plan_id", plan_id).executeUpdate();
- }
- //记录发起代扣信息
- archiveRedcodeLog(tx1, collect_sn, contract_id, plan_id, customer_name, certid, mobile, bankname, acc_number, account, quota.toString());
- tx1.commit();
- }
- if (index_y == 1) {
- //发起代扣
- JBOTransaction tx1 = JBOFactory.createJBOTransaction();
- collect_sn = SerialNumberUtil.getBatchSerialNumber(tx1);
- Map result = singleBatchCollectMoeny(tx, collect_sn,certid, bankname, acc_number, account, rent_over.subtract(quota.multiply(new BigDecimal(index_z))).toString());
- if (result.containsKey("transStatus") && "3".equals(result.get("transStatus"))) {
- archiveRedcodeStatus(tx1, collect_sn, contract_id, plan_id, rent_over.subtract(quota.multiply(new BigDecimal(index_z))).toString());
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- lrpbm.createQuery("update O set O.collect_status = '1' where O.id =:plan_id ").setParameter("plan_id", plan_id).executeUpdate();
- }else if (result.containsKey("transStatus") && "9".equals(result.get("transStatus"))) {
- //不做任何操作
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- lrpbm.createQuery("update O set O.collect_msg =:collect_msg where O.id =:plan_id ").setParameter("collect_msg", result.get("resMsg").toString()).setParameter("plan_id", plan_id).executeUpdate();
- }else{
- //其他情况均认为是 处理中 状态
- archiveRedcodeStatus(tx1, collect_sn, contract_id, plan_id, rent_over.subtract(quota.multiply(new BigDecimal(index_z))).toString());
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- lrpbm.createQuery("update O set O.collect_status = '1' where O.id =:plan_id ").setParameter("plan_id", plan_id).executeUpdate();
- }
- //记录发起代扣信息
- archiveRedcodeLog(tx1, collect_sn, contract_id, plan_id, customer_name, certid, mobile, bankname, acc_number, account, rent_over.subtract(quota.multiply(new BigDecimal(index_z))).toString());
- tx1.commit();
- }
- break;
- }else if (bankname.indexOf(itemname) !=-1 && rent_over.compareTo(quota) == -1) {//如果小于限额,则直接扣款
- JBOTransaction tx1 = JBOFactory.createJBOTransaction();
- collect_sn = SerialNumberUtil.getBatchSerialNumber(tx1);
- //发起代扣
- Map result = singleBatchCollectMoeny(tx, collect_sn, certid,bankname, acc_number, account, rent);
- if (result.containsKey("transStatus") && "3".equals(result.get("transStatus"))) {
- archiveRedcodeStatus(tx1, collect_sn, contract_id, plan_id, rent);
- }else if (result.containsKey("transStatus") && "9".equals(result.get("transStatus"))) {
- //不做任何操作
- }else{
- //其他情况均认为是 处理中 状态
- archiveRedcodeStatus(tx1, collect_sn, contract_id, plan_id, rent);
- }
- tx1.commit();
- break;
- }
- }
-
- }
- return "系统正在处理中,请稍后";
- }
-
- /**
- * 记录请求日志
- * @param tx1
- * @param contract_id 合同编号
- * @param plan_id 租金计划编号
- * @param bankname 银行名称
- * @param acc_number 银行账号
- * @param account 开户户名
- * @param rent 扣款金额
- * @throws JBOException
- */
- public void archiveRedcodeLog(JBOTransaction tx1,String collect_sn,String contract_id,String plan_id,String customer_name,String certid,String mobile,String bankname,String acc_number,String account,String rent) throws JBOException{
- BizObjectManager crlbm = JBOFactory.getFactory().getManager(COLLECT_RECORD_LOG.CLASS_NAME);
- BizObject crl = crlbm.newObject();
- tx1.join(crlbm);
- crl.setAttributeValue("contract_id", contract_id);
- crl.setAttributeValue("customer_name", customer_name);
- crl.setAttributeValue("collect_sn", collect_sn);
- crl.setAttributeValue("certid", certid);
- crl.setAttributeValue("mobile", mobile);
- crl.setAttributeValue("acc_number", acc_number);
- crl.setAttributeValue("money", new BigDecimal(rent).multiply(new BigDecimal(100)).intValue());
- crl.setAttributeValue("inputorg", getInputorgid());
- crl.setAttributeValue("inputuser", getInputuserid());
- crl.setAttributeValue("inputdate", DateAssistant.getToday());
- crlbm.saveObject(crl);
- }
-
- /**
- * 记录请求流水号标志位
- * @param tx1
- * @param contract_id 合同编号
- * @param plan_id 租金计划编号
- * @param bankname 银行名称
- * @param acc_number 银行账号
- * @param account 开户户名
- * @param rent 扣款金额
- * @throws JBOException
- */
- public void archiveRedcodeStatus(JBOTransaction tx1,String collect_sn,String contract_id,String plan_id,String rent) throws JBOException{
- BizObjectManager crsbm = JBOFactory.getFactory().getManager(COLLECT_RECORD_STATUS.CLASS_NAME);
- BizObject crs = crsbm.newObject();
- tx1.join(crsbm);
- crs.setAttributeValue("contract_id", contract_id);
- crs.setAttributeValue("rent_plan_id", plan_id);
- crs.setAttributeValue("collect_sn", collect_sn);
- crs.setAttributeValue("money", rent);
- //处理中,processing/处理完成,success/处理失败,failure
- crs.setAttributeValue("deduct_stata", "processing");
- crs.setAttributeValue("inputorg", getInputorgid());
- crs.setAttributeValue("inputuser", getInputuserid());
- crs.setAttributeValue("inputdate", DateAssistant.getToday());
- crsbm.saveObject(crs);
- }
-
- /**
- * 代收-发送请求
- * @param tx
- * @param bc
- * @param bo
- * @param rent
- * @return
- * @throws Exception
- */
- public Map singleBatchCollectMoeny(JBOTransaction tx,String collect_sn,String certid,String bankName,String accNumber,String account,String rent) throws Exception{
- int money = new BigDecimal(rent).setScale(2).multiply(new BigDecimal(100)).intValue();
- String serviceName = "payacq.transInTrans";
- ZhongAnApiClient client = new ZhongAnApiClient(InitCollectConfig.C_ENV, InitCollectConfig.C_APPKEY, InitCollectConfig.C_PRIVATEKEY, InitCollectConfig.C_VERSION);
- CommonRequest request = new CommonRequest(serviceName);
- JSONObject params = new JSONObject();
- //传入业务参数
- params.put("version", InitCollectConfig.C_VERSION);
- params.put("bizCat", InitCollectConfig.C_BIZCAT);
- params.put("bizSys", InitCollectConfig.C_BIZSYS);
- //交易流水号
- String outTradeNo = collect_sn;
- params.put("outTradeNo", outTradeNo);
- params.put("bizType", InitCollectConfig.C_BIZTYPE);//"1-消费 8-申购 30-追偿"
- System.out.println(new Date());
- params.put("subBusinessCode", InitCollectConfig.C_SUBBUSINESSCODE);
- params.put("businessCode", InitCollectConfig.C_BUSINESSCODE);
- params.put("reqTime", new Date());
- params.put("chanAcctId", InitCollectConfig.C_CHANACCTID);
- // params.put("ccy", "");
- params.put("orderAmt", money);
- /*
- 1:借记卡,
- 2:信用账户
- 3:中信电子账户
- 5:微信支付
- 7:二类户(备注 2类户)
- 8:余额支付工具
- */
- JSONObject values = new JSONObject();
- values.put("payerTool", "1");
- values.put("payerAcctId", "0");
- values.put("payerName", account);//户名
- values.put("payerIdType", "l");
- values.put("payerIdNo", accNumber);//银行卡号
- values.put("payerCardNo", certid);
- values.put("payAmt", money);
- params.put("payerInfoList", new Object[]{values});
- request.setParams(params);
- CommonResponse response = (CommonResponse) client.call(request);
- Map map = JSON.parseObject(response.getBizContent());
- if (null == map) {
- map = new HashMap();
- }
- return map;
- }
-
- /**
- * 查询批量收款状态
- * @return
- * @throws Exception
- */
- public String queryBatchCollectStatus(JBOTransaction tx,StringBuffer parms) throws Exception{
- BizObjectManager bc = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME);
- List bolist = bc.createQuery("select crs.rent_plan_id,crs.collect_sn,crs.money from O left join jbo.com.tenwa.lease.comm.COLLECT_RECORD_STATUS crs on crs.rent_plan_id = O.id where crs.collect_sn in ("+parms.toString()+")").getResultList(false);
- List listId = new ArrayList();
- for (BizObject bo : bolist) {
- String plan_id = bo.getAttribute("rent_plan_id").toString();
- String collect_sn = bo.getAttribute("collect_sn").toString();
- Map result = queryTransQry(collect_sn);
- JBOTransaction transaction = JBOFactory.createJBOTransaction();
- BizObjectManager crsbm = JBOFactory.getFactory().getManager(COLLECT_RECORD_STATUS.CLASS_NAME,transaction);
- if (result.containsKey("transStatus") && "3".equals(result.get("transStatus"))) {
- //回笼租金
- querysingleCollectMoeny(transaction, bo);
- //更新收款状态
- crsbm.createQuery("update O set O.deduct_stata = 'success',O.deduct_msg = '"+result.get("transMsg")+"' where O.rent_plan_id=:plan_id and O.collect_sn=:collect_sn ")
- .setParameter("plan_id", plan_id).setParameter("collect_sn", collect_sn).executeUpdate();
- }else if (result.containsKey("transStatus") && "9".equals(result.get("transStatus"))) {
- //如果扣款失败,更新状态,不回笼租金//////处理中,processing/处理完成,success/处理失败,failure
- crsbm.createQuery("update O set O.deduct_stata = 'failure',O.deduct_msg = '"+result.get("transMsg")+"' where O.rent_plan_id=:plan_id and O.collect_sn=:collect_sn ")
- .setParameter("plan_id", plan_id).setParameter("collect_sn", collect_sn).executeUpdate();
- } else{
- //正在处理中,不做任何操做
- }
- transaction.commit();
- if (!listId.contains(plan_id)) {
- listId.add(plan_id);
- }
-
- }
- Object[] arryId = listId.toArray();
- StringBuffer arryparm = new StringBuffer();
- for (Object string : arryId) {
- if (arryparm.length() == 0) {
- arryparm.append("'"+string+"'");
- }else {
- arryparm.append(",'"+string+"'");
- }
- }
- BizObjectManager crsbm = JBOFactory.getFactory().getManager(COLLECT_RECORD_STATUS.CLASS_NAME);
- List querylist = crsbm.createQuery("select v.GROUP_CONCAT(O.deduct_stata) AS v.debuct_statas,O.rent_plan_id from O where O.rent_plan_id in ("+arryparm.toString()+") ").getResultList(false);
- for (BizObject biz : querylist) {
- String deduct_stata = biz.getAttribute("debuct_statas").toString();
- String plan_id = biz.getAttribute("rent_plan_id").toString();
- //处理中,processing/处理完成,success/处理失败,failure
- if (deduct_stata.contains("processing") && deduct_stata.contains("success") && deduct_stata.contains("failure")) {
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- bc.createQuery("update O set O.collect_status = '1' where id = '"+plan_id+"'").executeUpdate();
- }else if (!deduct_stata.contains("processing") && deduct_stata.contains("success") && deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- bc.createQuery("update O set O.collect_status = '2' where id = '"+plan_id+"'").executeUpdate();
- }else if (!deduct_stata.contains("processing") && deduct_stata.contains("success") && !deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- bc.createQuery("update O set O.collect_status = '3' where id = '"+plan_id+"'").executeUpdate();
- }else if (!deduct_stata.contains("processing") && !deduct_stata.contains("success") && deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- bc.createQuery("update O set O.collect_status = '4' where id = '"+plan_id+"'").executeUpdate();
- }
- }
-
- return "sucess";
-
- }
-
- public static String getDeductStata(String plan_id){
- JBOTransaction tx = null;
- StringBuffer result = new StringBuffer();
- try {
- tx = JBOFactory.createJBOTransaction();
- BizObjectManager crsbm = JBOFactory.getFactory().getManager(COLLECT_RECORD_STATUS.CLASS_NAME,tx);
- BizObject querybiz = crsbm.createQuery("select v.GROUP_CONCAT(O.deduct_stata) AS v.debuct_statas,v.GROUP_CONCAT(O.deduct_msg) AS v.debuct_msgs from O where O.rent_plan_id =:plan_id ").setParameter("plan_id", plan_id).getSingleResult(false);
- if(null != querybiz) {
- String deduct_stata = querybiz.getAttribute("debuct_statas").toString();
- String[] deduct_statas = querybiz.getAttribute("debuct_statas").toString().trim().split(",");
- String[] debuct_msgs = querybiz.getAttribute("debuct_msgs").toString().trim().split(",");
- //处理中,processing/处理完成,success/处理失败,failure
- if (deduct_stata.contains("processing") && deduct_stata.contains("success") && deduct_stata.contains("failure")) {
- result.append("部分收款 >> 收款中 >> ");
- for (int i = 0; i < deduct_statas.length; i++) {
- if (deduct_statas[i].contains("failure")) {
- result.append(debuct_msgs[i]);
- break;
- }
- }
- }else if (deduct_stata.contains("processing") && !deduct_stata.contains("success") && !deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- result.append("收款中 ");
- }else if (!deduct_stata.contains("processing") && deduct_stata.contains("success") && deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- result.append("部分收款 >>> ");
- for (int i = 0; i < deduct_statas.length; i++) {
- if (deduct_statas[i].contains("failure")) {
- result.append(debuct_msgs[i]);
- break;
- }
- }
-
- }else if (!deduct_stata.contains("processing") && deduct_stata.contains("success") && !deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- result.append("收款成功 ");
- }else if (!deduct_stata.contains("processing") && !deduct_stata.contains("success") && deduct_stata.contains("failure")){
- //更新状态,1,处理中,2,部分收款,3,收款成功,4,收款失败,5,未收款
- result.append("收款失败 >>> ");
- for (int i = 0; i < deduct_statas.length; i++) {
- if (deduct_statas[i].contains("failure")) {
- result.append(debuct_msgs[i]);
- break;
- }
- }
- }
- }
- return result.toString().trim();
- } catch (JBOException e) {
- if (tx != null) {
- try {
- tx.rollback();
- } catch (JBOException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
- }
- }finally{
- try {
- tx.commit();
- } catch (JBOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- return result.toString().trim();
-
- }
-
- /**
- * 查询扣款是否成功
- * @param outTradeNo
- * @return
- */
- public Map queryTransQry(String outTradeNo) {
- String serviceName = "payacq.transQry";
- Map result = new HashMap();
- try {
- ZhongAnApiClient client = new ZhongAnApiClient(InitCollectConfig.C_ENV, InitCollectConfig.C_APPKEY, InitCollectConfig.C_PRIVATEKEY, InitCollectConfig.C_VERSION);
- CommonRequest request = new CommonRequest(serviceName);
- JSONObject params = new JSONObject();
- //传入业务参数
- params.put("version", InitCollectConfig.C_VERSION);
- params.put("chanAcctId", InitCollectConfig.C_CHANACCTID);
- params.put("outTradeNo", outTradeNo);
- params.put("bizCat", InitCollectConfig.C_BIZCAT);
- params.put("bizSys", InitCollectConfig.C_BIZSYS);
- request.setParams(params);
- CommonResponse response = (CommonResponse) client.call(request);
- System.out.println(response);
- result = JSON.parseObject(response.getBizContent());
- } catch (ZhongAnOpenException e) {
- e.printStackTrace();
- }
- return result;
- }
-
- /**
- * 查询接口--回笼租金
- * @param tx
- * @param bc
- * @param bo
- * @param rent
- * @return
- * @throws Exception
- */
- public void querysingleCollectMoeny(JBOTransaction tx,BizObject bo) throws Exception{
- String cerrentDate = DateAssistant.getToday();
- JBOTransaction transaction = tx;
- int hire_index = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME, transaction).createQuery("select COUNT(O.plan_id) from O GROUP BY O.plan_id HAVING O.plan_id=:plan_id ").getResultList(false).size() + 1;
- BigDecimal money_value = new BigDecimal(bo.getAttribute("moeny").toString()).setScale(2);
- BizObjectManager bmi = JBOFactory.getFactory().getManager(LC_RENT_PLAN.CLASS_NAME,transaction);
- BizObject boi = bmi.createQuery("SELECT v.REPLACE(v.UUID(),'-','') AS id, O.QUOT_ID AS QUOT_ID, O.CUST_ID AS CUST_ID, O.PROJECT_ID AS PROJECT_ID, O.PROJECT_PLAN_NUMBER AS PROJECT_PLAN_NUMBER, "
- + "O.CONTRACT_ID AS CONTRACT_ID, O.CONTRACT_PLAN_NUMBER AS CONTRACT_PLAN_NUMBER, "
- + "O.PAYMENT_NUMBER AS PAYMENT_NUMBER, '' AS v.EBANK_NUMBER, O.id AS v.PLAN_ID, "
- + "O.PLAN_LIST AS PLAN_LIST, '0' AS v.INTEREST_ADJUST, 'settlemethod6' AS SETTLE_METHOD, "
- + " '"+hire_index+"' AS v.HIRE_LIST, '"+cerrentDate+"' AS HIRE_DATE, vl.rent_over AS RENT, "
- + "vl.corpus_over AS CORPUS, vl.interest_over AS INTEREST, vl.penalty_over AS PENALTY,"
- + " '0' AS CORPUS_ADJUST, '0' AS PENALTY_ADJUST, '0' AS ROLL_BACK, O.COIN AS COIN FROM O, "
- + "jbo.app.tenwa.calc.VI_LC_RENT_PLAN vl WHERE O.id = vl.id AND vl.contract_id = :contract_id "
- + " AND vl.plan_date = :plan_date ").setParameter("contract_id", bo.getAttribute("contract_id").toString())
- .setParameter("plan_date", bo.getAttribute("plan_date").toString()).getSingleResult(false);
- if (boi != null) {
- String sql = "";
- BigDecimal interest_value = new BigDecimal(boi.getAttribute("interest").toString()).setScale(2);
- BigDecimal corpus_value = new BigDecimal(boi.getAttribute("corpus").toString()).setScale(2);
- BigDecimal penalty_value = new BigDecimal(boi.getAttribute("penalty").toString()).setScale(2);
- BigDecimal rent_value = new BigDecimal(boi.getAttribute("rent").toString()).setScale(2);
- BigDecimal rent = new BigDecimal(0);
- BigDecimal corpus = new BigDecimal(0);
- BigDecimal interest = new BigDecimal(0);
- BigDecimal penalty = new BigDecimal(0);
- if (rent_value.add(penalty_value).compareTo(money_value) == 0) {//如果 租金+罚息=本次扣款金额
- rent = rent_value;
- corpus = corpus_value;
- interest = interest_value;
- penalty = penalty_value;
- }else if (interest_value.doubleValue() > 0 && (money_value.compareTo(interest_value) == -1 || money_value.compareTo(interest_value) == 0)) {//剩余利息大于0,本次扣款金额小于或等于利息
- rent = money_value;
- interest = money_value;
- }else if (interest_value.doubleValue() > 0 && money_value.compareTo(interest_value) == 1) { //剩余利息大于0,本次扣款金额大于利息
- rent = money_value;
- corpus = money_value.subtract(interest_value).setScale(2);
- interest = interest_value;
- }else if (corpus_value.doubleValue() > 0 && (money_value.compareTo(corpus_value) == -1 || money_value.compareTo(corpus_value) == 0)) {//本金大于0,本次扣款金额小于或等于本金
- rent = money_value;
- corpus = money_value;
- }else if (corpus_value.doubleValue() > 0 && money_value.compareTo(corpus_value) == 1) {//本金大于0,本次扣款金额大于本金
- rent = money_value;
- corpus = corpus_value;
- penalty = money_value.subtract(corpus_value).setScale(2);
- }else if (penalty_value.doubleValue() > 0 && (money_value.compareTo(penalty_value) == -1 || money_value.compareTo(penalty_value) == 0)) {//罚息大于0,本次扣款金额小于或等于罚息
- rent = money_value;
- penalty = money_value;
- }else if (penalty_value.doubleValue() > 0 && money_value.compareTo(penalty_value) == 1) {//罚息大于0,本次扣款金额大于罚息
- rent = money_value;
- corpus = money_value.subtract(interest_value).subtract(corpus_value).setScale(2);
- interest = money_value.subtract(interest_value).setScale(2);
- penalty = penalty_value;
- }
- sql = "insert into LC_RENT_INCOME (ID, QUOT_ID, CUST_ID, PROJECT_ID, PROJECT_PLAN_NUMBER, CONTRACT_ID, CONTRACT_PLAN_NUMBER, PAYMENT_NUMBER,EBANK_NUMBER,PLAN_ID, PLAN_LIST,"
- + " INTEREST_ADJUST,SETTLE_METHOD,HIRE_LIST,HIRE_DATE, RENT,CORPUS,INTEREST,PENALTY,CORPUS_ADJUST,PENALTY_ADJUST,ROLL_BACK,COIN)"
- + "values ('"+boi.getAttribute("id")+"','"+boi.getAttribute("QUOT_ID")+"','"+boi.getAttribute("CUST_ID")+"','"+boi.getAttribute("PROJECT_ID")+"','"+boi.getAttribute("PROJECT_PLAN_NUMBER")+"',"
- + "'"+boi.getAttribute("CONTRACT_ID")+"','"+boi.getAttribute("CONTRACT_PLAN_NUMBER")+"','"+boi.getAttribute("PAYMENT_NUMBER")+"','"+boi.getAttribute("EBANK_NUMBER")+"','"+boi.getAttribute("PLAN_ID")+"',"
- + "'"+boi.getAttribute("PLAN_LIST")+"','"+boi.getAttribute("INTEREST_ADJUST")+"','"+boi.getAttribute("SETTLE_METHOD")+"','"+boi.getAttribute("HIRE_LIST")+"','"+boi.getAttribute("HIRE_DATE")+"','"+rent.toString()+"','"+corpus.toString()+"',"
- + "'"+interest.toString()+"','"+penalty.toString()+"','"+boi.getAttribute("CORPUS_ADJUST")+"','"+boi.getAttribute("PENALTY_ADJUST")+"','"+boi.getAttribute("ROLL_BACK")+"','"+boi.getAttribute("COIN")+"')";
- //插入数据
- Transaction Sqlca =null;
- Sqlca = Transaction.createTransaction(transaction);
- SqlObject asql = new SqlObject(sql);
- Sqlca.executeSQL(asql);
- }
- }
-
-
- public String getInputuserid() {
- return inputuserid;
- }
-
- public void setInputuserid(String inputuserid) {
- this.inputuserid = inputuserid;
- }
-
- public String getInputorgid() {
- return inputorgid;
- }
-
- public void setInputorgid(String inputorgid) {
- this.inputorgid = inputorgid;
- }
-
- public String getId() {
- return id;
- }
-
- public void setId(String id) {
- this.id = id;
- }
-
-}
+package com.tenwa.collectaudit.cache;
+
+import java.io.File;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import jbo.app.tenwa.calc.LC_RENT_PLAN;
+import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
+import jbo.com.tenwa.lease.comm.LB_CLEAR_FILE_RECORD;
+import jbo.com.tenwa.lease.comm.LB_INTFACE_FILE_RECORD;
+import jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN;
+import jbo.sys.CODE_LIBRARY;
+
+import com.amarsoft.app.als.sys.tools.DateTool;
+import com.amarsoft.app.awe.config.InitCollectConfig;
+import com.amarsoft.app.util.StringUtil;
+import com.amarsoft.are.jbo.BizObject;
+import com.amarsoft.are.jbo.BizObjectManager;
+import com.amarsoft.are.jbo.JBOException;
+import com.amarsoft.are.jbo.JBOFactory;
+import com.amarsoft.are.jbo.JBOTransaction;
+import com.amarsoft.awe.util.SqlObject;
+import com.amarsoft.awe.util.Transaction;
+import com.gnete.security.crypt.Crypt;
+import com.gnete.security.crypt.CryptException;
+import com.ibm.sslight.tools.mainExit;
+import com.tenwa.comm.util.date.DateAssistant;
+import com.tenwa.comm.util.jboutil.DataOperatorUtil;
+
+public class CollectAuditInfoCache {
+
+ private String id;
+ private String fileSavePath = "d:/tmp/als/InterFace";
+ private String inputuserid;
+ private String inputorgid;
+ private String clearDate;
+
+ //获取存盘文件
+ public static String getCollectIntface(String id) throws Exception{
+
+ String sql="select lr.filename from LB_INTFACE_FILE_RECORD lr "
+ + "where lr.id=:id";
+ Map map=new HashMap();
+ map.put("id", id);
+ JBOTransaction tx = null;
+ String filename="";
+ tx=JBOFactory.createJBOTransaction();
+ List