diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceInfo.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceInfo.jsp new file mode 100644 index 000000000..e619bf66e --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceInfo.jsp @@ -0,0 +1,82 @@ +<%@page import="com.itextpdf.text.log.SysoCounter"%> +<%@ page contentType="text/html; charset=GBK"%> +<%@include file="/Frame/resources/include/include_begin_info.jspf"%><% + + String Id = CurPage.getParameter("ID"); + String sPrevUrl = CurPage.getParameter("PrevUrl"); + if(sPrevUrl == null) sPrevUrl = "/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceList.jsp"; + String sTempletNo = "LPoundageMaintenanceInfo";//--模板号-- + ASObjectModel doTemp = new ASObjectModel(sTempletNo); + doTemp.setHtmlEvent("charge_channel", "onchange", "getChargeWay"); + doTemp.setHtmlEvent("expiry_date", "onchange", "isEndTime"); + doTemp.setHtmlEvent("start_date", "onchange", "isStartTime"); + if(Id!=null){ + String sql = "SELECT id FROM LPOUNDAGE_MAINTENANCE WHERE charge_channel='"+CurPage.getParameter("chargeChannel")+"' AND charge_way='"+CurPage.getParameter("chargeWay")+"' AND DATE_FORMAT("+CurPage.getParameter("startDate")+",'%Y/%m/%d')<%@ include file="/Frame/resources/include/ui/include_info.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> diff --git a/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceList.jsp b/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceList.jsp new file mode 100644 index 000000000..1b4b18a50 --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/Comm/LBAssetTransferRegistration/PoundageMaintenanceList.jsp @@ -0,0 +1,53 @@ +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><% + + String PG_TITLE = "扣款渠道手续费率维护"; // 浏览器窗口标题 PG_TITLE + + ASObjectModel doTemp = new ASObjectModel("LPoundageMaintenanceList"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + //dwTemp.MultiSelect = true; //多选 + dwTemp.ReadOnly = "1"; //只读模式 + dwTemp.setPageSize(30); + dwTemp.genHTMLObjectWindow(""); + String sButtons[][] = { + {"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""}, + {"true","","Button","修改","修改","viewAndEdit()","","","","btn_icon_edit"}, + {"true","All","Button","删除","删除","deleteRecord()","","","","btn_icon_delete",""}, + }; +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/VIActualFundPlanList.jsp b/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/VIActualFundPlanList.jsp new file mode 100644 index 000000000..6967f1400 --- /dev/null +++ b/WebContent/Tenwa/Lease/Flow/Fund/ActualPayment/VIActualFundPlanList.jsp @@ -0,0 +1,46 @@ +<%@page import="org.apache.catalina.startup.UserConfig"%> +<%@ page contentType="text/html; charset=GBK"%> +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><% + /* + Author: undefined 2017-12-28 + Content: + History Log: + */ + String ishistory = CurPage.getAttribute("IsHistory"); + ASObjectModel doTemp = new ASObjectModel("VIActualFundPlan"); + ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); + dwTemp.Style="1"; //--设置为Grid风格-- + /*if(!ishistory.equals("true")&&"0010".equals(phaseNo)){ + dwTemp.MultiSelect = true; //多选 + }*/ + dwTemp.ShowSummary="1"; //汇总 + dwTemp.ReadOnly = "1"; //只读模式 + dwTemp.setPageSize(pageSize == null ? 30 : Integer.parseInt(pageSize)); + dwTemp.genHTMLObjectWindow(""); + + String[][] sButtons = new String[][]{ + {"true","All","Button","退回经销商","退回经销商","paymentReturn()","","","","btn_icon_add",""} + }; + + +%><%@include file="/Frame/resources/include/ui/include_list.jspf"%> + +<%@ include file="/Frame/resources/include/include_end.jspf"%> \ No newline at end of file diff --git a/WebContent/WEB-INF/etc/jbo/jbo_calc.xml b/WebContent/WEB-INF/etc/jbo/jbo_calc.xml index 5b497a11b..cc9ebfdb5 100644 --- a/WebContent/WEB-INF/etc/jbo/jbo_calc.xml +++ b/WebContent/WEB-INF/etc/jbo/jbo_calc.xml @@ -4078,6 +4078,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src_sql/tft_20191228.sql b/src_sql/tft_20191228.sql index ac5eed0b9..ff3bd2010 100644 --- a/src_sql/tft_20191228.sql +++ b/src_sql/tft_20191228.sql @@ -196,4 +196,77 @@ insert into `class_method` (`classname`, `methodname`, `methodtype`, `methoddesc delete from FLOW_MODEL where FlowNo='FundPaymentCarFlow' AND PhaseNo='0020'; insert into `FLOW_MODEL` (`flowno`, `phaseno`, `phasetype`, `phasename`, `phasedescribe`, `phaseattribute`, `prescript`, `initscript`, `choicedescribe`, `choicescript`, `actiondescribe`, `actionscript`, `postscript`, `attribute1`, `attribute2`, `attribute3`, `attribute4`, `attribute5`, `attribute6`, `attribute7`, `attribute8`, `attribute9`, `attribute10`, `aaenabled`, `aapointinitscript`, `aapointcomp`, `aapointcompurl`, `standardtime1`, `standardtime2`, `costlob`, `strips`, `checklist`, `decisionscript`, `riskscanrule`, `buttonset2`, `inputuser`, `inputtime`, `updateuser`, `updatetime`, `distributerule`, `id`, `type`, `name`, `xcoordinate`, `ycoordinate`, `width`, `height`, `version`, `swimlane`, `nodetype`, `flowphasecontext`, `OPINIONSREQUIRED`, `isreadonly`, `flowpageconfig`, `flowprocessclass`, `flowpagecheck`, `backstepnexttype`, `backsteps`, `backscript`, `deletescript`, `phasescript`, `loadproductcheck`, `nextsteps`, `flowtiptype`, `remindnoticttype`, `flowoverdate`, `overnoticetype`, `overnoticeUser`) values('FundPaymentCarFlow','0020','1020','运营部初审',NULL,NULL,'!审批流程.付款申请提交时自动删除GPS状态(#ObjectNo)+!审批流程.付款申请退回在提交标记(#ObjectNo)','toStringArray(\"#PhaseAction\",\",\",\" \",1)',NULL,'commroute',NULL,'[{usertype:\"选择指定任务池角色\",userinfo:\"800R00000016,业务二部运营专员初审\"}]','#PhaseOpinion1','closePage,doSubmit,backStep,signOpinion',NULL,'all_except',NULL,NULL,NULL,'01',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0','0',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'368','250','100','50','1',NULL,'TASK',NULL,'N','N','FundPaymentCarFlow010','Map paramMap=new HashMap();\r\nparamMap.put(\"TempletNo\", \"FlowPayDocList\");\r\nparamMap.put(\"isReview\", \"true\");\r\nTreeView.AddNodeUrlParam(\"投放资料清单\", paramMap);\r\nTreeView.updateNodeSetReadOnly(\"商务条件\",\"ReadOnly\");\r\nTreeView.addLastNodeByCode(\"11268\");\r\nTreeView.addBeforeNodeByCode(\"合同列表\",\"11532\");\r\nTreeView.deleteNode(\"扣款卡信息详情\");','','backnextperson',NULL,NULL,NULL,NULL,'N','运营复审(0030)',NULL,NULL,NULL,NULL,NULL); +-- 提前结清都按一年外计算 +delete from awe_do_library where dono='LCContractTerminate' and colindex='1064'; +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LCContractTerminate','1064','1064','1','O','FIST_RENT','FIST_RENT','Number','','一年内剩余利息','','1','Text','2','3','','','','22','0','1','0','1','0',0,'','0010','','SYS_Designer','2018/07/28 17:31:36','SYS_Designer','2019/11/27 10:53:26','0','','1','','','',''); + +delete from awe_do_library where dono='LCContractTerminate' and colindex='1065'; +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LCContractTerminate','1065','1065','1','O','FIST_CORPUS','FIST_CORPUS','Number','0.00','商定一年内剩余利息','','1','Text','2','3','','','','22','0','0','0','1','0',0,'','0010','','SYS_Designer','2018/07/31 15:11:34','SYS_Designer','2019/11/27 10:53:26','0','','1','','','',''); + + +-- 创建推送日志表表 +DROP TABLE lb_PaymentReturn_log; +CREATE TABLE `lb_PaymentReturn_log` ( + `id` VARCHAR(32) NOT NULL COMMENT '主键', + `contract_no` VARCHAR(50) DEFAULT NULL COMMENT '合同编号', + `distributor_name` VARCHAR(100) DEFAULT NULL COMMENT '渠道', + `product_name` VARCHAR(100) DEFAULT NULL COMMENT '产品名称', + `person_name` VARCHAR(100) DEFAULT NULL COMMENT '客户名称', + `pay_object` VARCHAR(100) DEFAULT NULL COMMENT '付款对象', + `pay_number` VARCHAR(32) DEFAULT NULL COMMENT '付款金额', + `distributor_bank_name` VARCHAR(100) DEFAULT NULL COMMENT '经销商SP银行', + `distributor_Account_name` VARCHAR(100) DEFAULT NULL COMMENT '经销商SP银行账户', + `distributor_bank_number` VARCHAR(32) DEFAULT NULL COMMENT '经销商SP银行账号', + `loan_type` VARCHAR(32) DEFAULT NULL COMMENT '放款方式', + `INPUTUSERNAME` VARCHAR(32) DEFAULT NULL COMMENT '登录名', + `INPUTUSERID` VARCHAR(32) DEFAULT NULL COMMENT '登记人', + `INPUTORGID` VARCHAR(32) DEFAULT NULL COMMENT '登记部门', + `INPUTTIME` VARCHAR(32) DEFAULT NULL COMMENT '登记时间', + `UPDATEUSERID` VARCHAR(32) DEFAULT NULL COMMENT '更新人', + `UPDATEORGID` VARCHAR(32) DEFAULT NULL COMMENT '更新部门', + `UPDATETIME` VARCHAR(32) DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=INNODB DEFAULT CHARSET=gbk COMMENT='汽车付款申请退回日志表'; + +-- 手续费率维护 +delete from AWE_DO_CATALOG where dono='LPoundageMaintenanceInfo'; +Insert Into AWE_DO_CATALOG (dono,doname,dodescribe,dotype,doclass,isinuse,colcount,modeid,jboclass,jbofrom,jbowhere,jbogroup,jboorder,businessprocess,exportflag,inputuser,inputtime,updateuser,updatetime,remark,isvalidate,parent) Values ('LPoundageMaintenanceInfo','扣款渠道手续费率维护',null,'30020',null,'1','2','default','jbo.app.tenwa.customer.LPOUNDAGE_MAINTENANCE','O','ID=:ID','','','com.amarsoft.awe.dw.handler.impl.CommonHandler',null,'SYS_Designer','2019/11/13 20:20:25','SYS_Designer','2019/11/16 14:26:11','','1',''); +delete from awe_do_library where dono='LPoundageMaintenanceInfo'; +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0010','0010','1','O','id','id','String','','标识','','1','Text','1','1','','','','32','0','0','0','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0015','0015','1','O','start_date','start_date','String','','开始日期','','1','Date','3','1','','','','32','1','0','1','1','0',0,'','','','SYS_Designer','2019/11/25 17:52:30','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0016','0016','1','O','expiry_date','expiry_date','String','','终止日期','','1','Date','3','1','','','','32','1','0','1','1','0',0,'','','','SYS_Designer','2019/11/25 17:52:30','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0020','0020','1','O','validity_date','validity_date','String','','有效期','','1','Text','1','1','','','','50','0','0','0','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0030','0030','1','O','subject','subject','String','','主体','','1','Text','1','1','','','','50','0','1','0','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0040','0040','1','O','charge_channel','charge_channel','String','','扣款渠道','','1','Select','1','1','Code','charge_channel','','50','1','0','1','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0050','0050','1','O','charge_way','charge_way','String','','扣款方式','','1','Select','1','1','Code','charge_way','','50','1','0','1','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0060','0060','1','O','rate','rate','Number','','费率','%','1','Text','2','1','','','','50','1','0','1','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','SYS_Designer','2019/12/06 20:16:08','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0100','0100','1','O','updateuserid','updateuserid','String','','更新人','','1','Text','1','1','','','','32','0','1','0','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0110','0110','1','O','updateorgid','updateorgid','String','','更新部门','','1','Text','1','1','','','','32','0','1','0','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0120','0120','1','O','updatetime','updatetime','String','','更新时间','','1','Text','3','1','','','','32','0','1','0','1','0',0,'','','','SYS_Designer','2019/11/13 20:20:25','administrator','2019/12/06 18:11:49','0','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0130','0130','1','O','inputuserid','inputuserid','String','','登记人','','1','Text','1','1','','','','32','0','0','0','1','0',0,'','','','SYS_Designer','2019/11/16 14:41:47','administrator','2019/12/06 18:11:49','','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0140','0140','1','O','inputorgid','inputorgid','String','','登记部门','','1','Text','1','1','','','','32','0','0','0','1','0',0,'','','','SYS_Designer','2019/11/16 14:41:47','administrator','2019/12/06 18:11:49','','','1','','','',''); +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LPoundageMaintenanceInfo','0150','0150','1','O','inputtime','inputtime','String','','登记时间','','1','Text','1','1','','','','32','0','0','0','1','0',0,'','','','SYS_Designer','2019/11/16 14:41:47','administrator','2019/12/06 18:11:49','','','1','','','',''); + + + +-- 传统添加手续费类型 +Insert Into awe_do_library (dono,colindex,sortno,isinuse,coltablename,colactualname,colname,coltype,coldefaultvalue,colheader,colunit,colcolumntype,coleditstyle,colcheckformat,colalign,coleditsourcetype,coleditsource,colhtmlstyle,collimit,colvisible,colreadonly,colrequired,colsortable,isfilter,colspan,isautocomplete,groupid,colfilterrefid,inputuser,inputtime,updateuser,updatetime,isaudit,colfilterattrs,isupdate,parentcolindex,tips,colinnerbtevent,colfilteroptions) Values ('LoanSimulationBasicInfoBusiness','01510','01510','1','O','HANDLING_CHARGE_MONEY_TYPE','HANDLING_CHARGE_MONEY_TYPE','String','','手续费类型','','1','Select','1','1','','0010,一次性确认收入,0020,按月分摊收入','','32','0','0','0','1','0',0,'','credit_conditon','','SYS_Designer','2019/12/08 17:00:26','SYS_Designer','2019/12/08 17:04:33','0','','1','','','',''); + +-- 手续费的扣款数据字典 +delete from CODE_CATALOG where codeno='charge_way'; +Insert Into CODE_CATALOG (codeno,sortno,codetypeone,codetypetwo,codename,codedescribe,codeattribute,inputuser,inputorg,inputtime,updateuser,updatetime,remark) Values ('charge_way','0012','费率维护','参数定义','扣款方式','','','SYS_Designer',null,'2019/12/06 10:45:39','SYS_Designer','2019/12/06 10:45:39',''); + +delete from Code_Library where codeno='charge_way'; +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_way','AutoBuckle','自动卡扣','','0040','1','','','','gzyl','','','','','','','','SYS_Designer',null,'2019/12/06 10:52:30','SYS_Designer','2019/12/12 19:06:36','',''); +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_way','Collection','网银回款','','0050','1','','','','wysk','','','','','','','','SYS_Designer',null,'2019/12/16 10:02:11','SYS_Designer','2019/12/16 11:56:51','',''); +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_way','WXPay','微信支付','','0010','1','','','','wx','','','','','','','','SYS_Designer',null,'2019/12/06 10:45:39','SYS_Designer','2019/12/06 10:54:03','',''); +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_way','WXUnionPay','主动支付','','0020','1','','','','gzyl','','','','','','','','SYS_Designer',null,'2019/12/06 10:45:39','SYS_Designer','2019/12/12 19:12:48','',''); + +delete from CODE_CATALOG where codeno='charge_channel'; +Insert Into CODE_CATALOG (codeno,sortno,codetypeone,codetypetwo,codename,codedescribe,codeattribute,inputuser,inputorg,inputtime,updateuser,updatetime,remark) Values ('charge_channel','0011','费率维护','参数定义','扣款渠道','','','SYS_Designer',null,'2019/12/06 10:41:42','SYS_Designer','2019/12/06 10:41:42',''); +delete from Code_Library where codeno='charge_channel'; +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','gzyl','广州银联','','0010','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/06 10:41:42','SYS_Designer','2019/12/12 19:04:25','',''); +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','wx','微信','','0020','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/06 10:41:42','SYS_Designer','2019/12/12 19:04:25','',''); +Insert Into Code_Library (codeno,itemno,itemname,bankno,sortno,isinuse,itemdescribe,itemattribute,relativecode,attribute1,attribute2,attribute3,attribute4,attribute5,attribute6,attribute7,attribute8,inputuser,inputorg,inputtime,updateuser,updatetime,remark,helptext) Values ('charge_channel','wysk','网银回款','','0030','1','','','','','','','','','','','','SYS_Designer',null,'2019/12/16 10:00:51','SYS_Designer','2019/12/16 11:56:51','',''); + diff --git a/src_tenwa/com/tenwa/customer/controller/group/CheckPoundegeDate.java b/src_tenwa/com/tenwa/customer/controller/group/CheckPoundegeDate.java new file mode 100644 index 000000000..6753c59b2 --- /dev/null +++ b/src_tenwa/com/tenwa/customer/controller/group/CheckPoundegeDate.java @@ -0,0 +1,77 @@ +package com.tenwa.customer.controller.group; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import com.amarsoft.are.jbo.JBOTransaction; +import com.tenwa.reckon.util.Conn; + +public class CheckPoundegeDate { + + private String chargeChannel;//扣款渠道 + private String chargeWay;//扣款方式 + private String startDate;//开始时间 + private String expiryDate;//结束时间 + private String id; + public String getChargeChannel() { + return chargeChannel; + } + public void setChargeChannel(String chargeChannel) { + this.chargeChannel = chargeChannel; + } + public String getChargeWay() { + return chargeWay; + } + public void setChargeWay(String chargeWay) { + this.chargeWay = chargeWay; + } + public String getStartDate() { + return startDate; + } + public void setStartDate(String startDate) { + this.startDate = startDate; + } + public String getExpiryDate() { + return expiryDate; + } + public void setExpiryDate(String expiryDate) { + this.expiryDate = expiryDate; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + + //校验扣款手续费维护日期 + public String checkPoundegeDate(JBOTransaction tx) throws Exception{ + Conn conn = new Conn(tx); + String sql = "SELECT id FROM LPOUNDAGE_MAINTENANCE where charge_channel=? AND charge_way=? AND DATE_FORMAT(expiry_date,'%Y/%m/%d')>DATE_FORMAT(?,'%Y/%m/%d')"; + List> results = conn.executeQuery(sql, chargeChannel,chargeWay,startDate); + if(id==null &&results.size()>0){ + return "开始时间大于已有数据的结束时间!!"; + } + + String endSql = "SELECT a.expiry_date FROM LPOUNDAGE_MAINTENANCE AS a WHERE expiry_date = (SELECT MAX(expiry_date) FROM LPOUNDAGE_MAINTENANCE WHERE a.charge_channel=charge_channel AND a.charge_way=charge_way) and a.charge_channel=? AND a.charge_way=?"; + List> endtime = conn.executeQuery(endSql, chargeChannel,chargeWay); + if(id==null && endtime.size()>0){ + String enddate = endtime.get(0).get("expiry_date"); + DateFormat df = new SimpleDateFormat("yyyy/MM/dd"); + Date startdate = df.parse(startDate); + Date endTime = df.parse(enddate); + long days = (startdate.getTime() - endTime.getTime()) / 1000 / 3600 / 24; + if(days!=1){ + return "开始时间比上一条数据结束时间相差大于1天!"; + } + } + + + return "true"; + + } +} diff --git a/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java b/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java index 5806b77bc..1e659bcb5 100644 --- a/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java +++ b/src_tenwa/com/tenwa/flow/fund/fundcollection/FundIncomeMethod.java @@ -1,474 +1,611 @@ -package com.tenwa.flow.fund.fundcollection; - -import java.math.BigDecimal; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.amarsoft.are.jbo.BizObject; -import com.amarsoft.are.jbo.BizObjectManager; -import com.amarsoft.are.jbo.JBOException; -import com.amarsoft.are.jbo.JBOFactory; -import com.amarsoft.are.jbo.JBOTransaction; -import com.amarsoft.are.util.StringFunction; -import com.amarsoft.awe.util.ASResultSet; -import com.amarsoft.awe.util.SqlObject; -import com.amarsoft.awe.util.Transaction; -import com.tenwa.comm.util.jboutil.DataOperatorUtil; -import com.tenwa.flow.bussinessapprove.BussinessStatusAndDetailAction; - -import jbo.app.tenwa.calc.LC_EBANK_PROCESS; -import jbo.app.tenwa.calc.LC_EBANK_TEMP; -import jbo.app.tenwa.calc.LC_FUND_INCOME; -import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; -import jbo.app.tenwa.calc.LC_FUND_PLAN; -import jbo.app.tenwa.calc.VI_LC_FUND_PLAN; -import jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT; -import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; - -public class FundIncomeMethod { - - private String planIDs; - private String flowunid; - private String overMoneys; - private String balance; - private String portionCollectionID; - private String portionMoney; - private String oldFactMoney; - private String newFactMoney; - private String isChanged; - private String CONTRACT_ID; - private String contractIds; - private String userId; - private String orgId; - private String status; - private String payType; - - public String getIsChanged() { - return isChanged; - } - - public void setIsChanged(String isChanged) { - this.isChanged = isChanged; - } - - public String getFlowunid() { - return flowunid; - } - - public void setFlowunid(String flowunid) { - this.flowunid = flowunid; - } - - public String getPlanIDs() { - return planIDs; - } - - public void setPlanIDs(String planIDs) { - this.planIDs = planIDs; - } - - public String getOverMoneys() { - return overMoneys; - } - - public void setOverMoneys(String overMoneys) { - this.overMoneys = overMoneys; - } - - public String getBalance() { - return balance; - } - - public void setBalance(String balance) { - this.balance = balance; - } - - public String getPortionCollectionID() { - return portionCollectionID; - } - - public void setPortionCollectionID(String portionCollectionID) { - this.portionCollectionID = portionCollectionID; - } - - public String getPortionMoney() { - return portionMoney; - } - - public void setPortionMoney(String portionMoney) { - this.portionMoney = portionMoney; - } - - public String getOldFactMoney() { - return oldFactMoney; - } - - public void setOldFactMoney(String oldFactMoney) { - this.oldFactMoney = oldFactMoney; - } - - public String getNewFactMoney() { - return newFactMoney; - } - - public void setNewFactMoney(String newFactMoney) { - this.newFactMoney = newFactMoney; - } - - public String getCONTRACT_ID() { - return CONTRACT_ID; - } - - public void setCONTRACT_ID(String cONTRACT_ID) { - CONTRACT_ID = cONTRACT_ID; - } - - public String getContractIds() { - return contractIds; - } - - public void setContractIds(String contractIds) { - this.contractIds = contractIds; - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - public String getOrgId() { - return orgId; - } - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - public String getPayType() { - return payType; - } - - public void setPayType(String payType) { - this.payType = payType; - } - public String getContactId(JBOTransaction tx) throws SQLException, Exception{ - - SqlObject s = new SqlObject("select customertype,contract_number,customer_id," - + "LC_FUND_INCOME_TEMP.project_id,Product_Id from LC_FUND_INCOME_TEMP " - + "left join LB_CONTRACT_INFO lpi on lpi.ID=LC_FUND_INCOME_TEMP.CONTRACT_ID " - + "left join LB_UNION_LESSEE ul on LC_FUND_INCOME_TEMP.contract_id=ul.contract_id and ul.is_main='Y' " - + "left join CUSTOMER_INFO cu on ul.customer_id=cu.customerid where LC_FUND_INCOME_TEMP.contract_id = '" + CONTRACT_ID+"'"); - Transaction sqlTran = Transaction.createTransaction(tx); - ASResultSet rs = sqlTran.getResultSet(s); - String customertype = null; - String contract_number = null; - String customer_id = null; - String project_id = null; - String Product_Id = null; - if(rs.next()){ - customertype = rs.getString("customertype"); - contract_number = rs.getString("contract_number"); - customer_id = rs.getString("customer_id"); - project_id = rs.getString("project_id"); - Product_Id = rs.getString("Product_Id"); - } - return customertype+"@"+contract_number+"@"+customer_id+"@"+project_id+"@"+Product_Id; - } - public String delTemp(JBOTransaction tx) throws JBOException { - try { - for(String contractId : contractIds.split("@")){ - BussinessStatusAndDetailAction.CancelRun(tx, userId, contractId, "30"); - } - } catch (Exception e) { - e.printStackTrace(); - tx.rollback(); - return "ERROR"; - } - return "SUCCESS"; - } - public String updateTemp(JBOTransaction tx) throws JBOException { - try { - Transaction sqlTran = Transaction.createTransaction(tx); - ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status='apply_pass' group by flowunid")); - if(rs.next()){ - BigDecimal totalMoney = new BigDecimal(rs.getString("total_money")); - int contractCount = Integer.parseInt(rs.getString("contract_count")); - SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); - so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); - so.setRunSql(so.getRunSql().replaceAll("@", ":")); - sqlTran.executeSQL(so); - so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); - sqlTran.executeSQL(so); - }else{ - BigDecimal totalMoney = new BigDecimal("0"); - int contractCount = 0; - SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); - so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); - so.setRunSql(so.getRunSql().replaceAll("@", ":")); - sqlTran.executeSQL(so); - so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); - sqlTran.executeSQL(so); - } - } catch (Exception e) { - e.printStackTrace(); - tx.rollback(); - return "ERROR"; - } - return "SUCCESS"; - } - public String setFundDataToFundIncome(JBOTransaction tx) throws JBOException{ - try{ - boolean flag = false; - if("Y".equals(isChanged)){ - flag = true; - } - BigDecimal bel = new BigDecimal(balance); - BigDecimal allFactMoney = bel; - BigDecimal zero = new BigDecimal(0); - BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME); - tx.join(bomEb); - BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID") - .setParameter("FLOWUNID", flowunid).getSingleResult(true); - if(flag){ - bel = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getString()); - allFactMoney = bel; - } - String[] moneys = overMoneys.split("@"); - String[] ids = planIDs.split("@"); - for(int i=0;i boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i]) - .getResultList(false); - List boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = 0 and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i]) - .getResultList(false); - boLFIT.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1); - boLFIT.setAttributeValue("FACT_DATE", boEb.getAttribute("FACT_DATE").getString()); - if(!flag){ - if(!ids[i].equals(portionCollectionID) && bel.subtract(new BigDecimal(moneys[i])).compareTo(new BigDecimal(0)) >= 0){ - bel = bel.subtract(new BigDecimal(moneys[i])); - boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i])); - }else{ - boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(portionMoney)); - bel = bel.subtract(new BigDecimal(portionMoney)); - } - }else{ - moneys[i] = boVLFP.getAttribute("OVERMONEY").getString(); - if(bel.subtract(new BigDecimal(moneys[i])).compareTo(new BigDecimal(0)) >= 0){ - bel = bel.subtract(new BigDecimal(moneys[i])); - boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i])); - }else{ - boLFIT.setAttributeValue("FACT_MONEY",bel); - bel = zero; - } - } - boLFIT.setAttributeValue("FEE_ADJUST", 0); - boLFIT.setAttributeValue("FACT_OBJECT", boVLF.getAttribute("PAY_OBJ").getString()); - boLFIT.setAttributeValue("EBANK_NUMBER", boEb.getAttribute("ID").getString()); - boLFIT.setAttributeValue("BANK", boEb.getAttribute("OWN_BANK").getString()); - boLFIT.setAttributeValue("ACCOUNT", boEb.getAttribute("OWN_ACCOUNT").getString()); - boLFIT.setAttributeValue("ACC_NUMBER", boEb.getAttribute("OWNACC_NUMBER").getString()); - boLFIT.setAttributeValue("CLIENT_BANK", boEb.getAttribute("CLIENT_BANK").getString()); - boLFIT.setAttributeValue("CLIENT_ACCOUNT", boEb.getAttribute("CLIENT_ACCOUNT").getString()); - boLFIT.setAttributeValue("CLIENT_ACCNUMBER", boEb.getAttribute("CLIENT_ACC_NUMBER").getString()); - boLFIT.setAttributeValue("ACCOUNTING_DATE", StringFunction.getToday()); - boLFIT.setAttributeValue("ROLL_BACK", 0); - boLFIT.setAttributeValue("COIN", boVLF.getAttribute("COIN").getString()); - boLFIT.setAttributeValue("IS_FLOWING", 0); - boLFIT.setAttributeValue("FLOWUNID", flowunid); - boLFI.saveObject(boLFIT); - } - if(bel.compareTo(new BigDecimal(0)) > 0){ - allFactMoney = allFactMoney.subtract(bel);//一共多少余额减去用剩多少等于用了多少 - } - BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME); - tx.join(bomLEP); - BizObject boLEP = bomLEP.createQuery("FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", flowunid).getSingleResult(true); - BigDecimal processMoney = new BigDecimal(boLEP.getAttribute("PROCESS_MONEY").getDouble()); - boLEP.setAttributeValue("PROCESS_MONEY", processMoney.add(allFactMoney)); - bomLEP.saveObject(boLEP); - BigDecimal hadMoney = new BigDecimal(boEb.getAttribute("HAD_MONEY").getDouble()).add(allFactMoney); - BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble()); - boEb.setAttributeValue("HAD_MONEY", hadMoney); - boEb.setAttributeValue("MAYOPE_MONEY", factMoney.subtract(hadMoney)); - bomEb.saveObject(boEb); - }catch(Exception e){ - e.printStackTrace(); - return "ERROR"; - } - return "SUCCESS"; - } - - public String updateEbankAndEbankProcess(JBOTransaction tx){ - try{ - BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME); - tx.join(bomEb); - BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID") - .setParameter("FLOWUNID", flowunid).getSingleResult(true); - BigDecimal hadMoney = new BigDecimal(boEb.getAttribute("HAD_MONEY").getDouble()) - .subtract(new BigDecimal(oldFactMoney)).add(new BigDecimal(newFactMoney)); - BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble()); - boEb.setAttributeValue("HAD_MONEY", hadMoney); - boEb.setAttributeValue("MAYOPE_MONEY", factMoney.subtract(hadMoney)); - BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME); - tx.join(bomLEP); - bomLEP.createQuery("update O set process_money=:allFactMoney where flowunid=:flowUnid") - .setParameter("allFactMoney", newFactMoney).setParameter("flowUnid", flowunid).executeUpdate(); - bomEb.saveObject(boEb); - }catch(Exception e){ - e.printStackTrace(); - return "ERROR"; - } - return "SUCCESS"; - } - public String createActualPayment(JBOTransaction tx) throws JBOException{ - try{ - //获取深圳本方账户 - BizObject boOA = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME,tx) - .createQuery("account_purpose='default' and state_='0010' and FbSdk='Y'").getSingleResult(false); - for(String contractId : contractIds.split("@")){ - @SuppressWarnings("unchecked") - List bos = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME) - .createQuery("contract_id='"+contractId+"' and pay_type='pay_type_out' and pay_status='apply_pass'") - .getResultList(false); - BigDecimal totalMoney = new BigDecimal("0"); - int contractCount = 0; - if(bos.size() > 0){ - Map fromCondition = new HashMap(); - Map otherProperty = new HashMap(); - for(BizObject bo:bos){ - fromCondition.clear(); - fromCondition.put("ID", bo.getAttribute("ID").getString()); - fromCondition.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod6"); - otherProperty.clear(); - otherProperty.put("FlowUnid", flowunid); - otherProperty.put("IS_FLOWING", "0"); - otherProperty.put("ACCOUNTING_DATE", StringFunction.getTodayNow().split(" ")[0]); - - otherProperty.put("BANK", boOA.getAttribute("ACC_BANK").getString()); - otherProperty.put("ACCOUNT", boOA.getAttribute("ACC_NAME").getString()); - otherProperty.put("ACC_NUMBER", boOA.getAttribute("ACC_NUMBER").getString()); - - otherProperty.put("INCOME_ID", bo.getAttribute("ID").getString()); - otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "03"); - if("0020".equals(payType)||"0030".equals(payType)){ - otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "05"); - } - if("0030".equals(payType)){ - otherProperty.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod13"); - } - otherProperty.put("FACT_DATE", StringFunction.getToday()); - DataOperatorUtil.copySingleJBO(LC_FUND_INCOME.CLASS_NAME, fromCondition,LC_FUND_INCOME_TEMP.CLASS_NAME, null, otherProperty,tx); - } - } - Transaction sqlTran = Transaction.createTransaction(tx); - ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,sum(fact_money) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid")); - if(rs.next()){ - totalMoney = new BigDecimal(rs.getString("total_money")); - contractCount = Integer.parseInt(rs.getString("contract_count")); - SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); - so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); - so.setRunSql(so.getRunSql().replaceAll("@", ":")); - sqlTran.executeSQL(so); - so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); - sqlTran.executeSQL(so); - } - } - }catch(Exception e){ - e.printStackTrace(); - tx.rollback(); - return "ERROR"; - } - return "SUCCESS"; - } - public String updateFundIncomeStatus(JBOTransaction tx) throws JBOException{//target - try{ - for(String contractId : contractIds.split("@")){ - JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME,tx).createQuery("update O set "+("cancel".equals(status)?"pay_status='apply_return'":"pay_status=null")+" where flowunid='"+flowunid+"' and contract_id='"+contractId+"'").executeUpdate(); - } - Transaction sqlTran = Transaction.createTransaction(tx); - ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid")); - if(rs.next()){ - BigDecimal totalMoney = new BigDecimal(rs.getString("total_money")); - int contractCount = Integer.parseInt(rs.getString("contract_count")); - SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); - so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); - so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); - so.setRunSql(so.getRunSql().replaceAll("@", ":")); - sqlTran.executeSQL(so); - so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); - sqlTran.executeSQL(so); - } - }catch(Exception e){ - e.printStackTrace(); - tx.rollback(); - return "ERROR"; - } - return "SUCCESS"; - } - - public static String setCerificationMoney(String corpus,String interest,String penalty){ - BigDecimal c = new BigDecimal(corpus); - BigDecimal i = new BigDecimal(interest); - BigDecimal p = new BigDecimal(penalty); - c=c.add(i).add(p); -// double CerificationMoney= Double.valueOf(corpus)+Double.valueOf(interest)+Double.valueOf(penalty); - return c.doubleValue()+""; - } - public String check(JBOTransaction tx) throws Exception{ - String sql = "SELECT lfit.project_id,lpi.product_id,psl.paytype AS payType FROM "+ - "lc_fund_income_temp lfit "+ - "LEFT JOIN lb_project_info lpi ON lfit.project_id=lpi.id "+ - "LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id "+ - "WHERE lfit.flowunid=:flowunid"; - Map params=new HashMap(); - params.put("flowunid", flowunid); - List> payTypeList = DataOperatorUtil.getDataBySql(tx,sql,params); - if(payTypeList.size()<1){ - return "0"; - } - for(Map payType:payTypeList){ - String paytype = payType.get("payType"); - if(this.payType.equals(paytype)){ - return "0"; - } - return "1"; - } - return "1"; - } -} +package com.tenwa.flow.fund.fundcollection; + +import java.math.BigDecimal; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jbo.app.tenwa.calc.LB_PAYMENTRETURN_LOG; +import jbo.app.tenwa.calc.LC_EBANK_PROCESS; +import jbo.app.tenwa.calc.LC_EBANK_TEMP; +import jbo.app.tenwa.calc.LC_FUND_INCOME; +import jbo.app.tenwa.calc.LC_FUND_INCOME_TEMP; +import jbo.app.tenwa.calc.LC_FUND_PLAN; +import jbo.app.tenwa.calc.VI_LC_FUND_PLAN; +import jbo.com.tenwa.entity.comm.own.OWN_ACCOUNT; +import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO; +import jbo.com.tenwa.lease.comm.LB_PROJECT_INFO; + +import com.amarsoft.are.jbo.BizObject; +import com.amarsoft.are.jbo.BizObjectManager; +import com.amarsoft.are.jbo.JBOException; +import com.amarsoft.are.jbo.JBOFactory; +import com.amarsoft.are.jbo.JBOTransaction; +import com.amarsoft.are.util.StringFunction; +import com.amarsoft.awe.util.ASResultSet; +import com.amarsoft.awe.util.SqlObject; +import com.amarsoft.awe.util.Transaction; +import com.tenwa.comm.util.jboutil.DataOperatorUtil; +import com.tenwa.flow.bussinessapprove.BussinessStatusAndDetailAction; + +public class FundIncomeMethod { + + private String planIDs; + private String flowunid; + private String overMoneys; + private String balance; + private String portionCollectionID; + private String portionMoney; + private String oldFactMoney; + private String newFactMoney; + private String isChanged; + private String CONTRACT_ID; + private String contractIds; + private String userId; + private String orgId; + private String status; + private String payType; + private String contract_number; + private String channel_name; + private String product_id; + private String customer_name; + private String fact_object; + private String fact_money; + private String CLIENT_BANK; + private String CLIENT_ACCOUNT; + private String CLIENT_ACCNUMBER; + private String username; + + public String getIsChanged() { + return isChanged; + } + + public void setIsChanged(String isChanged) { + this.isChanged = isChanged; + } + + public String getFlowunid() { + return flowunid; + } + + public void setFlowunid(String flowunid) { + this.flowunid = flowunid; + } + + public String getPlanIDs() { + return planIDs; + } + + public void setPlanIDs(String planIDs) { + this.planIDs = planIDs; + } + + public String getOverMoneys() { + return overMoneys; + } + + public void setOverMoneys(String overMoneys) { + this.overMoneys = overMoneys; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getPortionCollectionID() { + return portionCollectionID; + } + + public void setPortionCollectionID(String portionCollectionID) { + this.portionCollectionID = portionCollectionID; + } + + public String getPortionMoney() { + return portionMoney; + } + + public void setPortionMoney(String portionMoney) { + this.portionMoney = portionMoney; + } + + public String getOldFactMoney() { + return oldFactMoney; + } + + public void setOldFactMoney(String oldFactMoney) { + this.oldFactMoney = oldFactMoney; + } + + public String getNewFactMoney() { + return newFactMoney; + } + + public void setNewFactMoney(String newFactMoney) { + this.newFactMoney = newFactMoney; + } + + public String getCONTRACT_ID() { + return CONTRACT_ID; + } + + public void setCONTRACT_ID(String cONTRACT_ID) { + CONTRACT_ID = cONTRACT_ID; + } + + public String getContractIds() { + return contractIds; + } + + public void setContractIds(String contractIds) { + this.contractIds = contractIds; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getOrgId() { + return orgId; + } + + public void setOrgId(String orgId) { + this.orgId = orgId; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getContract_number() { + return contract_number; + } + + public void setContract_number(String contract_number) { + this.contract_number = contract_number; + } + + public String getChannel_name() { + return channel_name; + } + + public void setChannel_name(String channel_name) { + this.channel_name = channel_name; + } + + public String getProduct_id() { + return product_id; + } + + public void setProduct_id(String product_id) { + this.product_id = product_id; + } + + public String getCustomer_name() { + return customer_name; + } + + public void setCustomer_name(String customer_name) { + this.customer_name = customer_name; + } + + public String getFact_object() { + return fact_object; + } + + public void setFact_object(String fact_object) { + this.fact_object = fact_object; + } + + public String getFact_money() { + return fact_money; + } + + public void setFact_money(String fact_money) { + this.fact_money = fact_money; + } + + public String getCLIENT_BANK() { + return CLIENT_BANK; + } + + public void setCLIENT_BANK(String cLIENT_BANK) { + CLIENT_BANK = cLIENT_BANK; + } + + public String getCLIENT_ACCOUNT() { + return CLIENT_ACCOUNT; + } + + public void setCLIENT_ACCOUNT(String cLIENT_ACCOUNT) { + CLIENT_ACCOUNT = cLIENT_ACCOUNT; + } + + public String getCLIENT_ACCNUMBER() { + return CLIENT_ACCNUMBER; + } + + public void setCLIENT_ACCNUMBER(String cLIENT_ACCNUMBER) { + CLIENT_ACCNUMBER = cLIENT_ACCNUMBER; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + +public String getContactId(JBOTransaction tx) throws SQLException, Exception{ + + SqlObject s = new SqlObject("select customertype,contract_number,customer_id," + + "LC_FUND_INCOME_TEMP.project_id,Product_Id from LC_FUND_INCOME_TEMP " + + "left join LB_CONTRACT_INFO lpi on lpi.ID=LC_FUND_INCOME_TEMP.CONTRACT_ID " + + "left join LB_UNION_LESSEE ul on LC_FUND_INCOME_TEMP.contract_id=ul.contract_id and ul.is_main='Y' " + + "left join CUSTOMER_INFO cu on ul.customer_id=cu.customerid where LC_FUND_INCOME_TEMP.contract_id = '" + CONTRACT_ID+"'"); + Transaction sqlTran = Transaction.createTransaction(tx); + ASResultSet rs = sqlTran.getResultSet(s); + String customertype = null; + String contract_number = null; + String customer_id = null; + String project_id = null; + String Product_Id = null; + if(rs.next()){ + customertype = rs.getString("customertype"); + contract_number = rs.getString("contract_number"); + customer_id = rs.getString("customer_id"); + project_id = rs.getString("project_id"); + Product_Id = rs.getString("Product_Id"); + } + return customertype+"@"+contract_number+"@"+customer_id+"@"+project_id+"@"+Product_Id; + } + public String delTemp(JBOTransaction tx) throws JBOException { + try { + for(String contractId : contractIds.split("@")){ + BussinessStatusAndDetailAction.CancelRun(tx, userId, contractId, "30"); + } + } catch (Exception e) { + e.printStackTrace(); + tx.rollback(); + return "ERROR"; + } + return "SUCCESS"; + } + public String updateTemp(JBOTransaction tx) throws JBOException { + try { + Transaction sqlTran = Transaction.createTransaction(tx); + ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status='apply_pass' group by flowunid")); + if(rs.next()){ + BigDecimal totalMoney = new BigDecimal(rs.getString("total_money")); + int contractCount = Integer.parseInt(rs.getString("contract_count")); + SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); + so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); + so.setRunSql(so.getRunSql().replaceAll("@", ":")); + sqlTran.executeSQL(so); + so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); + sqlTran.executeSQL(so); + }else{ + BigDecimal totalMoney = new BigDecimal("0"); + int contractCount = 0; + SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); + so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); + so.setRunSql(so.getRunSql().replaceAll("@", ":")); + sqlTran.executeSQL(so); + so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); + sqlTran.executeSQL(so); + } + } catch (Exception e) { + e.printStackTrace(); + tx.rollback(); + return "ERROR"; + } + return "SUCCESS"; + } + public String setFundDataToFundIncome(JBOTransaction tx) throws JBOException{ + try{ + boolean flag = false; + if("Y".equals(isChanged)){ + flag = true; + } + BigDecimal bel = new BigDecimal(balance); + BigDecimal allFactMoney = bel; + BigDecimal zero = new BigDecimal(0); + BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME); + tx.join(bomEb); + BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID") + .setParameter("FLOWUNID", flowunid).getSingleResult(true); + if(flag){ + bel = new BigDecimal(boEb.getAttribute("MAYOPE_MONEY").getString()); + allFactMoney = bel; + } + String[] moneys = overMoneys.split("@"); + String[] ids = planIDs.split("@"); + for(int i=0;i boLCFI = JBOFactory.createBizObjectQuery(LC_FUND_INCOME.CLASS_NAME, "PLAN_ID=:PLAN_ID and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i]) + .getResultList(false); + List boLCFIT = JBOFactory.createBizObjectQuery(LC_FUND_INCOME_TEMP.CLASS_NAME, "PLAN_ID=:PLAN_ID and IS_FLOWING = 0 and ROLL_BACK='0'").setParameter("PLAN_ID", ids[i]) + .getResultList(false); + boLFIT.setAttributeValue("CHARGE_LIST", boLCFI.size()+boLCFIT.size()+1); + boLFIT.setAttributeValue("FACT_DATE", boEb.getAttribute("FACT_DATE").getString()); + if(!flag){ + if(!ids[i].equals(portionCollectionID) && bel.subtract(new BigDecimal(moneys[i])).compareTo(new BigDecimal(0)) >= 0){ + bel = bel.subtract(new BigDecimal(moneys[i])); + boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i])); + }else{ + boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(portionMoney)); + bel = bel.subtract(new BigDecimal(portionMoney)); + } + }else{ + moneys[i] = boVLFP.getAttribute("OVERMONEY").getString(); + if(bel.subtract(new BigDecimal(moneys[i])).compareTo(new BigDecimal(0)) >= 0){ + bel = bel.subtract(new BigDecimal(moneys[i])); + boLFIT.setAttributeValue("FACT_MONEY", new BigDecimal(moneys[i])); + }else{ + boLFIT.setAttributeValue("FACT_MONEY",bel); + bel = zero; + } + } + boLFIT.setAttributeValue("FEE_ADJUST", 0); + boLFIT.setAttributeValue("FACT_OBJECT", boVLF.getAttribute("PAY_OBJ").getString()); + boLFIT.setAttributeValue("EBANK_NUMBER", boEb.getAttribute("EBANK_NUMBER").getString()); + boLFIT.setAttributeValue("BANK", boEb.getAttribute("OWN_BANK").getString()); + boLFIT.setAttributeValue("ACCOUNT", boEb.getAttribute("OWN_ACCOUNT").getString()); + boLFIT.setAttributeValue("ACC_NUMBER", boEb.getAttribute("OWNACC_NUMBER").getString()); + boLFIT.setAttributeValue("CLIENT_BANK", boEb.getAttribute("CLIENT_BANK").getString()); + boLFIT.setAttributeValue("CLIENT_ACCOUNT", boEb.getAttribute("CLIENT_ACCOUNT").getString()); + boLFIT.setAttributeValue("CLIENT_ACCNUMBER", boEb.getAttribute("CLIENT_ACC_NUMBER").getString()); + boLFIT.setAttributeValue("ACCOUNTING_DATE", StringFunction.getToday()); + boLFIT.setAttributeValue("ROLL_BACK", 0); + boLFIT.setAttributeValue("COIN", boVLF.getAttribute("COIN").getString()); + boLFIT.setAttributeValue("IS_FLOWING", 0); + boLFIT.setAttributeValue("FLOWUNID", flowunid); + boLFI.saveObject(boLFIT); + } + if(bel.compareTo(new BigDecimal(0)) > 0){ + allFactMoney = allFactMoney.subtract(bel);//一共多少余额减去用剩多少等于用了多少 + } + BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME); + tx.join(bomLEP); + BizObject boLEP = bomLEP.createQuery("FLOWUNID=:FLOWUNID").setParameter("FLOWUNID", flowunid).getSingleResult(true); + BigDecimal processMoney = new BigDecimal(boLEP.getAttribute("PROCESS_MONEY").getDouble()); + boLEP.setAttributeValue("PROCESS_MONEY", processMoney.add(allFactMoney)); + bomLEP.saveObject(boLEP); + BigDecimal hadMoney = new BigDecimal(boEb.getAttribute("HAD_MONEY").getDouble()).add(allFactMoney); + BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble()); + boEb.setAttributeValue("HAD_MONEY", hadMoney); + boEb.setAttributeValue("MAYOPE_MONEY", factMoney.subtract(hadMoney)); + bomEb.saveObject(boEb); + }catch(Exception e){ + e.printStackTrace(); + return "ERROR"; + } + return "SUCCESS"; + } + + public String updateEbankAndEbankProcess(JBOTransaction tx){ + try{ + BizObjectManager bomEb = JBOFactory.getBizObjectManager(LC_EBANK_TEMP.CLASS_NAME); + tx.join(bomEb); + BizObject boEb = bomEb.createQuery("FLOWUNID=:FLOWUNID") + .setParameter("FLOWUNID", flowunid).getSingleResult(true); + BigDecimal hadMoney = new BigDecimal(boEb.getAttribute("HAD_MONEY").getDouble()) + .subtract(new BigDecimal(oldFactMoney)).add(new BigDecimal(newFactMoney)); + BigDecimal factMoney = new BigDecimal(boEb.getAttribute("FACT_MONEY").getDouble()); + boEb.setAttributeValue("HAD_MONEY", hadMoney); + boEb.setAttributeValue("MAYOPE_MONEY", factMoney.subtract(hadMoney)); + BizObjectManager bomLEP = JBOFactory.getBizObjectManager(LC_EBANK_PROCESS.CLASS_NAME); + tx.join(bomLEP); + bomLEP.createQuery("update O set process_money=:allFactMoney where flowunid=:flowUnid") + .setParameter("allFactMoney", newFactMoney).setParameter("flowUnid", flowunid).executeUpdate(); + bomEb.saveObject(boEb); + }catch(Exception e){ + e.printStackTrace(); + return "ERROR"; + } + return "SUCCESS"; + } + public String createActualPayment(JBOTransaction tx) throws JBOException{ + try{ + //获取深圳本方账户 + BizObject boOAS = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME,tx) + .createQuery("account_purpose='default' and state_='0010' and FbSdk='Y' and own_id='807001002001' ").getSingleResult(false); + //获取天津本方账户 + BizObject boOAT = JBOFactory.getBizObjectManager(OWN_ACCOUNT.CLASS_NAME,tx) + .createQuery("account_purpose='default' and state_='0010' and FbSdk='Y' and own_id='807001003' ").getSingleResult(false); + for(String contractId : contractIds.split("@")){ + @SuppressWarnings("unchecked") + List bos = JBOFactory.getBizObjectManager(LC_FUND_INCOME.CLASS_NAME) + .createQuery("contract_id='"+contractId+"' and pay_type='pay_type_out' and pay_status='apply_pass'").getResultList(false); + + BigDecimal totalMoney = new BigDecimal("0"); + int contractCount = 0; + if(bos.size() > 0){ + BizObject lci = JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME,tx) + .createQuery(" id=:id ").setParameter("id", contractId).getSingleResult(false); + Map fromCondition = new HashMap(); + Map otherProperty = new HashMap(); + for(BizObject bo:bos){ + fromCondition.clear(); + fromCondition.put("ID", bo.getAttribute("ID").getString()); + fromCondition.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod6"); + otherProperty.clear(); + otherProperty.put("FlowUnid", flowunid); + otherProperty.put("IS_FLOWING", "0"); + otherProperty.put("ACCOUNTING_DATE", StringFunction.getTodayNow().split(" ")[0]); + if("aa740e4111c111eaaa0000163e0e11e6".equals(lci.getAttribute("SUBJECTID").toString())){ + otherProperty.put("BANK", boOAS.getAttribute("ACC_BANK").getString()); + otherProperty.put("ACCOUNT", boOAS.getAttribute("ACC_NAME").getString()); + otherProperty.put("ACC_NUMBER", boOAS.getAttribute("ACC_NUMBER").getString()); + }else if("d989246c11c111eaaa0000163e0e11e6".equals(lci.getAttribute("SUBJECTID").toString())){ + otherProperty.put("BANK", boOAT.getAttribute("ACC_BANK").getString()); + otherProperty.put("ACCOUNT", boOAT.getAttribute("ACC_NAME").getString()); + otherProperty.put("ACC_NUMBER", boOAT.getAttribute("ACC_NUMBER").getString()); + }else{ + throw new RuntimeException("未查询到对应的主体信息!"); + } + otherProperty.put("INCOME_ID", bo.getAttribute("ID").getString()); + otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "03"); + if("0020".equals(payType)||"0030".equals(payType)){ + otherProperty.put(LC_FUND_INCOME.EBANK_STATUS, "05"); + } + if("0030".equals(payType)){ + otherProperty.put(LC_FUND_INCOME.SETTLE_METHOD, "settlemethod13"); + } + otherProperty.put("FACT_DATE", StringFunction.getToday()); + DataOperatorUtil.copySingleJBO(LC_FUND_INCOME.CLASS_NAME, fromCondition,LC_FUND_INCOME_TEMP.CLASS_NAME, null, otherProperty,tx); + } + } + Transaction sqlTran = Transaction.createTransaction(tx); + ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,sum(fact_money) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid")); + if(rs.next()){ + totalMoney = new BigDecimal(rs.getString("total_money")); + contractCount = Integer.parseInt(rs.getString("contract_count")); + SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); + so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); + so.setRunSql(so.getRunSql().replaceAll("@", ":")); + sqlTran.executeSQL(so); + so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); + sqlTran.executeSQL(so); + } + } + }catch(Exception e){ + e.printStackTrace(); + tx.rollback(); + return "ERROR"; + } + return "SUCCESS"; + } + public String updateFundIncomeStatus(JBOTransaction tx) throws JBOException{//target + try{ + for(String contractId : contractIds.split("@")){ + JBOFactory.getBizObjectManager(LC_FUND_INCOME_TEMP.CLASS_NAME,tx).createQuery("update O set "+("cancel".equals(status)?"pay_status='apply_return'":"pay_status=null")+" where flowunid='"+flowunid+"' and contract_id='"+contractId+"'").executeUpdate(); + } + Transaction sqlTran = Transaction.createTransaction(tx); + ASResultSet rs = sqlTran.getResultSet(new SqlObject("select count(1) contract_count,IFNULL(sum(fact_money),0) total_money from lc_fund_income_temp where flowunid='"+flowunid+"' and pay_status<>'apply_return' group by flowunid")); + if(rs.next()){ + BigDecimal totalMoney = new BigDecimal(rs.getString("total_money")); + int contractCount = Integer.parseInt(rs.getString("contract_count")); + SqlObject so = new SqlObject("update lb_actual_payment_info_temp set contract_count='"+contractCount+"',total_money='"+totalMoney+"',updateuserid='"+userId+"',updateorgid='"+orgId+"',updatetime='"+StringFunction.getTodayNow().replaceAll(":", "@")+"' where flowunid='"+flowunid+"'"); + so.setDebugSql(so.getDebugSql().replaceAll("@", ":")); + so.setOriginalSql(so.getOriginalSql().replaceAll("@", ":")); + so.setRunSql(so.getRunSql().replaceAll("@", ":")); + sqlTran.executeSQL(so); + so = new SqlObject("update flow_bussiness_object set proj_name=CONCAT(substr(proj_name,1,instr(proj_name,'实际付款')-1),'实际付款,金额为:"+totalMoney+"') where flow_unid='"+flowunid+"'"); + sqlTran.executeSQL(so); + } + }catch(Exception e){ + e.printStackTrace(); + tx.rollback(); + return "ERROR"; + } + return "SUCCESS"; + } + + public static String setCerificationMoney(String corpus,String interest,String penalty){ + BigDecimal c = new BigDecimal(corpus); + BigDecimal i = new BigDecimal(interest); + BigDecimal p = new BigDecimal(penalty); + c=c.add(i).add(p); +// double CerificationMoney= Double.valueOf(corpus)+Double.valueOf(interest)+Double.valueOf(penalty); + return c.doubleValue()+""; + } + public String check(JBOTransaction tx) throws Exception{ + String sql = "SELECT lfit.project_id,lpi.product_id,psl.paytype AS payType FROM "+ + "lc_fund_income_temp lfit "+ + "LEFT JOIN lb_project_info lpi ON lfit.project_id=lpi.id "+ + "LEFT JOIN PRD_SPECIFIC_LIBRARY psl ON psl.productid=lpi.product_id "+ + "WHERE lfit.flowunid=:flowunid"; + Map params=new HashMap(); + params.put("flowunid", flowunid); + List> payTypeList = DataOperatorUtil.getDataBySql(tx,sql,params); + if(payTypeList.size()<1){ + return "0"; + } + for(Map payType:payTypeList){ + String paytype = payType.get("payType"); + if(this.payType.equals(paytype)){ + return "0"; + } + return "1"; + } + return "1"; + } + + public String paymentReturn(JBOTransaction tx){ + try { + Transaction sqlTran = Transaction.createTransaction(tx); + sqlTran.executeSQL(new SqlObject("delete from lc_fund_income where CONTRACT_ID='"+CONTRACT_ID+"'")); + + BizObjectManager lplManage = JBOFactory.getBizObjectManager(LB_PAYMENTRETURN_LOG.CLASS_NAME,tx); + BizObject lpl = lplManage.newObject(); + lpl.setAttributeValue("contract_no",contract_number); + lpl.setAttributeValue("distributor_name",channel_name); + lpl.setAttributeValue("product_name",product_id); + lpl.setAttributeValue("person_name",customer_name); + lpl.setAttributeValue("pay_object",fact_object); + lpl.setAttributeValue("pay_number",fact_money); + lpl.setAttributeValue("distributor_bank_name",CLIENT_BANK); + lpl.setAttributeValue("distributor_Account_name",CLIENT_ACCOUNT); + lpl.setAttributeValue("distributor_bank_number",CLIENT_ACCNUMBER); + lpl.setAttributeValue("loan_type",payType); + lpl.setAttributeValue("INPUTUSERNAME",username); + lpl.setAttributeValue("INPUTUSERID",userId); + lpl.setAttributeValue("INPUTORGID",orgId); + lpl.setAttributeValue("INPUTTIME",StringFunction.getTodayNow()); + lplManage.saveObject(lpl); + sqlTran.commit(); + return "success"; + } catch (Exception e) { + e.printStackTrace(); + return "系统错误!"; + } + + + } + +}