1.扣款的内容从深圳的复制到天津的
This commit is contained in:
parent
47298ef2bf
commit
cc89661b83
@ -22,7 +22,7 @@
|
||||
dwTemp.genHTMLObjectWindow("");
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{flag,"All","Button","±£´æ","±£´æÅú´ÎºÅ","as_save(0)","","","","",""},
|
||||
{flag,"All","Button","±£´æ","±£´æÅú´ÎºÅ","save(0)","","","","",""},
|
||||
{flag,"All","Button","批量修改","批量修改","batch_edit()","","","","",""},
|
||||
{"true","All","Button","批量上传","批量上传","upload('')","","","","",""},
|
||||
{"true","All","Button","导出明细","导出明细","createFundIncomeExcel()","","","","",""},
|
||||
@ -31,6 +31,9 @@
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
|
||||
<script type="text/javascript">
|
||||
function save(){
|
||||
as_save("myiframe0");
|
||||
}
|
||||
function showPDF(id,name){
|
||||
var sUrl="/Tenwa/Comm/DocList/showPDF.jsp";
|
||||
var param="attrid="+id;
|
||||
|
||||
@ -140,7 +140,7 @@
|
||||
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCache", "batchCollectManageManual", parm);
|
||||
alert(res);
|
||||
}else if("d989246c11c111eaaa0000163e0e11e6"==oneSubjectId){
|
||||
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCacheTj", "batchCollectManage", parm);
|
||||
var res = RunJavaMethodTrans("com.tenwa.collectaudit.cache.CollectAuditInfoCacheTj", "batchCollectManageManual", parm);
|
||||
alert(res);
|
||||
}else{
|
||||
alert("未查询到对应的主体方法!");
|
||||
|
||||
@ -10,6 +10,13 @@ import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.quartz.impl.StdSchedulerFactory;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.amarsoft.app.awe.config.InitCollectConfigTj;
|
||||
import com.amarsoft.app.util.StringUtil;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
@ -25,7 +32,9 @@ import com.gnete.security.crypt.Crypt;
|
||||
import com.gnete.security.crypt.CryptException;
|
||||
import com.tenwa.comm.util.date.DateAssistant;
|
||||
import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
import com.tenwa.quartz.DateUtil;
|
||||
|
||||
import jbo.app.tenwa.calc.LC_COLLECT_MANUAL_INFO;
|
||||
import jbo.app.tenwa.calc.LC_RENT_PLAN;
|
||||
import jbo.app.tenwa.customer.CUSTOMER_ACCOUNT;
|
||||
import jbo.app.tenwa.customer.DISTRIBUTOR_INFO;
|
||||
@ -46,6 +55,17 @@ public class CollectAuditInfoCacheTj {
|
||||
private String clearDate;
|
||||
private String distributor_id;
|
||||
private String penaltys;
|
||||
private String collectStyle;
|
||||
private String datas;
|
||||
private String jobName;
|
||||
|
||||
public String getDatas() {
|
||||
return datas;
|
||||
}
|
||||
|
||||
public void setDatas(String datas) {
|
||||
this.datas = datas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 经销商保证金代偿后红冲
|
||||
@ -54,29 +74,42 @@ public class CollectAuditInfoCacheTj {
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public void writeBackDistributor(String RENT_PLAN_ID,Transaction Sqlca) throws JBOException{
|
||||
BizObjectManager bmDCI = JBOFactory.getFactory().getManager(D_DEPOSITCHARGE_INFO.CLASS_NAME);
|
||||
BizObjectManager bmDRI = JBOFactory.getFactory().getManager(D_DEPOSITRETURN_INFO.CLASS_NAME);
|
||||
BizObjectManager bmDI = JBOFactory.getFactory().getManager(DISTRIBUTOR_INFO.CLASS_NAME);
|
||||
BizObject bDRI= bmDRI.createQuery("RENT_PLAN_ID=:RENT_PLAN_ID").setParameter("RENT_PLAN_ID", RENT_PLAN_ID).getSingleResult(false);
|
||||
String distributorId = bDRI.getAttribute("DISTRIBUTOR_ID").toString();
|
||||
String cautionMoney = bDRI.getAttribute("CAUTION_MONEY").toString();
|
||||
//D_DEPOSITCHARGE_INFO插入新数据
|
||||
BizObject bDCI_N = bmDCI.newObject();
|
||||
bDCI_N.setAttributeValue("DISTRIBUTOR_ID", distributorId);
|
||||
bDCI_N.setAttributeValue("CAUTION_MONEY", cautionMoney);
|
||||
bDCI_N.setAttributeValue("MONEY_TYPE","bondBack");
|
||||
bDCI_N.setAttributeValue("INPUTTIME",StringFunction.getTodayNow());
|
||||
bDCI_N.setAttributeValue("INPUTUSERID",inputuserid);
|
||||
bDCI_N.setAttributeValue("INPUTORGID",inputorgid);
|
||||
bDCI_N.setAttributeValue("RENT_PLAN_ID",RENT_PLAN_ID);
|
||||
bmDCI.saveObject(bDCI_N);
|
||||
//修改经销商信息表里的金额
|
||||
BizObject bDI = bmDI.createQuery("distributor_no=:distributor_id").setParameter("distributor_id", distributorId).getSingleResult(false);
|
||||
BigDecimal sum = new BigDecimal(bDI.getAttribute("sums").getString());
|
||||
double account_balance = sum.add(new BigDecimal(cautionMoney)).doubleValue();
|
||||
bmDI.createQuery("update O set O.sums='"+account_balance+"' where O.distributor_no=:distributor_id").setParameter("distributor_id", distributorId).executeUpdate();
|
||||
System.out.println("红冲成功");
|
||||
public void writeBackDistributor(String rentPlanId,String money,Transaction Sqlca) throws JBOException{
|
||||
//查询是否有代偿记录
|
||||
BizObject boDRI=JBOFactory.createBizObjectQuery(D_DEPOSITRETURN_INFO.CLASS_NAME,"RENT_PLAN_ID=:rentPlanId").setParameter("rentPlanId", rentPlanId).getSingleResult(false);
|
||||
if(boDRI!=null&&boDRI.getAttribute("CAUTION_MONEY")!=null){
|
||||
//代偿操作
|
||||
BigDecimal dci_money = new BigDecimal("0");
|
||||
BizObjectManager bmDCI = JBOFactory.getFactory().getManager(D_DEPOSITCHARGE_INFO.CLASS_NAME);
|
||||
List<BizObject> boDCI=bmDCI.createQuery("RENT_PLAN_ID=:rentPlanId").setParameter("rentPlanId", rentPlanId).getResultList(false);
|
||||
if(boDCI.size()>0){
|
||||
for(BizObject bo_dci : boDCI){
|
||||
dci_money = dci_money.add(new BigDecimal(bo_dci.getAttribute("CAUTION_MONEY").toString()));
|
||||
}
|
||||
}
|
||||
if(dci_money.compareTo(new BigDecimal(boDRI.getAttribute("CAUTION_MONEY").toString()))==-1){
|
||||
|
||||
BizObjectManager bmDI = JBOFactory.getFactory().getManager(DISTRIBUTOR_INFO.CLASS_NAME);
|
||||
//D_DEPOSITCHARGE_INFO插入新数据
|
||||
BizObject bDCI_N = bmDCI.newObject();
|
||||
String distributorId = boDRI.getAttribute("DISTRIBUTOR_ID").toString();
|
||||
bDCI_N.setAttributeValue("DISTRIBUTOR_ID", distributorId);
|
||||
bDCI_N.setAttributeValue("CAUTION_MONEY", money);
|
||||
bDCI_N.setAttributeValue("MONEY_TYPE","bondBack");
|
||||
bDCI_N.setAttributeValue("INPUTTIME",StringFunction.getTodayNow());
|
||||
bDCI_N.setAttributeValue("INPUTUSERID",inputuserid);
|
||||
bDCI_N.setAttributeValue("INPUTORGID",inputorgid);
|
||||
bDCI_N.setAttributeValue("RENT_PLAN_ID",rentPlanId);
|
||||
bmDCI.saveObject(bDCI_N);
|
||||
//修改经销商信息表里的金额
|
||||
BizObject bDI = bmDI.createQuery("distributor_no=:distributor_id").setParameter("distributor_id", distributorId).getSingleResult(true);
|
||||
String sum = new BigDecimal(bDI.getAttribute("sums").getString()).add(new BigDecimal(money)).toString();
|
||||
bDI.setAttributeValue("sums", sum);
|
||||
bmDI.saveObject(bDI);
|
||||
System.out.println("红冲成功");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//获取存盘文件
|
||||
@ -116,7 +149,7 @@ public class CollectAuditInfoCacheTj {
|
||||
String batchstatus = bo.getAttribute("BATCH_STATUS").toString();
|
||||
String rent = bo.getAttribute("rent").toString();
|
||||
if ("process".equals(batchstatus)) {//判断是否在批量处理中
|
||||
return "error@"+name+"的"+plan_list+"日期为"+plan_date+"的租金正在进行批量扣款处理中".trim();
|
||||
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();
|
||||
@ -522,7 +555,7 @@ public class CollectAuditInfoCacheTj {
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 手动回笼租金
|
||||
* 手动回笼租金(经销商代偿)
|
||||
* @param tx
|
||||
* @param bc
|
||||
* @param bo
|
||||
@ -627,10 +660,9 @@ public class CollectAuditInfoCacheTj {
|
||||
.setParameter("COLLECT_STATUS", "手工收款")
|
||||
.setParameter("COLLECT_MSG", "手工扣款")
|
||||
.setParameter("id", bo.getAttribute("id").toString()).executeUpdate();
|
||||
BizObject boDDI=JBOFactory.createBizObjectQuery(D_DEPOSITRETURN_INFO.CLASS_NAME,"RENT_PLAN_ID=:rentPlanId").setParameter("rentPlanId", bo.getAttribute("id").toString()).getSingleResult(false);
|
||||
if(boDDI!=null){
|
||||
this.writeBackDistributor(bo.getAttribute("id").toString(), Sqlca);
|
||||
}
|
||||
//红冲代偿的数据(由于视图里的rent包含罚息,所以要先减去罚息)
|
||||
String rent = new BigDecimal(bo.getAttribute("rent").toString()).subtract( new BigDecimal(bo.getAttribute("PENALTY").toString())).toString();
|
||||
this.writeBackDistributor(bo.getAttribute("id").toString(),rent, Sqlca);
|
||||
|
||||
|
||||
}
|
||||
@ -676,7 +708,7 @@ public class CollectAuditInfoCacheTj {
|
||||
|
||||
//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")
|
||||
@ -801,6 +833,85 @@ public class CollectAuditInfoCacheTj {
|
||||
}
|
||||
return "系统正在处理中,请稍后";
|
||||
}
|
||||
/**
|
||||
* 手动批量代收-发送请求
|
||||
* @param tx
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String batchCollectManageManual(JBOTransaction tx) throws Exception{
|
||||
String[] ids = id.split("@");
|
||||
String datas_json = datas.replaceAll("@", ",");
|
||||
JSONObject object = JSON.parseObject(datas_json);
|
||||
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<BizObject> bolist = bm.createQuery("select distinct O.contract_id,O.plan_date,O.id,ca.ACC_NUMBER,ca.ACCOUNT,ca.BANK_NAME,O.rent from O , jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca where O.contract_id=ca.contract_id and ca.acc_type = 'Debit' and O.id in ("+parms.toString()+")").getResultList(false);
|
||||
if (bolist.size() != 0) {
|
||||
for(BizObject bo:bolist){
|
||||
String plan_id = bo.getAttribute("id").toString();
|
||||
bo.setAttributeValue("rent", object.get(plan_id));
|
||||
}
|
||||
singleBatchCollectMoeny(tx, bolist);
|
||||
}
|
||||
return "发起扣款申请成功!";
|
||||
}
|
||||
/**
|
||||
* 检查定时任务是否正在运行
|
||||
* @param jobName
|
||||
* @return
|
||||
*/
|
||||
public String isRunning(){
|
||||
try {
|
||||
Scheduler defaultScheduler = StdSchedulerFactory.getDefaultScheduler();
|
||||
List<JobExecutionContext> jobContexts = defaultScheduler.getCurrentlyExecutingJobs();
|
||||
for (JobExecutionContext context : jobContexts) {
|
||||
System.out.println(context.getTrigger().getJobKey().getName());
|
||||
if (jobName.equals(context.getTrigger().getJobKey().getName())) {
|
||||
return "using";
|
||||
}
|
||||
}
|
||||
} catch (SchedulerException e) {
|
||||
e.printStackTrace();
|
||||
return "using";
|
||||
}
|
||||
System.out.println("定时任务未在运行中,可以发起!");
|
||||
return "unUse";
|
||||
}
|
||||
/**
|
||||
* 获取当日扣款数量是否超过指定次数
|
||||
* @param jobName
|
||||
* @return
|
||||
*/
|
||||
public String getCollectCount(){
|
||||
String flag = "false";
|
||||
try {
|
||||
BizObjectManager bmlcmi = JBOFactory.getFactory().getManager(LC_COLLECT_MANUAL_INFO.CLASS_NAME);
|
||||
String curDate = DateUtil.getSystemTimeByFormat("yyyy/MM/dd");
|
||||
String[] ids = id.split("@");
|
||||
for(int i=0;i<ids.length;i++){
|
||||
int collectCount= bmlcmi.createQuery("select O.id from O where hire_date=:curDate and plan_id=:id")
|
||||
.setParameter("curDate", curDate)
|
||||
.setParameter("id", ids[i])
|
||||
.getTotalCount();
|
||||
if(collectCount>=2){
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
} catch (JBOException e) {
|
||||
e.printStackTrace();
|
||||
return "error";
|
||||
}
|
||||
|
||||
return "true";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询批量收款状态
|
||||
@ -820,12 +931,14 @@ public class CollectAuditInfoCacheTj {
|
||||
parms.append(",'"+str+"'");
|
||||
}
|
||||
}
|
||||
List<BizObject> bolist = bm.createQuery("select distinct O.BATCH_NO,O.BATCH_SN,O.contract_id,O.plan_date,O.id,ca.ACC_NUMBER,ca.ACCOUNT,ca.BANK_NAME,O.rent from O , jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca where O.contract_id=ca.contract_id and ca.acc_type = 'Debit' and O.id in ("+parms.toString()+")").getResultList(false);
|
||||
List<BizObject> bolist = bm.createQuery("select distinct O.BATCH_NO,O.BATCH_SN,O.contract_id,O.plan_date,O.id,ca.ACC_NUMBER,ca.ACCOUNT,ca.BANK_NAME,O.rent,O.PENALTY from O , jbo.app.tenwa.customer.CUSTOMER_ACCOUNT ca where O.contract_id=ca.contract_id and ca.acc_type = 'Debit' and O.id in ("+parms.toString()+")").getResultList(false);
|
||||
for (BizObject bo : bolist) {
|
||||
String query_sn = bo.getAttribute("BATCH_NO").toString();
|
||||
String sn = bo.getAttribute("BATCH_SN").toString();
|
||||
String rent = bo.getAttribute("rent").toString();
|
||||
String bank_name = bo.getAttribute("BANK_NAME").toString();
|
||||
String penalty = bo.getAttribute("PENALTY").toString();
|
||||
BigDecimal penalty_over = new BigDecimal(penalty);
|
||||
int m = 0;
|
||||
String[] singleRent = null;
|
||||
BigDecimal mi = new BigDecimal(rent);
|
||||
@ -879,16 +992,16 @@ public class CollectAuditInfoCacheTj {
|
||||
//回盘成功
|
||||
if (map.containsKey("RET_CODE") && "0000".equals(map.get("RET_CODE"))) {
|
||||
querysingleCollectMoeny(tx, bc, bo, rent,i+"");
|
||||
//红冲代偿的数据(由于视图里的rent包含罚息,所以要先减去罚息)
|
||||
String redRent = new BigDecimal(rent).subtract(new BigDecimal(penalty)).toString();
|
||||
this.writeBackDistributor(bo.getAttribute("id").toString(),redRent,Sqlca);
|
||||
|
||||
//更新收付状态
|
||||
bc.createQuery("update O set O.COLLECT_STATUS=:COLLECT_STATUS ,O.COLLECT_MSG=:COLLECT_MSG,O.BATCH_STATUS=:BATCH_STATUS,O.BATCH_NO='',O.BATCH_SN='' where O.id=:id")
|
||||
.setParameter("COLLECT_STATUS", "批量收款")
|
||||
.setParameter("COLLECT_MSG", "批量代收,收款成功")
|
||||
.setParameter("BATCH_STATUS", "complete")//更新批量处理状态-完成
|
||||
.setParameter("id", bo.getAttribute("id").toString()).executeUpdate();
|
||||
BizObject boDDI=JBOFactory.createBizObjectQuery(D_DEPOSITRETURN_INFO.CLASS_NAME,"RENT_PLAN_ID=:rentPlanId").setParameter("rentPlanId", bo.getAttribute("id").toString()).getSingleResult(false);
|
||||
if(boDDI!=null){
|
||||
this.writeBackDistributor(bo.getAttribute("id").toString(),Sqlca);
|
||||
}
|
||||
bo.setAttributeValue("COLLECT_STATUS", "批量收款");
|
||||
bo.setAttributeValue("COLLECT_MSG", "批量代收,收款成功");
|
||||
bo.setAttributeValue("BATCH_STATUS", "complete");
|
||||
@ -918,6 +1031,15 @@ public class CollectAuditInfoCacheTj {
|
||||
}else if (snArray.length > 1) {
|
||||
if (map.containsKey("RET_CODE") && "0000".equals(map.get("RET_CODE"))) {
|
||||
querysingleCollectMoeny(tx, bc, bo, singleRent[i-1],i+"");
|
||||
//红冲代偿的数据(由于视图里的rent包含罚息,所以要先减去罚息)
|
||||
BigDecimal singleRent_over = new BigDecimal(singleRent[i-1]);
|
||||
if(singleRent_over.compareTo(penalty_over)==1){
|
||||
String redRent = new BigDecimal(singleRent[i-1]).subtract(penalty_over).toString();
|
||||
penalty_over = new BigDecimal("0");
|
||||
this.writeBackDistributor(bo.getAttribute("id").toString(),redRent,Sqlca);
|
||||
}else{
|
||||
penalty_over = penalty_over.subtract(singleRent_over);
|
||||
}
|
||||
n++;
|
||||
if (n == snArray.length) {
|
||||
n = 0;//将扣款成功项 置为 0
|
||||
@ -927,15 +1049,12 @@ public class CollectAuditInfoCacheTj {
|
||||
.setParameter("COLLECT_MSG", "批量代收,收款成功")
|
||||
.setParameter("BATCH_STATUS", "complete")//更新批量处理状态-完成
|
||||
.setParameter("id", bo.getAttribute("id").toString()).executeUpdate();
|
||||
BizObject boDDI=JBOFactory.createBizObjectQuery(D_DEPOSITRETURN_INFO.CLASS_NAME,"RENT_PLAN_ID=:rentPlanId").setParameter("rentPlanId", bo.getAttribute("id").toString()).getSingleResult(false);
|
||||
if(boDDI!=null){
|
||||
this.writeBackDistributor( bo.getAttribute("id").toString(),Sqlca);
|
||||
}
|
||||
|
||||
bo.setAttributeValue("COLLECT_STATUS", "批量收款");
|
||||
bo.setAttributeValue("COLLECT_MSG", "批量代收,收款成功");
|
||||
bo.setAttributeValue("BATCH_STATUS", "complete");
|
||||
//bo.setAttributeValue("rent", bo.getAttribute("rent").toString());
|
||||
saveBuckle(bo,tx,snArray[(i-1)],singleRent[i-1]);
|
||||
saveBuckle(bo,tx,i+"",rent);
|
||||
}else{
|
||||
//更新收付状态
|
||||
bc.createQuery("update O set O.COLLECT_STATUS=:COLLECT_STATUS ,O.COLLECT_MSG=:COLLECT_MSG,O.BATCH_STATUS=:BATCH_STATUS,O.BATCH_NO='',O.BATCH_SN='' where O.id=:id")
|
||||
@ -946,7 +1065,7 @@ public class CollectAuditInfoCacheTj {
|
||||
bo.setAttributeValue("COLLECT_STATUS", "部分收款");
|
||||
bo.setAttributeValue("COLLECT_MSG", map.get("ERR_MSG"));
|
||||
bo.setAttributeValue("BATCH_STATUS", "complete");
|
||||
saveBuckle(bo,tx,snArray[(i-1)],singleRent[i-1]);
|
||||
saveBuckle(bo,tx,i+"",singleRent[i-1]);
|
||||
}
|
||||
}else if (map.containsKey("RET_CODE") && ("2007".equals(map.get("RET_CODE")) || "2005".equals(map.get("RET_CODE")) || "2003".equals(map.get("RET_CODE")) || "2001".equals(map.get("RET_CODE")) || "2000".equals(map.get("RET_CODE")))){
|
||||
//更新银联处理中的反馈信息
|
||||
@ -954,7 +1073,7 @@ public class CollectAuditInfoCacheTj {
|
||||
.setParameter("COLLECT_MSG", map.get("ERR_MSG"))
|
||||
.setParameter("id", bo.getAttribute("id").toString()).executeUpdate();
|
||||
bo.setAttributeValue("COLLECT_MSG", map.get("ERR_MSG"));
|
||||
saveBuckle(bo,tx,snArray[(i-1)],"0.00");
|
||||
saveBuckle(bo,tx,i+"","0.00");
|
||||
}else{//批量拆分多笔扣款,如果扣款成功条数未 0 ,则更新扣款状态为 未扣款
|
||||
if (i == snArray.length && n == 0) {
|
||||
//更新收付状态
|
||||
@ -966,7 +1085,7 @@ public class CollectAuditInfoCacheTj {
|
||||
bo.setAttributeValue("COLLECT_STATUS", "未收款");
|
||||
bo.setAttributeValue("COLLECT_MSG", map.get("ERR_MSG"));
|
||||
bo.setAttributeValue("BATCH_STATUS", "");
|
||||
saveBuckle(bo,tx,snArray[(i-1)],"0.00");
|
||||
saveBuckle(bo,tx,i+"","0.00");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -988,6 +1107,8 @@ public class CollectAuditInfoCacheTj {
|
||||
blbo.setAttributeValue("COLLECT_MSG", bo.getAttribute("COLLECT_MSG").getString());
|
||||
blbo.setAttributeValue("BATCH_STATUS", bo.getAttribute("BATCH_STATUS").getString());
|
||||
}
|
||||
DecimalFormat format = new DecimalFormat("0.00");
|
||||
rent = format.format(new BigDecimal(rent ));
|
||||
blbo.setAttributeValue(LB_BUCKLE_LOG.BATCH_SN, batch_sn);
|
||||
blbo.setAttributeValue(LB_BUCKLE_LOG.BATCH_NO, bo.getAttribute("BATCH_NO").getString());
|
||||
blbo.setAttributeValue(LB_BUCKLE_LOG.RENT_ID, bo.getAttribute("ID").getString());
|
||||
@ -1327,6 +1448,7 @@ public class CollectAuditInfoCacheTj {
|
||||
String acc_number = biz.getAttribute("acc_number").toString();
|
||||
String account = biz.getAttribute("account").toString();
|
||||
String bank_name = biz.getAttribute("BANK_NAME").toString();
|
||||
String planId = biz.getAttribute("id").toString();
|
||||
List<BizObject> codelist = JBOFactory.getFactory().getBizObjectManager(CODE_LIBRARY.CLASS_NAME).createQuery("O.codeno = 'TjbankType' and O.itemdescribe is not null ").getResultList(false);
|
||||
BigDecimal itemdescribe = new BigDecimal("0");
|
||||
boolean flag = false;
|
||||
@ -1377,6 +1499,26 @@ public class CollectAuditInfoCacheTj {
|
||||
.setParameter("BATCH_NO", req_sn)
|
||||
.setParameter("BATCH_SN", itemsn0)
|
||||
.setParameter("id", biz.getAttribute("id").toString()).executeUpdate();
|
||||
//手动的添加到手动表
|
||||
if("manual".equals(collectStyle)){
|
||||
BizObjectManager bmlcmi = JBOFactory.getFactory().getManager(LC_COLLECT_MANUAL_INFO.CLASS_NAME,trans);
|
||||
if(k==1){
|
||||
BizObject bolmci = bmlcmi.newObject();
|
||||
bolmci.setAttributeValue("contract_id",biz.getAttribute("contract_id").toString());
|
||||
bolmci.setAttributeValue("plan_id",planId);
|
||||
bolmci.setAttributeValue("BATCH_NO",req_sn);
|
||||
bolmci.setAttributeValue("BATCH_SN",itemsn0);
|
||||
bolmci.setAttributeValue("money",biz.getAttribute("rent").toString());
|
||||
bolmci.setAttributeValue("hire_date",DateUtil.getSystemTimeByFormat("yyyy/MM/dd"));
|
||||
bmlcmi.saveObject(bolmci);
|
||||
}else{
|
||||
bmlcmi.createQuery("update O set O.BATCH_SN=:BATCH_SN where O.plan_id=:id and O.BATCH_NO=:BATCH_NO")
|
||||
.setParameter("BATCH_SN", itemsn0)
|
||||
.setParameter("BATCH_NO", req_sn)
|
||||
.setParameter("id", planId).executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
trans.commit();
|
||||
trans_detail.setSN(sn);
|
||||
trans_detail.setACCOUNT_TYPE("");
|
||||
@ -1422,6 +1564,14 @@ public class CollectAuditInfoCacheTj {
|
||||
.setParameter("BATCH_NO", req_sn)
|
||||
.setParameter("BATCH_SN", itemsn0)
|
||||
.setParameter("id", biz.getAttribute("id").toString()).executeUpdate();
|
||||
//手动的添加到手动表
|
||||
if("manual".equals(collectStyle)){
|
||||
BizObjectManager bmlcmi = JBOFactory.getFactory().getManager(LC_COLLECT_MANUAL_INFO.CLASS_NAME,trans);
|
||||
bmlcmi.createQuery("update O set O.BATCH_SN=:BATCH_SN where O.plan_id=:id and O.BATCH_NO=:BATCH_NO")
|
||||
.setParameter("BATCH_SN", itemsn0)
|
||||
.setParameter("BATCH_NO", req_sn)
|
||||
.setParameter("id", planId).executeUpdate();
|
||||
}
|
||||
trans.commit();
|
||||
trans_detail.setSN(sn);
|
||||
trans_detail.setACCOUNT_TYPE("");
|
||||
@ -1455,6 +1605,18 @@ public class CollectAuditInfoCacheTj {
|
||||
.setParameter("BATCH_NO", req_sn)
|
||||
.setParameter("BATCH_SN", sn)
|
||||
.setParameter("id", biz.getAttribute("id").toString()).executeUpdate();
|
||||
//手动的添加到手动表
|
||||
if("manual".equals(collectStyle)){
|
||||
BizObjectManager bmlcmi = JBOFactory.getFactory().getManager(LC_COLLECT_MANUAL_INFO.CLASS_NAME,trans);
|
||||
BizObject bolmci = bmlcmi.newObject();
|
||||
bolmci.setAttributeValue("contract_id",biz.getAttribute("contract_id").toString());
|
||||
bolmci.setAttributeValue("plan_id",planId);
|
||||
bolmci.setAttributeValue("BATCH_NO",req_sn);
|
||||
bolmci.setAttributeValue("BATCH_SN",sn);
|
||||
bolmci.setAttributeValue("money",biz.getAttribute("rent").toString());
|
||||
bolmci.setAttributeValue("hire_date",DateUtil.getSystemTimeByFormat("yyyy/MM/dd"));
|
||||
bmlcmi.saveObject(bolmci);
|
||||
}
|
||||
trans.commit();
|
||||
trans_detail.setSN(sn);
|
||||
trans_detail.setACCOUNT_TYPE("");
|
||||
@ -1471,7 +1633,7 @@ public class CollectAuditInfoCacheTj {
|
||||
strbuff.append("</TRANS_DETAILS>");
|
||||
strbuff.append("</BODY>");
|
||||
strbuff.append("</GZELINK>");
|
||||
|
||||
collectStyle=null;
|
||||
|
||||
return strbuff;
|
||||
}
|
||||
@ -1805,6 +1967,21 @@ public class CollectAuditInfoCacheTj {
|
||||
public void setPenaltys(String penaltys) {
|
||||
this.penaltys = penaltys;
|
||||
}
|
||||
public String getCollectStyle() {
|
||||
return collectStyle;
|
||||
}
|
||||
|
||||
public void setCollectStyle(String collectStyle) {
|
||||
this.collectStyle = collectStyle;
|
||||
}
|
||||
|
||||
public String getJobName() {
|
||||
return jobName;
|
||||
}
|
||||
|
||||
public void setJobName(String jobName) {
|
||||
this.jobName = jobName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ public class AutoBuckle implements Job {
|
||||
try {
|
||||
txTj = JBOFactory.createJBOTransaction();
|
||||
CollectAuditInfoCacheTj caTj = new CollectAuditInfoCacheTj();
|
||||
List<BizObject> bosTj = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN", txTj).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);
|
||||
List<BizObject> bosTj = JBOFactory.getBizObjectManager("jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN", txTj).createQuery(" O.plan_list=(select min(t.plan_list) from jbo.com.tenwa.lease.comm.VI_LC_AUDIT_RENT_PLAN t where t.contract_id=O.contract_id and t.COLLECT_STATUS IN ('δÊÕ¿î', '²¿·ÖÊÕ¿î','´ú³¥') and t.SUBJECTID='d989246c11c111eaaa0000163e0e11e6' and t.PLAN_DATE <= '" + plan_date + "' and ( t.BATCH_STATUS<>'process' or t.BATCH_STATUS IS NULL ) and (t.contract_number NOT IN ('BQAP(AH)201908060003','BQAP(AH)201908070002','BQAP(AH)201908070003')) and (t.distributor_id not in (select dw.distributor_id from jbo.app.tenwa.customer.DEDUCTIONS_WAY dw where dw.Whether_to_enable='Y'))) GROUP BY contract_id").getResultList(true);
|
||||
StringBuffer idsTj = new StringBuffer();
|
||||
if(bosTj!=null && bosTj.size()>0){
|
||||
a:for(BizObject bo : bosTj){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user