1.增加手续费维护字段,修改其他支付的一些bug

This commit is contained in:
zhangbb 2019-12-13 18:33:09 +08:00
parent 512d8e01cf
commit 456ef5a63c
3 changed files with 61 additions and 41 deletions

View File

@ -38,7 +38,7 @@
}
var sResult = RunJavaMethodTrans("com.tenwa.lease.flow.rent.rentreback.OtherPayMethod","createSplittingPayTemp",
"planIDs="+id+",interestSPs="+interestSP+",flowunid=<%=flowunid%>,serviceType=AutoBuckle");
"planIDs="+id+",interestSPs="+interestSP+",flowunid=<%=flowunid%>");
if("success"==sResult){
alert("操作成功,请到分润支付数据中查看!");
reloadSelf();

View File

@ -245,6 +245,7 @@
<attribute name="UPDATEORGID" label="更新部门" type="STRING" length="32"/>
<attribute name="UPDATETIME" label="更新时间" type="STRING" length="32"/>
<attribute name="RETURN_MONEY" label="退回金额" type="DOUBLE" length="22" scale="2"/>
<attribute name="BUSINESS_TYPE" label="业务类型" type="STRING" length="10"/>
</attributes>
<manager>
<managerProperties>
@ -530,6 +531,7 @@
<attribute name="CORPUS_SP" label="分润成本" type="String" length="18" scale="2"/>
<attribute name="INTEREST_sp" label="分润给SP" type="String" length="18" scale="2"/>
<attribute name="SPLITTING_STATUS" label="分润支付状态" type="STRING" length="2"/>
<attribute name="CHARGE_WAY" label="手续费费率类型" type="STRING" length="10"/>
</attributes>
<manager>
<managerProperties>
@ -1515,6 +1517,7 @@
<attribute name="CORPUS_SP" label="分润成本" type="String" length="18" scale="2"/>
<attribute name="INTEREST_sp" label="分润给SP" type="String" length="18" scale="2"/>
<attribute name="SPLITTING_STATUS" label="分润支付状态" type="STRING" length="2"/>
<attribute name="CHARGE_WAY" label="手续费费率类型" type="STRING" length="10"/>
</attributes>
<manager>
<managerProperties>
@ -2491,6 +2494,7 @@
<attribute name="CORPUS_SP" label="分润成本" type="String" length="18" scale="2"/>
<attribute name="INTEREST_sp" label="分润给SP" type="String" length="18" scale="2"/>
<attribute name="SPLITTING_STATUS" label="分润支付状态" type="STRING" length="2"/>
<attribute name="CHARGE_WAY" label="手续费费率类型" type="STRING" length="10"/>
</attributes>
<manager>
<managerProperties>
@ -4104,7 +4108,8 @@
<attribute name="interest" label="interest" type="STRING"/>
<attribute name="corpus_sp" label="corpus_sp" type="STRING"/>
<attribute name="INTEREST_sp" label="INTEREST_sp" type="STRING"/>
<attribute name="splitting_status" label="splitting_status" type="STRING"/>
<attribute name="splitting_status" label="splitting_status" type="STRING"/>
<attribute name="CHARGE_WAY" label="手续费费率类型" type="STRING" length="10"/>
</attributes>
<manager>
<managerProperties>

View File

@ -8,6 +8,7 @@ import java.util.HashMap;
import java.util.Map;
import jbo.app.tenwa.calc.LC_EBANK_PROCESS;
import jbo.app.tenwa.calc.LC_RENT_PLAN;
import jbo.app.tenwa.customer.LPOUNDAGE_MAINTENANCE;
import jbo.com.tenwa.entity.comm.flow.LC_SPLITTING_PAY_TEMP;
@ -36,48 +37,45 @@ public class OtherPayMethod {
public String createSplittingPayTemp(JBOTransaction tx){
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
String currentDate = df.format(new Date());
BizObjectManager lm;
public String createSplittingPayTemp(JBOTransaction tx) throws JBOException{
BigDecimal ratio = null;
String rate = "0";
try {
lm = JBOFactory.getBizObjectManager(LPOUNDAGE_MAINTENANCE.CLASS_NAME,tx);
String getServiceRatioSQL = "select rate from O where charge_way='"+serviceType+"' AND start_date<='"+currentDate+"' AND expiry_date>='"+currentDate+"'";
BizObject boRatio = lm.createQuery(getServiceRatioSQL).getSingleResult(false);
rate = boRatio.getAttribute("rate").toString();
ratio = (new BigDecimal(rate)).divide(new BigDecimal("100"), 6, BigDecimal.ROUND_HALF_UP);
} catch (JBOException e1) {
e1.printStackTrace();
return "获取手续费费率失败";
}
if(ratio!=null){
String[] interestSP = interestSPs.split("@");
String[] planID = planIDs.split("@");
if(interestSP.length==planID.length){
for(int i=0;i<planID.length;i++){
String serviceMoney = (new BigDecimal(interestSP[i])).multiply(ratio).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
String splitting_money = (new BigDecimal(interestSP[i])).subtract(new BigDecimal(serviceMoney)).toString();
String plan_id = planID[i];
try {
BizObjectManager bomLspt = JBOFactory.getBizObjectManager(LC_SPLITTING_PAY_TEMP.CLASS_NAME,tx);
BizObject bolspt = bomLspt.newObject();
bolspt.setAttributeValue("plan_id", plan_id);
bolspt.setAttributeValue("splitting_money", splitting_money);
bolspt.setAttributeValue("service_ratio", rate);
bolspt.setAttributeValue("service_money", serviceMoney);
bolspt.setAttributeValue("flowunid", flowunid);
bolspt.setAttributeValue("inputtime", StringFunction.getTodayNow());
bomLspt.saveObject(bolspt);
changeSplittingStatus(tx,plan_id,"0");
} catch (JBOException e) {
e.printStackTrace();
return "插入临时表失败";
}
}
String[] planID = planIDs.split("@");
for(int i=0;i<planID.length;i++){
BizObject boLRP = JBOFactory.createBizObjectQuery(LC_RENT_PLAN.CLASS_NAME, "ID=:ID").setParameter("ID", planID[i]).getSingleResult(false);
String interest_sp = boLRP.getAttribute("INTEREST_sp")==null?"0":boLRP.getAttribute("INTEREST_sp").toString();
String chargeWay = boLRP.getAttribute("CHARGE_WAY")==null?"0":boLRP.getAttribute("CHARGE_WAY").toString();
String serviceMoney = "0";
String splitting_money = interest_sp;
ratio = getRatio(tx,chargeWay);
if(ratio==null){
return "获取手续费费率失败。";
}
if(ratio.compareTo(new BigDecimal("0"))!=0){
serviceMoney = (new BigDecimal(interest_sp)).multiply(ratio).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
splitting_money = (new BigDecimal(interest_sp)).subtract(new BigDecimal(serviceMoney)).toString();
}
String plan_id = planID[i];
try {
BizObjectManager bomLspt = JBOFactory.getBizObjectManager(LC_SPLITTING_PAY_TEMP.CLASS_NAME,tx);
BizObject bolspt = bomLspt.newObject();
bolspt.setAttributeValue("plan_id", plan_id);
bolspt.setAttributeValue("splitting_money", splitting_money);
bolspt.setAttributeValue("service_ratio", rate);
bolspt.setAttributeValue("service_money", serviceMoney);
bolspt.setAttributeValue("flowunid", flowunid);
bolspt.setAttributeValue("inputtime", StringFunction.getTodayNow());
bomLspt.saveObject(bolspt);
changeSplittingStatus(tx,plan_id,"0");
} catch (Exception e) {
e.printStackTrace();
return "插入临时表失败";
}
}
return "success";
}
/**
@ -119,7 +117,7 @@ public class OtherPayMethod {
LeaseFlowBaseService service=new LeaseFlowBaseServiceImp();
try {
BizObjectManager bom = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME);
BizObjectManager bom = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME,tx);
tx.join(bom);
BizObject bo = bom.newObject();
bo.setAttributeValue("EBANK_NUMBER", idArray[i]);
@ -159,6 +157,23 @@ public class OtherPayMethod {
}
return "success";
}
public BigDecimal getRatio(JBOTransaction tx,String serviceType){
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
String currentDate = df.format(new Date());
BizObjectManager lm;
BigDecimal ratio = null;
try {
lm = JBOFactory.getBizObjectManager(LPOUNDAGE_MAINTENANCE.CLASS_NAME,tx);
String getServiceRatioSQL = "select rate from O where charge_way='"+serviceType+"' AND start_date<='"+currentDate+"' AND expiry_date>='"+currentDate+"'";
BizObject boRatio = lm.createQuery(getServiceRatioSQL).getSingleResult(false);
String rate = boRatio.getAttribute("rate")==null?"0":boRatio.getAttribute("rate").toString();
ratio = (new BigDecimal(rate)).divide(new BigDecimal("100"), 6, BigDecimal.ROUND_HALF_UP);
} catch (Exception e) {
e.printStackTrace();
return null;
}
return ratio;
}
public String getFlowunid() {
return flowunid;
}