From 984052fde11b837ac385db6b5b18bdbc625915dc Mon Sep 17 00:00:00 2001 From: zhangbb Date: Wed, 19 Aug 2020 19:51:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=A7=9F=E9=87=91=E7=BA=A2=E5=86=B2=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=90=8E=E6=9B=B4=E6=94=B9=E7=A7=9F=E9=87=91=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E8=A1=A8=E6=89=A3=E6=AC=BE=E7=8A=B6=E6=80=81=E3=80=82?= =?UTF-8?q?=E5=BD=93=E5=85=A8=E9=83=A8=E7=BA=A2=E5=86=B2=E5=AE=8C=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=8A=B6=E6=80=81=E6=B8=85=E7=A9=BA=EF=BC=8C=E7=BA=A2?= =?UTF-8?q?=E5=86=B2=E9=83=A8=E5=88=86=EF=BC=8C=E5=88=99=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E2=80=98=E9=83=A8=E5=88=86=E6=94=B6=E6=AC=BE=E2=80=99=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LCRentIncomeTempToFormalBusiness.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java b/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java index 5f8b8f864..e54ec7364 100644 --- a/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java +++ b/src_tenwa/com/tenwa/lease/flow/rent/rentreback/LCRentIncomeTempToFormalBusiness.java @@ -1,5 +1,6 @@ package com.tenwa.lease.flow.rent.rentreback; +import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -7,6 +8,7 @@ import jbo.app.tenwa.calc.LC_FUND_INCOME; import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; import jbo.app.tenwa.calc.LC_RENT_INCOME; import jbo.app.tenwa.calc.LC_RENT_INCOME_TEMP; +import jbo.app.tenwa.calc.LC_RENT_PLAN; import com.amarsoft.are.jbo.BizObject; import com.amarsoft.are.jbo.BizObjectManager; @@ -28,14 +30,17 @@ public class LCRentIncomeTempToFormalBusiness extends BaseBussiness{ BizObjectManager fiTemp = JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME); BizObjectManager riFormal = JBOFactory.getBizObjectManager(LC_RENT_INCOME.CLASS_NAME); BizObjectManager riTemp = JBOFactory.getBizObjectManager(LC_RENT_INCOME_TEMP.CLASS_NAME); + BizObjectManager bom_lrp = JBOFactory.getBizObjectManager(LC_RENT_PLAN.CLASS_NAME); Sqlca.join(fiFormal); Sqlca.join(fiTemp); Sqlca.join(riFormal); Sqlca.join(riTemp); + Sqlca.join(bom_lrp); List fits = DataOperatorUtil.getSetJBO(LC_FUND_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca); List rits = DataOperatorUtil.getSetJBO(LC_RENT_INCOME_TEMP.CLASS_NAME, fromCondtion, Sqlca); String fsql="update O set ROLL_BACK=1 where ID=:ID "; String tsql="update O set IS_FLOWING=1 where ID=:ID "; + String lsql = "update O set collect_status=:collect_status,collect_msg='租金红冲' where ID=:ID"; MapotherProperty=this.getDefaultOtherProperty(); if(fits.size()>0){ for(BizObject fit:fits){ @@ -51,6 +56,20 @@ public class LCRentIncomeTempToFormalBusiness extends BaseBussiness{ } service.copyRentIncomeInfo(Sqlca, fromCondtion, null, otherProperty, ServiceOperatorEnum.TempToFormal,null); } + List lrits = riTemp.createQuery("select plan_id from O where flowunid=:flowunid group by plan_id").setParameter("flowunid", this.getAttribute("flowunid").toString()).getResultList(false); + if(lrits.size()>0){ + for(BizObject lrit:lrits){ + String status = ""; + String planId = lrit.getAttribute("plan_id").toString(); + BizObject bo_lrp = bom_lrp.createQuery("select rent from O where id=:id").setParameter("id", planId).getSingleResult(false); + BizObject bo_lri = riFormal.createQuery("select sum(rent) as rent from O where plan_id=:plan_id group by plan_id").setParameter("plan_id", planId).getSingleResult(false); + String lriRent = bo_lri.getAttribute("rent").toString(); + if(new BigDecimal(lriRent).compareTo(new BigDecimal("0"))==1&&new BigDecimal(lriRent).compareTo(new BigDecimal(bo_lrp.getAttribute("rent").toString()))==-1){ + status = "部分收款"; + } + bom_lrp.createQuery(lsql).setParameter("collect_status", status).setParameter("ID", planId).executeUpdate(); + } + } String sMessage="true"; return sMessage; }