贴息管理excel导入
This commit is contained in:
parent
43da0fe7b6
commit
a28e6b065a
70
WebContent/com/tenwa/apzl/discount/LbDiscountList.jsp
Normal file
70
WebContent/com/tenwa/apzl/discount/LbDiscountList.jsp
Normal file
@ -0,0 +1,70 @@
|
||||
<%@ page contentType="text/html; charset=GBK"%>
|
||||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
|
||||
/*
|
||||
Author: undefined 2018-07-24
|
||||
Content:
|
||||
History Log:
|
||||
*/
|
||||
ASObjectModel doTemp = new ASObjectModel("LbDiscountList");
|
||||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||||
dwTemp.Style="1"; //--设置为Grid风格--
|
||||
dwTemp.ReadOnly = "1"; //只读模式
|
||||
dwTemp.setPageSize(10);
|
||||
dwTemp.genHTMLObjectWindow("");
|
||||
|
||||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||||
String sButtons[][] = {
|
||||
//{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
|
||||
//{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
|
||||
{"true","","Button","导入Excel","导入Excel","importExcel()","","","","btn_icon_import"},
|
||||
{"true","","Button","贴息模版下载","贴息模版下载","DiscountDownload()","","","","btn_icon_down",""},
|
||||
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
|
||||
};
|
||||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||||
<iframe name="MyAtt" src="<%=com.amarsoft.awe.util.Escape.getBlankJsp(sWebRootPath,"正在下载附件,请稍候...")%>" style="background-color: blue" width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no">
|
||||
</iframe>
|
||||
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
|
||||
<div style="display:none">
|
||||
<input id="sqlString" name=sqlString value="">
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function DiscountDownload(){
|
||||
var sId="ee4b3c16e94d4319a403ea25c8733858";
|
||||
if (typeof(sId)=="undefined" || sId.length==0){
|
||||
return;
|
||||
}else{
|
||||
$("#sqlString").val("save@"+sId);
|
||||
form1.submit();
|
||||
}
|
||||
|
||||
}
|
||||
function importExcel(){
|
||||
var importCondition={};//导入配置
|
||||
importCondition["templateNo"]="ee4b3c16e94d4319a403ea25c8733858";//导入的模板编号必填s
|
||||
//增加其他配置参数
|
||||
importCondition["inputuserid"]="<%=CurUser.getUserID()%>";
|
||||
importCondition["inputorgid"]="<%=CurUser.getOrgID()%>";
|
||||
var sparam=JSON.stringify(importCondition).replace(/,/g,"@");//生成模板的参数据
|
||||
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/TemplateManager/BFTemplateTest/uploadExcel.jsp","importparam="+sparam,
|
||||
{width:"350px",height:"40px",title:"上传贴息数据"},function(){reloadSelf();});
|
||||
}
|
||||
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 newRecord(){
|
||||
var sUrl = "";
|
||||
AsControl.OpenView(sUrl,'','_self','');
|
||||
}
|
||||
function viewAndEdit(){
|
||||
var sUrl = "";
|
||||
var sPara = getItemValue(0,getRow(0),'SerialNo');
|
||||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||||
alert("参数不能为空!");
|
||||
return ;
|
||||
}
|
||||
AsControl.OpenView(sUrl,'SerialNo=' +sPara ,'_self','');
|
||||
}
|
||||
</script>
|
||||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|
||||
37
src_tenwa/com/tenwa/apzl/discount/DiscountCallBack.java
Normal file
37
src_tenwa/com/tenwa/apzl/discount/DiscountCallBack.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.tenwa.apzl.discount;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO;
|
||||
|
||||
import com.amarsoft.are.jbo.BizObject;
|
||||
import com.amarsoft.are.jbo.JBOFactory;
|
||||
import com.amarsoft.are.jbo.JBOTransaction;
|
||||
import com.amarsoft.awe.util.Transaction;
|
||||
import com.amarsoft.context.ASUser;
|
||||
import com.tenwa.comm.exception.BusinessException;
|
||||
import com.tenwa.officetempalte.importcallback.impl.BaseImportExcelCallBack;
|
||||
|
||||
public class DiscountCallBack extends BaseImportExcelCallBack{
|
||||
|
||||
@Override
|
||||
public void run(ASUser CurUser, BizObject importObject,
|
||||
Map<String, String> model, Integer rowIndex, JBOTransaction tx,
|
||||
Transaction Sqlca) throws Exception {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//设置日期格式
|
||||
importObject.setAttributeValue("INPUTTIME",df.format(new Date()));
|
||||
/*String contractNo = importObject.getAttribute("CONTRACT_NO").getString();
|
||||
BizObject contractInfo = JBOFactory.createBizObjectQuery(LB_CONTRACT_INFO.CLASS_NAME, "select * from O where contract_no=:contractNo").setParameter(contractNo, contractNo).getSingleResult(false);
|
||||
if(null!=contractInfo){
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//设置日期格式
|
||||
importObject.setAttributeValue("INPUTTIME",df.format(new Date()));
|
||||
}else{
|
||||
throw new BusinessException("该合同编号不存在");
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user