汽车付款申请通过后可以退回给经销商并可以再次提交。添加微信付款付款超时删除占用表和在微信支付中的不经销卡扣

This commit is contained in:
tangfutang 2019-11-30 19:34:51 +08:00
parent 38a6578528
commit c2a01c5329
4 changed files with 212 additions and 102 deletions

View File

@ -0,0 +1,43 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2017-12-28
Content:
History Log:
*/
String ishistory = CurPage.getAttribute("IsHistory");
ASObjectModel doTemp = new ASObjectModel("VIActualFundPlan");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
/*if(!ishistory.equals("true")&&"0010".equals(phaseNo)){
dwTemp.MultiSelect = true; //多选
}*/
dwTemp.ShowSummary="1"; //汇总
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(pageSize == null ? 30 : Integer.parseInt(pageSize));
dwTemp.genHTMLObjectWindow("");
String[][] sButtons = new String[][]{
{"true","All","Button","退回经销商","退回经销商","paymentReturn()","","","","btn_icon_add",""}
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function paymentReturn(){
var contractid = getItemValue(0,getRow(),"ID");
if(contractid.length == 0){
AsDebug.showMessage("提示","请选择一行数据","","",true);
return;
}
var result = RunJavaMethodTrans("com.tenwa.flow.fund.fundcollection.FundIncomeMethod","paymentReturn","CONTRACT_ID="+contractid);
if("success" == result){
AsDebug.showMessage("提示","操作成功!","","",true);
reloadSelf();
}else{
AsDebug.showMessage("提示","操作失败","","",true);
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -470,4 +470,18 @@ public class FundIncomeMethod {
return "1";
}
public String paymentReturn(JBOTransaction tx){
try {
Transaction sqlTran = Transaction.createTransaction(tx);
sqlTran.executeSQL(new SqlObject("delete from lc_fund_income where CONTRACT_ID='"+CONTRACT_ID+"'"));
sqlTran.commit();
return "success";
} catch (Exception e) {
e.printStackTrace();
return "ϵͳ´íÎó£¡";
}
}
}

View File

@ -1,102 +1,108 @@
package com.tenwa.lease.app.quartzmession;
import java.util.ArrayList;
import java.util.List;
import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
import jbo.com.tenwa.lease.comm.LC_OCCUPY_RENT_LIST;
import jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN;
import jbo.sys.FLOW_OBJECT;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.quartz.Trigger;
import com.amarsoft.are.jbo.BizObject;
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.base.util.QuartzUtil;
import com.tenwa.collectaudit.cache.CollectAuditInfoCache;
import com.tenwa.comm.util.date.DateAssistant;
public class AutoBuckle implements Job {
private JobInitUserName jboName;
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
CollectAuditInfoCache ca = new CollectAuditInfoCache();
JBOTransaction tx = null;
String plan_date = DateAssistant.getToday();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
// 获取传递过来的参数
try {
//
tx = JBOFactory.createJBOTransaction();
//and (O.rent<>'' or O.rent<>'0' or O.rent<>'0.0')
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款','代偿') and O.PLAN_DATE <= '"+plan_date+"' and ( O.BATCH_STATUS<>'process' or o.BATCH_STATUS IS NULL ) ").getResultList(true);
List<BizObject> bol = JBOFactory.createBizObjectQuery(LC_OCCUPY_RENT_LIST.CLASS_NAME,"FLOW_NAME='网银收款'").getResultList(false);
//获取租金占用表里的数据有哪些是网银收款占用的
List<String> planIDs = new ArrayList<String>();
if(bol.size()>0){
for(int i=0;i<bol.size();i++){
String flowunid = bol.get(i).getAttribute("FLOWUNID").toString();
List<BizObject> bof = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid", flowunid).getResultList(false);
if(bof.size()>0){
for(int j=0;j<bof.size();j++){
String planID = bof.get(j).getAttribute("PLAN_ID").toString();
planIDs.add(planID);
}
}
}
}
StringBuffer ids = new StringBuffer();
if(bos.size()>0){
a:for(BizObject bo : bos){
String pid = bo.getAttribute("id").getString();
if(planIDs.size()>0){
for(int i=0;i<planIDs.size();i++){
if(pid.equals(planIDs.get(i))){
continue a;
}
}
}
ids.append(pid+"@");
}
System.out.println("本次扣款的plan_id:"+ids.toString());
ca.setId(ids.toString().substring(0, ids.toString().length()-1));
Configure CurConfig = Configure.getInstance();
ca.setFileSavePath(CurConfig.getConfigure("InterfaceFileSavePath"));
ca.setInputuserid(jboName.getUserId(arg0, tx));
ca.setInputorgid("system");
ca.batchCollectManage(tx);
ca.queryBatchCollectStatus(tx);
}
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "success", "成功", curUserId);
} catch (Exception e) {
e.printStackTrace();
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "error", "失败", curUserId);
if (tx != null) {
try {
tx.rollback();
tx=null;
} catch (JBOException e1) {
e1.printStackTrace();
}
}
}finally{
try {
if(tx !=null){
tx.commit();
}
} catch (JBOException e) {
e.printStackTrace();
}
}
}
}
package com.tenwa.lease.app.quartzmession;
import java.util.ArrayList;
import java.util.List;
import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP;
import jbo.com.tenwa.lease.comm.LC_OCCUPY_RENT_LIST;
import jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN;
import jbo.sys.FLOW_OBJECT;
import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.quartz.Trigger;
import com.amarsoft.are.jbo.BizObject;
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.base.util.QuartzUtil;
import com.tenwa.collectaudit.cache.CollectAuditInfoCache;
import com.tenwa.comm.util.date.DateAssistant;
public class AutoBuckle implements Job {
private JobInitUserName jboName;
@Override
public void execute(JobExecutionContext arg0) throws JobExecutionException {
CollectAuditInfoCache ca = new CollectAuditInfoCache();
JBOTransaction tx = null;
String plan_date = DateAssistant.getToday();
Object userId = arg0.getTrigger().getJobDataMap().get("CurUserId");
String curUserId = userId == null? "system" : userId.toString();
// 获取传递过来的参数
try {
//
tx = JBOFactory.createJBOTransaction();
//and (O.rent<>'' or O.rent<>'0' or O.rent<>'0.0')
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款','代偿') and O.PLAN_DATE <= '"+plan_date+"' and ( O.BATCH_STATUS<>'process' or o.BATCH_STATUS IS NULL ) ").getResultList(true);
List<BizObject> bol = JBOFactory.createBizObjectQuery(LC_OCCUPY_RENT_LIST.CLASS_NAME,"FLOW_NAME in ('网银收款','微信银联收款','微信支付收款')").getResultList(false);
//获取租金占用表里的数据有哪些是网银收款占用的
List<String> planIDs = new ArrayList<String>();
if(bol.size()>0){
for(int i=0;i<bol.size();i++){
String flowName = bol.get(i).getAttribute("FLOW_NAME").toString();
if("网银收款".equals(flowName)){
String flowunid = bol.get(i).getAttribute("FLOWUNID").toString();
List<BizObject> bof = JBOFactory.createBizObjectQuery(LC_RENT_INCOME_TEMP.CLASS_NAME,"FLOWUNID=:flowunid").setParameter("flowunid", flowunid).getResultList(false);
if(bof.size()>0){
for(int j=0;j<bof.size();j++){
String planID = bof.get(j).getAttribute("PLAN_ID").toString();
planIDs.add(planID);
}
}
}else if ("微信银联收款".equals(flowName) || "微信支付收款".equals(flowName)){
planIDs.add(bol.get(i).getAttribute("PLAN_ID").toString());
}
}
}
StringBuffer ids = new StringBuffer();
if(bos.size()>0){
a:for(BizObject bo : bos){
String pid = bo.getAttribute("id").getString();
if(planIDs.size()>0){
for(int i=0;i<planIDs.size();i++){
if(pid.equals(planIDs.get(i))){
continue a;
}
}
}
ids.append(pid+"@");
}
System.out.println("本次扣款的plan_id:"+ids.toString());
ca.setId(ids.toString().substring(0, ids.toString().length()-1));
Configure CurConfig = Configure.getInstance();
ca.setFileSavePath(CurConfig.getConfigure("InterfaceFileSavePath"));
ca.setInputuserid(jboName.getUserId(arg0, tx));
ca.setInputorgid("system");
ca.batchCollectManage(tx);
ca.queryBatchCollectStatus(tx);
}
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "success", "成功", curUserId);
} catch (Exception e) {
e.printStackTrace();
QuartzUtil.insertLog(plan_date,"com.tenwa.lease.app.quartzmession.AutoBuckle", "error", "失败", curUserId);
if (tx != null) {
try {
tx.rollback();
tx=null;
} catch (JBOException e1) {
e1.printStackTrace();
}
}
}finally{
try {
if(tx !=null){
tx.commit();
}
} catch (JBOException e) {
e.printStackTrace();
}
}
}
}

View File

@ -0,0 +1,47 @@
package com.tenwa.lease.app.quartzmession;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import com.amarsoft.are.jbo.JBOException;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.dict.als.cache.CacheLoaderFactory;
/**
* 1:删除微信发起付款占用表
* @author tangfutang
*/
public class DeleteWechatRentPay implements Job{
public void execute(JobExecutionContext arg0) throws JobExecutionException {
Transaction Sqlca=null;
try{
Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource());
String deleteSql = "DELETE FROM LC_OCCUPY_RENT_LIST WHERE inputtime <= DATE_ADD(NOW(),INTERVAL -30 MINUTE) AND (flow_name='微信银联收款' OR flow_name='微信支付收款')";
SqlObject asql = new SqlObject(deleteSql);
Sqlca.executeSQL(asql);
Sqlca.commit();
}catch(Exception e){
try {
Sqlca.rollback();
} catch (JBOException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally {
if(Sqlca!=null) {
try {
Sqlca.commit();
Sqlca.disConnect();
} catch (JBOException e) {
e.printStackTrace();
}
}
}
}
}