修改卡扣导入导出
This commit is contained in:
parent
62725db862
commit
6b85fc2f32
@ -0,0 +1,10 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
||||
String bankType = CurPage.getParameter("BankType");
|
||||
String result = Sqlca.getString(new SqlObject("select count(1) cou from lc_card_deduct_info where import_date is null"));
|
||||
if("0".equals(result)){
|
||||
out.println("true");
|
||||
}else{
|
||||
out.println("false");
|
||||
}
|
||||
%><%@ include file="/IncludeEndAJAX.jsp"%>
|
||||
@ -5,9 +5,22 @@
|
||||
<%@page import="java.math.BigDecimal"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
||||
SqlObject so = new SqlObject("delete from lc_occupy_rent_list where flow_name='¿¨¿ÛºËÏú'");
|
||||
String id = CurPage.getParameter("ID");
|
||||
String bankType = CurPage.getParameter("ObjectType");
|
||||
String fileId = CurPage.getParameter("FileId");
|
||||
String result = "";
|
||||
try{
|
||||
SqlObject so = new SqlObject("delete from lc_occupy_rent_list where flow_name='¿¨¿ÛºËÏú' and flowunid='"+id+"'");
|
||||
Sqlca.executeSQL(so);
|
||||
so = new SqlObject("delete from lc_"+bankType+"_export_data where deduct_info_id='"+id+"'");
|
||||
Sqlca.executeSQL(so);
|
||||
so = new SqlObject("delete from lb_docrelative where id=(select ldl.relative_id from lb_doclibrary ldl left join lb_docattribute lda on ldl.id=lda.library_id where lda.id='"+fileId+"')");
|
||||
Sqlca.executeSQL(so);
|
||||
so = new SqlObject("delete from lb_doclibrary where id=(select library_id from lb_docattribute where id='"+fileId+"')");
|
||||
Sqlca.executeSQL(so);
|
||||
so = new SqlObject("delete from lb_docattribute where id='"+fileId+"'");
|
||||
Sqlca.executeSQL(so);
|
||||
so = new SqlObject("delete from lc_card_deduct_info where id='"+id+"'");
|
||||
Sqlca.executeSQL(so);
|
||||
result = "SUCCESS";
|
||||
}catch(Exception e){
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
<%@page import="com.amarsoft.are.jbo.JBOTransaction"%>
|
||||
<%@page import="java.math.BigDecimal"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/IncludeBeginMDAJAX.jsp"%><%
|
||||
String objecttype = CurPage.getAttribute("OBJECTTYPE");
|
||||
String flowunid = CurPage.getAttribute("FLOW_UNID");
|
||||
String type = CurPage.getAttribute("TYPE");
|
||||
String id = CurPage.getAttribute("ID");
|
||||
String docattributeID = "";
|
||||
try{
|
||||
SqlObject so = new SqlObject("SELECT la.id FROM lb_docrelative lr INNER JOIN LB_DOCLIBRARY ll ON ll.relative_id=lr.id INNER JOIN LB_DOCATTRIBUTE la ON la.library_id=ll.id WHERE lr.objecttype=:objecttype AND lr.flow_unid=:flowunid");
|
||||
so.setParameter("objecttype", objecttype);
|
||||
so.setParameter("flowunid", flowunid);
|
||||
docattributeID = Sqlca.getString(so);
|
||||
if("save".equals(type) && docattributeID != null){
|
||||
Sqlca.executeSQL(new SqlObject("UPDATE LC_CARD_DEDUCT_INFO SET FILE_ID = '" + docattributeID + "' WHERE ID = '" + id + "'"));
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
docattributeID = "";
|
||||
}
|
||||
out.println(docattributeID);
|
||||
%><%@ include file="/IncludeEndAJAX.jsp"%>
|
||||
@ -0,0 +1,59 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2017-11-26
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("LCCardDeductInfoList");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(20);
|
||||
dwTemp.genHTMLObjectWindow("");
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{"true","All","Button","导出数据","导出数据","exportExcel()","","","","btn_icon_export",""},
|
||||
{"true","All","Button","导出撤回","导出撤回","doDelete()","","","","btn_icon_delete",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function exportExcel(){
|
||||
var fileId = getItemValue(0,getRow(0),"FILE_ID");
|
||||
if(fileId){
|
||||
downloadFile(fileId);
|
||||
reloadSelf();
|
||||
}else{
|
||||
AsDebug.showMessage("提示","导出失败!","","",true);
|
||||
}
|
||||
}
|
||||
function downloadFile(id){
|
||||
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
|
||||
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
|
||||
}
|
||||
|
||||
function doDelete(){
|
||||
if(DZ[0][2].length == 0){
|
||||
AsDebug.showMessage("提示","无数据需要撤回!","","",true);
|
||||
return;
|
||||
}
|
||||
var importDate = getItemValue(0, getRow(0), "IMPORT_DATE");
|
||||
if("" != importDate){
|
||||
AsDebug.showMessage("提示","此数据已导入,不能撤回!","","",true);
|
||||
return;
|
||||
}
|
||||
if(confirm("确定要撤回已导出的卡扣数据?")){
|
||||
var fileId = getItemValue(0, getRow(0), "FILE_ID");
|
||||
var id = getItemValue(0, getRow(0), "ID");
|
||||
var sResult = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/CardDeduct/DeleteRentOccupy.jsp","ObjectType=card&FileId="+fileId+"&ID="+id);
|
||||
if("SUCCESS" == sResult){
|
||||
AsDebug.showMessage("提示","撤回成功!","","",true);
|
||||
reloadSelf();
|
||||
}else{
|
||||
AsDebug.showMessage("提示","撤回失败!","","",true);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -0,0 +1,42 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin.jspf"%>
|
||||
<%
|
||||
/*
|
||||
页面说明:示例模块主页面
|
||||
*/
|
||||
String PG_TITLE = "卡扣导出"; // 浏览器窗口标题 <title> PG_TITLE </title>
|
||||
String PG_CONTENT_TITLE = " 通联数据明细 "; //默认的内容区标题
|
||||
String PG_CONTNET_TEXT = "请点击左侧列表";//默认的内容区文字
|
||||
String PG_LEFT_WIDTH = "200";//默认的treeview宽度
|
||||
|
||||
//定义Treeview
|
||||
OHTMLTreeView tviTemp = new OHTMLTreeView(CurPage, "示例模块主页面","right");
|
||||
|
||||
//定义树图结构
|
||||
tviTemp.insertPage("root","卡扣数据","",1);
|
||||
tviTemp.insertPage("root","已导出卡扣信息","",2);
|
||||
|
||||
//另外两种定义树图结构的方法:SQL生成和代码生成 参见View的生成 ExampleView.jsp和ExampleView01.jsp
|
||||
%>
|
||||
<%@ include file="/Frame/resources/include/include_main.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function TreeViewOnClick(){
|
||||
var sCurItemname = getCurTVItem().name;
|
||||
if(sCurItemname == "卡扣数据"){
|
||||
AsControl.OpenView("/Tenwa/Lease/Flow/Rent/CardDeduct/VILCContractRentPlanList.jsp","","right");
|
||||
}else if(sCurItemname == "已导出卡扣信息"){
|
||||
AsControl.OpenView("/Tenwa/Lease/Flow/Rent/CardDeduct/LCCardDeductInfoList.jsp","","right");
|
||||
}
|
||||
setTitle(getCurTVItem().name);
|
||||
}
|
||||
|
||||
<%/*~[Describe=生成treeview;]~*/%>
|
||||
function initTreeView(){
|
||||
<%=tviTemp.generateHTMLTreeView()%>
|
||||
expandNode('root');
|
||||
selectItemByName("卡扣数据"); //默认打开的(叶子)选项
|
||||
}
|
||||
|
||||
initTreeView();
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
@ -1,3 +1,4 @@
|
||||
<%@page import="com.tenwa.reckon.util.UUIDUtil"%>
|
||||
<%@page import="com.amarsoft.app.util.ProductParamUtil"%>
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
@ -8,7 +9,7 @@
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("VILCContractRentPlanList");
|
||||
String sql = doTemp.getJboWhere();
|
||||
ASResultSet rs = Sqlca.getASResultSet("select distinct O.id,O.product_id from vi_lc_contract_rent_plan O where "+sql.replaceAll("v.", ""));
|
||||
/* ASResultSet rs = Sqlca.getASResultSet("select distinct O.id,O.product_id from vi_lc_contract_rent_plan O where "+sql.replaceAll("v.", ""));
|
||||
String contractIDs = "";
|
||||
while(rs.next()){
|
||||
String productID = rs.getString("PRODUCT_ID");
|
||||
@ -21,11 +22,11 @@
|
||||
contractIDs = contractIDs.substring(1);
|
||||
}else{
|
||||
contractIDs = "' '";
|
||||
}
|
||||
doTemp.appendJboWhere(" and ((O.id in ("+contractIDs+") and O.fee_type<>'罚息') or O.id not in ("+contractIDs+"))");
|
||||
} */
|
||||
//doTemp.appendJboWhere(" and ((O.id in ("+contractIDs+") and O.fee_type<>'罚息') or O.id not in ("+contractIDs+"))");
|
||||
//doTemp.appendJboWhere("(case when O.id in("+contractIDs+") then O.fee_type<>'罚息' else 1 end)");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
String jboWhere = dwTemp.getDataObject().getJboWhere().replaceAll("v.", "").replaceAll("O.", "");//用于卡扣数据导出过滤
|
||||
//String jboWhere = dwTemp.getDataObject().getJboWhere().replaceAll("v.", "").replaceAll("O.", "");//用于卡扣数据导出过滤
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(pageSize!=null?Integer.parseInt(pageSize):10);
|
||||
@ -33,12 +34,20 @@
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
{"true","All","Button","卡扣数据导出","卡扣数据导出","exportExcel()","","","","btn_icon_exportNew",""},
|
||||
{"true","All","Button","卡扣导出撤回","卡扣数据撤回","doDelete()","","","","btn_icon_delete",""}
|
||||
{"true","All","Button","卡扣数据导出","卡扣数据导出","exportExcel()","","","","btn_icon_exportNew",""}
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<script type="text/javascript">
|
||||
function exportExcel(){
|
||||
if(DZ[0][2].length == 0){
|
||||
AsDebug.showMessage("提示","无数据需要导出!","","",true);
|
||||
return;
|
||||
}
|
||||
var sReturn = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/CardDeduct/CheckCardExport.jsp","");
|
||||
if("false" == sReturn){
|
||||
AsDebug.showMessage("提示","检查到有数据已导出未处理!","","",true);
|
||||
return;
|
||||
}
|
||||
var param={};
|
||||
var tempParam={};
|
||||
var sparam="";
|
||||
@ -49,7 +58,8 @@
|
||||
//生成文件关联关系
|
||||
tempParam["OBJECTTYPE"]="卡扣数据导出";
|
||||
tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>";
|
||||
tempParam["jboWhere"]="<%=jboWhere%>".replace(/,/ig,"△").replace(/=/ig,"&");
|
||||
tempParam["DeductInfoId"]="<%=UUIDUtil.getUUID()%>";
|
||||
<%-- tempParam["jboWhere"]="<%=jboWhere%>".replace(/,/ig,"△").replace(/=/ig,"&"); --%>
|
||||
|
||||
//生成模板固定参数
|
||||
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
|
||||
@ -63,12 +73,14 @@
|
||||
}
|
||||
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
|
||||
if(result == "success"){
|
||||
var attributeID = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/BatchIncome/GetLBDocAttributeID.jsp",
|
||||
"FLOW_UNID="+tempParam["FLOW_UNID"]+"&OBJECTTYPE="+tempParam["OBJECTTYPE"]);
|
||||
var attributeID = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/CardDeduct/GetLBDocAttributeIDByCard.jsp",
|
||||
"FLOW_UNID="+tempParam["FLOW_UNID"]+"&OBJECTTYPE="+tempParam["OBJECTTYPE"]+"&TYPE=save&ID="+tempParam["DeductInfoId"]);
|
||||
downloadFile(attributeID);
|
||||
console.log(attributeID);
|
||||
AsDebug.showMessage("提示","操作成功,可在【已导出卡扣信息】中查看!","","",true);
|
||||
reloadSelf();
|
||||
}else{
|
||||
alert("导出失败!");
|
||||
AsDebug.showMessage("提示","导出失败!","","",true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1990,30 +1990,6 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="VI_LC_CONTRACT_RENT_PLAN" label="已起租合同租金计划视图" keyAttributes="">
|
||||
<attributes>
|
||||
<attribute name="ID" label="合同编号" type="STRING"/>
|
||||
<attribute name="CONTRACT_NUMBER" label="业务合同号" type="STRING"/>
|
||||
<attribute name="PRODUCT_ID" label="产品编号" type="STRING"/>
|
||||
<attribute name="PAYMENT_NUMBER" label="投放编号" type="STRING"/>
|
||||
<attribute name="CUSTOMERNAME" label="客户名称" type="STRING"/>
|
||||
<attribute name="LEASE_ACC_BANK" label="本方银行" type="STRING"/>
|
||||
<attribute name="LEASE_ACC_NAME" label="本方银行" type="STRING"/>
|
||||
<attribute name="LEASE_ACC_NUMBER" label="本方银行" type="STRING"/>
|
||||
<attribute name="CLIENT_ACC_BANK" label="对方银行" type="STRING"/>
|
||||
<attribute name="CLIENT_ACC_NAME" label="对方账户" type="STRING"/>
|
||||
<attribute name="CLIENT_ACC_NUMBER" label="对方账号" type="STRING"/>
|
||||
<attribute name="PLAN_DATE" label="计划日期" type="STRING"/>
|
||||
<attribute name="PLAN_LIST" label="期次" type="STRING"/>
|
||||
<attribute name="FEE_TYPE" label="费用类型" type="STRING"/>
|
||||
<attribute name="PLAN_MONEY" label="金额" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="vi_lc_contract_rent_plan" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_CARD_DEDUCT_DOC" label="卡扣文件" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="卡扣文件编号" type="STRING" length="32"/>
|
||||
@ -2036,39 +2012,6 @@
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_CARD_DEDUCT_DATA" label="卡扣数据表" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="标识" type="STRING" length="32"/>
|
||||
<attribute name="payment_number" label="投放编号" type="STRING" length="32"/>
|
||||
<attribute name="plan_list" label="期次" type="STRING" length="32"/>
|
||||
<attribute name="fee_type" label="费用类型" type="STRING" length="32"/>
|
||||
<attribute name="deduct_docid" label="卡扣文件编号" type="STRING" length="32"/>
|
||||
<attribute name="serialno" label="序号" type="STRING" length="32"/>
|
||||
<attribute name="paytype" label="固定值7" type="STRING" length="32"/>
|
||||
<attribute name="transactiontype" label="固定值1" type="STRING" length="32"/>
|
||||
<attribute name="ownacc_number" label="本方账号" type="STRING" length="200"/>
|
||||
<attribute name="own_account" label="本方账户" type="STRING" length="200"/>
|
||||
<attribute name="client_acc_number" label="对方账号" type="STRING" length="200"/>
|
||||
<attribute name="client_account" label="对方账户" type="STRING" length="200"/>
|
||||
<attribute name="client_bank" label="对方银行" type="STRING" length="200"/>
|
||||
<attribute name="uage" label="固定值批量扣款" type="STRING" length="32"/>
|
||||
<attribute name="fencode" label="固定值01" type="STRING" length="32"/>
|
||||
<attribute name="currflag" label="固定值0" type="STRING" length="32"/>
|
||||
<attribute name="amount" label="计划金额" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="deductfeetype" label="扣款费用类型" type="STRING" length="200"/>
|
||||
<attribute name="enddate" label="扣款日期" type="STRING" length="32"/>
|
||||
<attribute name="transtatus" label="交易状态" type="STRING" length="32"/>
|
||||
<attribute name="errorcode" label="错误代码" type="STRING" length="32"/>
|
||||
<attribute name="resultdesc" label="交易结果" type="STRING" length="500"/>
|
||||
<attribute name="actual_debit_amt" label="到账金额" type="DOUBLE" length="22" scale="2"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="LC_CARD_DEDUCT_DATA" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_CARD_DEDUCT_DOC_TEMP" label="卡扣文件临时表" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="标识" type="STRING" length="32"/>
|
||||
@ -3138,6 +3081,150 @@
|
||||
<property name="table" value="vi_lc_rent_collection" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="VI_LC_CONTRACT_RENT_PLAN" label="" keyAttributes="">
|
||||
<attributes>
|
||||
<attribute name="ID" label="合同ID" type="STRING"/>
|
||||
<attribute name="customerid" label="银联网络用户编号" type="STRING"/>
|
||||
<attribute name="bankcode" label="银行代码" type="STRING"/>
|
||||
<attribute name="acc_number_type" label="账号类型" type="STRING"/>
|
||||
<attribute name="account_province" label="开户行所在省 " type="STRING"/>
|
||||
<attribute name="account_city" label="开户行所在市" type="STRING"/>
|
||||
<attribute name="account_type" label="账户类型" type="STRING"/>
|
||||
<attribute name="coin" label="货币类型" type="STRING"/>
|
||||
<attribute name="protocol_number" label="协议号" type="STRING"/>
|
||||
<attribute name="protocol_cust_number" label="协议用户编号" type="STRING"/>
|
||||
<attribute name="cert_type" label="开户证件类型" type="STRING"/>
|
||||
<attribute name="cert_id" label="证件号" type="STRING"/>
|
||||
<attribute name="mobile" label="手机号/小灵通" type="STRING"/>
|
||||
<attribute name="custom_number" label="自定义用户号" type="STRING"/>
|
||||
<attribute name="clearing_acc_number" label="清分账号" type="STRING"/>
|
||||
<attribute name="CONTRACT_NUMBER" label="合同编号" type="STRING"/>
|
||||
<attribute name="PRODUCT_ID" label="产品编号" type="STRING"/>
|
||||
<attribute name="PAYMENT_NUMBER" label="投放编号" type="STRING"/>
|
||||
<attribute name="CUSTOMERNAME" label="客户名称" type="STRING"/>
|
||||
<attribute name="LEASE_ACC_BANK" label="LEASE_ACC_BANK" type="STRING"/>
|
||||
<attribute name="LEASE_ACC_NAME" label="LEASE_ACC_NAME" type="STRING"/>
|
||||
<attribute name="LEASE_ACC_NUMBER" label="LEASE_ACC_NUMBER" type="STRING"/>
|
||||
<attribute name="bank_name" label="开户行名称" type="STRING"/>
|
||||
<attribute name="account" label="账户名" type="STRING"/>
|
||||
<attribute name="ACC_NUMBER" label="账号" type="STRING"/>
|
||||
<attribute name="amount" label="金额" type="STRING"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="vi_lc_contract_rent_plan" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_CARD_DEDUCT_DATA" label="卡扣导入数据" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="标识" type="STRING" length="32"/>
|
||||
<attribute name="payment_number" label="投放编号" type="STRING" length="32"/>
|
||||
<attribute name="plan_list" label="期次" type="STRING" length="32"/>
|
||||
<attribute name="fee_type" label="费用类型" type="STRING" length="32"/>
|
||||
<attribute name="deduct_docid" label="卡扣文件编号" type="STRING" length="32"/>
|
||||
<attribute name="serialno" label="序号" type="STRING" length="32"/>
|
||||
<attribute name="paytype" label="固定值7" type="STRING" length="32"/>
|
||||
<attribute name="transactiontype" label="固定值1" type="STRING" length="32"/>
|
||||
<attribute name="ownacc_number" label="本方账号" type="STRING" length="200"/>
|
||||
<attribute name="own_account" label="本方账户" type="STRING" length="200"/>
|
||||
<attribute name="client_acc_number" label="对方账号" type="STRING" length="200"/>
|
||||
<attribute name="client_account" label="对方账户" type="STRING" length="200"/>
|
||||
<attribute name="client_bank" label="对方银行" type="STRING" length="200"/>
|
||||
<attribute name="uage" label="固定值批量扣款" type="STRING" length="32"/>
|
||||
<attribute name="fencode" label="固定值01" type="STRING" length="32"/>
|
||||
<attribute name="currflag" label="固定值0" type="STRING" length="32"/>
|
||||
<attribute name="amount" label="计划金额" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="deductfeetype" label="扣款费用类型" type="STRING" length="200"/>
|
||||
<attribute name="enddate" label="扣款日期" type="STRING" length="32"/>
|
||||
<attribute name="transtatus" label="交易状态" type="STRING" length="32"/>
|
||||
<attribute name="errorcode" label="错误代码" type="STRING" length="32"/>
|
||||
<attribute name="resultdesc" label="交易结果" type="STRING" length="500"/>
|
||||
<attribute name="actual_debit_amt" label="到账金额" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="customerid" label="银联网络用户编号" type="STRING" length="32"/>
|
||||
<attribute name="bankcode" label="银行代码" type="STRING" length="32"/>
|
||||
<attribute name="acc_number_type" label="帐号类型" type="STRING" length="32"/>
|
||||
<attribute name="account_province" label="开户行所在省" type="STRING" length="200"/>
|
||||
<attribute name="account_city" label="开户行所在市" type="STRING" length="200"/>
|
||||
<attribute name="account_type" label="账户类型" type="STRING" length="32"/>
|
||||
<attribute name="coin" label="货币类型" type="STRING" length="32"/>
|
||||
<attribute name="protocol_number" label="协议号" type="STRING" length="32"/>
|
||||
<attribute name="protocol_cust_number" label="协议用户编号" type="STRING" length="32"/>
|
||||
<attribute name="cert_type" label="开户证件类型" type="STRING" length="32"/>
|
||||
<attribute name="cert_id" label="证件号" type="STRING" length="32"/>
|
||||
<attribute name="mobile" label="手机号/小灵通" type="STRING" length="32"/>
|
||||
<attribute name="custom_number" label="自定义用户号" type="STRING" length="32"/>
|
||||
<attribute name="clearing_acc_number" label="清分账号" type="STRING" length="32"/>
|
||||
<attribute name="contract_number" label="备注" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="lc_card_deduct_data" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_CARD_DEDUCT_INFO" label="" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="id" type="STRING" length="32"/>
|
||||
<attribute name="all_count" label="all_count" type="STRING" length="32"/>
|
||||
<attribute name="all_amount" label="all_amount" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="may_count" label="may_count" type="STRING" length="32"/>
|
||||
<attribute name="may_amount" label="may_amount" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="export_date" label="export_date" type="STRING" length="32"/>
|
||||
<attribute name="agreement" label="agreement" type="STRING" length="32"/>
|
||||
<attribute name="inputuserid" label="inputuserid" type="STRING" length="32"/>
|
||||
<attribute name="inputorgid" label="inputorgid" type="STRING" length="32"/>
|
||||
<attribute name="inputtime" label="inputtime" type="STRING" length="32"/>
|
||||
<attribute name="updateuserid" label="updateuserid" type="STRING" length="32"/>
|
||||
<attribute name="updateorgid" label="updateorgid" type="STRING" length="32"/>
|
||||
<attribute name="updatetime" label="updatetime" type="STRING" length="32"/>
|
||||
<attribute name="bank_type" label="bank_type" type="STRING" length="32"/>
|
||||
<attribute name="file_id" label="file_id" type="STRING" length="32"/>
|
||||
<attribute name="import_date" label="import_date" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="lc_card_deduct_info" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
<class name="LC_CARD_EXPORT_DATA" label="" keyAttributes="id">
|
||||
<attributes>
|
||||
<attribute name="id" label="id" type="STRING" length="32"/>
|
||||
<attribute name="serialno" label="serialno" type="STRING" length="32"/>
|
||||
<attribute name="customerid" label="customerid" type="STRING" length="32"/>
|
||||
<attribute name="bankcode" label="bankcode" type="STRING" length="32"/>
|
||||
<attribute name="acc_number_type" label="acc_number_type" type="STRING" length="32"/>
|
||||
<attribute name="account_province" label="account_province" type="STRING" length="200"/>
|
||||
<attribute name="account_city" label="account_city" type="STRING" length="200"/>
|
||||
<attribute name="account_type" label="account_type" type="STRING" length="32"/>
|
||||
<attribute name="coin" label="coin" type="STRING" length="32"/>
|
||||
<attribute name="protocol_number" label="protocol_number" type="STRING" length="32"/>
|
||||
<attribute name="protocol_cust_number" label="protocol_cust_number" type="STRING" length="32"/>
|
||||
<attribute name="cert_type" label="cert_type" type="STRING" length="32"/>
|
||||
<attribute name="cert_id" label="cert_id" type="STRING" length="32"/>
|
||||
<attribute name="mobile" label="mobile" type="STRING" length="32"/>
|
||||
<attribute name="custom_number" label="custom_number" type="STRING" length="32"/>
|
||||
<attribute name="clearing_acc_number" label="clearing_acc_number" type="STRING" length="32"/>
|
||||
<attribute name="contract_number" label="contract_number" type="STRING" length="32"/>
|
||||
<attribute name="product_id" label="product_id" type="STRING" length="32"/>
|
||||
<attribute name="payment_number" label="payment_number" type="STRING" length="32"/>
|
||||
<attribute name="customername" label="customername" type="STRING" length="32"/>
|
||||
<attribute name="bank_name" label="bank_name" type="STRING" length="100"/>
|
||||
<attribute name="account" label="account" type="STRING" length="32"/>
|
||||
<attribute name="acc_number" label="acc_number" type="STRING" length="32"/>
|
||||
<attribute name="amount" label="amount" type="DOUBLE" length="22" scale="2"/>
|
||||
<attribute name="deduct_info_id" label="deduct_info_id" type="STRING" length="32"/>
|
||||
</attributes>
|
||||
<manager>
|
||||
<managerProperties>
|
||||
<property name="table" value="lc_card_export_data" />
|
||||
<property name="createKey" value="true" />
|
||||
</managerProperties>
|
||||
</manager>
|
||||
</class>
|
||||
</package>
|
||||
</jbo>
|
||||
|
||||
@ -1,16 +1,21 @@
|
||||
package com.tenwa.officetempalte.exportcallback.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.util.Map;
|
||||
|
||||
import jbo.app.tenwa.calc.VI_LC_CONTRACT_RENT_PLAN;
|
||||
import jbo.com.tenwa.lease.comm.LC_OCCUPY_RENT_LIST;
|
||||
|
||||
import com.amarsoft.app.awe.config.InitDBType;
|
||||
import jbo.app.tenwa.calc.LC_CARD_DEDUCT_INFO;
|
||||
import jbo.app.tenwa.calc.LC_CARD_EXPORT_DATA;
|
||||
import jbo.com.tenwa.entity.comm.officetempalte.BF_LABLECONFIG;
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.BizObjectManager;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.are.lang.DataElement;
|
||||
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.officetempalte.serviceImp.BaseExcelCallBackServiceImpl;
|
||||
import com.tenwa.reckon.util.UUIDUtil;
|
||||
|
||||
@ -19,22 +24,95 @@ public class CardDeductExportCallBack extends BaseExcelCallBackServiceImpl {
|
||||
@Override
|
||||
public void runAfter(BizObject templateConfig,
|
||||
Map<String, String> paramMap, JBOTransaction tx) throws Exception {
|
||||
BizObjectManager bom = JBOFactory.getBizObjectManager(LC_OCCUPY_RENT_LIST.CLASS_NAME,tx);
|
||||
List<BizObject> bos;
|
||||
if(InitDBType.DBTYPE.equals("ORACLE")){
|
||||
bos = JBOFactory.getBizObjectManager(VI_LC_CONTRACT_RENT_PLAN.CLASS_NAME).createQuery(paramMap.get("jboWhere").replaceAll("to_char", "v.to_char").replaceAll("sysdate", "v.sysdate")).getResultList(false);
|
||||
}else{
|
||||
bos = JBOFactory.getBizObjectManager(VI_LC_CONTRACT_RENT_PLAN.CLASS_NAME).createQuery(paramMap.get("jboWhere").replaceAll("date_format", "v.date_format").replaceAll("now", "v.now")).getResultList(false);
|
||||
}
|
||||
if(bos.size() > 0){
|
||||
for(BizObject bo:bos){
|
||||
BizObject boLORL = bom.newObject();
|
||||
boLORL.setAttributeValue("ID", UUIDUtil.getUUID());
|
||||
boLORL.setAttributeValue("PAYMENT_NUMBER", bo.getAttribute("payment_number").getString());
|
||||
boLORL.setAttributeValue("PLAN_LIST", bo.getAttribute("plan_list").getString());
|
||||
boLORL.setAttributeValue("FLOW_NAME", "¿¨¿ÛºËÏú");
|
||||
bom.saveObject(boLORL);
|
||||
BizObjectManager bomLIED = JBOFactory.getBizObjectManager(LC_CARD_EXPORT_DATA.CLASS_NAME,tx);
|
||||
//通联在点击导出时,不止导出文件,在主页面中的通联导出信息中查看,并且能反复导出
|
||||
BizObjectManager bomLIDIT = JBOFactory.getBizObjectManager(LC_CARD_DEDUCT_INFO.CLASS_NAME,tx);
|
||||
/*BizObject boBTL = JBOFactory.getBizObjectManager(BF_TEMPLATELABLE.CLASS_NAME,tx)
|
||||
.createQuery("TEMPLATEID='"+templateConfig.getAttribute("ID").getString()+"'").getSingleResult(false);
|
||||
String lableId = boBTL.getAttribute("LABLEID").getString();*/
|
||||
BizObject boBLC = JBOFactory.getBizObjectManager(BF_LABLECONFIG.CLASS_NAME,tx)
|
||||
.createQuery("TAGNAME = 'card_deduct2'").getSingleResult(false);
|
||||
Transaction trans = Transaction.createTransaction(tx);
|
||||
Connection con = null;
|
||||
try{
|
||||
String sql = boBLC.getAttribute("VALUEMETHOD").getString();
|
||||
ASResultSet rs = trans.getResultSet(new SqlObject(sql));
|
||||
DataElement[] des = bomLIED.newObject().getAttributes();
|
||||
String liedInsert = "insert into lc_card_export_data(colName) values(colValue)";
|
||||
String lcrlInsert = "insert into lc_occupy_rent_list(ID,PAYMENT_NUMBER,FLOWUNID,FLOW_NAME) values(replace(uuid(), '-', ''),?,?,?)";
|
||||
String colName = "";
|
||||
String colValue = "";
|
||||
for(DataElement de:des){
|
||||
colName += "," + de.getName();
|
||||
colValue += ",?";
|
||||
}
|
||||
liedInsert = liedInsert.replace("colName", colName.substring(1));
|
||||
liedInsert = liedInsert.replace("colValue", colValue.substring(1));
|
||||
con = tx.getConnection(Transaction.createTransaction(tx));
|
||||
con.setAutoCommit(false);
|
||||
PreparedStatement liedStat = con.prepareStatement(liedInsert);
|
||||
PreparedStatement lcrlStat = con.prepareStatement(lcrlInsert);
|
||||
BigDecimal amount = new BigDecimal("0");
|
||||
String deductInfoId = paramMap.get("DeductInfoId");
|
||||
String inputtime = StringFunction.getTodayNow();
|
||||
int allNum = 0;
|
||||
int count = 0;
|
||||
String searchDate = StringFunction.getTodayNow().split(" ")[0];
|
||||
while(rs.next()){
|
||||
allNum++;
|
||||
count++;
|
||||
for(int i=0;i<des.length;i++){
|
||||
switch(des[i].getName()){
|
||||
case "id":
|
||||
liedStat.setString(i+1, UUIDUtil.getUUID());
|
||||
break;
|
||||
case "serialno":
|
||||
liedStat.setString(i+1, allNum + "");
|
||||
break;
|
||||
case "amount":
|
||||
liedStat.setBigDecimal(i+1, new BigDecimal(rs.getString("amount")));
|
||||
amount = amount.add(new BigDecimal(rs.getString("amount")));
|
||||
break;
|
||||
case "export_date":
|
||||
liedStat.setString(i+1, searchDate);
|
||||
break;
|
||||
case "deduct_info_id":
|
||||
liedStat.setString(i+1, deductInfoId);
|
||||
break;
|
||||
default:
|
||||
liedStat.setString(i+1, rs.getString(des[i].getName()));
|
||||
}
|
||||
}
|
||||
liedStat.addBatch();
|
||||
lcrlStat.setString(1, rs.getString("payment_number"));
|
||||
lcrlStat.setString(2, deductInfoId);
|
||||
lcrlStat.setString(3, "卡扣核销");
|
||||
lcrlStat.addBatch();
|
||||
if(count == 3000){
|
||||
liedStat.executeBatch();
|
||||
lcrlStat.executeBatch();
|
||||
liedStat.clearBatch();
|
||||
lcrlStat.clearBatch();
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
liedStat.executeBatch();
|
||||
lcrlStat.executeBatch();
|
||||
BizObject boLIDIT = bomLIDIT.newObject();
|
||||
boLIDIT.setAttributeValue("ID", deductInfoId);
|
||||
boLIDIT.setAttributeValue("ALL_COUNT", allNum);
|
||||
boLIDIT.setAttributeValue("ALL_AMOUNT", amount);
|
||||
boLIDIT.setAttributeValue("MAY_COUNT", allNum);
|
||||
boLIDIT.setAttributeValue("MAY_AMOUNT", amount);
|
||||
boLIDIT.setAttributeValue("EXPORT_DATE", searchDate);
|
||||
boLIDIT.setAttributeValue("INPUTUSERID", paramMap.get("CurUserId"));
|
||||
boLIDIT.setAttributeValue("INPUTORGID", paramMap.get("CurOrgId"));
|
||||
boLIDIT.setAttributeValue("INPUTTIME", inputtime);
|
||||
bomLIDIT.saveObject(boLIDIT);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
con.rollback();
|
||||
tx.rollback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -209,7 +209,11 @@ public class BaseImportExcelCallBack extends ImportCallBack{
|
||||
value = PoiExcelUtil.getCellValue(cell);
|
||||
value = value.trim();
|
||||
int colIndex = i;
|
||||
String headername=ExcelImportUtil.getImportHanderName(headerRows, colIndex);
|
||||
String cenote = importConfig.getAttribute("cenote").getString();
|
||||
String headername = ExcelImportUtil.getImportHanderName(headerRows, colIndex);
|
||||
if("no_head".equals(cenote)) {
|
||||
headername = cell.getColumnIndex() + "";
|
||||
}
|
||||
if(columnMap.containsKey(headername)){
|
||||
BizObject columnConfig=columnMap.get(headername);
|
||||
String dataType=columnConfig.getAttribute("datatype").getString();//数据类型
|
||||
@ -271,10 +275,11 @@ public class BaseImportExcelCallBack extends ImportCallBack{
|
||||
int n = 0;
|
||||
long start = System.currentTimeMillis();
|
||||
BizObject bo = importObjects.get(0);
|
||||
WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
|
||||
/*WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
|
||||
ComboPooledDataSource datasource = wac.getBean("dataSourceJDBC",ComboPooledDataSource.class);
|
||||
con = datasource.getConnection();
|
||||
con.setAutoCommit(false);
|
||||
con.setAutoCommit(false);*/
|
||||
con = Sqlca.getConnection(Sqlca);
|
||||
String sql = "insert into "+importConfig.getAttribute("importtable").getString()+" (";
|
||||
DataElement[] des = bo.getAttributes();
|
||||
BigDecimal money = new BigDecimal(0);
|
||||
@ -297,7 +302,7 @@ public class BaseImportExcelCallBack extends ImportCallBack{
|
||||
case 0:
|
||||
stat.setString(d+1, UUIDUtil.getUUID());
|
||||
continue;
|
||||
case 1:
|
||||
/*case 1:
|
||||
stat.setString(d+1, bo.getAttribute("deductfeetype").getString().split("/")[0]);
|
||||
continue;
|
||||
case 2:
|
||||
@ -305,14 +310,14 @@ public class BaseImportExcelCallBack extends ImportCallBack{
|
||||
continue;
|
||||
case 3:
|
||||
stat.setString(d+1, bo.getAttribute("deductfeetype").getString().split("/")[2]);
|
||||
continue;
|
||||
continue;*/
|
||||
case 4:
|
||||
stat.setString(d+1, lcddID);
|
||||
continue;
|
||||
case 16:
|
||||
stat.setBigDecimal(d+1, new BigDecimal(des1[d].getDouble()));
|
||||
stat.setBigDecimal(d+1, new BigDecimal("0"));
|
||||
continue;
|
||||
case 18:
|
||||
/*case 18:
|
||||
String endDate = bo.getAttribute(des1[d].getName()).getString();
|
||||
if(endDate.indexOf("/") == -1 && endDate.length() == 8){
|
||||
String year = endDate.substring(0, 4);
|
||||
@ -321,9 +326,9 @@ public class BaseImportExcelCallBack extends ImportCallBack{
|
||||
endDate = year + "/" + month + "/" + day;
|
||||
}
|
||||
stat.setString(d+1, endDate);
|
||||
continue;
|
||||
continue;*/
|
||||
case 22:
|
||||
stat.setBigDecimal(d+1, new BigDecimal(des1[d].getDouble()));
|
||||
stat.setBigDecimal(d+1, new BigDecimal(des1[d].getString().replaceAll(",", "")));
|
||||
money = money.add(new BigDecimal(des1[d].getDouble()));
|
||||
continue;
|
||||
default:
|
||||
@ -362,8 +367,6 @@ public class BaseImportExcelCallBack extends ImportCallBack{
|
||||
tx.rollback();
|
||||
con.rollback();
|
||||
throw new BusinessException("导入失败!");
|
||||
}finally{
|
||||
con.close();
|
||||
}
|
||||
}
|
||||
//导入之后的回调
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user