资金实收报表改权限

This commit is contained in:
tangfutang 2019-06-21 19:53:16 +08:00
parent 9ae82bec90
commit 31cfa4fca6
5 changed files with 2754 additions and 2750 deletions

View File

@ -112,6 +112,9 @@
<script type="text/javascript" src="<%=sWebRootPath %>/Frame/page/js/as_debug_message.js"></script>
<script type="text/javascript">
AsDebug.alert("提示","获取数据失败");
$(function(){
AsControl.OpenView("/Tenwa/Lease/Flow/Comm/BigdataPengyuan/query_report/pengyuandataList.jsp", "FlowUnid=<%=flowunid%>","_self","");
})
</script>
<%
} finally {

View File

@ -1,134 +1,135 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%
/*
Author: undefined 2018-10-30
Content:
History Log:
*/
String userid=CurUser.getUserID();
ASObjectModel doTemp = new ASObjectModel("FundIncomeReport");
//加权限
BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE");
List<BizObject> roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid).getResultList(false);
List<String> roleList = new ArrayList<String>();
String roleid = "";
for(BizObject bo : roleListObject){
roleid = bo.getAttribute("roleid").toString();
roleList.add(roleid);
}
//roleid:800R00000044 北财合作方
//String roleId = "800R00000044";
//roleid:800R00000045 rolename: bccuishou
//如果登录人属于bccuishou角色可以看到北财下的所有的合同
/* if(roleList.contains("800R00000045")){
List<BizObject> userObjectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false);
String userId = "";
List<String> useridList = new ArrayList<String>();
for(BizObject bo : userObjectList){
userId = bo.getAttribute("userid").toString();
useridList.add("'"+userId+"'");
}
String useridStr = StringUtils.join(useridList.toArray(), ",");
doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")");
} */
//导出模板编号
String template = "";
//登录人属于经销商角色 401经销商roleid
if(roleList.contains("401") && !roleList.contains("800R00000051")){
doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'");
//导出有权限
template = "2cd25a9b1c6248c8abacaeeaf7cda303";
}else{
//导出无权限
template = "a87e9bea25694013b9cc39216cac831e";
}
String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'");
String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'");
if(roleList.contains("800R00000051")){
doTemp.appendJboWhere(" and lci.distributor_id='"+distributor_no+"'");
template = "2cd25a9b1c6248c8abacaeeaf7cda303";
}else{
template = "a87e9bea25694013b9cc39216cac831e";
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.ShowSummary="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","exportExcel()","","","","btn_icon_up",""},
//{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function exportExcel(){
var param={};
var tempParam={};
var sparam="";
var templa = "<%=template%>";
//param["templateNo"]="a87e9bea25694013b9cc39216cac831e";
//模板号
//param["templateNo"]="2cd25a9b1c6248c8abacaeeaf7cda303";//权限
param["templateNo"]=templa;//权限
//生成文件关联关系
tempParam["OBJECTTYPE"]="资金实收报表导出";
tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>";
//生成模板固定参数
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
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"]);
downloadFile(attributeID);
}else{
alert("导出失败!");
}
}
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>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%
/*
Author: undefined 2018-10-30
Content:
History Log:
*/
String userid=CurUser.getUserID();
ASObjectModel doTemp = new ASObjectModel("FundIncomeReport");
//加权限
BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE");
List<BizObject> roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid).getResultList(false);
List<String> roleList = new ArrayList<String>();
String roleid = "";
for(BizObject bo : roleListObject){
roleid = bo.getAttribute("roleid").toString();
roleList.add(roleid);
}
//roleid:800R00000044 北财合作方
//String roleId = "800R00000044";
//roleid:800R00000045 rolename: bccuishou
//如果登录人属于bccuishou角色可以看到北财下的所有的合同
/* if(roleList.contains("800R00000045")){
List<BizObject> userObjectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false);
String userId = "";
List<String> useridList = new ArrayList<String>();
for(BizObject bo : userObjectList){
userId = bo.getAttribute("userid").toString();
useridList.add("'"+userId+"'");
}
String useridStr = StringUtils.join(useridList.toArray(), ",");
doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")");
} */
//导出模板编号
String template = "";
String belongorg = Sqlca.getString("select belongorg from user_info where userid='"+userid+"'");
String distributor_no = Sqlca.getString("select distributor_no from distributor_info where orgid='"+belongorg+"'");
// if("DSTB20190516003654".equals(distributor_no)){//测试环境18
if("DSTB20190510003636".equals(distributor_no)){//正式环境
doTemp.appendJboWhere(" and lci.distributor_id ='"+distributor_no+"'");
template = "56c237b623a54732b61196c0b64b8238";
}else if(roleList.contains("401")){
doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'");
//导出有权限
template = "2cd25a9b1c6248c8abacaeeaf7cda303";
}else{
//导出无权限
template = "a87e9bea25694013b9cc39216cac831e";
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.ShowSummary="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","exportExcel()","","","","btn_icon_up",""},
//{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function exportExcel(){
var param={};
var tempParam={};
var sparam="";
var templa = "<%=template%>";
//param["templateNo"]="a87e9bea25694013b9cc39216cac831e";
//模板号
//param["templateNo"]="2cd25a9b1c6248c8abacaeeaf7cda303";//权限
param["templateNo"]=templa;//权限
//生成文件关联关系
tempParam["OBJECTTYPE"]="资金实收报表导出";
tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>";
tempParam["distributor_no"]="<%=distributor_no%>";
//生成模板固定参数
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
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"]);
downloadFile(attributeID);
}else{
alert("导出失败!");
}
}
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"%>

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ public class MakingContractCarCheck extends DefaultBussinessCheck {
if(ldcl!=null){
BizObject psl = psltMange.createQuery("productid=:productid").setParameter("productid", lcit.getAttribute("PRODUCT_ID").getString()).getSingleResult(false);
if(psl!=null){
if("03".equals(ci.getAttribute("CUSTOMERTYPE").getString())&&!"BAIC_MOTOR".equals(psl.getAttribute("operationType").toString())&&!"DYCD".equals(psl.getAttribute("operationType").toString())&&!"ZYC".equals(psl.getAttribute("operationType").toString())&&!"KJZL".equals(psl.getAttribute("operationType").toString())){
if("03".equals(ci.getAttribute("CUSTOMERTYPE").getString())&&!"BAIC_MOTOR".equals(psl.getAttribute("operationType").toString())&&!"DYCD".equals(psl.getAttribute("operationType").toString())&&!"ZYC".equals(psl.getAttribute("operationType").toString())&&!"KJZL".equals(psl.getAttribute("operationType").toString())&&!"KHSQ".equals(psl.getAttribute("operationType").toString())){
if("4".equals(ldcl.getAttribute("PROCESS").getString())){
putMsg("已完成电子签约!");
setPass(true);