经销商导入

This commit is contained in:
liuzhao 2018-11-21 14:22:43 +08:00
parent 07b67ceacd
commit ecb2023908
3 changed files with 73 additions and 0 deletions

View File

@ -16,10 +16,47 @@
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","模版下载","模版下载","DistributorDownload()","","","","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 DistributorDownload(){
var sId="3813a4acb06e41fe80ad111016b67ee8";
if (typeof(sId)=="undefined" || sId.length==0){
return;
}else{
$("#sqlString").val("save@"+sId);
form1.submit();
}
}
function importExcel(){
var importCondition={};//导入配置
importCondition["templateNo"]="3813a4acb06e41fe80ad111016b67ee8";//导入的模板编号必填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(){
importExcelNew();
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','');

View File

@ -1021,6 +1021,8 @@
<attribute name="DISTRIBUTOR_CODING" label="经销商编号" type="STRING" length="32"/>
<attribute name="TOTAL" label="额度" type="STRING" length="32"/>
<attribute name="SUMS" label="总额" type="STRING" length="64"/>
<attribute name="import_status" label="导入状态" type="STRING" length="64"/>
</attributes>
<manager>
<managerProperties>

View File

@ -0,0 +1,34 @@
package com.tenwa.officetempalte.importcallback.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.Transaction;
import com.amarsoft.context.ASUser;
import com.tenwa.flow.util.FlowUtil;
public class DistributorImportCallback extends BaseImportExcelCallBack{
@Override
public void run(ASUser CurUser, BizObject importObject,
Map<String, String> model, Integer rowIndex, JBOTransaction tx,
Transaction Sqlca) throws Exception {
//获取经销商编号
String distributorNo=FlowUtil.getDistributorSerialNumber(tx);
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");//设置日期格式
String userId = CurUser.getUserID().toString();
String orgId = CurUser.getOrgID().toString();
importObject.setAttributeValue("distributor_no", distributorNo).toString();
//导入状态:初审(firstTrial)
importObject.setAttributeValue("import_status", "firstTrial").toString();
//登记时间
importObject.setAttributeValue("INPUTTIME",df.format(new Date()));
//登记人
importObject.setAttributeValue("inputuserid",userId);
//登记部门
importObject.setAttributeValue("inputorgid",orgId);
}
}