实际付款流程付款日期取招商实际支付日期和微信bug

This commit is contained in:
tangfutang 2019-12-25 20:32:13 +08:00
parent 9257607e01
commit 67895c249d
11 changed files with 470 additions and 4 deletions

View File

@ -135,7 +135,9 @@
} }
} }
function cmb_tp_callback(){ function cmb_tp_callback(){
var sParams = "CurUserID=<%=CurUser.getUserID()%>,FLOWUNID=<%=flowunid%>"; var contractId = getItemValueArray(0,"CONTRACT_ID")+"";
var contractIds = contractId.replace(",","@");
var sParams = "CurUserID=<%=CurUser.getUserID()%>,FLOWUNID=<%=flowunid%>,contractIds="+contractIds;
var sReturn = RunJavaMethodTrans("com.tenwa.sdk.controller.CmbToCallbackController", "action",sParams ); var sReturn = RunJavaMethodTrans("com.tenwa.sdk.controller.CmbToCallbackController", "action",sParams );
if(typeof(sReturn)=="undefined" || sReturn=="") return; if(typeof(sReturn)=="undefined" || sReturn=="") return;
if(sReturn.code==1){ if(sReturn.code==1){

View File

@ -3772,6 +3772,8 @@
<attribute name="UPDATEUSERID" label="UPDATEUSERID" type="STRING" length="32"/> <attribute name="UPDATEUSERID" label="UPDATEUSERID" type="STRING" length="32"/>
<attribute name="UPDATEORGID" label="UPDATEORGID" type="STRING" length="32"/> <attribute name="UPDATEORGID" label="UPDATEORGID" type="STRING" length="32"/>
<attribute name="UPDATETIME" label="UPDATETIME" type="STRING" length="32"/> <attribute name="UPDATETIME" label="UPDATETIME" type="STRING" length="32"/>
<attribute name="isPaymentDate" label="是否查询交易日" type="STRING" length="5"/>
<attribute name="PaymentDate" label="支付时间" type="STRING" length="32"/>
</attributes> </attributes>
<manager> <manager>
<managerProperties> <managerProperties>

View File

@ -145,7 +145,7 @@ public class WechatCustomerInfoChange {
} }
}else if("advance".equals(type)){ }else if("advance".equals(type)){
BizObjectManager wasMange = JBOFactory.getBizObjectManager(WECHAT_ADVANCE_SETTLE.CLASS_NAME, tx); BizObjectManager wasMange = JBOFactory.getBizObjectManager(WECHAT_ADVANCE_SETTLE.CLASS_NAME, tx);
BizObject was = wasMange.createQuery(" id=:id and status='处理中' and (flowStatus <> '已提交' or flowStatus is null) ").setParameter("id", id).getSingleResult(false); BizObject was = wasMange.createQuery(" id=:id and (status='处理中' or status='已受理') and (flowStatus <> '已提交' or flowStatus is null) ").setParameter("id", id).getSingleResult(false);
if(was == null ){ if(was == null ){
return "该申请在流程中或者已申请不能进行否决!"; return "该申请在流程中或者已申请不能进行否决!";
}else { }else {

View File

@ -37,6 +37,7 @@ public class CmbToCallbackController extends BaseFlowStartAction {
private String FLOWUNID ; //Á÷³ÌºÅ private String FLOWUNID ; //Á÷³ÌºÅ
private String CallbackStatus; private String CallbackStatus;
private String CurUserID; private String CurUserID;
private String contractIds;
public String getCurUserID() { public String getCurUserID() {
@ -64,6 +65,14 @@ public class CmbToCallbackController extends BaseFlowStartAction {
CallbackStatus = callbackStatus; CallbackStatus = callbackStatus;
} }
public String getContractIds() {
return contractIds;
}
public void setContractIds(String contractIds) {
this.contractIds = contractIds;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public String action(JBOTransaction tx) throws Exception { public String action(JBOTransaction tx) throws Exception {
Map<String,String> map = new HashMap<String,String>(); Map<String,String> map = new HashMap<String,String>();
@ -179,6 +188,7 @@ public class CmbToCallbackController extends BaseFlowStartAction {
//±£´æÏîÄ¿½øÈ±í //±£´æÏîÄ¿½øÈ±í
saveBusinessStatus(FLOWUNID); saveBusinessStatus(FLOWUNID);
} }
SelectActualPaymentDate.execute(contractIds,FLOWUNID, tx);
tx.commit(); tx.commit();
sql(tx); sql(tx);
map.put("code", "0") ; map.put("code", "0") ;

View File

@ -0,0 +1,190 @@
package com.tenwa.sdk.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
import jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT;
import jbo.com.tenwa.lease.comm.LC_FUND_INCOME_CALLBACK_DETAIL_TEMP;
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 com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.Configure;
import com.tenwa.sdk.VO.SDKCheckPayDateBackVO;
import com.tenwa.sdk.VO.SDKCheckPayDateDetail;
import com.tenwa.sdk.VO.SDKInfoVO;
import com.tenwa.sdk.VO.SDKToCheckPayDate;
import com.tenwa.sdk.VO.SDKTsinfx;
import com.tenwa.sdk.utils.HttpRequest;
import com.tenwa.sdk.utils.XMLStream;
import com.thoughtworks.xstream.XStream;
/**
* 1:获取实际付款流程的实际支付时间
* @author tangfutang
*/
public class SelectActualPaymentDate{
public static void execute(String contractIds,String flowUnid , JBOTransaction tx) throws JobExecutionException {
try{
contractIds = contractIds.replaceAll("@", "','");
BizObjectManager lficdtMange = JBOFactory.getBizObjectManager(LC_FUND_INCOME_CALLBACK_DETAIL_TEMP.CLASS_NAME, tx);
List<BizObject> lficdtList = lficdtMange.createQuery(" isPaymentDate is null and flowunid=:flowunid and contract_id in ('"+contractIds+"')").setParameter("flowunid", flowUnid).getResultList(true);
if(lficdtList!=null&&lficdtList.size()>0){
//查询深圳账户信息
BizObjectManager accountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
List<BizObject> accountBoList = accountManager.createQuery("select o.acc_number,o.acc_bank,o.acc_name,o.branch_code,oi.OWN_NAME from o left join jbo.com.tenwa.entity.comm.own.OWN_INFO oi on o.own_id = oi.OWN_NUMBER where o.money_type='01' and o.state_='0010' and o.acc_type='0010' and o.FbSdk='Y' and (o.account_type='out_account' or o.account_type='inAndOut_account') and oi.OWN_NAME='安鹏国际融资租赁(深圳)有限公司'").getResultList(false);
BizObject accountBo = accountBoList.get(0);
/*List<BizObject> accountBoList_tj = accountManager.createQuery("select o.acc_number,o.acc_bank,o.acc_name,o.branch_code,oi.OWN_NAME from o left join jbo.com.tenwa.entity.comm.own.OWN_INFO oi on o.own_id = oi.OWN_NUMBER where o.money_type='01' and o.state_='0010' and o.acc_type='0010' and o.FbSdk='Y' and (o.account_type='out_account' or o.account_type='inAndOut_account') and oi.OWN_NAME='安鹏融资租赁(天津)有限公司'").getResultList(false);
BizObject accountBo_tj = accountBoList_tj.get(0); */
String nowDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
Calendar now = Calendar.getInstance();
now.add(Calendar.DAY_OF_MONTH, -2);
String startDate = new SimpleDateFormat("yyyyMMdd").format(now.getTime());
// String LGNNAM = "安鹏经办";
// String LGNNAM = "银企直连测试用户113";
Configure config = Configure.getInstance();
String LGNNAM = config.getConfigure("LGNNAM");
String FUNNAM = "GetTransInfo";
int DATTYP = 2;
SDKToCheckPayDate toCheckVO = new SDKToCheckPayDate();
SDKInfoVO checkInfo = new SDKInfoVO();
checkInfo.setDATTYP(DATTYP);
checkInfo.setFUNNAM(FUNNAM);
checkInfo.setLGNNAM(LGNNAM);
toCheckVO.setINFO(checkInfo);
List<SDKTsinfx> TsinfxList = new ArrayList<SDKTsinfx>();
SDKTsinfx tsinfx_sz = new SDKTsinfx();
tsinfx_sz.setBBKNBR(accountBo.getAttribute("branch_code").toString());
//tsinfx_sz.setC_BBKNBR(accountBo.getAttribute("acc_name").toString());
tsinfx_sz.setACCNBR(accountBo.getAttribute("acc_number").toString());
tsinfx_sz.setBGNDAT(startDate);
tsinfx_sz.setENDDAT(nowDate);
TsinfxList.add(tsinfx_sz);
/*SDKTsinfx tsinfx_tj = new SDKTsinfx();
tsinfx_tj.setC_BBKNBR(accountBo_tj.getAttribute("acc_name").toString());
tsinfx_tj.setACCNBR(accountBo_tj.getAttribute("acc_number").toString());
tsinfx_tj.setBGNDAT(startDate);
tsinfx_tj.setENDDAT(nowDate);
TsinfxList.add(tsinfx_tj);*/
toCheckVO.setSDKTSINFX(tsinfx_sz);
XStream xStream = new XMLStream();
xStream.alias("SDKTSINFX", SDKTsinfx.class);
xStream.alias("CMBSDKPGK", SDKToCheckPayDate.class);
String xmlStr = xStream.toXML(toCheckVO);
xmlStr = xmlStr.replace("<ntstLinFxList>", "").replace("</ntstLinFxList>", "").replace("<ntstLinFxList/>", "");
HttpRequest request = new HttpRequest();
String data = xmlStr;
SDKCheckPayDateBackVO result = request.sendPayDateRequest(data);
if(result==null) {
System.out.println("请求出错!!!");
}
if(result.getInfo().getSTATUS()==1) {
for (BizObject lficdt : lficdtList) {
List<SDKCheckPayDateDetail> details = result.getDetails();
if(details!=null&&details.size()>0){
for (SDKCheckPayDateDetail detail : details) {
if(lficdt.getAttribute("REQNBR").toString().equals(detail.getREQNBR())){
BizObjectManager lfitManage = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME, tx);
BizObject lfit = lfitManage.createQuery(" flowunid=:flowunid and contract_id=:contractid and pay_type='pay_type_out' ").setParameter("flowunid", lficdt.getAttribute("flowunid").toString()).setParameter("contractid", lficdt.getAttribute("contract_id").toString()).getSingleResult(true);
if(lfit == null){
System.out.println(lficdt.getAttribute("REQNBR").toString()+"该流程实例没有找到对应的付款计划");
break;
}else{
String format = detail.getETYDAT();
String date = format.substring(0, 4)+"/"+format.substring(4,6)+"/"+format.substring(6, 8);
lfit.setAttributeValue("FACT_DATE", date);
lfitManage.saveObject(lfit);
lficdt.setAttributeValue("isPaymentDate", "01");
lficdt.setAttributeValue("PaymentDate",date);
lficdtMange.saveObject(lficdt);
break;
}
}
}
}
}
}
/*TsinfxList.clear();
SDKTsinfx tsinfx_tj = new SDKTsinfx();
tsinfx_tj.setBBKNBR(accountBo_tj.getAttribute("branch_code").toString());
//tsinfx_sz.setC_BBKNBR(accountBo.getAttribute("acc_name").toString());
tsinfx_tj.setACCNBR(accountBo_tj.getAttribute("acc_number").toString());
tsinfx_tj.setBGNDAT(startDate);
tsinfx_tj.setENDDAT(nowDate);
TsinfxList.add(tsinfx_tj);
toCheckVO.setSDKTSINFX(tsinfx_tj);
xStream = new XMLStream();
xStream.alias("SDKTSINFX", SDKTsinfx.class);
xStream.alias("CMBSDKPGK", SDKToCheckPayDate.class);
xmlStr = xStream.toXML(toCheckVO);
xmlStr = xmlStr.replace("<ntstLinFxList>", "").replace("</ntstLinFxList>", "").replace("<ntstLinFxList/>", "");
request = new HttpRequest();
data = xmlStr;
result = request.sendPayDateRequest(data);
if(result==null) {
System.out.println("请求出错!!!");
}
if(result.getInfo().getSTATUS()==1) {
for (BizObject lficdt : lficdtList) {
List<SDKCheckPayDateDetail> details = result.getDetails();
if(details!=null&&details.size()>0){
for (SDKCheckPayDateDetail detail : details) {
if(lficdt.getAttribute("REQNBR").toString().equals(detail.getREQNBR())){
BizObjectManager lfitManage = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME, tx);
BizObject lfit = lfitManage.createQuery(" flowunid=:flowunid AND contract_id=:contractid and pay_type='pay_type_out' ").setParameter("flowunid", lficdt.getAttribute("flowunid").toString()).setParameter("contractid", lficdt.getAttribute("contract_id").toString()).getSingleResult(true);
if(lfit == null){
System.out.println(lficdt.getAttribute("REQNBR").toString()+"该流程实例没有找到对应的付款计划");
break;
}else{
String format = detail.getETYDAT();
String date = format.substring(0, 4)+"/"+format.substring(4,6)+"/"+format.substring(6, 8);
lfit.setAttributeValue("FACT_DATE", date);
lfitManage.saveObject(lfit);
lficdt.setAttributeValue("isPaymentDate", "01");
lficdt.setAttributeValue("PaymentDate", date);
lficdtMange.saveObject(lficdt);
break;
}
}
}
}
}
}*/
}
}catch(Exception e){
e.printStackTrace();
}
}
}

View File

@ -368,6 +368,35 @@ public class DebitCardAction {
return "success"; return "success";
} }
//合同变更校验是否已经签约
public String IsSignStatus(JBOTransaction tx) throws Exception{
BizObjectManager cahManage = JBOFactory.getFactory().getManager(CUSTOMER_ACCOUNT_HIS.CLASS_NAME);
List<BizObject> cahs = cahManage.createQuery(" account=:account and acc_number=:acc_number and bank_name=:bank_name and mobile=:mobile ")
.setParameter("account", account).setParameter("acc_number", acc_number).setParameter("bank_name", bank_name).setParameter("mobile", mobile).getResultList(false);
for (BizObject cah : cahs) {
if("Y".equals(cah.getAttribute("sign_status").toString())){
return "Y";
}
}
return "N";
}
//校验是否已经生成直接扣款委托书
public String isEntrustFile(JBOTransaction tx){
try {
BizObjectManager ldrManage = JBOFactory.getBizObjectManager(LB_DOCRELATIVE.CLASS_NAME, tx);
BizObject ldr = ldrManage.createQuery("OBJECTTYPE='ChangeCar' and FLOW_UNID=:flowunid and CONTRACT_ID=:contractid ").setParameter("flowunid",FlowUnid).setParameter("contractid",contractid).getSingleResult(false);
if(ldr == null){
return "success";
}else{
return "直接扣款委托书已生成,无法重新保存数据!";
}
} catch (JBOException e) {
e.printStackTrace();
}
return "获取状态失败!";
}
public String getMobile() { public String getMobile() {
return mobile; return mobile;
} }

View File

@ -101,4 +101,12 @@ public interface LC_FUND_INCOME_CALLBACK_DETAIL_TEMP{
* UPDATETIME STRING(32)<br> * UPDATETIME STRING(32)<br>
*/ */
public static final String UPDATETIME = "UPDATETIME"; public static final String UPDATETIME = "UPDATETIME";
/**
* 是否查询交易日 STRING(5)<br>
*/
public static final String isPaymentDate = "isPaymentDate";
/**
* 支付时间 STRING(32)<br>
*/
public static final String PaymentDate = "PaymentDate";
} }

View File

@ -269,4 +269,22 @@ Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescr
Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','wx','΢ÐÅ','','0020','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/06 10:41:42','SYS_Designer','2019/12/12 19:04:25','',''); Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','wx','΢ÐÅ','','0020','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/06 10:41:42','SYS_Designer','2019/12/12 19:04:25','','');
Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','wysk','ÍøÒø»Ø¿î','','0030','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/16 10:00:51','SYS_Designer','2019/12/16 11:56:51','',''); Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','wysk','ÍøÒø»Ø¿î','','0030','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/16 10:00:51','SYS_Designer','2019/12/16 11:56:51','','');
-- 取招商银行的实际付日期
ALTER TABLE lc_fund_income_callback_detail_temp ADD COLUMN isPaymentDate VARCHAR(5) NULL COMMENT '是否查询交易日(01已查询)' AFTER contract_i, ADD COLUMN PaymentDate VARCHAR(32) NULL COMMENT '支付时间' AFTER isPaymentDate;
-- 将历史数据改为已查询
update lc_fund_income_callback_detail_temp set isPaymentDate='01';
Insert Into SCENARIO_MODEL (scenarioid,modelid,sortno,modelname,modeldescribe,modeltype,subtypeno,runcondition,status,nopassdeal,passdeal,passmessage,nopassmessage,executescript,remark,inputuser,inputorg,inputtime,updateuser,updatetime,groupid,modelkind,bizviewer) Values ('实际付款流程(汽车)','0030','0030','付款日期','','20','','','1','10',null,'付款日期已填写','付款日期未填写','SELECT CASE WHEN COUNT(id)>0 THEN ''false'' ELSE ''true'' END AS ''date'' FROM LC_FUND_INCOME_TEMP WHERE FlowUnid=''#{ObjectNo}'' AND (FACT_DATE IS NULL OR FACT_DATE='''')','',null,null,null,null,null,null,null,null);
Insert Into SCENARIO_RELATIVE (scenarioid,groupid,modelid) Values ('实际付款流程(汽车)','0030','0030');
Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('MissionName','com.tenwa.lease.app.quartzmession.SelectActualPaymentDate','自动获取实际支付日期','','0550','1','自动获取实际支付日期','','','','','','','','','','','SYS_Designer',null,'2019/12/18 15:50:19','SYS_Designer','2019/12/18 15:50:19','','');

View File

@ -235,7 +235,7 @@ public class CustomerGroupCompanyController {
List<Map<String, String>> results = conn.executeQuery(sql, this.contractId); List<Map<String, String>> results = conn.executeQuery(sql, this.contractId);
String istotal = results.get(0).get("total"); String istotal = results.get(0).get("total");
String channeltype = results.get(0).get("channeltype"); String channeltype = results.get(0).get("channeltype");
if("01".equals(channeltype) && new Double(istotal) <= 0){ if("01".equals(channeltype) && new Double(istotal) < 0){
return "经销商额度不足!"; return "经销商额度不足!";
} }
return "true"; return "true";

View File

@ -483,7 +483,9 @@ public String getContactId(JBOTransaction tx) throws SQLException, Exception{
if("0030".equals(payType)){ if("0030".equals(payType)){
otherProperty.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod13"); otherProperty.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod13");
} }
otherProperty.put("FACT_DATE", StringFunction.getToday()); if("0010"!=payType){
otherProperty.put("FACT_DATE", StringFunction.getToday());
}
DataOperatorUtil.copySingleJBO(LC_FUND_INCOME.CLASS_NAME, fromCondition,LC_FUND_INCOME_TEMP.CLASS_NAME, null, otherProperty,tx); DataOperatorUtil.copySingleJBO(LC_FUND_INCOME.CLASS_NAME, fromCondition,LC_FUND_INCOME_TEMP.CLASS_NAME, null, otherProperty,tx);
} }
} }

View File

@ -0,0 +1,205 @@
package com.tenwa.lease.app.quartzmession;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP;
import jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT;
import jbo.com.tenwa.lease.comm.LC_FUND_INCOME_CALLBACK_DETAIL_TEMP;
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 com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.Configure;
import com.tenwa.sdk.VO.SDKCheckPayDateBackVO;
import com.tenwa.sdk.VO.SDKCheckPayDateDetail;
import com.tenwa.sdk.VO.SDKInfoVO;
import com.tenwa.sdk.VO.SDKToCheckPayDate;
import com.tenwa.sdk.VO.SDKTsinfx;
import com.tenwa.sdk.utils.HttpRequest;
import com.tenwa.sdk.utils.XMLStream;
import com.thoughtworks.xstream.XStream;
/**
* 1:获取实际付款流程的实际支付时间
* @author tangfutang
*/
public class SelectActualPaymentDate implements Job{
public void execute(JobExecutionContext arg0) throws JobExecutionException {
JBOTransaction tx=null;
try{
tx = JBOFactory.createJBOTransaction();
BizObjectManager lficdtMange = JBOFactory.getBizObjectManager(LC_FUND_INCOME_CALLBACK_DETAIL_TEMP.CLASS_NAME, tx);
List<BizObject> lficdtList = lficdtMange.createQuery(" isPaymentDate is null ").getResultList(true);
if(lficdtList!=null&&lficdtList.size()>0){
//查询深圳账户信息
BizObjectManager accountManager = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME);
List<BizObject> accountBoList = accountManager.createQuery("select o.acc_number,o.acc_bank,o.acc_name,o.branch_code,oi.OWN_NAME from o left join jbo.com.tenwa.entity.comm.own.OWN_INFO oi on o.own_id = oi.OWN_NUMBER where o.money_type='01' and o.state_='0010' and o.acc_type='0010' and o.FbSdk='Y' and (o.account_type='out_account' or o.account_type='inAndOut_account') and oi.OWN_NAME='安鹏国际融资租赁(深圳)有限公司'").getResultList(false);
BizObject accountBo = accountBoList.get(0);
List<BizObject> accountBoList_tj = accountManager.createQuery("select o.acc_number,o.acc_bank,o.acc_name,o.branch_code,oi.OWN_NAME from o left join jbo.com.tenwa.entity.comm.own.OWN_INFO oi on o.own_id = oi.OWN_NUMBER where o.money_type='01' and o.state_='0010' and o.acc_type='0010' and o.FbSdk='Y' and (o.account_type='out_account' or o.account_type='inAndOut_account') and oi.OWN_NAME='安鹏融资租赁(天津)有限公司'").getResultList(false);
BizObject accountBo_tj = accountBoList_tj.get(0);
String nowDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
Calendar now = Calendar.getInstance();
now.add(Calendar.DAY_OF_MONTH, -2);
String startDate = new SimpleDateFormat("yyyyMMdd").format(now.getTime());
// String LGNNAM = "安鹏经办";
// String LGNNAM = "银企直连测试用户113";
Configure config = Configure.getInstance();
String LGNNAM = config.getConfigure("LGNNAM");
String FUNNAM = "GetTransInfo";
int DATTYP = 2;
SDKToCheckPayDate toCheckVO = new SDKToCheckPayDate();
SDKInfoVO checkInfo = new SDKInfoVO();
checkInfo.setDATTYP(DATTYP);
checkInfo.setFUNNAM(FUNNAM);
checkInfo.setLGNNAM(LGNNAM);
toCheckVO.setINFO(checkInfo);
List<SDKTsinfx> TsinfxList = new ArrayList<SDKTsinfx>();
SDKTsinfx tsinfx_sz = new SDKTsinfx();
tsinfx_sz.setBBKNBR(accountBo.getAttribute("branch_code").toString());
//tsinfx_sz.setC_BBKNBR(accountBo.getAttribute("acc_name").toString());
tsinfx_sz.setACCNBR(accountBo.getAttribute("acc_number").toString());
tsinfx_sz.setBGNDAT(startDate);
tsinfx_sz.setENDDAT(nowDate);
TsinfxList.add(tsinfx_sz);
/*SDKTsinfx tsinfx_tj = new SDKTsinfx();
tsinfx_tj.setC_BBKNBR(accountBo_tj.getAttribute("acc_name").toString());
tsinfx_tj.setACCNBR(accountBo_tj.getAttribute("acc_number").toString());
tsinfx_tj.setBGNDAT(startDate);
tsinfx_tj.setENDDAT(nowDate);
TsinfxList.add(tsinfx_tj);*/
toCheckVO.setSDKTSINFX(tsinfx_sz);
XStream xStream = new XMLStream();
xStream.alias("SDKTSINFX", SDKTsinfx.class);
xStream.alias("CMBSDKPGK", SDKToCheckPayDate.class);
String xmlStr = xStream.toXML(toCheckVO);
xmlStr = xmlStr.replace("<ntstLinFxList>", "").replace("</ntstLinFxList>", "").replace("<ntstLinFxList/>", "");
HttpRequest request = new HttpRequest();
String data = xmlStr;
SDKCheckPayDateBackVO result = request.sendPayDateRequest(data);
if(result==null) {
System.out.println("请求出错!!!");
}
if(result.getInfo().getSTATUS()==1) {
for (BizObject lficdt : lficdtList) {
List<SDKCheckPayDateDetail> details = result.getDetails();
if(details!=null&&details.size()>0){
for (SDKCheckPayDateDetail detail : details) {
if(lficdt.getAttribute("REQNBR").toString().equals(detail.getREQNBR())){
BizObjectManager lfitManage = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME, tx);
BizObject lfit = lfitManage.createQuery(" flowunid=:flowunid and contract_id=:contractid and pay_type='pay_type_out' ").setParameter("flowunid", lficdt.getAttribute("flowunid").toString()).setParameter("contractid", lficdt.getAttribute("contract_id").toString()).getSingleResult(true);
if(lfit == null){
System.out.println(lficdt.getAttribute("REQNBR").toString()+"该流程实例没有找到对应的付款计划");
break;
}else{
String format = detail.getETYDAT();
String date = format.substring(0, 4)+"/"+format.substring(4,6)+"/"+format.substring(6, 8);
lfit.setAttributeValue("FACT_DATE", date);
lfitManage.saveObject(lfit);
lficdt.setAttributeValue("isPaymentDate", "01");
lficdt.setAttributeValue("PaymentDate",date);
lficdtMange.saveObject(lficdt);
break;
}
}
}
}
}
}
TsinfxList.clear();
SDKTsinfx tsinfx_tj = new SDKTsinfx();
tsinfx_tj.setBBKNBR(accountBo_tj.getAttribute("branch_code").toString());
//tsinfx_sz.setC_BBKNBR(accountBo.getAttribute("acc_name").toString());
tsinfx_tj.setACCNBR(accountBo_tj.getAttribute("acc_number").toString());
tsinfx_tj.setBGNDAT(startDate);
tsinfx_tj.setENDDAT(nowDate);
TsinfxList.add(tsinfx_tj);
toCheckVO.setSDKTSINFX(tsinfx_tj);
xStream = new XMLStream();
xStream.alias("SDKTSINFX", SDKTsinfx.class);
xStream.alias("CMBSDKPGK", SDKToCheckPayDate.class);
xmlStr = xStream.toXML(toCheckVO);
xmlStr = xmlStr.replace("<ntstLinFxList>", "").replace("</ntstLinFxList>", "").replace("<ntstLinFxList/>", "");
request = new HttpRequest();
data = xmlStr;
result = request.sendPayDateRequest(data);
if(result==null) {
System.out.println("请求出错!!!");
}
if(result.getInfo().getSTATUS()==1) {
for (BizObject lficdt : lficdtList) {
List<SDKCheckPayDateDetail> details = result.getDetails();
if(details!=null&&details.size()>0){
for (SDKCheckPayDateDetail detail : details) {
if(lficdt.getAttribute("REQNBR").toString().equals(detail.getREQNBR())){
BizObjectManager lfitManage = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME, tx);
BizObject lfit = lfitManage.createQuery(" flowunid=:flowunid AND contract_id=:contractid and pay_type='pay_type_out' ").setParameter("flowunid", lficdt.getAttribute("flowunid").toString()).setParameter("contractid", lficdt.getAttribute("contract_id").toString()).getSingleResult(true);
if(lfit == null){
System.out.println(lficdt.getAttribute("REQNBR").toString()+"该流程实例没有找到对应的付款计划");
break;
}else{
String format = detail.getETYDAT();
String date = format.substring(0, 4)+"/"+format.substring(4,6)+"/"+format.substring(6, 8);
lfit.setAttributeValue("FACT_DATE", date);
lfitManage.saveObject(lfit);
lficdt.setAttributeValue("isPaymentDate", "01");
lficdt.setAttributeValue("PaymentDate", date);
lficdtMange.saveObject(lficdt);
break;
}
}
}
}
}
}
}
}catch(Exception e){
try {
tx.rollback();
} catch (JBOException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
if(tx!=null) {
try {
tx.commit();
} catch (JBOException e) {
e.printStackTrace();
}
}
}
}
}