();
for (CashDetailsBean obj : cdbList) {
new_cdbList.add(obj);
}
-
-
- //TODO:sea 期末购买权在月付情况下:最后一期日期加一月作为单独的一行数据,其它情况下:最后一期的日期
+
+
+ //TODO:sea 期末购买权在月付情况下:最后一期日期加一月作为单独的一行数据,其它情况下:最后一期的日期
//2014-06-11 期末余值新的处理逻辑:【符合】‘期末购买权月付/双月付情况’这个前提下, 期初情况的‘期末余值’与‘期末购买权’一致放在新增的一期一起作为最后一期现金流的数据
if(null != nominal_price && !"".equals(nominal_price) && Double.parseDouble(nominal_price) > Double.parseDouble("0.00") && !Tools.isNullOrEmpty(planDate) && ( "income_1".equals(income_number_year) || "12".equals(income_number_year) || "income_2".equals(income_number_year) || "6".equals(income_number_year) ) && ("period_type_1".equals(periodType) || "1".equals(periodType)) ){//月付/双月付情况下
//重新取一次值
CashDetailsBean new_cdb = new CashDetailsBean();//cdbList.get(cdbList.size() - 1);
planDate = planDate+"-01";//构建成完整的日期格式
- //2014-01-01 日期加1个月
+ //2014-01-01 日期加1个月
planDate = DateTools.getDateAdd(planDate, 1, "mm");
new_cdb.setPlanDate(planDate.substring(0, 7)+"-01");
new_cdb.setFundOut("0");
new_cdb.setFundOutDetails("");
-
+
new_cdb.setFundIn(String.valueOf(Double.parseDouble(nominal_price) + Double.parseDouble(equip_end_value)));
new_cdb.setFundInDetails("期末购买权:" + NumTools.formatNumberDouble(Double.parseDouble(NumTools.formatNumberDoubleScale(nominal_price, 2))) + ";期末余值:" + NumTools.formatNumberDouble(Double.parseDouble(NumTools.formatNumberDoubleScale(equip_end_value, 2))));
new_cdb.setNetFlow( String.valueOf( Double.parseDouble(nominal_price) + Double.parseDouble(equip_end_value) ) );
-
+
new_cdb.setOnhire_id( onhire_id + 1 );//现金流按固定格式补0情况下,所以这里月付情况下,直接最后一次变量加1做为最终的期末购买权排序依据
new_cdbList.add(new_cdb);
}else{
-
+
//TODO:2014-06-11 期末余值新的处理逻辑:【不符合】‘期末购买权月付情况’这个前提下, 期初情况的‘期末余值’与‘期末购买权’一致放在新增的一期一起作为最后一期现金流的数据
//TODO:这里存在少处理不是月付情况,例如:季付情况下,‘期末余值’是不是不能直接最后一期加一个月,是加一个租赁间隔,是加一个季度三个月,中间需要补两个0
if( !Tools.isNullOrEmpty(planDate) && null != equip_end_value && !"".equals(equip_end_value) && Double.parseDouble(equip_end_value) > Double.parseDouble("0.00") && ("period_type_1".equals(periodType) || "1".equals(periodType)) ){// 期初
//重新取一次值
CashDetailsBean new_cdb = new CashDetailsBean();//cdbList.get(cdbList.size() - 1);
planDate = planDate+"-01";//构建成完整的日期格式
- //2014-01-01 日期加1个月
+ //2014-01-01 日期加1个月
planDate = DateTools.getDateAdd(planDate, 1, "mm");
new_cdb.setPlanDate(planDate.substring(0, 7)+"-01");
new_cdb.setFundOut("0");
@@ -541,13 +541,13 @@ public class IrrTools {
new_cdb.setOnhire_id( onhire_id + 1 );//现金流按固定格式补0情况下,所以这里月付情况下,直接最后一次变量加1做为最终的期末购买权排序依据
new_cdbList.add(new_cdb);
}
-
+
}
-
+
return new_cdbList;
}
-
+
/**
* 对最后一项现金流明细进行整理,针对项目类型为‘VP业务’情况下,期末购买权不计算入最后一期现金流中。
* @author sea
@@ -562,31 +562,31 @@ public class IrrTools {
// 更新流入,净流量值
if (null != equip_end_value && !"".equals(equip_end_value) && Double.parseDouble(equip_end_value) > 0) {// 期末残值大于0时
cdb.setFundIn(String.valueOf(Double.parseDouble(cdb.getFundIn()) + Double.parseDouble(equip_end_value)));
-
+
cdb.setFundInDetails(cdb.getFundInDetails() + ";期末余值:" + NumTools.formatNumberDouble(Double.parseDouble(NumTools.formatNumberDoubleScale(equip_end_value, 2))));
-
+
cdb.setNetFlow(String.valueOf(Double.parseDouble(cdb.getNetFlow()) + Double.parseDouble(equip_end_value)));
}
-
+
if (null != nominal_price && !"".equals(nominal_price) && Double.parseDouble(nominal_price) > 0) {// 期末购买权【原名称:名义货价】大于0时
cdb.setFundIn(String.valueOf(Double.parseDouble(cdb.getFundIn()) + Double.parseDouble(nominal_price)));
//项目类型为‘VP业务’情况下,期末购买权不算入流入中
cdb.setFundInDetails( cdb.getFundInDetails() );
cdb.setNetFlow( cdb.getNetFlow() );
}
-
+
// 重新设置此元素的值
cdbList.set(cdbList.size() - 1, cdb);
-
+
// 2011-10-26
// 处理特殊的保证金抵扣 保证金抵扣金额小于保证金金额 最后要做一笔流出 为保证金金额减去保证金抵扣金额
cdbList = IrrTools.getRentDetailsByDeductOut(cdbList, cb.getCautionMoney(), cb.getCautionDeductionMoney());
-
+
return cdbList;
-
+
}
/**
- *
+ *
* ( 现金流明细构建)
* 按月计算IRR
* @param cdbList
@@ -595,7 +595,7 @@ public class IrrTools {
public static String getIrr(List cdbList) {
// 得到租金列表
List rent_list = getRentListByCashDetails(cdbList);
- /*
+ /*
* 后三个参数为固定按月计算
* @param chjg 固定值1
* @param zjjg 固定值1
@@ -606,7 +606,7 @@ public class IrrTools {
}
/**
- *
+ *
* @Title: getIrr
* @author zhangc
* @Description: 牛顿分切法计算XIRR
@@ -624,7 +624,7 @@ public class IrrTools {
return IrrTools.getXIRR(rent_list, planDate_list).toString();
//return IrrTools.getIRR(rent_list, "1","1","12");
}
-
+
public static String getIrrNew( List netList,List dateList,String process) throws Exception {
// 得到租金列表
//List rent_list = getRentListByCashDetails(cashlist,process);
@@ -634,9 +634,9 @@ public class IrrTools {
//return IrrTools.getIRR(rent_list, "1","1","12");
}
/**
- *
+ *
* ( 现金流明细构建)
- *
+ *
* @param cdbList
* @param cb
* @return
@@ -651,9 +651,9 @@ public class IrrTools {
}
/**
- *
+ *
* ( 现金流明细构建)
- *
+ *
* @param cdbList
* @param cb
* @return
@@ -668,9 +668,9 @@ public class IrrTools {
}
/**
- *
+ *
* ( 根据现金流明细得到新的租金列表,用于算irr值)
- *
+ *
* @param cdbList
*/
private static List getRentListByCashDetails(List cdbList) {
@@ -680,7 +680,7 @@ public class IrrTools {
}
return rent_list;
}
-
+
private static List getRentListByCashDetails(List cdbList,String process) throws Exception {
List rent_list = new ArrayList();
for (Object cdb : cdbList) {
@@ -691,12 +691,12 @@ public class IrrTools {
}else{
rent_list.add(((ContractCashDetailTemp)cdb).getNetFlow().toString());
}*/
-
+
rent_list.add(((BizObject)cdb).getAttribute("NET_FLOW").getString());
}
return rent_list;
}
-
+
private static List getRentListByCashDetailsPlanDate(List cdbList,String process) throws Exception {
List rent_list = new ArrayList();
for (Object cdb : cdbList) {
@@ -706,9 +706,9 @@ public class IrrTools {
}
/**
- *
+ *
* ( 算出均息法下的均息法租金列表的irr,并把其当做年利率传递做第二次正常租金测算)
- *
+ *
* @param cb
* 交易结构bean
* @param frpb
@@ -734,7 +734,7 @@ public class IrrTools {
} else {
l_inflow_pour.add("-" + leasing_money);
}
-
+
for (int i = grace; i < rent_list.size(); i++) {
l_inflow_pour.add(rent_list.get(i).toString());
}
@@ -745,16 +745,16 @@ public class IrrTools {
l_inflow_pour.set(l_inflow_pour.size()-1, new BigDecimal(l_inflow_pour.get(l_inflow_pour.size()-1)).add(new BigDecimal(cb.getEquipEndValue())).toString());
}
}
-
+
irr = IrrTools.getIRR(l_inflow_pour, String.valueOf(12 / Integer.parseInt(cb.getIncomeNumberYear())), String.valueOf(12 / Integer.parseInt(cb.getIncomeNumberYear())), cb.getIncomeNumberYear());
irr = Double.parseDouble(irr) + "";
return irr;
}
/**
- *
+ *
* (根据现金流获得对应的年利率)
- *
+ *
* @param alCash
* 现金流 用HashMap key为net_flow 存的每期的值
* @param income_number_year
@@ -770,7 +770,7 @@ public class IrrTools {
}
return NumTools.formatNumberDoubleScale(Double.parseDouble(getIRR(alirr, "1", "1", income_number_year)) * 100 + "", 6);
}
-
+
/**
* 根据原始现金流集合按固定模式补0构建成独特格式的现金流。
* @author sea
@@ -784,26 +784,26 @@ public class IrrTools {
List list = new ArrayList();
List cashList = new ArrayList();
// 期初(期末)支付 注意: 期初 数字 1 字符串 period_type_1 #分割线# 期末 数字0 字符串 period_type_0
- String periodType = cb.getPeriodType();
+ String periodType = cb.getPeriodType();
if (ccfbList != null && ccfbList.size() > 0 && ccfbList.size() > size) {//现金流的长度如果小于2条,该方法不适用,特别是期初情况下,理论上现金流只存在一行数据了
-
+
//第0期现金流集合
CashDetailsBean objFirst = new CashDetailsBean();
objFirst = ccfbList.get(0);//默认第0期的值等于原始现金流的第0期
-
- double firstIn = 0.00;
- double firstOut = 0.00;
+
+ double firstIn = 0.00;
+ double firstOut = 0.00;
String firstFundInDetails = "";
String firstFundOutDetails = "";
for (int i = 0; i < size; i++) {
CashDetailsBean oneObj = ccfbList.get(i);
//第i期流入流出
- firstIn = firstIn + NumberUtils.parseDouble( NumberUtils.nullToZero( oneObj.getFundIn() ) );
- firstOut = firstOut + NumberUtils.parseDouble( NumberUtils.nullToZero( oneObj.getFundOut() ) );
+ firstIn = firstIn + NumberUtils.parseDouble( NumberUtils.nullToZero( oneObj.getFundIn() ) );
+ firstOut = firstOut + NumberUtils.parseDouble( NumberUtils.nullToZero( oneObj.getFundOut() ) );
firstFundInDetails = firstFundInDetails +oneObj.getFundInDetails();
firstFundOutDetails = firstFundOutDetails+oneObj.getFundOutDetails();
}
-
+
//期初前收情况下:做合并处理
if("1".equals(periodType) || "period_type_1".equals(periodType)){
//封装新的第0期
@@ -816,7 +816,7 @@ public class IrrTools {
objFirst.setNetFlow(NumberUtils.doubleToString( firstIn + firstRent - firstOut ) );
objFirst.setOnhire_id(1000);
cashList.add(objFirst);
-
+
//封装后续所有现金流
int key = 2;
int onhire_id = 1000;
@@ -868,7 +868,7 @@ public class IrrTools {
}
return cashList;
}
-
+
/**
* 计算固定格式情况现金流补0个数。
* @author sea
@@ -894,7 +894,7 @@ public class IrrTools {
}
return num;
}
-
+
/**
* 生成补0的现金流对象。
* @author sea
@@ -915,14 +915,14 @@ public class IrrTools {
newObj.setOnhire_id(onhire_id);
return newObj;
}
-
-
+
+
/**
* 牛顿迭代法求IRR
* @param cashList:现金流List
* @return IRR
*/
- public BigDecimal getIRR(List cashList){
+ public static BigDecimal getIRR(List cashList){
//long startTime = System.currentTimeMillis();
BigDecimal diff = BigDecimal.ONE; //租金现值总和与总本金的差值
BigDecimal irr = BigDecimal.ZERO;
@@ -970,7 +970,7 @@ public class IrrTools {
BigDecimal daoRate=BigDecimal.ZERO; // 1/(1+irr)
BigDecimal netflowNow; //净流量现值
BigDecimal error = new BigDecimal("0.0000000001"); //误差
- int size = cashList.size(); //现金流大小
+ int size = cashList.size(); //现金流大小
int j = 0; //迭代次数
double k = 0;
String startDate = "";
@@ -990,7 +990,7 @@ public class IrrTools {
}catch(Exception e){
e.printStackTrace();
}
-
+
}
j++;
irr = irr.subtract(diff.divide(derivative, 20, BigDecimal.ROUND_HALF_UP)); //迭代关系式
diff --git a/config/cgb.properties b/config/cgb.properties
new file mode 100644
index 000000000..54ed59eb2
--- /dev/null
+++ b/config/cgb.properties
@@ -0,0 +1,8 @@
+#客户号
+cifMaster=60000002922
+#操作员
+entUserId=100001
+#操作密码
+password=1q2w3e4r
+#前置机地址
+cgbUrl=http://114.242.219.170:63312/CGBClient/BankAction
\ No newline at end of file
diff --git a/src/com/amarsoft/app/flow/FlowAction.java b/src/com/amarsoft/app/flow/FlowAction.java
index 494cbb258..04587d97f 100644
--- a/src/com/amarsoft/app/flow/FlowAction.java
+++ b/src/com/amarsoft/app/flow/FlowAction.java
@@ -691,7 +691,7 @@ public class FlowAction {
sql.setOriginalSql(sql.getOriginalSql().replaceAll("△", ":"));
sql.setRunSql(sql.getRunSql().replaceAll("△", ":"));
tran.executeSQL(sql);
- sql = new SqlObject("update user_task_info set task_number = nvl(task_number, 0) + 1 "
+ sql = new SqlObject("update user_task_info set task_number = task_number + 1 "
+ " where userid = '" + AssignmentId + "' and roleid = '" + curRole + "'");
tran.executeSQL(sql);
} else {
@@ -703,8 +703,8 @@ public class FlowAction {
sql.setOriginalSql(sql.getOriginalSql().replaceAll("△", ":"));
sql.setRunSql(sql.getRunSql().replaceAll("△", ":"));
tran.executeSQL(sql);
- sql = new SqlObject("update user_task_info set task_number = nvl(task_number, 0) - 1 "
- + " where userid = '" + userID + "' and roleid = '" + curRole + "'");
+ sql = new SqlObject("update user_task_info set task_number = task_number - 1 "
+ + " where userid = '" + userID + "' and roleid = '" + curRole + "' and task_number >=1 ");
tran.executeSQL(sql);
}
}
diff --git a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentDo.java b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentDo.java
index 30e005792..cc76dbd1a 100644
--- a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentDo.java
+++ b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentDo.java
@@ -19,7 +19,7 @@ import com.amarsoft.are.jbo.JBOTransaction;
public class AllinpayPaymentDo {
private String id;
-
+
/**
* 批量代收-发送请求
* @param tx
@@ -103,8 +103,7 @@ public class AllinpayPaymentDo {
new Thread(run).start();
}
public void queryCollectResult(){
- AllinpayPaymentQueryRun run = new AllinpayPaymentQueryRun();
- new Thread(run).start();
+ new AllinpayPaymentQueryRun().allinpayPaymentQuerySt();
}
public String getId() {
return id;
diff --git a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryJob.java b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryJob.java
index 4e6020ae6..c7ec72914 100644
--- a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryJob.java
+++ b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryJob.java
@@ -1,31 +1,30 @@
package com.tenwa.lease.app.allinpay.service.impl;
-import org.apache.log4j.Logger;
-import org.quartz.Job;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-
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 org.apache.log4j.Logger;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
-public class AllinpayPaymentQueryJob implements Job{
- private Logger logger = Logger.getLogger(this.getClass());
- @Override
- public void execute(JobExecutionContext arg0) throws JobExecutionException {
- try {
- BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_CARD_PAYMENT");
- BizObject object = manager.createQuery("O.STATUS='正在处理'").getSingleResult(true);
- if(object==null) {
- logger.info("没有需要查询的通联卡扣信息");
- return;
- }
- AllinpayPaymentQueryRun run = new AllinpayPaymentQueryRun();
- run.run();
- } catch (JBOException e) {
- e.printStackTrace();
- }
- }
+public class AllinpayPaymentQueryJob implements Job {
+ private Logger logger = Logger.getLogger(this.getClass());
+
+ @Override
+ public void execute(JobExecutionContext arg0) throws JobExecutionException {
+ try {
+ BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.app.tenwa.calc.LC_CARD_PAYMENT");
+ BizObject object = manager.createQuery("O.STATUS='正在处理'").getSingleResult(true);
+ if (object == null) {
+ logger.info("没有需要查询的通联卡扣信息");
+ return;
+ }
+ new AllinpayPaymentQueryRun().allinpayPaymentQuerySt();
+ } catch (JBOException e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java
index 94d42949f..2fd414732 100644
--- a/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java
+++ b/src/com/tenwa/lease/app/allinpay/service/impl/AllinpayPaymentQueryRun.java
@@ -1,67 +1,53 @@
package com.tenwa.lease.app.allinpay.service.impl;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.sql.SQLException;
-import java.text.DecimalFormat;
-import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import jbo.com.tenwa.lease.comm.LB_BUCKLE_LOG;
-
-import org.apache.log4j.Logger;
-
import com.allinpay.xml.XmlParser;
import com.allinpay.xstruct.common.AipgRsp;
import com.allinpay.xstruct.common.InfoRsp;
import com.allinpay.xstruct.trans.qry.QTDetail;
import com.allinpay.xstruct.trans.qry.QTransRsp;
import com.amarsoft.app.lc.util.DateAssistant;
-import com.amarsoft.are.jbo.BizObject;
-import com.amarsoft.are.jbo.BizObjectManager;
-import com.amarsoft.are.jbo.JBOException;
-import com.amarsoft.are.jbo.JBOFactory;
-import com.amarsoft.are.jbo.JBOTransaction;
+import com.amarsoft.are.jbo.*;
import com.amarsoft.are.util.StringFunction;
import com.amarsoft.awe.util.ASResultSet;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
-import com.ctc.wstx.util.DataUtil;
import com.tenwa.collectaudit.cache.CollectAuditInfoCache;
import com.tenwa.lease.app.allinpay.util.AllinpayProperties;
import com.tenwa.lease.app.allinpay.util.ConfigConstant;
import com.tenwa.reckon.util.UUIDUtil;
+import jbo.app.tenwa.calc.LC_RENT_INCOME;
+import jbo.com.tenwa.lease.comm.LB_BUCKLE_LOG;
+import org.apache.log4j.Logger;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.*;
public class AllinpayPaymentQueryRun implements Runnable{
-
+
@Override
public void run() {
this.allinpayPaymentQuerySt();
}
private AllinpayProperties allinpay;
-
+
private String localFilePath;
private Logger logger = Logger.getLogger(this.getClass());
- public AllinpayPaymentQueryRun() {
- }
-
/**
* 分页处理需要进行查询的扣款数据
- * @param
+ * @param
* @return
*/
@SuppressWarnings({ "unchecked"})
@@ -82,16 +68,16 @@ public class AllinpayPaymentQueryRun implements Runnable{
while (size > start) {
logger.info("开始第" + start + "至" + (start + maxCount) + "次循环");
boLOEDs = bomLCP.createQuery("O.STATUS='正在处理' ").setFirstResult(start).setMaxResults(maxCount).getResultList(true);
-
+
if (boLOEDs == null || boLOEDs.size() == 0) {
logger.error("没有需要查询的通联支付信息>>>>>>>>>>:");
break;
}
for (BizObject boLCP : boLOEDs) {
try {
-
+
BizObject object = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.LB_PROJECT_INFO").createQuery("O.id=:id").setParameter("id", boLCP.getAttribute("PROJECT_ID").toString()).getSingleResult(false);
-
+
allinpay = new AllinpayProperties(object.getAttribute("subjectid").toString());
String quertSn= boLCP.getAttribute("REQ_SN").toString();
String num = boLCP.getAttribute("NUM").toString();
@@ -101,7 +87,7 @@ public class AllinpayPaymentQueryRun implements Runnable{
sqlMap.put("NUM", Integer.parseInt(num) + "");
mapXml.put("quertSn", quertSn);
sqlMap = sendMessageByProxy(mapXml, sqlMap);
-
+
if (localFilePath == null) {
LocalDateTime ldt = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyyMMdd");
@@ -248,7 +234,6 @@ public class AllinpayPaymentQueryRun implements Runnable{
/**
* 修改通联扣款数据汇总表
- * @param map
* @return Exception
*/
private void updateMessage(BizObjectManager bomLCP, BizObject boLCP, Map sqlMap) throws Exception {
@@ -260,7 +245,7 @@ public class AllinpayPaymentQueryRun implements Runnable{
boLCP.setAttributeValue(key, sqlMap.get(key));
}
bomLCP.saveObject(boLCP);
-
+
updateOtherMessage(boLCP);
}
public void saveBuckle(BizObject bo,JBOTransaction tx,String sn,String rent) throws JBOException{
@@ -306,11 +291,11 @@ public class AllinpayPaymentQueryRun implements Runnable{
if("处理成功".equals(status)&&boLCP.getAttribute("FINISH_AMOUNT")!=null&&!"".equals(boLCP.getAttribute("FINISH_AMOUNT").toString())){
insertMessage(boLRP,finishAmount,tx);
//租金计划表状态处理
- BizObjectManager bomVRC = JBOFactory.getBizObjectManager("jbo.loan.VI_RENT_COLLECT",tx);
- BizObject vrc = bomVRC.createQuery("id=:id").setParameter("id", plan_id).getSingleResult(false);
- double rentOver = vrc.getAttribute("rent_over").getDouble();
- double penaltyOver = vrc.getAttribute("penalty_over").getDouble();
- if(rentOver>0 || penaltyOver>0){
+ BizObjectManager bomIncome = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME,tx);
+ BizObject boLRI = bomIncome.createQuery("select v.sum(v.ifnull(rent,0)) as v.rent from o where payment_number=:paymentNumber and plan_list=:planList")
+ .setParameter("paymentNumber", boLRP.getAttribute("payment_number").getString())
+ .setParameter("planList", boLRP.getAttribute("plan_list").getString()).getSingleResult(false);
+ if(boLRP.getAttribute("rent").getDouble()>boLRI.getAttribute("rent").getDouble()){
batchStatus = "complete";
collectStatus = "部分收款";
collectMsg = "通联收款";
diff --git a/src_cmb/com/tenwa/cgb/conf/CGBconfProperties.java b/src_cmb/com/tenwa/cgb/conf/CGBconfProperties.java
new file mode 100644
index 000000000..91ba0a429
--- /dev/null
+++ b/src_cmb/com/tenwa/cgb/conf/CGBconfProperties.java
@@ -0,0 +1,32 @@
+package com.tenwa.cgb.conf;
+
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * 广发银企直联配置
+ *
+ * @program: apzl_leasing
+ * @author: yjf
+ * @create: 2021-07-20 08:24
+ **/
+public class CGBconfProperties {
+
+ public static final String CIFMASTER;
+ public static final String ENTUSERID;
+ public static final String PASSWORD;
+ public static final String CGBURL;
+
+ static {
+ Properties prop = new Properties();
+ try {
+ prop.load(CGBconfProperties.class.getResourceAsStream("/cgb.properties"));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ CIFMASTER = prop.getProperty("cifMaster");
+ ENTUSERID = prop.getProperty("entUserId");
+ PASSWORD = prop.getProperty("password");
+ CGBURL = prop.getProperty("cgbUrl");
+ }
+}
diff --git a/src_cmb/com/tenwa/cgb/controller/OperateOfCGBController.java b/src_cmb/com/tenwa/cgb/controller/OperateOfCGBController.java
new file mode 100644
index 000000000..910882247
--- /dev/null
+++ b/src_cmb/com/tenwa/cgb/controller/OperateOfCGBController.java
@@ -0,0 +1,476 @@
+package com.tenwa.cgb.controller;
+
+import com.amarsoft.are.jbo.*;
+import com.amarsoft.awe.util.ASResultSet;
+import com.amarsoft.awe.util.SqlObject;
+import com.amarsoft.awe.util.Transaction;
+import com.amarsoft.dict.als.manage.CodeManager;
+import com.tenwa.cgb.conf.CGBconfProperties;
+import com.tenwa.cgb.util.CGBLogAssistant;
+import com.tenwa.cgb.util.HttpAssistant;
+import com.tenwa.comm.exception.BusinessException;
+import com.tenwa.comm.util.date.DateAssistant;
+import com.tenwa.comm.util.jboutil.DataOperatorUtil;
+import jbo.app.tenwa.calc.LB_ACTUAL_PAYMENT_INFO_TEMP;
+import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
+import jbo.com.tenwa.lease.comm.LC_FUND_INCOME_CALLBACK_DETAIL_TEMP;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @program: apzl_leasing
+ * @author: yjf
+ * @create: 2021-07-19 11:39
+ **/
+public class OperateOfCGBController {
+
+ private static final String XMLDECLARE = "";
+ private static Log log = LogFactory.getLog(OperateOfCGBController.class);
+ private String flowUnid;
+ private String userId;
+ private String orgId;
+ private String contractIds;
+
+ public void setFlowUnid(String flowUnid) {
+ this.flowUnid = flowUnid;
+ }
+
+ public void setContractIds(String contractIds) {
+ this.contractIds = contractIds;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ public void setOrgId(String orgId) {
+ this.orgId = orgId;
+ }
+
+ /**
+ * 批量转账
+ *
+ * @param tx
+ * @return
+ * @throws Exception
+ */
+ public String batchPayOfCGB(JBOTransaction tx) throws Exception {
+ String retResult = "success发起付款成功!";
+ contractIds = contractIds.replaceAll("@", "','");
+ String subjectSql = "SELECT subjectId AS subjectuid FROM lb_contract_info WHERE id IN ('" + contractIds + "') GROUP BY subjectId ";
+ List