代偿不卡扣初步整理

This commit is contained in:
zhangbb 2020-02-11 10:34:19 +08:00
parent 4284d9281c
commit 077d0d263c
4 changed files with 136 additions and 136 deletions

View File

@ -12,7 +12,7 @@
// doTemp.setJboWhere(" O.AUDIT_STATE = 'N'");
//默认预查询
//只有计划日期未收款的都可以收款
doTemp.setJboWhereWhenNoFilter(" and O.PLAN_DATE <= '"+plan_date+"' and O.COLLECT_STATUS in ('未收款','部分收款','代偿')");
doTemp.setJboWhereWhenNoFilter(" and O.PLAN_DATE <= '"+plan_date+"' and O.COLLECT_STATUS in ('未收款','部分收款')");
// doTemp.setJboWhereWhenNoFilter(" and O.COLLECT_STATUS in ('未收款','部分收款') ");
// doTemp.setJboWhere("O.PLAN_DATE <= '"+plan_date+"'");

View File

@ -522,7 +522,7 @@ public class CollectAuditInfoCache {
return map;
}
/**
* 手动回笼租金
* 手动回笼租金(经销商代偿)
* @param tx
* @param bc
* @param bo
@ -676,7 +676,7 @@ public class CollectAuditInfoCache {
//handcraftsingleCollectMoeny方法的最后一个参数原为hire_list现改为客户输入核销罚息参数周亚辉
//代偿不再往租金实收表插入数据
// Map<String, String> map = handcraftsingleCollectMoenyDistrbutor(tx,bc,bom,rent,penaltyArray[c]);
Map<String, String> map = handcraftsingleCollectMoenyDistrbutor(tx,bc,bom,t_rent,penaltyArray[c]);
i++;
//更新收付状态
bc.createQuery("update O set O.COLLECT_STATUS=:COLLECT_STATUS ,O.COLLECT_MSG=:COLLECT_MSG,O.PENALTY=:PENALTY where O.id=:id")

View File

@ -1,131 +1,131 @@
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 org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
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.collectaudit.cache.CollectAuditInfoCacheTj;
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> bosSz = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN", tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款','代偿') and O.SUBJECTID='aa740e4111c111eaaa0000163e0e11e6' and O.PLAN_DATE <= '" + plan_date + "' and ( O.BATCH_STATUS<>'process' or O.BATCH_STATUS IS NULL ) and (O.distributor_id not in (select dw.distributor_id from jbo.app.tenwa.customer.DEDUCTIONS_WAY dw where dw.Whether_to_enable='Y')) ").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(bosSz!=null&&bosSz.size()>0){
a:for(BizObject bo : bosSz){
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);
}
//天津自动扣款
CollectAuditInfoCacheTj caTj = new CollectAuditInfoCacheTj();
List<BizObject> bosTj = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN", tx).createQuery(" O.COLLECT_STATUS IN ('未收款', '部分收款','代偿') and O.SUBJECTID='d989246c11c111eaaa0000163e0e11e6' and O.PLAN_DATE <= '" + plan_date + "' and ( O.BATCH_STATUS<>'process' or O.BATCH_STATUS IS NULL ) and (O.distributor_id not in (select dw.distributor_id from jbo.app.tenwa.customer.DEDUCTIONS_WAY dw where dw.Whether_to_enable='Y')) ").getResultList(true);
StringBuffer idsTj = new StringBuffer();
if(bosTj!=null && bosTj.size()>0){
a:for(BizObject bo : bosTj){
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;
}
}
}
idsTj.append(pid+"@");
}
System.out.println("本次扣款的plan_id:"+idsTj.toString());
caTj.setId(idsTj.toString().substring(0, idsTj.toString().length()-1));
Configure CurConfig = Configure.getInstance();
caTj.setFileSavePath(CurConfig.getConfigure("InterfaceFileSavePath"));
caTj.setInputuserid(jboName.getUserId(arg0, tx));
caTj.setInputorgid("system");
caTj.batchCollectManage(tx);
caTj.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 org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
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.collectaudit.cache.CollectAuditInfoCacheTj;
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> bosSz = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN", tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款') and O.SUBJECTID='aa740e4111c111eaaa0000163e0e11e6' and O.PLAN_DATE <= '" + plan_date + "' and ( O.BATCH_STATUS<>'process' or O.BATCH_STATUS IS NULL ) and (O.distributor_id not in (select dw.distributor_id from jbo.app.tenwa.customer.DEDUCTIONS_WAY dw where dw.Whether_to_enable='Y')) ").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(bosSz!=null&&bosSz.size()>0){
a:for(BizObject bo : bosSz){
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);
}
//天津自动扣款
CollectAuditInfoCacheTj caTj = new CollectAuditInfoCacheTj();
List<BizObject> bosTj = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN", tx).createQuery(" O.COLLECT_STATUS IN ('未收款', '部分收款') and O.SUBJECTID='d989246c11c111eaaa0000163e0e11e6' and O.PLAN_DATE <= '" + plan_date + "' and ( O.BATCH_STATUS<>'process' or O.BATCH_STATUS IS NULL ) and (O.distributor_id not in (select dw.distributor_id from jbo.app.tenwa.customer.DEDUCTIONS_WAY dw where dw.Whether_to_enable='Y')) ").getResultList(true);
StringBuffer idsTj = new StringBuffer();
if(bosTj!=null && bosTj.size()>0){
a:for(BizObject bo : bosTj){
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;
}
}
}
idsTj.append(pid+"@");
}
System.out.println("本次扣款的plan_id:"+idsTj.toString());
caTj.setId(idsTj.toString().substring(0, idsTj.toString().length()-1));
Configure CurConfig = Configure.getInstance();
caTj.setFileSavePath(CurConfig.getConfigure("InterfaceFileSavePath"));
caTj.setInputuserid(jboName.getUserId(arg0, tx));
caTj.setInputorgid("system");
caTj.batchCollectManage(tx);
caTj.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

@ -29,7 +29,7 @@ public class AutoRefresh implements Job{
String curUserId = userId == null? "system" : userId.toString();
try {
tx = JBOFactory.createJBOTransaction();
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款','代偿') and O.SUBJECTID='aa740e4111c111eaaa0000163e0e11e6' and O.BATCH_STATUS='process' and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
List<BizObject> bos = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款') and O.SUBJECTID='aa740e4111c111eaaa0000163e0e11e6' and O.BATCH_STATUS='process' and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
StringBuffer ids = new StringBuffer();
if(bos!=null && bos.size()>0){
for (BizObject bo : bos) {
@ -44,7 +44,7 @@ public class AutoRefresh implements Job{
}
//天津自动回盘
CollectAuditInfoCacheTj caTj = new CollectAuditInfoCacheTj();
List<BizObject> bosTj = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款','代偿') and O.SUBJECTID='d989246c11c111eaaa0000163e0e11e6' and O.BATCH_STATUS='process' and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
List<BizObject> bosTj = JBOFactory.getBizObjectManager(VI_LC_AUDIT_RENT_PLAN.CLASS_NAME, tx).createQuery("O.COLLECT_STATUS IN ('未收款', '部分收款') and O.SUBJECTID='d989246c11c111eaaa0000163e0e11e6' and O.BATCH_STATUS='process' and O.PLAN_DATE <= '"+plan_date+"'").getResultList(true);
StringBuffer idsTj = new StringBuffer();
if(bosTj!=null && bosTj.size()>0){
for (BizObject bo : bosTj) {