diff --git a/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp b/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp index 412eba8b7..6b5d97acc 100644 --- a/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp +++ b/WebContent/Tenwa/Core/FlowManager/FlowPage/FlowPageViewTab.jsp @@ -42,6 +42,9 @@ break; } } + if("BusinessApplyApply".equals(startMap.get("ApplyType"))){ + flag = true; + } %> diff --git a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp index be30be110..5ef58648c 100644 --- a/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp +++ b/WebContent/Tenwa/Lease/Flow/Project/BusinessApplication/ApprovalForm.jsp @@ -78,6 +78,9 @@ dwTemp.getDataObject().setReadOnly("INTEROPINION3", true); dwTemp.setGroupHidden("0050"); } + if(CurUser.hasRole("401")){ + dwTemp.setGroupHidden("0030,0040"); + } }else if("0050".equals(phaseNo)){//信审 if(!"true".equals(ishistory)){ dwTemp.getDataObject().setVisible("firstchoice", true); @@ -146,6 +149,17 @@ $("#A_div_1240").attr("style","display:block;"); $("#A_div_1260").attr("style","display:block;"); } + if("true"=="<%=ishistory%>"&&<%=CurUser.hasRole("401")%>){ + $("#A_div_1130").attr("style","display:none;"); + $("#A_div_1140").attr("style","display:none;"); + $("#A_div_1210").attr("style","display:none;"); + $("#A_div_1150").attr("style","display:none;"); + $("#A_div_1160").attr("style","display:none;"); + $("#A_div_1230").attr("style","display:none;"); + $("#A_div_1170").attr("style","display:none;"); + $("#A_div_1180").attr("style","display:none;"); + $("#A_div_1250").attr("style","display:none;"); + } _user_validator[0]['rules']['FIRSTCHOICE']['required0'] = true; _user_validator[0]['messages']['FIRSTCHOICE']['required0'] = '请输入初审意见'; _user_validator[0]['rules']['FIRSTOPINION']['required0'] = true; @@ -163,6 +177,17 @@ $("#A_div_1250").attr("style","display:block;"); $("#A_div_1260").attr("style","display:block;"); } + if("true"=="<%=ishistory%>"&&<%=CurUser.hasRole("401")%>){ + $("#A_div_1130").attr("style","display:none;"); + $("#A_div_1140").attr("style","display:none;"); + $("#A_div_1210").attr("style","display:none;"); + $("#A_div_1150").attr("style","display:none;"); + $("#A_div_1160").attr("style","display:none;"); + $("#A_div_1230").attr("style","display:none;"); + $("#A_div_1170").attr("style","display:none;"); + $("#A_div_1180").attr("style","display:none;"); + $("#A_div_1250").attr("style","display:none;"); + } _user_validator[0]['rules']['SECONDCHOICE']['required0'] = true; _user_validator[0]['messages']['SECONDCHOICE']['required0'] = '请输入复审意见'; _user_validator[0]['rules']['SECONDOPINION']['required0'] = true; @@ -178,7 +203,17 @@ $("#SECONDOPINION").attr("disabled","disabled");//审批意见 $("#INTEROPINION2").attr("disabled","disabled");//复审内部意见 $("#DISTRIOPINION2").attr("disabled","disabled");//复审经销商意见 - + if("true"=="<%=ishistory%>"&&<%=CurUser.hasRole("401")%>){ + $("#A_div_1130").attr("style","display:none;"); + $("#A_div_1140").attr("style","display:none;"); + $("#A_div_1210").attr("style","display:none;"); + $("#A_div_1150").attr("style","display:none;"); + $("#A_div_1160").attr("style","display:none;"); + $("#A_div_1230").attr("style","display:none;"); + $("#A_div_1170").attr("style","display:none;"); + $("#A_div_1180").attr("style","display:none;"); + $("#A_div_1250").attr("style","display:none;"); + } _user_validator[0]['rules']['THIRDCHOICE']['required0'] = true; _user_validator[0]['messages']['THIRDCHOICE']['required0'] = '请输入部门负责人意见'; _user_validator[0]['rules']['THIRDOPINION']['required0'] = true; @@ -200,7 +235,22 @@ $("#SECONDOPINION").attr("disabled","disabled");//审批意见 $("#INTEROPINION2").attr("disabled","disabled");//复审内部意见 $("#DISTRIOPINION2").attr("disabled","disabled");//复审经销商意见 - + if("BACK"=="<%=flowstate%>"||"ANYBACK"=="<%=flowstate%>"){ + $("#A_div_1130").attr("style","display:none;"); + $("#A_div_1140").attr("style","display:none;"); + $("#A_div_1210").attr("style","display:none;"); + } + if("true"=="<%=ishistory%>"&&<%=CurUser.hasRole("401")%>){ + $("#A_div_1130").attr("style","display:none;"); + $("#A_div_1140").attr("style","display:none;"); + $("#A_div_1210").attr("style","display:none;"); + $("#A_div_1150").attr("style","display:none;"); + $("#A_div_1160").attr("style","display:none;"); + $("#A_div_1230").attr("style","display:none;"); + $("#A_div_1170").attr("style","display:none;"); + $("#A_div_1180").attr("style","display:none;"); + $("#A_div_1250").attr("style","display:none;"); + } _user_validator[0]['rules']['FOURCHOICE']['required0'] = true; _user_validator[0]['messages']['FOURCHOICE']['required0'] = '请输入总经理意见'; _user_validator[0]['rules']['FOUROPINION']['required0'] = true; diff --git a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml index afba61bc7..9624f0d54 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_customer.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_customer.xml @@ -2533,7 +2533,9 @@ - + + + @@ -2572,7 +2574,9 @@ - + + + @@ -2609,7 +2613,9 @@ - + + + diff --git a/calc/com/tenwa/reckon/product/ProductCondition.java b/calc/com/tenwa/reckon/product/ProductCondition.java index 7a3583afc..6e83baa2d 100644 --- a/calc/com/tenwa/reckon/product/ProductCondition.java +++ b/calc/com/tenwa/reckon/product/ProductCondition.java @@ -8,6 +8,7 @@ import java.util.Map.Entry; import java.util.Vector; import jbo.sys.CODE_LIBRARY; +import apx.com.amarsoft.als.apzl.apply.business.loan.product.ProductBaseLoanTools; import com.amarsoft.app.als.sys.tools.DateUtil; import com.amarsoft.app.awe.config.InitDBType; @@ -47,6 +48,24 @@ public class ProductCondition { return sb.toString(); } + public String getProductRulesApp(List> appList,String productId,Vector vali) throws Exception{ + ProductBaseLoanTools.addAppList(appList, "LEASE_AMT_DATE", "coldefaultvalue", DateUtil.getToday()); + StringBuilder sb=new StringBuilder(); + sb.append("{"); + sb.append("'fund':"+this.getProductFundRulesApp(appList, productId,vali));//资金配置项 + sb.append(",'grace':"+this.getProductGraceRulesApp(appList, productId, vali));//宽限期 + sb.append(",'method':"+this.getProductSettleRulesApp(appList, productId));//计算方式 + sb.append("}"); + setRentOrRateApp(appList, productId);//租金推算方法 + this.getOtherRuleApp(appList, productId);//其它配置 + this.getProductPenaRulesApp(appList, productId);//罚息 + this.getProductAdjustRulesApp(appList, productId);//调息 + this.getGrossRulesApp(appList, productId);// +// this.setDateRule(doTemp, productId);//日期 + this.getCautionRatioApp(appList, productId);//保证金比例 + return sb.toString(); + } + /** * 设置日期 * @param doTemp @@ -109,6 +128,91 @@ public class ProductCondition { } } + public void setDateRuleApp(List> appList,String productId) throws Exception{ + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0340"); + Map PLAN_DATE_HOILDAY = new HashMap(); + PLAN_DATE_HOILDAY.put("colname", "PLAN_DATE_HOILDAY"); + Map FIRST_PLAN_DATE = new HashMap(); + FIRST_PLAN_DATE.put("colname", "FIRST_PLAN_DATE"); + Map LAST_PLAN_DATE = new HashMap(); + LAST_PLAN_DATE.put("colname", "LAST_PLAN_DATE"); + Map INTEREST_DATE_HOLIDAY = new HashMap(); + INTEREST_DATE_HOLIDAY.put("colname", "INTEREST_DATE_HOLIDAY"); + Map FIRST_INTEREST_DATE = new HashMap(); + FIRST_INTEREST_DATE.put("colname", "INTEREST_DATE_HOLIDAY"); + Map LAST_INTEREST_DATA = new HashMap(); + LAST_INTEREST_DATA.put("colname", "LAST_INTEREST_DATA"); + Map RATE = new HashMap(); + Map ADDITIONAL_RATE = new HashMap(); + RATE.put("colname", "RATE"); + ADDITIONAL_RATE.put("colname", "ADDITIONAL_RATE"); + if(map.containsKey("PaymentDate")){//还款日 + Map plandatemap=map.get("PaymentDate"); + if(plandatemap.containsKey("HolidayAdjust")){ + PLAN_DATE_HOILDAY.put("coldefaultvalue", plandatemap.get("HolidayAdjust")); + appList.add(PLAN_DATE_HOILDAY); + }else{ + PLAN_DATE_HOILDAY.put("coldefaultvalue", "unchanged"); + appList.add(PLAN_DATE_HOILDAY); + } + if(plandatemap.containsKey("date_proc")){ + String s=plandatemap.get("date_proc"); + if(s.indexOf("1")>=0){ + FIRST_PLAN_DATE.put("colvisible", "1"); + FIRST_PLAN_DATE.put("colrequired", "1"); + appList.add(FIRST_PLAN_DATE); + } + if(s.indexOf("2")>=0){ + LAST_PLAN_DATE.put("colvisible", "1"); + LAST_PLAN_DATE.put("colrequired", "1"); + appList.add(LAST_PLAN_DATE); + } + if(s.indexOf("3")>=0){ + PLAN_DATE_HOILDAY.put("colvisible", "1"); + PLAN_DATE_HOILDAY.put("colrequired", "1"); + appList.add(PLAN_DATE_HOILDAY); + } + } + } + + if(map.containsKey("InterestDate")){//计息日 + Map plandatemap=map.get("InterestDate"); + if(plandatemap.containsKey("HolidayAdjust")){ + INTEREST_DATE_HOLIDAY.put("coldefaultvalue", plandatemap.get("HolidayAdjust")); + appList.add(INTEREST_DATE_HOLIDAY); + }else{ + INTEREST_DATE_HOLIDAY.put("coldefaultvalue", "unchanged"); + appList.add(INTEREST_DATE_HOLIDAY); + } + if(plandatemap.containsKey("date_proc")){ + String s=plandatemap.get("date_proc"); + if(s.indexOf("1")>=0){ + + FIRST_INTEREST_DATE.put("colvisible", "1"); + FIRST_INTEREST_DATE.put("colrequired", "1"); + appList.add(FIRST_INTEREST_DATE); + } + if(s.indexOf("2")>=0){ + LAST_INTEREST_DATA.put("colvisible", "1"); + LAST_INTEREST_DATA.put("colrequired", "1"); + appList.add(LAST_INTEREST_DATA); + } + if(s.indexOf("3")>=0){ + INTEREST_DATE_HOLIDAY.put("colvisible", "1"); + INTEREST_DATE_HOLIDAY.put("colrequired", "1"); + appList.add(INTEREST_DATE_HOLIDAY); + } + + } + } + if(map.containsKey("RateInfo")){ + RATE.put("coldefaultvalue", map.get("RateInfo").get("RATE")); + ADDITIONAL_RATE.put("coldefaultvalue", map.get("RateInfo").get("AdditionalRate")); + appList.add(RATE); + appList.add(ADDITIONAL_RATE); + } + } + /** * 项目粗利 净融资额 期初付款总计 是否显示 * @param doTemp @@ -128,6 +232,20 @@ public class ProductCondition { doTemp.setVisible("FIRST_PAYMENT_TOTAL",false); } } + + public void getGrossRulesApp(List> appList,String productId) throws Exception{ + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0330"); + if(!map.containsKey("GrossProfit")){ + ProductBaseLoanTools.addAppList(appList, "GROSS_PROFIT", "colvisible", "0"); + } + if(!map.containsKey("CleanCreditMoney")){ + ProductBaseLoanTools.addAppList(appList, "CLEAN_CREDIT_MONEY", "colvisible", "0"); + ProductBaseLoanTools.addAppList(appList, "CLEAN_CREDIT_RATIO", "colvisible", "0"); + } + if(!map.containsKey("PeriodBeginPayMoney")){ + ProductBaseLoanTools.addAppList(appList, "FIRST_PAYMENT_TOTAL", "colvisible", "0"); + } + } /** * 设置租金推算方法 下拉选项 @@ -151,6 +269,25 @@ public class ProductCondition { } + + public void setRentOrRateApp(List> appList,String productId) throws Exception{ + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0310"); + if(map.containsKey("ROR01")){ + if(map.get("ROR01").get("RentOrRate").length()>0){ + String[] rule=map.get("ROR01").get("RentOrRate").split(","); + String s=""; + for(int i=0;i0){s+=",";} + s+="'"+rule[i]+"'"; + } + ProductBaseLoanTools.addAppList(appList, "RENT_OR_RATE", "coleditsource", "jbo.sys.CODE_LIBRARY," + + "itemno,itemname,codeno='rent_or_rate' and itemno in ("+s+") order by sortno"); + } + } + + + } + /** * 获取产品配置的资金项 * @param productId @@ -258,6 +395,78 @@ public class ProductCondition { sb.append("}"); return sb.toString(); } + + @SuppressWarnings("unchecked") + public String getProductFundRulesApp(List> appList,String productId,Vector vali) throws Exception{ + StringBuilder sb=new StringBuilder(); + sb.append("{"); + //获取产品资金项 + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0315"); + //获取需要和产品关联的资金项 + String sql = "codeno='FeeType' and relativecode is not null and relativecode<>''"; + List feeList=JBOFactory.createBizObjectQuery(CODE_LIBRARY.CLASS_NAME,sql).getResultList(false); + String rule=""; + Map _FINA = new HashMap(); + for(BizObject fee:feeList){ + rule=""; + String col=fee.getAttribute("relativecode").getString();//费用项在表中的字段 + String colName=fee.getAttribute("itemname").getString();//费用名称 + String isFina=fee.getAttribute("attribute2").getString();//是否参与融资 + String fina = ProductParamUtil.getProductParameterValue(productId, "PRD0315",col,"FINAN"); + String cautionMoneymethod = ProductParamUtil.getProductParameterValue(productId, "PRD0315",col,"DepositStyle"); + if(!"".equals(cautionMoneymethod)&&cautionMoneymethod!=null){ + ProductBaseLoanTools.addAppList(appList, "CAUTION_MONEY_METHOD", "coldefaultvalue", cautionMoneymethod); + } + + if("Y".equals(fina)){ + fina = "finatype02"; + }else { + fina = "finatype01"; + } + if(fee.getAttribute("itemno").getString().equals("feetype10")){ + rule=prodSer.getEquipRuleApp(appList, map,col,vali); + }else{ + if(map.containsKey(col)){//产品配置了该费用项 + rule=prodSer.getFeeRuleApp(appList, map, col,colName,vali); + ProductBaseLoanTools.addAppList(appList, col+"_FINA", "coldefaultvalue", fina); + }else{ + if("FINA".equals(isFina)){ + ProductBaseLoanTools.addAppList(appList, col+"_FINA", "colvisible", "0"); + } + ProductBaseLoanTools.addAppList(appList, col, "colvisible", "0"); + + if(fee.getAttribute("itemno").getString().equals("feetype2")){ + ProductBaseLoanTools.addAppList(appList, "CAUTION_DEDUCTION_MONEY", "colvisible", "0"); + ProductBaseLoanTools.addAppList(appList, "CAUTION_MONEY_REMAIN", "colvisible", "0"); + ProductBaseLoanTools.addAppList(appList, "CAUTION_MONEY_METHOD", "colvisible", "0"); + ProductBaseLoanTools.addAppList(appList, "CAUTION_MONEY_METHOD", "colrequired", "0"); + } + if("FINAL_PAYMENT".equals(col)) { + Map _METHOD = new HashMap(); + _METHOD.put("colname", col+"_METHOD"); + _METHOD.put("colvisible", "0"); + _METHOD.put("colrequired", "0"); + appList.add(_METHOD); + } + rule=null; + } + } + if(rule!=null){ + if(sb.length()>1){sb.append(",");} + sb.append("'"+col+"':"+rule+""); + } + } + for(String key:map.keySet()){ + if(key.toUpperCase().indexOf("FEETYPE")>=0){ + rule=prodSer.getFeeRuleApp(appList, map, key,map.get(key).get("colheader"),vali); + if(sb.length()>1){sb.append(",");} + sb.append("'"+key.toUpperCase()+"':"+rule+""); + } + } + sb.append("}"); + return sb.toString(); + } + /** * 宽限期最大值 * @param doTemp @@ -286,6 +495,27 @@ public class ProductCondition { } return FileOperatorUtil.getMapToJsonStr(rule); } + + public String getProductGraceRulesApp(List> appList,String productId,Vector vali) throws Exception{ + + Map rule=new HashMap(); + //获取产品其它 + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0311"); + if(map.isEmpty()){ + ProductBaseLoanTools.addAppList(appList, "GRACE", "colvisible", "0"); + }else if(map.containsKey("LT01")&&map.get("LT01").containsKey("isleaseterm")&&"N".equals(map.get("LT01").get("isleaseterm"))){ + ProductBaseLoanTools.addAppList(appList, "GRACE", "colvisible", "0"); + }else{ + if(map.containsKey("LT01")){ + String max=StringUtil.nullToString(map.get("LT01").get("leaseterm-MAX")); + if(max.length()>0){ + rule.put("max","宽限期最大"+max+"期@<="); + } + } + } + return FileOperatorUtil.getMapToJsonStr(rule); + } + /** * 设置 第一期还款计划 第二期还款计划 期末余值 是否显示 * @param doTemp @@ -305,6 +535,21 @@ public class ProductCondition { } } + + public void getOtherRuleApp(List> appList,String productId) throws Exception{ + + String[] param={"EQUIP_END_VALUE"}; + //获取产品其它 + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0311"); + for(int i=0;i> appList,String productId) throws Exception{ + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0308"); + if(map.containsKey("PFD01")){//免罚息天数 + String day=map.get("PFD01").get("PenaltyFreeDays"); + if(day.length()>0){ + ProductBaseLoanTools.addAppList(appList, "FREE_DEFA_INTER_DAY", "coldefaultvalue", day); + } + if("N".equals(map.get("PFD01").get("AllowModify"))){ + ProductBaseLoanTools.addAppList(appList, "FREE_DEFA_INTER_DAY", "colreadonly", "1"); + } + } + if(map.containsKey("PENALTY_RATE_DAY")){//罚息日利率 + String rate=map.get("PENALTY_RATE_DAY").get("PENALTY_RATE_DAY"); + if(rate.length()>0){ + ProductBaseLoanTools.addAppList(appList, "PENA_RATE", "coldefaultvalue", rate); + } + if("N".equals(map.get("PENALTY_RATE_DAY").get("AllowModify"))){ + ProductBaseLoanTools.addAppList(appList, "PENA_RATE", "colreadonly", "1"); + } + } + } + /** * 设置调息规则 * @param doTemp @@ -363,6 +631,19 @@ public class ProductCondition { } } } + + public void getProductAdjustRulesApp(List> appList,String productId) throws Exception{ + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0320"); + if(map.containsKey("ADJUST_INTEREST")){ + Map rule=map.get("ADJUST_INTEREST"); + if(null != rule.get("rate_float_type") && null != rule.get("adjust_style")) { + //调息方式 + ProductBaseLoanTools.addAppList(appList, "ADJUST_TYPE", "coldefaultvalue", rule.get("rate_float_type")); + //调息生效节点 + ProductBaseLoanTools.addAppList(appList, "ADJUST_STYLE", "coldefaultvalue", rule.get("adjust_style")); + } + } + } /** * 设置计算方式 * @param doTemp @@ -435,6 +716,71 @@ public class ProductCondition { return "{"+sJson+"}"; } + + public String getProductSettleRulesApp(List> appList,String productId) throws Exception{ + + //租金计算方式 + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0301"); + //分段 + Map> submap=ProductParamUtil.getProductComponentType(productId, "PRD0321"); + String s=""; + + String sJson=""; + for(Map.Entry> entry:map.entrySet()){ + if(s.length()>0)s+=","; + s+="'"+entry.getKey()+"'"; + if(sJson.length()>0)sJson+=","; + sJson+="'"+entry.getKey()+"':"+FileOperatorUtil.getMapToJsonStr(entry.getValue()); + String coldefaultvalue = ""; + for (Map app : appList) { + String colName = app.get("colname") == null ? "" : app.get("colname").toString(); + if ("SETTLE_METHOD".equals(colName)) { + coldefaultvalue = app.get("coldefaultvalue") == null ? "" : app.get("coldefaultvalue").toString(); + break; + } + } + if(entry.getKey().equals(coldefaultvalue)){ + Map values=entry.getValue(); + if(values.containsKey("HolidayAdjust")){ + ProductBaseLoanTools.addAppList(appList, "PLAN_DATE_HOILDAY", "coldefaultvalue", values.get("HolidayAdjust")); + } + if(values.containsKey("InterestHolidayAdjust")){ + ProductBaseLoanTools.addAppList(appList, "INTEREST_DATE_HOLIDAY", "coldefaultvalue", values.get("InterestHolidayAdjust")); + } + if(values.containsKey("RATE")){ + ProductBaseLoanTools.addAppList(appList, "RATE", "coldefaultvalue", values.get("RATE")); + } + if(values.containsKey("AdditionalRate")){ + ProductBaseLoanTools.addAppList(appList, "ADDITIONAL_RATE", "coldefaultvalue", values.get("AdditionalRate")); + } + if(values.containsKey("InterestDayType")){ + ProductBaseLoanTools.addAppList(appList, "INTEREST_DAY_TYPE", "coldefaultvalue", values.get("InterestDayType")); + } + } + //是按起租日计算的情况,直接读取当前日期 + Map valMap = entry.getValue(); + for(Entry val : valMap.entrySet()) { + if("DefaultDueDay".equals(val.getKey())) { + if(!"02".equals(val.getValue())) { + sJson = sJson.replaceAll("}", ",ActualDay:" + Calendar.getInstance().get(Calendar.DAY_OF_MONTH) + "}"); + ProductBaseLoanTools.addAppList(appList, "DefaultDueDay", "colvisible", "0"); + ProductBaseLoanTools.addAppList(appList, "DefaultDueDay", "colrequired", "0"); + } + break; + } + } + } + if(submap.containsKey("ISSUBSECTION")){ + if(s.length()>0)s+=","; + s+="'even_subsection'"; + } + ProductBaseLoanTools.addAppList(appList, "SETTLE_METHOD", "colreadonly", "1"); + ProductBaseLoanTools.addAppList(appList, "SETTLE_METHOD", "coleditsource", "jbo.sys.CODE_LIBRARY,itemno,itemname,codeno='settle_method' and itemno in ("+s+") order by sortno"); + ProductBaseLoanTools.addAppList(appList, "coldefaultvalue", "colreadonly", s.replaceAll("'", "")); + + return "{"+sJson+"}"; + } + /** * 获取产品 资金类型 配置 添加列 * @param doTemp @@ -455,6 +801,28 @@ public class ProductCondition { } } } + /** + * + * APP + * 获取产品 资金类型 配置 添加列 + * @param doTemp + * @param productId + * @return + * @throws Exception + */ + public void getProductFundRulesApp(List> appList, String productId) throws Exception{ + //获取产品资金项 + Map> map=ProductParamUtil.getProductComponentType(productId, "PRD0315"); + for(String key:map.keySet()){ + if(!("EQUIP_AMT".equals(key)||"FIRST_PAYMENT".equals(key))){//设备款和首付款不管 + if("feetype_test".equals(key)){//测试费用 + this.prodSer.createFeeColRatioApp(appList, key, map.get(key)); + this.prodSer.createFeeColApp(appList, key, map.get(key)); + } + } + } + } + public String getSqlWhere(String condition){ String[] conds=condition.split(","); String s=""; @@ -488,4 +856,27 @@ public class ProductCondition { doTemp.setDefaultValue("YEAR_RATE",YEAR_RATE); } } + + public void getCautionRatioApp(List> appList, String productId) throws Exception{ + //测算年利率字段 + Map> productRates = ProductParamUtil.getProductComponentType(productId, "PRD0350"); + Map productRate = productRates.get("product_rate"); + if(productRate != null) { + String incomeNumber = productRate.get("INCOME_NUMBER") == null ? "0" : productRate.get("INCOME_NUMBER"); + ProductBaseLoanTools.addAppList(appList, "INCOME_NUMBER", "coldefaultvalue", incomeNumber); + String periodType = productRate.get("begin_end") == null ? "period_type_0" : productRate.get("begin_end"); + ProductBaseLoanTools.addAppList(appList, "PERIOD_TYPE", "coldefaultvalue", periodType); + String ProductType = productRate.get("ProductType") == null ? "0" : productRate.get("ProductType"); + String isReadOnly = productRate.get("ProductRateReadOnly") == null ? "Y" : productRate.get("ProductRateReadOnly"); + String YEAR_RATE = productRate.get("ProductRate") == null ? "0" : productRate.get("ProductRate"); + //利率为0,费率为1 + if("1".equals(ProductType)){ + ProductBaseLoanTools.addAppList(appList, "YEAR_RATE", "colheader", "测算费率"); + } + if("Y".equals(isReadOnly)){ + ProductBaseLoanTools.addAppList(appList, "YEAR_RATE", "colreadyonly", "1"); + } + ProductBaseLoanTools.addAppList(appList, "YEAR_RATE", "coldefaultvalue", YEAR_RATE); + } + } } diff --git a/calc/com/tenwa/reckon/product/ProductConditionService.java b/calc/com/tenwa/reckon/product/ProductConditionService.java index 48e99d02a..e2d0601b1 100644 --- a/calc/com/tenwa/reckon/product/ProductConditionService.java +++ b/calc/com/tenwa/reckon/product/ProductConditionService.java @@ -1,9 +1,14 @@ package com.tenwa.reckon.product; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Vector; +import apx.com.amarsoft.als.apzl.apply.business.loan.product.ProductBaseLoanTools; +import apx.com.amarsoft.als.base.cache.instance.AppAweDoCache; + +import com.amarsoft.are.ARE; import com.amarsoft.awe.dw.ASColumn; import com.amarsoft.awe.dw.ASObjectModel; import com.amarsoft.awe.dw.ui.validator.ValidateRule; @@ -42,6 +47,31 @@ public class ProductConditionService { } return FileOperatorUtil.getMapToJsonStr(rule); } + + //获取设备款 产品配置 + public String getEquipRuleApp(List> appList,Map> map,String col,Vector vali) throws Exception{ + Map rule=new HashMap(); + if(map.containsKey(col)){ + String min=StringUtil.nullToString(map.get(col).get("CostType08-MIN"));//最小值 + String max=StringUtil.nullToString(map.get(col).get("CostType08-MAX"));//最大值 + String defaultValue=StringUtil.nullToString(map.get(col).get("CostType08"));//限定值 + if(min.length()>0){ + rule.put("min", "设备款不能小于"+min+"@>="); + } + if(max.length()>0){ + rule.put("max", "设备款不能小于"+max+"@<="); + } + + if(defaultValue.length()>0){ + ProductBaseLoanTools.addAppList(appList, col, "coldefaultvalue", defaultValue); + ProductBaseLoanTools.addAppList(appList, col, "colreadonly", "1"); + } + }else{ + rule.put("0", "设备款必须大于0@>"); + } + ProductBaseLoanTools.addAppList(appList, col, "colvalidat", rule); + return FileOperatorUtil.getMapToJsonStr(rule); + } //获取除设备款外其它费用项 配置 public String getFeeRule(ASObjectModel doTemp,Map> map,String col,String colName,Vector vali)throws Exception{ //CostType05 是否显示比例 CostType06 输入方式 CostType07 比例参照 CostType08 金额限定 CostType09 比例限定 @@ -142,6 +172,135 @@ public class ProductConditionService { return "{"+sJson+"}"; } + @SuppressWarnings("unchecked") + public String getFeeRuleApp(List> appList,Map> map,String col,String colName,Vector vali)throws Exception{ + //CostType05 是否显示比例 CostType06 输入方式 CostType07 比例参照 CostType08 金额限定 CostType09 比例限定 + Map rule=new HashMap(); + Map ratioRule=new HashMap(); + Map aweDo = AppAweDoCache.getAppAweDoCachePool(); + Map doTemplate = null; + List> doLibrary = null; + try { + doTemplate = (Map) aweDo.get("LoanSimulationBasicInfoApp"); + doLibrary = (List>) doTemplate.get("library"); + } catch (Exception e) { + ARE.getLog().error(e); + return ""; + } + String sontno2 = ""; + + String sontno3 = ""; + String sontno4 = ""; + String sontno5 = ""; + String groupId = ""; + for (Map colM2 : doLibrary) { + String colName2 = colM2.get("colname") == null ? "" : colM2.get("colname").toString(); + if (col.equalsIgnoreCase(colName2)) { + sontno2 = colM2.get("sortno") == null ? "" : colM2.get("sortno").toString(); + groupId = colM2.get("groupid") == null ? "" : colM2.get("groupid").toString(); + } + + if ("CAUTION_DEDUCTION_MONEY".equalsIgnoreCase(colName2)) sontno3 = colM2.get("sortno") == null ? "" : colM2.get("sortno").toString(); + if ("CAUTION_MONEY_REMAIN".equalsIgnoreCase(colName2)) sontno4 = colM2.get("sortno") == null ? "" : colM2.get("sortno").toString(); + if ("CAUTION_MONEY_METHOD".equalsIgnoreCase(colName2)) sontno5 = colM2.get("sortno") == null ? "" : colM2.get("sortno").toString(); + } + String sJson=""; + if(map.containsKey(col)){ + String min=StringUtil.nullToString(map.get(col).get("CostType08-MIN"));//最小值 + String max=StringUtil.nullToString(map.get(col).get("CostType08-MAX"));//最大值 + String defaultValue=StringUtil.nullToString(map.get(col).get("CostType08"));//限定值 + String isShowRatio=StringUtil.nullToString(map.get(col).get("CostType05"));//是否显示比例 + String inputModel=StringUtil.nullToString(map.get(col).get("CostType06"));//输入方式 + String oder=StringUtil.nullToString(map.get(col).get("DISPLAY_ORDER"));//排序号 + if(!col.equals("FIRST_PAYMENT")){ + ProductBaseLoanTools.addAppList(appList, col, "sortno", oder+sontno2); + if(col.equals("CAUTION_MONEY")){ + Map CAUTION_DEDUCTION_MONEY = new HashMap(); + CAUTION_DEDUCTION_MONEY.put("colname", "CAUTION_DEDUCTION_MONEY"); + appList.add(CAUTION_DEDUCTION_MONEY); + ProductBaseLoanTools.addAppList(appList, CAUTION_DEDUCTION_MONEY.get("colname").toString(), "sortno", oder+sontno3); + Map CAUTION_MONEY_REMAIN = new HashMap(); + CAUTION_MONEY_REMAIN.put("colname", "CAUTION_MONEY_REMAIN"); + appList.add(CAUTION_MONEY_REMAIN); + ProductBaseLoanTools.addAppList(appList, CAUTION_MONEY_REMAIN.get("colname").toString(), "sortno", oder+sontno4); + Map CAUTION_MONEY_METHOD = new HashMap(); + CAUTION_MONEY_METHOD.put("colname", col); + appList.add(CAUTION_MONEY_METHOD); + ProductBaseLoanTools.addAppList(appList, CAUTION_MONEY_METHOD.get("colname").toString(), "sortno", oder+sontno5); + } + } + +// String groupId = doTemp.getColumnAttribute(col, "groupid"); + if("0070".equals(groupId)) { + rule.put("financing", "true"); + } + + String ratioMin=StringUtil.nullToString(map.get(col).get("CostType09-MIN"));//比例最小值 + String ratioMax=StringUtil.nullToString(map.get(col).get("CostType09-MAX"));//比例最小值 + String ratioDefaultValue=StringUtil.nullToString(map.get(col).get("CostType09"));//比例限定值 + + rule.put("ratioFee", StringUtil.nullToString(map.get(col).get("CostType07")));//比例参考项 + rule.put("ratioType", inputModel);//比例计算方式 + + rule.put("min", min); + rule.put("max", max); + rule.put("defaultValue", defaultValue); + String para=""; + if(min.length()>0){ + rule.put("min", colName+"不能小于"+min+"@>="); + } + if(max.length()>0){ + rule.put("min", colName+"不能大于"+max+"@<="); + } + + //比例限定 + ratioRule.put("min", ratioMin); + ratioRule.put("max", ratioMax); + ratioRule.put("defaultValue", ratioDefaultValue); + para=""; + if(ratioMin.length()>0){ + ratioRule.put("min", colName+"比例不能小于"+ratioMin+"%@>="); + } + if(ratioMax.length()>0){ + ratioRule.put("min", colName+"比例不能大于"+ratioMax+"%@<="); + } + + if("InputMode03".equals(inputModel)){//互算 + rule.put("isShowRatio","true"); + if(defaultValue.length()>0){ + ProductBaseLoanTools.addAppList(appList, col, "defaultValue", defaultValue); + } + if(ratioDefaultValue.length()>0){ + ProductBaseLoanTools.addAppList(appList, col+"_RATIO", "defaultValue", ratioDefaultValue); + } + }else if("InputMode02".equals(inputModel)){//比例算金额 + rule.put("isShowRatio","true"); + ProductBaseLoanTools.addAppList(appList, col, "colreadonly", "1"); + if(ratioDefaultValue.length()>0){ + ProductBaseLoanTools.addAppList(appList, col+"_RATIO", "colreadonly", "1"); + ProductBaseLoanTools.addAppList(appList, col+"_RATIO", "defaultValue", ratioDefaultValue); + } + }else{ + rule.put("isShowRatio","true"); + ProductBaseLoanTools.addAppList(appList, col+"_RATIO", "colreadonly", "1"); + if(defaultValue.length()>0){ + ProductBaseLoanTools.addAppList(appList, col, "defaultValue", defaultValue); + ProductBaseLoanTools.addAppList(appList, col, "colreadonly", "1"); + ProductBaseLoanTools.addAppList(appList, col+"_FINA", "colreadonly", "1"); + } + if("N".equals(isShowRatio)){ + ProductBaseLoanTools.addAppList(appList, col, "colfilterrefid", ""); + rule.put("isShowRatio","false"); + } + } + for(Map.Entry entry:rule.entrySet()){ + sJson+="'"+entry.getKey()+"':'"+entry.getValue()+"',"; + } + sJson+="'ratioRule':"+FileOperatorUtil.getMapToJsonStr(ratioRule); + } + return "{"+sJson+"}"; + } + /** * 给模板加字段校验 * @param vali 检验规则集合 @@ -217,4 +376,74 @@ public class ProductConditionService { col.setAttribute("GROUPID", "fund_info");//分组 return col; } + + public void createFeeColApp(List> appList, String colname,Map column){ + colname = colname.toUpperCase(); + //使用名 + ProductBaseLoanTools.addAppList(appList, colname, "COLNAME".toLowerCase(), colname); + //显示序号 + ProductBaseLoanTools.addAppList(appList, colname, "COLINDEX".toLowerCase(), column.get("DISPLAY_ORDER")); + //排序号 + ProductBaseLoanTools.addAppList(appList, colname, "SORTNO".toLowerCase(), column.get("DISPLAY_ORDER")); + //是否有效 1 有效 0 无效 + ProductBaseLoanTools.addAppList(appList, colname, "ISINUSE".toLowerCase(), "1"); + // JBO属性名 + ProductBaseLoanTools.addAppList(appList, colname, "COLACTUALNAME".toLowerCase(), "''"); + //值类型 + ProductBaseLoanTools.addAppList(appList, colname, "COLTYPE".toLowerCase(), "Number"); + //默认值 + ProductBaseLoanTools.addAppList(appList, colname, "COLDEFAULTVALUE".toLowerCase(), "0"); + //显示名称 + ProductBaseLoanTools.addAppList(appList, colname, "COLHEADER".toLowerCase(), column.get("colheader")); + //编辑形式 + ProductBaseLoanTools.addAppList(appList, colname, "COLEDITSTYLE".toLowerCase(), column.get("Text")); + //格式检查 + ProductBaseLoanTools.addAppList(appList, colname, "COLCHECKFORMAT".toLowerCase(), "2"); + //对齐方式 + ProductBaseLoanTools.addAppList(appList, colname, "COLALIGN".toLowerCase(), "1"); + //可见 + ProductBaseLoanTools.addAppList(appList, colname, "COLVISIBLE".toLowerCase(), "1"); + //只读 + ProductBaseLoanTools.addAppList(appList, colname, "COLREADONLY".toLowerCase(), "0"); + //必填 + ProductBaseLoanTools.addAppList(appList, colname, "COLREQUIRED".toLowerCase(), "1"); + //分组 + ProductBaseLoanTools.addAppList(appList, colname, "GROUPID".toLowerCase(), "fund_info"); + //比例 + ProductBaseLoanTools.addAppList(appList, colname, "colfilterrefid".toLowerCase(), colname+"_RATIO"); + } + + public void createFeeColRatioApp(List> appList,String colname,Map column){ + colname = colname.toUpperCase(); + //使用名 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLNAME".toLowerCase(), colname+"_RATIO"); + //显示序号 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLINDEX".toLowerCase(), column.get("DISPLAY_ORDER")); + //排序号 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "SORTNO".toLowerCase(), column.get("DISPLAY_ORDER")); + //是否有效 1 有效 0 无效 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "ISINUSE".toLowerCase(), "1"); + // JBO属性名 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLACTUALNAME".toLowerCase(), "''"); + //值类型 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLTYPE".toLowerCase(), "Number"); + //默认值 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLDEFAULTVALUE".toLowerCase(), "0"); + //显示名称 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLHEADER".toLowerCase(), column.get("colheader")); + //编辑形式 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLEDITSTYLE".toLowerCase(), column.get("Text")); + //格式检查 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLCHECKFORMAT".toLowerCase(), "2"); + //对齐方式 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLALIGN".toLowerCase(), "1"); + //可见 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLVISIBLE".toLowerCase(), "0"); + //只读 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLREADONLY".toLowerCase(), "0"); + //必填 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "COLREQUIRED".toLowerCase(), "1"); + //分组 + ProductBaseLoanTools.addAppList(appList, colname+"_RATIO", "GROUPID".toLowerCase(), "fund_info"); + } } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/upload/service/impl/BusinessDocUploadServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/upload/service/impl/BusinessDocUploadServiceImpl.java index 69bf52edf..99bf55c17 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/upload/service/impl/BusinessDocUploadServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/doc/upload/service/impl/BusinessDocUploadServiceImpl.java @@ -31,14 +31,29 @@ public class BusinessDocUploadServiceImpl implements BusinessDocUploadService { private Map fieldMap; private List> fileList; + public void setFieldMap(Map fieldMap) { + this.fieldMap = fieldMap; + } + + public void setFileList(List> fileList) { + this.fileList = fileList; + } + @SuppressWarnings({ "unchecked", "deprecation" }) public Map upload(HttpServletRequest request, HttpServletResponse response, JBOTransaction tx, Transaction sqlca, ReturnMapUtil ReturnMapUtil) throws Exception { - Map testMap = (Map) MultipartDataUtil + + Map testMap = null; + + if (response != null) { + testMap = (Map) MultipartDataUtil .readRequestParam(request, "UTF-8"); - fieldMap = (Map) testMap.get("fieldMap"); // 参数 - fileList = (List>) testMap.get("fileList"); // 资料列表 + } + + fieldMap = testMap != null ? (Map) testMap.get("fieldMap") : fieldMap; // 参数 + fileList = testMap != null ? (List>) testMap.get("fileList") : fileList; // 资料列表 + String applyType = "BusinessApplyApply"; String flowUnid = fieldMap.get("objectno") == null ? "" : fieldMap.get( "objectno").toString(); // 流程号 @@ -125,7 +140,7 @@ public class BusinessDocUploadServiceImpl implements BusinessDocUploadService { attr.setAttributeValue("FullPath",sFullPath); attr.setAttributeValue("Content_Type", file.get("fileContentType")); attr.setAttributeValue("FileSize", file.get("fileSize")); - tx.join(attrBm); +// tx.join(attrBm); attrBm.saveObject(attr); } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/controller/LoanSimulationBasicInfoController.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/controller/LoanSimulationBasicInfoController.java index 93d109323..1bd1d5b23 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/controller/LoanSimulationBasicInfoController.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/controller/LoanSimulationBasicInfoController.java @@ -19,6 +19,23 @@ import com.base.util.ReturnMapUtil; @Path("/loan/simulation/basic") public class LoanSimulationBasicInfoController { + @Path("/product") + @POST + public Map product(@Context HttpServletRequest request, @Context HttpServletResponse response, + @Context JBOTransaction tx, @Context Transaction sqlca) throws Exception { + ReturnMapUtil ReturnMapUtil = new ReturnMapUtil(tx, sqlca); + ARE.getLog().info( + "[CONTROLLER] LoanSimulationBasicInfo run ................."); + ARE.getLog().info("[Path] /loan/simulation/basic/product" + " run ................."); + + LoanSimulationBasicService service = new LoanSimulationBasicServiceImpl(); + try { + return service.product(request, response, tx, sqlca, ReturnMapUtil); + } catch (Exception e) { + return ReturnMapUtil.rollback(e); + } + } + @Path("/query") @POST public Map queryInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java new file mode 100644 index 000000000..1054fe517 --- /dev/null +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/product/ProductBaseLoanTools.java @@ -0,0 +1,311 @@ +package apx.com.amarsoft.als.apzl.apply.business.loan.product; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Vector; + +import jbo.sys.CODE_LIBRARY; +import apx.com.amarsoft.als.base.cache.instance.AppAweDoCache; + +import com.amarsoft.app.lc.workflow.action.GetFlowAction; +import com.amarsoft.are.ARE; +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.BizObjectQuery; +import com.amarsoft.are.jbo.JBOException; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.lang.StringX; +import com.amarsoft.awe.dw.ui.validator.ValidateRule; +import com.tenwa.reckon.bean.TabCalBean; +import com.tenwa.reckon.product.ProductCondition; +import com.tenwa.reckon.util.TbBeanTools; +import com.tenwa.util.SerialNumberUtil; + +public class ProductBaseLoanTools { + @SuppressWarnings("unchecked") + public static Map checkSource(Map app, + String colName, String operation, Object value) { + + if ("finatype01".equals(value)) { + ARE.getLog().info("finatype01"); + } + + if (operation.contains("defaultValue")) { + app.put("coldefaultvalue", value); + } else { + if (!"coldefaultvalue".equals(operation)) { + return app; + } + } + + Map donoTemp = (Map) (AppAweDoCache.getAppAweDoCachePool().get("LoanSimulationBasicInfoApp")); + List> libarary = (List>) (donoTemp.get("library")); + String source = ""; + String sourceType = ""; + + for (Map col : libarary) { + String sColName = col.get("colname") == null ? "" : col.get("colname").toString(); + if (sColName.equals(colName)) { + source = col.get("coleditsource") == null ? "" : col.get("coleditsource").toString(); + sourceType = col.get("coleditsourcetype") == null ? "" : col.get("coleditsourcetype").toString(); + break; + } + } + source = app.get("coleditsource") == null ? source : app.get("coleditsource").toString(); + sourceType = app.get("coleditsourcetype") == null ? sourceType : app.get("coleditsourcetype").toString(); + if (StringX.isSpace(source)) { + app.put("coldefaultitemno", value); + return app; + } + + if (StringX.isSpace(sourceType)) { + app.put("coldefaultitemno", value); + return app; + } + + if ("Code".equals(sourceType)) { // CODENO='SettleMethod' + try { + String itemno = value == null ? null : value.toString(); + BizObjectManager bom = JBOFactory.getBizObjectManager(CODE_LIBRARY.CLASS_NAME); + BizObject bo = bom.createQuery("CODENO=:CODENO and itemno=:itemno") + .setParameter("CODENO", source).setParameter("itemno", itemno) + .getSingleResult(false); + if (null == bo) { + app.put("coldefaultitemno", value); + return app; + } + app.put("coldefaultitemno", bo.getAttribute("itemname").getValue()); + return app; + } catch (JBOException e) { + ARE.getLog().error(e); + app.put("coldefaultitemno", value); + return app; + } + + } else if ("CodeTable".equals(sourceType)) { // 班,班,休,休 + try { + String itemno = value == null ? null : value.toString(); + int size = source.split(",").length; + if (size > 0 && size % 2 == 0) { + String [] array = source.split(","); + for (int i = 0; i < size; i++) { + if (i!=0 && i + 1 > size) break; + String itemno2 = array[i]; + if (itemno2.equalsIgnoreCase(itemno)) { + app.put("coldefaultitemno", array[i+1]); + break; + } + i++; + } + if (null == app.get("coldefaultitemno")) { + app.put("coldefaultitemno", value); + return app; + } + } else { + app.put("coldefaultitemno", value); + return app; + } + } catch (Exception e) { + ARE.getLog().error(e); + app.put("coldefaultitemno", value); + return app; + } + } else if ("JBO".equals(sourceType)) { // jbo.app.tenwa.customer.DISTRIBUTOR_INFO,ID,DISTRIBUTOR_NAME,1=1 + + try { + String itemno = value == null ? null : value.toString(); + if (source.contains(",")) { + String[] arrayJbo = source.split(","); + if (arrayJbo.length >= 4) { + String sClass = arrayJbo[0]; + String sKey = arrayJbo[1]; + String sValue = arrayJbo[2]; + String sWhere = arrayJbo[3]; + if (arrayJbo.length > 4) { + for (int io = 4; io < arrayJbo.length; io++) { + sWhere += "," + arrayJbo[io]; + } + } + BizObjectManager bom = JBOFactory + .getBizObjectManager(sClass); + BizObjectQuery boq = bom.createQuery("SELECT " + + sKey + ", " + sValue + + " FROM O WHERE " + sWhere); + List bos = boq.getResultList(false); + for (BizObject bo : bos) { + // sDefult + if (itemno.equals(bo.getAttribute(sKey) + .getValue())) { + app.put("coldefaultitemno", bo.getAttribute(sValue) + .getValue()); + return app; + } + } + if (null == app.get("coldefaultitemno")) { + app.put("coldefaultitemno", value); + return app; + } + } + } + } catch (JBOException e) { + ARE.getLog().error(e); + app.put("coldefaultitemno", value); + return app; + } + + } else if ("@MIN_MAX".equals(sourceType)) { // 6,8 + try { + String itemno = value == null ? null : value.toString(); + int size = source.split(",").length; + if (size == 2) { + String [] array = source.split(","); + String itemno2 = array[0]; + String itemno3 = array[1]; + int min = Integer.valueOf(itemno2); + int max = Integer.valueOf(itemno3); + int iin = Integer.valueOf(itemno); + + if(min <= iin && iin <= max) { + app.put("coldefaultitemno", iin); + return app; + } else { + app.put("coldefaultitemno", value); + return app; + } + } else { + app.put("coldefaultitemno", value); + return app; + } + } catch (NumberFormatException e) { + ARE.getLog().error(e); + app.put("coldefaultitemno", value); + return app; + } + } + + return app; + } + + public static void addAppList(List> appList, + String colName, String operation, Object value) { + if (null == appList) + return; + if (null == colName) + return; + if (null == operation) + return; + boolean flag = false; + for (Map app : appList) { + String colName2 = app.get("colname") == null ? "" : app.get( + "colname").toString(); + if (colName.equals(colName2)) { + app.put(operation, value); + checkSource(app, colName, operation, value); + flag = true; + break; + } + } + if (!flag) { + Map app = new HashMap(); + app.put("colname", colName); + app.put(operation, value); + checkSource(app, colName, operation, value); + appList.add(app); + } + flag = false; + } + + // begin 费用规则 + public static String getProductFundRules(List> appList, + String productId) throws Exception { + if (null == appList) + appList = new ArrayList>(); + ProductCondition pc = new ProductCondition(); + pc.getProductFundRulesApp(appList, productId); + /* 设置模板属性 */ + Vector vali = new Vector(); + String calcRules = pc.getProductRulesApp(appList, productId, vali); + return calcRules; + } + + // end + + // begin 获取 测算基础值及流水号 + public static Map deadWork(String productId, + String calType, String planCName, String plannumber, String tb, + String flowunid, JBOTransaction tx) throws Exception { + Map map = new HashMap(); + /* 获取参数 */ + /* 根据参数判断 是否去数据库查询 */ + BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); + if (productId == null) { + productId = flow.getAttribute("productId").getString(); + } + map.put("productId", productId); + if (calType == null) { + calType = "proj_process"; + } + map.put("calType", calType); + TabCalBean tcb = TbBeanTools.getTabInfo(calType); + planCName = tcb.getPlanCName(); + map.put("planCName", planCName); + // 方案编号 + if (plannumber == null) { + if ("pay_process".equals(calType) + || "onHire_process".equals(calType)) { + BizObject condtion = JBOFactory + .createBizObjectQuery( + "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", + "flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ") + .setParameter("flowunid", flowunid) + .getSingleResult(false); + if (condtion != null) { + plannumber = condtion.getAttribute(planCName).getString(); + } + } else { + BizObject condtion = JBOFactory + .createBizObjectQuery( + "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", + "flowunid=:flowunid") + .setParameter("flowunid", flowunid) + .getSingleResult(false); + if (condtion != null) { + plannumber = condtion.getAttribute(planCName).getString(); + } + } + } + + // 新增数据 自动生成方案编号 + if (plannumber == null) { + String sSerialType = ""; + if ("proj_process".equals(calType)) { + BizObject proj = JBOFactory + .createBizObjectQuery( + "jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP", + "flowunid=:flowunid") + .setParameter("flowunid", flowunid) + .getSingleResult(false); + sSerialType = proj.getAttribute("PROJECT_NO").getString(); + } else { + BizObject contract = JBOFactory + .createBizObjectQuery( + "jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP", + "flowunid=:flowunid") + .setParameter("flowunid", flowunid) + .getSingleResult(false); + sSerialType = contract.getAttribute("CONTRACT_NO").getString(); + } + plannumber = SerialNumberUtil.getPlannumber(sSerialType, calType, + tx); + tx.commit(); + } + map.put("plannumber", plannumber); + tb = tcb.getCondition_tb(); + map.put("tb", tb); + return map; + } + // end +} diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/LoanSimulationBasicService.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/LoanSimulationBasicService.java index c31632f44..35a647414 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/LoanSimulationBasicService.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/LoanSimulationBasicService.java @@ -11,6 +11,11 @@ import com.amarsoft.awe.util.Transaction; import com.base.util.ReturnMapUtil; public interface LoanSimulationBasicService { + Map product(@Context HttpServletRequest request, + @Context HttpServletResponse response, @Context JBOTransaction tx, + @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) + throws Exception; + Map queryInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @Context JBOTransaction tx, @Context Transaction sqlca, ReturnMapUtil ReturnMapUtil) diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java index a8287f996..f8ca86e36 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/loan/service/impl/LoanSimulationBasicServiceImpl.java @@ -1,5 +1,8 @@ package apx.com.amarsoft.als.apzl.apply.business.loan.service.impl; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; @@ -7,26 +10,67 @@ import javax.servlet.http.HttpServletResponse; import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LoanSimulationBasicInfoAppInfoDoManage; import apx.com.amarsoft.als.apzl.apply.business.loan.manage.LoanSimulationBasicInfoAppInfoSaveDoManage; +import apx.com.amarsoft.als.apzl.apply.business.loan.product.ProductBaseLoanTools; import apx.com.amarsoft.als.apzl.apply.business.loan.service.LoanSimulationBasicService; import com.amarsoft.app.lc.workflow.action.GetFlowAction; import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.JBOFactory; import com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.awe.util.Transaction; import com.amarsoft.context.ASUser; import com.base.constant.RestfullConstant; +import com.base.util.JsonUtil; import com.base.util.MultipartDataUtil; import com.base.util.ReturnMapUtil; -import com.tenwa.reckon.bean.TabCalBean; import com.tenwa.reckon.executor.CreateTransactionExecutor; -import com.tenwa.reckon.util.TbBeanTools; -import com.tenwa.util.SerialNumberUtil; public class LoanSimulationBasicServiceImpl implements LoanSimulationBasicService { private Map fieldMap; + @SuppressWarnings("unchecked") + public Map product(HttpServletRequest request, + HttpServletResponse response, JBOTransaction tx, Transaction sqlca, + ReturnMapUtil ReturnMapUtil) throws Exception { + + Map testMap = (Map) MultipartDataUtil + .readRequestParam(request, "UTF-8"); + fieldMap = (Map) testMap.get("fieldMap"); + + String flowunid = fieldMap.get("objectNo".toLowerCase()) == null ? "" + : fieldMap.get("objectNo".toLowerCase()).toString(); + + fieldMap.put("flowunid".toLowerCase(), flowunid); + fieldMap.put("flowunid".toUpperCase(), flowunid); + fieldMap.put("flow_unid".toLowerCase(), flowunid); + fieldMap.put("flow_unid".toUpperCase(), flowunid); + + // 获取 测算基础值及流水号 + Map baseMap = ProductBaseLoanTools.deadWork(null, null, + null, null, null, flowunid, tx); + // 费用规则 + List> appList = new ArrayList>(); + + String calcRules = ProductBaseLoanTools + .getProductFundRules(appList, baseMap.get("productId").toString()); + + Map calcRulesMap = JsonUtil.str2JSONObject(calcRules); + + Map body = new HashMap(); + body.put("planCName", baseMap.get("planCName")); + body.put("plannumber", baseMap.get("plannumber")); + body.put("tb", baseMap.get("tb")); + body.put("calType", baseMap.get("calType")); + + body.put("productId", baseMap.get("productId")); + body.put("productDatas", appList); + body.put("productFundRules", calcRulesMap); + + ReturnMapUtil.setReturnMap(body, + RestfullConstant.baseProperty.get("success").toString(), ""); + return ReturnMapUtil.getReturnMap(); + } + @SuppressWarnings("unchecked") public Map queryInfo(HttpServletRequest request, HttpServletResponse response, JBOTransaction tx, Transaction sqlca, @@ -37,65 +81,22 @@ public class LoanSimulationBasicServiceImpl implements String flowunid = fieldMap.get("objectNo".toLowerCase()) == null ? "" : fieldMap.get("objectNo".toLowerCase()).toString(); + String planCName = fieldMap.get("planCName".toLowerCase()) == null ? null + : fieldMap.get("planCName".toLowerCase()).toString(); // 方案编号 String plannumber = fieldMap.get("plannumber".toLowerCase()) == null ? null : fieldMap.get("plannumber".toLowerCase()).toString(); // 方案编号 - String productId = fieldMap.get("ProductId".toLowerCase()) == null ? null - : fieldMap.get("ProductId".toLowerCase()).toString(); - String calType = fieldMap.get("calType".toLowerCase()) == null ? null - : fieldMap.get("calType".toLowerCase()).toString(); + String conditionTB = fieldMap.get("tb".toLowerCase()) == null ? null + : fieldMap.get("tb".toLowerCase()).toString(); fieldMap.put("flowunid".toLowerCase(), flowunid); fieldMap.put("flowunid".toUpperCase(), flowunid); fieldMap.put("flow_unid".toLowerCase(), flowunid); fieldMap.put("flow_unid".toUpperCase(), flowunid); - /* 获取参数 */ - /* 根据参数判断 是否去数据库查询 */ - BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); - if (productId == null) { - productId = flow.getAttribute("productId").getString(); - } - if (calType == null) { - calType = "proj_process"; - } - - TabCalBean tcb = TbBeanTools.getTabInfo(calType); - String planCName = tcb.getPlanCName(); - // 方案编号 - if (plannumber == null) { - if ("pay_process".equals(calType) - || "onHire_process".equals(calType)) { - BizObject condtion = JBOFactory - .createBizObjectQuery( - "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", - "flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - if (condtion != null) { - plannumber = condtion.getAttribute(planCName).getString(); - } - } else { -// String planType = ProductParamUtil.getProductParameterValue( -// productId, "PRD0314", "planinformation"); -// if ("SinglePlan".equals(planType)) { - BizObject condtion = JBOFactory - .createBizObjectQuery( - "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", - "flowunid=:flowunid") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - if (condtion != null) { - plannumber = condtion.getAttribute(planCName) - .getString(); - } -// } - } - } - LoanSimulationBasicInfoAppInfoDoManage manage = new LoanSimulationBasicInfoAppInfoDoManage(); manage.setDono("LoanSimulationBasicInfoApp2"); manage.setsAddWhere(" and " + planCName + "='" + plannumber + "'"); - manage.setsJboClass(tcb.getCondition_tb()); + manage.setsJboClass(conditionTB); manage.setFieldMap(fieldMap); return manage.queryDefaultDo(request, sqlca, tx, ReturnMapUtil); } @@ -112,88 +113,20 @@ public class LoanSimulationBasicServiceImpl implements : fieldMap.get("objectNo".toLowerCase()).toString(); String plannumber = fieldMap.get("plannumber".toLowerCase()) == null ? null : fieldMap.get("plannumber".toLowerCase()).toString(); // 方案编号 - String productId = fieldMap.get("ProductId".toLowerCase()) == null ? null - : fieldMap.get("ProductId".toLowerCase()).toString(); - String calType = fieldMap.get("calType".toLowerCase()) == null ? null - : fieldMap.get("calType".toLowerCase()).toString(); + String planCName = fieldMap.get("planCName".toLowerCase()) == null ? null + : fieldMap.get("planCName".toLowerCase()).toString(); // 方案编号 + String conditionTB = fieldMap.get("tb".toLowerCase()) == null ? null + : fieldMap.get("tb".toLowerCase()).toString(); fieldMap.put("flowunid".toLowerCase(), flowunid); fieldMap.put("flowunid".toUpperCase(), flowunid); fieldMap.put("flow_unid".toLowerCase(), flowunid); fieldMap.put("flow_unid".toUpperCase(), flowunid); - /* 获取参数 */ - /* 根据参数判断 是否去数据库查询 */ - BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); - if (productId == null) { - productId = flow.getAttribute("productId").getString(); - } - if (calType == null) { - calType = "proj_process"; - } - - TabCalBean tcb = TbBeanTools.getTabInfo(calType); - String planCName = tcb.getPlanCName(); - // 方案编号 - if (plannumber == null) { - if ("pay_process".equals(calType) - || "onHire_process".equals(calType)) { - BizObject condtion = JBOFactory - .createBizObjectQuery( - "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", - "flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - if (condtion != null) { - plannumber = condtion.getAttribute(planCName).getString(); - } - } else { -// String planType = ProductParamUtil.getProductParameterValue( -// productId, "PRD0314", "planinformation"); -// if ("SinglePlan".equals(planType)) { - BizObject condtion = JBOFactory - .createBizObjectQuery( - "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", - "flowunid=:flowunid") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - if (condtion != null) { - plannumber = condtion.getAttribute(planCName) - .getString(); - } -// } - } - } - - // 新增数据 自动生成方案编号 - if (plannumber == null) { - String sSerialType = ""; - if ("proj_process".equals(calType)) { - BizObject proj = JBOFactory - .createBizObjectQuery( - "jbo.com.tenwa.lease.comm.LB_PROJECT_INFO_TEMP", - "flowunid=:flowunid") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - sSerialType = proj.getAttribute("PROJECT_NO").getString(); - } else { - BizObject contract = JBOFactory - .createBizObjectQuery( - "jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO_TEMP", - "flowunid=:flowunid") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - sSerialType = contract.getAttribute("CONTRACT_NO").getString(); - } - plannumber = SerialNumberUtil.getPlannumber(sSerialType, calType, - tx); - tx.commit(); - } - LoanSimulationBasicInfoAppInfoSaveDoManage manage = new LoanSimulationBasicInfoAppInfoSaveDoManage(); manage.setDono("LoanSimulationBasicInfoApp2"); manage.setAddWhere(" and " + planCName + "='" + plannumber + "'"); - manage.setsJboClass(tcb.getCondition_tb()); + manage.setsJboClass(conditionTB); manage.setFieldMap(fieldMap); String userId = request.getSession().getAttribute("userid").toString(); ASUser user = new ASUser(userId, sqlca); @@ -214,16 +147,14 @@ public class LoanSimulationBasicServiceImpl implements : fieldMap.get("objectNo".toLowerCase()).toString(); String plannumber = fieldMap.get("plannumber".toLowerCase()) == null ? null : fieldMap.get("plannumber".toLowerCase()).toString(); // 方案编号 - String productId = fieldMap.get("ProductId".toLowerCase()) == null ? null - : fieldMap.get("ProductId".toLowerCase()).toString(); - String calType = fieldMap.get("calType".toLowerCase()) == null ? null - : fieldMap.get("calType".toLowerCase()).toString(); fieldMap.put("flowunid".toLowerCase(), flowunid); fieldMap.put("flowunid".toUpperCase(), flowunid); fieldMap.put("flow_unid".toLowerCase(), flowunid); fieldMap.put("flow_unid".toUpperCase(), flowunid); + String productId = null; + String calType = null; /* 获取参数 */ /* 根据参数判断 是否去数据库查询 */ BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid); @@ -234,39 +165,6 @@ public class LoanSimulationBasicServiceImpl implements calType = "proj_process"; } - TabCalBean tcb = TbBeanTools.getTabInfo(calType); - String planCName = tcb.getPlanCName(); - // 方案编号 - if (plannumber == null) { - if ("pay_process".equals(calType) - || "onHire_process".equals(calType)) { - BizObject condtion = JBOFactory - .createBizObjectQuery( - "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", - "flowunid=:flowunid and PAYMENT_NUMBER is not null and length(PAYMENT_NUMBER)>0 ") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - if (condtion != null) { - plannumber = condtion.getAttribute(planCName).getString(); - } - } else { -// String planType = ProductParamUtil.getProductParameterValue( -// productId, "PRD0314", "planinformation"); -// if ("SinglePlan".equals(planType)) { - BizObject condtion = JBOFactory - .createBizObjectQuery( - "jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP", - "flowunid=:flowunid") - .setParameter("flowunid", flowunid) - .getSingleResult(false); - if (condtion != null) { - plannumber = condtion.getAttribute(planCName) - .getString(); - } -// } - } - } - CreateTransactionExecutor cte = new CreateTransactionExecutor(); cte.setCalType(calType); cte.setFlowunid(flowunid); diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java index 6074355d7..0b070f7dc 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/init/InitDocListTools.java @@ -20,79 +20,85 @@ import com.tenwa.doc.action.DocListInitAction; public class InitDocListTools { @SuppressWarnings({ "rawtypes", "unchecked" }) - public static void initDocList(String flowUnid, String userId, String carAttributes) throws Exception { - BizObjectManager objectManage = JBOFactory - .getBizObjectManager(FLOW_OBJECT.CLASS_NAME); - BizObject object = objectManage.createQuery("OBJECTNO=:OBJECTNO") - .setParameter("OBJECTNO", flowUnid).getSingleResult(false); - if (null == object) - return; - String flowNo = object.getAttribute("flowno") == null ? "" : object - .getAttribute("flowno").toString(); - String sObjectType = object.getAttribute("ObjectType") == null ? "" - : object.getAttribute("ObjectType").toString(); - String productId = ""; - BizObject flow = GetFlowAction.getFlowBussinessObject(flowUnid); - if (null == flow) - return; - productId = flow.getAttribute("productId").getString(); - - BizObjectManager businessManage = JBOFactory - .getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME); - BizObject business = businessManage.createQuery("flow_unid=:flow_unid") - .setParameter("flow_unid", flowUnid).getSingleResult(false); - if (null == business) - return; - List list; + public static boolean initDocList(String flowUnid, String userId, String carAttributes) throws Exception { try { - list = ProductParamUtil.getProductDocInfo(productId, "PRD0412"); - } catch (Exception e) { - ARE.getLog().error(e); - return; - } - String type = ""; - String docList = ""; - for (int i = 0; i < list.size(); i++) { - Map map = (Map) list.get(i); - if ("BusinessApplyFlow".equals(map.get("FLOW_INFO").toString())) { - type = map.get("TYPE").toString(); - if ("SingleRow".equals(type)) { - docList = map.get("DOCLIST").toString(); - } else { - List l = (List) map.get("DOCCONFIG"); - docList = l.toString(); + BizObjectManager objectManage = JBOFactory + .getBizObjectManager(FLOW_OBJECT.CLASS_NAME); + BizObject object = objectManage.createQuery("OBJECTNO=:OBJECTNO") + .setParameter("OBJECTNO", flowUnid).getSingleResult(false); + if (null == object) + return false; + String flowNo = object.getAttribute("flowno") == null ? "" : object + .getAttribute("flowno").toString(); + String sObjectType = object.getAttribute("ObjectType") == null ? "" + : object.getAttribute("ObjectType").toString(); + String productId = ""; + BizObject flow = GetFlowAction.getFlowBussinessObject(flowUnid); + if (null == flow) + return false; + productId = flow.getAttribute("productId").getString(); + + BizObjectManager businessManage = JBOFactory + .getBizObjectManager(FLOW_BUSSINESS_OBJECT.CLASS_NAME); + BizObject business = businessManage.createQuery("flow_unid=:flow_unid") + .setParameter("flow_unid", flowUnid).getSingleResult(false); + if (null == business) + return false; + List list; + try { + list = ProductParamUtil.getProductDocInfo(productId, "PRD0412"); + } catch (Exception e) { + ARE.getLog().error(e); + return false; + } + String type = ""; + String docList = ""; + for (int i = 0; i < list.size(); i++) { + Map map = (Map) list.get(i); + if ("BusinessApplyFlow".equals(map.get("FLOW_INFO").toString())) { + type = map.get("TYPE").toString(); + if ("SingleRow".equals(type)) { + docList = map.get("DOCLIST").toString(); + } else { + List l = (List) map.get("DOCCONFIG"); + docList = l.toString(); + } } } - } - String docClassItemno = docList;// CurPage.getParameter("docList"); - String[] itemnos=docClassItemno.split(","); - String s=""; - for(int i=0;i0){ - s=s.substring(0, s.length()-1); - } - - try { - ASUser CurUser = new ASUser(userId); - Map docParam=new HashMap(); - Map other=new HashMap(); - other.put("carAttributes", carAttributes); - docParam.put("ObjectType",sObjectType); - docParam.put("proj_id", flow.getAttribute("proj_id").getString()); - docParam.put("contract_id", flow.getAttribute("contract_id").getString()); - docParam.put("flow_unid", flowUnid); - docParam.put("inputtime", StringFunction.getTodayNow()); - docParam.put("inputuserid", CurUser.getUserID()); - docParam.put("inputorgid", CurUser.getOrgID()); - @SuppressWarnings("deprecation") - Configure CurConfig = Configure.getInstance(); - //判断是否存在,不存在就从配置表倒到临时表 - DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig); + String docClassItemno = docList;// CurPage.getParameter("docList"); + String[] itemnos=docClassItemno.split(","); + String s=""; + for(int i=0;i0){ + s=s.substring(0, s.length()-1); + } + + try { + ASUser CurUser = new ASUser(userId); + Map docParam=new HashMap(); + Map other=new HashMap(); + other.put("carAttributes", carAttributes); + docParam.put("ObjectType",sObjectType); + docParam.put("proj_id", flow.getAttribute("proj_id").getString()); + docParam.put("contract_id", flow.getAttribute("contract_id").getString()); + docParam.put("flow_unid", flowUnid); + docParam.put("inputtime", StringFunction.getTodayNow()); + docParam.put("inputuserid", CurUser.getUserID()); + docParam.put("inputorgid", CurUser.getOrgID()); + @SuppressWarnings("deprecation") + Configure CurConfig = Configure.getInstance(); + //判断是否存在,不存在就从配置表倒到临时表 + DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig); + } catch (Exception e) { + ARE.getLog().error(e); + return false; + } } catch (Exception e) { ARE.getLog().error(e); - return; + return false; } + return true; } } diff --git a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java index 79b35be73..ff8dbd752 100644 --- a/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java +++ b/src_app_fresh/apx/com/amarsoft/als/apzl/apply/business/start/service/impl/BusinessApplyStartServiceImpl.java @@ -1,23 +1,28 @@ package apx.com.amarsoft.als.apzl.apply.business.start.service.impl; +import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import apx.com.amarsoft.als.apzl.apply.business.doc.upload.service.impl.BusinessDocUploadServiceImpl; import apx.com.amarsoft.als.apzl.apply.business.start.bo.BusinessBO; -import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService; import apx.com.amarsoft.als.apzl.apply.business.start.init.InitDocListTools; +import apx.com.amarsoft.als.apzl.apply.business.start.service.BusinessApplyStartService; import com.amarsoft.are.jbo.JBOTransaction; import com.amarsoft.awe.util.Transaction; import com.base.constant.RestfullConstant; +import com.base.util.DateUtil; import com.base.util.MultipartDataUtil; import com.base.util.ReturnMapUtil; public class BusinessApplyStartServiceImpl implements BusinessApplyStartService { private Map fieldMap; + private List> fileList; @SuppressWarnings("unchecked") public Map applyStart(HttpServletRequest request, @@ -27,6 +32,7 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService Map testMap = (Map) MultipartDataUtil .readRequestParam(request, "UTF-8"); fieldMap = (Map) testMap.get("fieldMap"); + fileList = (List>) testMap.get("fileList"); BusinessBO bo = new BusinessBO(fieldMap, tx); tx.commit(); String sReturnInfo = bo.getMsg(); @@ -34,6 +40,29 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService String serialNo = sReturnInfo.split("@")[1]; // 获取当前申请的相关参数,包含FlowUnid Map params = bo.getParams(); + // 加载附件 + boolean flag = InitDocListTools.initDocList(params.get("FlowUnid"), + fieldMap.get("userid").toString(), bo.getCarAttributes()); + + String certType = bo.getCerttype(); + String date = DateUtil.getDateTime(new Date()); + if (flag && "ind01".equals(certType.toLowerCase()) + && (fileList != null && fileList.size() > 0)) { // 承租人身份证(正反面)照片 + fieldMap.put("objectNo".toUpperCase(), params.get("FlowUnid")); + fieldMap.put("objectNo".toLowerCase(), params.get("FlowUnid")); + + fieldMap.put("docname".toUpperCase(), "承租人身份证(正反面)"); + fieldMap.put("docname".toLowerCase(), "承租人身份证(正反面)"); + + fieldMap.put("remark".toUpperCase(), + "业务申请流程手机APP发起 - 上传资料照片 - " + date); + fieldMap.put("remark".toLowerCase(), + "业务申请流程手机APP发起 - 上传资料照片 - " + date); + BusinessDocUploadServiceImpl service = new BusinessDocUploadServiceImpl(); + service.setFieldMap(fieldMap); + service.setFileList(fileList); + service.upload(null, null, tx, sqlca, null); + } // 返回前台的数据 Map body = new HashMap(); body.put("flowUnid", params.get("FlowUnid")); @@ -44,7 +73,6 @@ public class BusinessApplyStartServiceImpl implements BusinessApplyStartService ReturnMapUtil.setReturnMap(body, RestfullConstant.baseProperty.get("success").toString(), "发起成功"); - InitDocListTools.initDocList(params.get("FlowUnid"), fieldMap.get("userid").toString(), bo.getCarAttributes()); } else if (sReturnInfo.startsWith("failed")) { ReturnMapUtil.setReturnMap(null, RestfullConstant.baseProperty.get("FAIL").toString(), diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractOnhireChange.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractOnhireChange.java index 4ff270528..4963b23aa 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractOnhireChange.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractOnhireChange.java @@ -42,11 +42,11 @@ public class CreateVoucherContractOnhireChange { map.put("FlowUnid", FlowUnid); if("PZ2018072100000049".equals(VOUCHERNO)){ - sql="SELECT LRPT.SUMINTE - LRP.SUMINTE AS MONEY,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LB_CONTRACT_INFO LCI INNER JOIN (SELECT MAX(CONTRACT_ID) CONTRACT_ID,SUM(ROUND(INTEREST / 1.06, 2)) SUMINTE,FLOWUNID FROM LC_RENT_PLAN_TEMP GROUP BY FLOWUNID) LRPT ON LRPT.CONTRACT_ID = LCI.ID INNER JOIN (SELECT CONTRACT_ID,SUM(ROUND(INTEREST / 1.06, 2)) SUMINTE FROM LC_RENT_PLAN GROUP BY CONTRACT_ID) LRP ON LRP.CONTRACT_ID = LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO = LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id = lci.id LEFT JOIN customer_info cif ON cif.customerid = lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LRPT.FLOWUNID = :FLOWUNID "; + sql="SELECT LRPT.SUMINTE - LRP.SUMINTE AS MONEY,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(), '%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LB_CONTRACT_INFO LCI INNER JOIN (SELECT MAX(CONTRACT_ID) CONTRACT_ID,SUM(ROUND(INTEREST / 1.06, 2)) SUMINTE,FLOWUNID FROM LC_RENT_PLAN_TEMP GROUP BY FLOWUNID) LRPT ON LRPT.CONTRACT_ID = LCI.ID INNER JOIN (SELECT CONTRACT_ID,SUM(ROUND(INTEREST / 1.06, 2)) SUMINTE FROM LC_RENT_PLAN GROUP BY CONTRACT_ID) LRP ON LRP.CONTRACT_ID = LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO = LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id = lci.id LEFT JOIN customer_info cif ON cif.customerid = lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LRPT.FLOWUNID = :FLOWUNID "; } if("PZ2018072100000050".equals(VOUCHERNO)){ - sql="SELECT LRPT.SUMINTE-LRP.SUMINTE AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME ,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LB_CONTRACT_INFO LCI INNER JOIN (SELECT MAX(CONTRACT_ID) CONTRACT_ID,SUM(INTEREST-ROUND(INTEREST/1.06,2))SUMINTE, FLOWUNID FROM LC_RENT_PLAN_TEMP GROUP BY FLOWUNID) LRPT ON LRPT.CONTRACT_ID=LCI.ID INNER JOIN (SELECT CONTRACT_ID,SUM(INTEREST-ROUND(INTEREST/1.06,2)) SUMINTE FROM LC_RENT_PLAN GROUP BY CONTRACT_ID) LRP ON LRP.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LRPT.FLOWUNID=:FLOWUNID"; + sql="SELECT LRPT.SUMINTE-LRP.SUMINTE AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME ,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LB_CONTRACT_INFO LCI INNER JOIN (SELECT MAX(CONTRACT_ID) CONTRACT_ID,SUM(INTEREST-ROUND(INTEREST/1.06,2))SUMINTE, FLOWUNID FROM LC_RENT_PLAN_TEMP GROUP BY FLOWUNID) LRPT ON LRPT.CONTRACT_ID=LCI.ID INNER JOIN (SELECT CONTRACT_ID,SUM(INTEREST-ROUND(INTEREST/1.06,2)) SUMINTE FROM LC_RENT_PLAN GROUP BY CONTRACT_ID) LRP ON LRP.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LRPT.FLOWUNID=:FLOWUNID"; } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java index 401e4355d..c4da09359 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherContractTerminate.java @@ -40,19 +40,19 @@ public class CreateVoucherContractTerminate { map.put("FlowUnid", FlowUnid); //回款--收到违约金 if("PZ2018072100000026".equals(VOUCHERNO)){ - sql= "SELECT IFNULL(HANDLING_CHARGE,0) AS MONEY ,ROUND(IFNULL(HANDLING_CHARGE,0)/1.06,2) AS MONEYNOTAX,(IFNULL(HANDLING_CHARGE,0)-ROUND(IFNULL(HANDLING_CHARGE,0)/1.06,2)) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; + sql= "SELECT IFNULL(HANDLING_CHARGE,0) AS MONEY ,ROUND(IFNULL(HANDLING_CHARGE,0)/1.06,2) AS MONEYNOTAX,(IFNULL(HANDLING_CHARGE,0)-ROUND(IFNULL(HANDLING_CHARGE,0)/1.06,2)) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; } //收到的提前还款 if("PZ2018072100000027".equals(VOUCHERNO)){ - sql= "SELECT IFNULL(CORPUS_OVERAGE,0) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; + sql= "SELECT IFNULL(CORPUS_OVERAGE,0) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; } //提前还款-调整未实现利息收入 if("PZ2018072100000045".equals(VOUCHERNO)){ - sql="SELECT ROUND(IFNULL(AGREED_INTEREST,0)/1.06,2) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; + sql="SELECT ROUND(IFNULL(AGREED_INTEREST,0)/1.06,2) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; } //提前还款-调整未实现利息收入税金 if("PZ2018072100000046".equals(VOUCHERNO)){ - sql="SELECT IFNULL(AGREED_INTEREST,0)-ROUND(IFNULL(AGREED_INTEREST,0)/1.06,2) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; + sql="SELECT IFNULL(AGREED_INTEREST,0)-ROUND(IFNULL(AGREED_INTEREST,0)/1.06,2) AS MONEY ,0 AS MONEYNOTAX,0 AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%M/%D') AS FACT_DATE,LCI.ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_RENT_ADJUST_TEMP LFRA INNER JOIN LC_CALC_CONDITION LCC ON LCC.PAYMENT_NUMBER=LFRA.PAYMENT_NUMBER INNER JOIN LB_CONTRACT_INFO LCI ON LCC.CONTRACT_ID=LCI.ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFRA.FLOWUNID=:FLOWUNID"; } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java index 1c94cb51d..472f1d994 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustCautionMoneyIncome.java @@ -42,9 +42,11 @@ public class CreateVoucherCustCautionMoneyIncome extends BaseBussiness{ param.clear(); map.put("FlowUnid", FlowUnid); map.put("FEE_TYPE", FeeType); - sql= "SELECT LFIT.FACT_MONEY AS MONEY,LFIT.FACT_MONEY/1.06 AS MONEYNOTAX,(LFIT.FACT_MONEY-LFIT.FACT_MONEY/1.06) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LFIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_INCOME_TEMP LFIT LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFIT.FEE_TYPE=:FEE_TYPE AND LFIT.FLOWUNID=:FLOWUNID "; - - + if("PZ2018073100000062".equals(VOUCHERNO)){ + sql="SELECT LFIT.FACT_MONEY AS MONEY,LFIT.FACT_MONEY/1.06 AS MONEYNOTAX,(LFIT.FACT_MONEY-LFIT.FACT_MONEY/1.06) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LFIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_INCOME_TEMP LFIT LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFIT.FEE_TYPE IN ('feetype20','feetype21','feetype22','feetype23') AND LFIT.FLOWUNID=:FLOWUNID"; + }else{ + sql= "SELECT LFIT.FACT_MONEY AS MONEY,LFIT.FACT_MONEY/1.06 AS MONEYNOTAX,(LFIT.FACT_MONEY-LFIT.FACT_MONEY/1.06) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LFIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_FUND_INCOME_TEMP LFIT LEFT JOIN LB_CONTRACT_INFO LCI ON LFIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LFIT.FEE_TYPE=:FEE_TYPE AND LFIT.FLOWUNID=:FLOWUNID "; + } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java index c276a946b..1f12d33ad 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherCustomerRentOrFee.java @@ -49,7 +49,7 @@ public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { //String FlowUnid=this.getAttribute("FlowUnid").toString(); //String VOUCHERNO="PZ2018071000000005"; //String VOUCHERNO=this.getAttribute("VoucherNo").toString(); - String sql="SELECT LCCT.EQUIP_AMT,LCCT.FIRST_PAYMENT,LCCT.CLEAN_LEASE_MONEY,LCCT.INSURANCE_PREMIUM,LCCT.PURCHASE_TAX,LCCT.INCIDENTAL,LCCT.GPS_FEE_FINANCE,LRPT.INTEREST,LRPT.INTERESTNOTAX,LRPT.TAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_CALC_CONDITION_TEMP LCCT LEFT JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LCCT.CONTRACT_ID LEFT JOIN (SELECT FLOWUNID,SUM(INTEREST) AS INTEREST,SUM(ROUND((INTEREST/1.06),2)) AS INTERESTNOTAX,SUM(INTEREST-ROUND((INTEREST/1.06),2)) AS TAX FROM LC_RENT_PLAN_TEMP GROUP BY FLOWUNID) LRPT ON LRPT.FLOWUNID=LCCT.FLOWUNID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LCCT.FLOWUNID=:FLOWUNID"; + String sql="SELECT LCCT.EQUIP_AMT,LCCT.FIRST_PAYMENT,LCCT.CLEAN_LEASE_MONEY,LCCT.INSURANCE_PREMIUM,LCCT.PURCHASE_TAX,LCCT.INCIDENTAL,LCCT.GPS_FEE_FINANCE,LRPT.INTEREST,LRPT.INTERESTNOTAX,LRPT.TAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_CALC_CONDITION LCCT inner join lc_fund_income_temp lfit on lfit.contract_id=lcct.contract_id and lfit.fee_type='feetype10' LEFT JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LCCT.CONTRACT_ID LEFT JOIN (SELECT FLOWUNID,SUM(INTEREST) AS INTEREST,SUM(ROUND((INTEREST/1.06),2)) AS INTERESTNOTAX,SUM(INTEREST-ROUND((INTEREST/1.06),2)) AS TAX FROM LC_RENT_PLAN_TEMP GROUP BY FLOWUNID) LRPT ON LRPT.FLOWUNID=LCCT.FLOWUNID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE lfit.FLOWUNID=:FLOWUNID"; param.clear(); map.put("FLOWUNID", FlowUnid); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java index 9f52ee4e4..2025d371c 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherHandlingMoney.java @@ -44,7 +44,7 @@ public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { //String VOUCHERNO=this.getAttribute("VoucherNo").toString(); param.clear(); map.put("FlowUnid", FlowUnid); - sql= "SELECT LCCT.HANDLING_CHARGE_MONEY AS MONEY,LCCT.HANDLING_CHARGE_MONEY/1.06 AS HANDLFEENOTAX,(LCCT.HANDLING_CHARGE_MONEY-LCCT.HANDLING_CHARGE_MONEY/1.06)AS HANDLTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d')AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_CALC_CONDITION_TEMP LCCT LEFT JOIN LB_CONTRACT_INFO LCI ON LCCT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LCCT.FLOWUNID=:FLOWUNID"; + sql= "SELECT LCCT.HANDLING_CHARGE_MONEY AS MONEY,LCCT.HANDLING_CHARGE_MONEY/1.06 AS HANDLFEENOTAX,(LCCT.HANDLING_CHARGE_MONEY-LCCT.HANDLING_CHARGE_MONEY/1.06)AS HANDLTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d')AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL ,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_CALC_CONDITION LCCT INNER JOIN lc_fund_income_temp lfit ON lfit.contract_id=lcct.contract_id AND lfit.fee_type='feetype10' LEFT JOIN LB_CONTRACT_INFO LCI ON LCCT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE lfit.FLOWUNID=:FLOWUNID"; List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoanDistributor.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoanDistributor.java index 3f2c3ecc8..c8723f5e8 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoanDistributor.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherLoanDistributor.java @@ -55,7 +55,7 @@ public class CreateVoucherLoanDistributor { moneyDataSource="LCCT.CAUTION_MONEY"; } //sql= "SELECT "+moneyDataSource+ " AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,LCI.DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CUSTOMERID,CIF.CUSTOMERNAME FROM LC_CALC_CONDITION_TEMP LCCT LEFT JOIN LB_CONTRACT_INFO LCI ON LCCT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id WHERE LCCT.FLOWUNID=:FLOWUNID"; - sql="SELECT "+moneyDataSource+ " AS MONEY,ROUND("+moneyDataSource+ "/1.17,2) AS MONEYNOTAX, ("+moneyDataSource+ "-ROUND("+moneyDataSource+ "/1.17,2)) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_CALC_CONDITION_TEMP LCCT LEFT JOIN LB_CONTRACT_INFO LCI ON LCCT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LCCT.FLOWUNID=:FLOWUNID"; + sql="SELECT "+moneyDataSource+ " AS MONEY,ROUND("+moneyDataSource+ "/1.06,2) AS MONEYNOTAX, ("+moneyDataSource+ "-ROUND("+moneyDataSource+ "/1.06,2)) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCCT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_CALC_CONDITION LCCT INNER JOIN lc_fund_income_temp lfit ON lfit.contract_id=lcct.contract_id AND lfit.fee_type='feetype10' LEFT JOIN LB_CONTRACT_INFO LCI ON LCCT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE lfit.FLOWUNID=:FLOWUNID"; List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); CreateVoucherServiceImpl vs=new CreateVoucherServiceImpl(); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java index 9c5885384..f26b20187 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMethodSettle/IncomeVoucher.java @@ -16,11 +16,14 @@ public class IncomeVoucher extends BaseBussiness { cvci.CreateVoucher(FlowUnid, "PZ2018071100000012", "feetype2");//收到客户保证金 cvci.CreateVoucher(FlowUnid, "PZ2018072100000023", "feetype1");//按月分摊的保证金 cvci.CreateVoucher(FlowUnid, "PZ2018072100000031", "feetype4");//都到留购价款 + cvci.CreateVoucher(FlowUnid, "PZ2018072100000028", "feetype27");//贴息 + cvci.CreateVoucher(FlowUnid, "PZ2018073100000062", null);//购置税+保险+装饰 + cvci.CreateVoucher(FlowUnid, "PZ2018073100000061", "feetype24");//GPS - CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); + /*CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); cvri.CreateVoucher(FlowUnid, "PZ2018072100000024");//收到租金 cvri.CreateVoucher(FlowUnid, "PZ2018072100000025");//收到逾期利息 - +*/ return "true"; } diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMonthSettlement.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMonthSettlement.java index e54e67ad8..196e229f0 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMonthSettlement.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherMonthSettlement.java @@ -47,10 +47,10 @@ public class CreateVoucherMonthSettlement{ String moneyType="MONEY"; if("PZ2018071200000017".equals(voucherNo)) moneyType="FEEMONEY"; if("PZ2018071200000016".equals(voucherNo)) moneyType="MONEY"; - sql="SELECT CRM.INTEREST AS MONEY,CRM.FEE AS FEEMONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,CRM.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM CONTRACT_RENT_MONTH CRM LEFT JOIN LB_CONTRACT_INFO LCI ON CRM.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(STR_TO_DATE(CRM.END_DATE,'%Y/%m/%d'),'%Y/%m/%d')=DATE_FORMAT(SYSDATE(),'%Y/%m/%d')"; + sql="SELECT CRM.INTEREST AS MONEY,CRM.FEE AS FEEMONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,CRM.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LEC.ID AS CARID,LEC.MODEL,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM CONTRACT_RENT_MONTH CRM LEFT JOIN LB_CONTRACT_INFO LCI ON CRM.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(STR_TO_DATE(CRM.END_DATE,'%Y/%m/%d'),'%Y/%m/%d')=DATE_FORMAT(SYSDATE(),'%Y/%m/%d')"; if("PZ2018072100000055".equals(voucherNo)){ - sql="SELECT LRP.INTEREST-ROUND(LRP.INTEREST/1.06,2) AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID AS CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_RENT_PLAN LRP INNER JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LRP.CONTRACT_ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(SYSDATE(),'%Y/%m/%d')=DATE_FORMAT(STR_TO_DATE(LRP.PLAN_DATE,'%Y/%m/%d'),'%Y/%m/%d')"; + sql="SELECT LRP.INTEREST-ROUND(LRP.INTEREST/1.06,2) AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LCI.ID AS CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_RENT_PLAN LRP INNER JOIN LB_CONTRACT_INFO LCI ON LCI.ID=LRP.CONTRACT_ID INNER JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(SYSDATE(),'%Y/%m/%d')=DATE_FORMAT(STR_TO_DATE(LRP.PLAN_DATE,'%Y/%m/%d'),'%Y/%m/%d')"; } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); diff --git a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java index cdf3b92da..e9584a3e2 100644 --- a/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java +++ b/src_core/com/tenwa/voucher/CreateVoucherProcess/CreateVoucherRentIncome.java @@ -7,6 +7,7 @@ import java.util.Map; import jbo.voucher.LV_VOUCHER_CONFIG; import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.JBOException; import com.amarsoft.awe.util.Transaction; import com.amarsoft.dict.als.cache.CacheLoaderFactory; import com.tenwa.comm.util.jboutil.DataOperatorUtil; @@ -14,13 +15,16 @@ import com.tenwa.voucher.serviceImp.CreateVoucherServiceImpl; public class CreateVoucherRentIncome { - public String CreateVoucher(String FlowUnid,String VOUCHERNO) throws Exception { + public void CreateVoucher(String VOUCHERNO){ Transaction Sqlca =null; + try{ Map map=new HashMap(); Map param=new HashMap(); Sqlca = Transaction.createTransaction(CacheLoaderFactory.getDataSource()); String MONEY=null; + String MONEYNOTAX=null; + String MONEYTAX=null; String ACCOUNT_DATE=null; String FACT_DATE=null; String CONTRACT_ID=null; @@ -37,12 +41,11 @@ public class CreateVoucherRentIncome { String BUSINESSTYPE=null; String sql=""; param.clear(); - map.put("FLOWUNID", FlowUnid); if("PZ2018072100000024".equals(VOUCHERNO)){ - sql= "SELECT LRIT.rent AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_rent_INCOME_TEMP LrIT LEFT JOIN LB_CONTRACT_INFO LCI ON LrIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LrIT.FLOWUNID=:FLOWUNID"; + sql= "SELECT LRIT.rent AS MONEY,0 AS MONEYNOTAX,0 AS MONEYTAX, DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_rent_INCOME LrIT LEFT JOIN LB_CONTRACT_INFO LCI ON LrIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(LrIT.hire_date,'%Y/%m/%d')=DATE_FORMAT(SYSDATE(),'%Y/%m/%d') "; } if("PZ2018072100000025".equals(VOUCHERNO)){ - sql= "SELECT LrIT.penalty AS MONEY,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_rent_INCOME_TEMP LrIT LEFT JOIN LB_CONTRACT_INFO LCI ON LrIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE LrIT.FLOWUNID=:FLOWUNID"; + sql= "SELECT LrIT.penalty AS MONEY,ROUND(LrIT.penalty/1.06,2) AS MONEYNOTAX,LrIT.penalty-ROUND(LrIT.penalty/1.06,2) AS MONEYTAX,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS ACCOUNT_DATE,DATE_FORMAT(SYSDATE(),'%Y/%m/%d') AS FACT_DATE,LrIT.CONTRACT_ID,LCI.CONTRACT_NUMBER,LCI.PROJECT_NAME,LCI.LEAS_FORM,DI.DISTRIBUTOR_CODING DISTRIBUTOR_ID,DI.DISTRIBUTOR_NAME,LrIT.FLOWUNID,CIF.CERTID AS CUSTOMERID,CIF.CUSTOMERNAME,CIF.CUSTOMERTYPE,LPI.BUSINESSTYPE FROM LC_rent_INCOME LrIT LEFT JOIN LB_CONTRACT_INFO LCI ON LrIT.CONTRACT_ID=LCI.ID LEFT JOIN DISTRIBUTOR_INFO DI ON DI.DISTRIBUTOR_NO=LCI.DISTRIBUTOR_ID LEFT JOIN LB_EQUIPMENT_CAR LEC ON LEC.CONTRACT_ID=LCI.ID LEFT JOIN lb_union_lessee lul ON lul.contract_id=lci.id LEFT JOIN customer_info cif ON cif.customerid=lul.customer_id LEFT JOIN LB_PROJECT_INFO LPI ON LPI.ID = LUL.PROJECT_ID WHERE DATE_FORMAT(LrIT.hire_date,'%Y/%m/%d')=DATE_FORMAT(SYSDATE(),'%Y/%m/%d')"; } List> dataList=DataOperatorUtil.getDataBySql(Sqlca, sql, map); @@ -53,7 +56,9 @@ public class CreateVoucherRentIncome { MONEY=dataList.get(i).get("MONEY").toString(); if("".equals(MONEY)||MONEY==null) MONEY="0.00"; double mon=Double.parseDouble(MONEY); - if(mon>0){ + if(Math.abs(mon)>0){ + MONEYNOTAX=dataList.get(i).get("MONEYNOTAX").toString(); + MONEYTAX=dataList.get(i).get("MONEYTAX").toString(); ACCOUNT_DATE=dataList.get(i).get("ACCOUNT_DATE").toString(); FACT_DATE =dataList.get(i).get("FACT_DATE").toString(); CONTRACT_ID=dataList.get(i).get("CONTRACT_ID").toString(); @@ -70,6 +75,8 @@ public class CreateVoucherRentIncome { BUSINESSTYPE=dataList.get(i).get("BUSINESSTYPE"); param.put("FACT_MONEY",MONEY); + param.put("INTERESTNOTAX",MONEYNOTAX); + param.put("TAX",MONEYTAX); param.put("ACCOUNT_DATE",ACCOUNT_DATE); param.put("FACT_DATE",FACT_DATE); param.put("CONTRACT_ID",CONTRACT_ID); @@ -97,7 +104,6 @@ public class CreateVoucherRentIncome { //param.put("FUNDTYPE", ""); // 主营类型 param.put("BUSINESSTYPE", "06"); - param.put("FlowUnid", FlowUnid); map.clear(); map.put("PROJ_TYPE", leas_form); map.put("VOUCHER_NO", VOUCHERNO); @@ -112,7 +118,17 @@ public class CreateVoucherRentIncome { Sqlca.commit(); } - String sMessage="true"; - return sMessage; + }catch (Exception e){ + e.printStackTrace(); + }finally{ + if(Sqlca!=null){ + try { + Sqlca.disConnect(); + } catch (JBOException e) { + e.printStackTrace(); + } + Sqlca = null; + } + } } } diff --git a/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java b/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java new file mode 100644 index 000000000..9d1ca989d --- /dev/null +++ b/src_tenwa/com/tenwa/lease/app/quartzmession/CreateVoucherRentIncomeMission.java @@ -0,0 +1,19 @@ +package com.tenwa.lease.app.quartzmession; + +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherMonthSettlement; +import com.tenwa.voucher.CreateVoucherProcess.CreateVoucherRentIncome; + +public class CreateVoucherRentIncomeMission implements Job { + + @Override + public void execute(JobExecutionContext arg0) throws JobExecutionException { + CreateVoucherRentIncome cvri=new CreateVoucherRentIncome(); + cvri.CreateVoucher("PZ2018072100000024");//收到租金 + cvri.CreateVoucher("PZ2018072100000025");//收到逾期利息 + } + +}