接口平台

This commit is contained in:
lixuebo 2019-10-14 15:56:57 +08:00
parent 378a58cbe5
commit 19dc4299a5
5 changed files with 235 additions and 0 deletions

View File

@ -0,0 +1,46 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2019-10-11
Content: 示例详情页面
History Log:
*/
String roleid = CurPage.getParameter("roleid");
String sPrevUrl = CurPage.getParameter("PrevUrl");
if(sPrevUrl == null) sPrevUrl = "/Tenwa/platform/PfTaskAllocationRoleList.jsp";
String sTempletNo = "PfTaskAllocationRoleInfo";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
if(roleid!=null)
doTemp.setVisible("ROLENAME",false);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//只读模式
dwTemp.genHTMLObjectWindow(roleid);
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","as_save(0)","","","",""},
{String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""}
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function returnList(){
AsControl.OpenView("<%=sPrevUrl%>", "","_self","");
}
function selectRole(){
AsDialog.OpenSelector("selectRole","","dialogWidth=" + parseInt(window.screen.width * 0.3) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn==""||sReturn=="_NONE_"){
return;
}
sReturn = sReturn.split("@");
var roleid=sReturn[0];
var rolename=sReturn[1];
setItemValue(0,getRow(),"ROLEID",roleid);
setItemValue(0,getRow(),"ROLENAME",rolename);
});
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,57 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2019-10-11
Content:
History Log:
*/
ASObjectModel doTemp = new ASObjectModel("PfTaskAllocationRoleList");
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","角色下用户","角色下用户","viewUser()","","","","btn_icon_detail",""},
{"true","","Button","删除","删除","deleteRole()","","","","btn_icon_delete",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function newRecord(){
var sUrl = "/Tenwa/platform/PfTaskAllocationRoleInfo.jsp";
AsControl.OpenView(sUrl,'','_self','');
}
function viewAndEdit(){
var sUrl = "/Tenwa/platform/PfTaskAllocationRoleInfo.jsp";
var roleid = getItemValue(0,getRow(0),'ROLEID');
if(typeof(roleid)=="undefined" || roleid.length==0 ){
alert("参数不能为空!");
return ;
}
AsControl.OpenView(sUrl,'roleid='+roleid ,'_self','');
}
function viewUser(){
var sUrl = "/Tenwa/platform/PfTaskAllocationUserList.jsp";
var roleid = getItemValue(0,getRow(0),'ROLEID');
if(typeof(roleid)=="undefined" || roleid.length==0 ){
alert("参数不能为空!");
return ;
}
AsControl.OpenView(sUrl,'roleid='+roleid ,'_self','');
}
function deleteRole(){
if(confirm('确实要删除角色以及角色下用户么?')){
var roleid = getItemValue(0,getRow(0),'ROLEID');
var sReturn = RunJavaMethodTrans("com.tenwa.platform.controller.PfTaskAllocationRoleDelete","deleteRole","roleid="+roleid);
alert(sReturn)
reloadSelf();
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,60 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2019-10-11
Content: 示例详情页面
History Log:
*/
String sPrevUrl = CurPage.getParameter("PrevUrl");
String roleid = CurPage.getParameter("roleid");
String id = CurPage.getParameter("id");
System.out.println(roleid);
System.out.println(id);
String sTempletNo = "PfTaskAllocationUserInfo";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
if(id!=null)
doTemp.setVisible("USERNAME",false);
if(sPrevUrl == null) sPrevUrl = "/Tenwa/platform/PfTaskAllocationUserList.jsp";
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//只读模式
dwTemp.genHTMLObjectWindow(id);
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","saveUser()","","","",""},
{String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""}
};
sButtonPosition = "south";
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function saveUser(){
var pattern = /^(\d|[1-9]\d)$/;
var weight = getItemValue(0,getRow(0),'WEIGHT');
if(!pattern.test(weight)){
alert("权重请输入1~99的整数");
return
}
as_save(0);
}
function returnList(){
AsControl.OpenView("<%=sPrevUrl%>", "roleid=<%=roleid%>","_self","");
}
function selectRoleUser(){
AsDialog.OpenSelector("selectRoleUser","roleid,<%=roleid%>","dialogWidth=" + parseInt(window.screen.width * 0.3) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn==""||sReturn=="_NONE_"){
return;
}
sReturn = sReturn.split("@");
var userid=sReturn[0];
var username=sReturn[1];
setItemValue(0,getRow(),"USERID",userid);
setItemValue(0,getRow(),"USERNAME",username);
setItemValue(0,getRow(),"ROLEID","<%=roleid%>");
});
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,46 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2019-10-11
Content:
History Log:
*/
String sPrevUrl = CurPage.getParameter("PrevUrl");
String roleid = CurPage.getParameter("roleid");
if(sPrevUrl == null) sPrevUrl = "/Tenwa/platform/PfTaskAllocationRoleList.jsp";
ASObjectModel doTemp = new ASObjectModel("PfTaskAllocationUserList");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow(roleid);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{String.valueOf(!com.amarsoft.are.lang.StringX.isSpace(sPrevUrl)),"All","Button","返回","返回列表","returnList()","","","",""},
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function newRecord(){
var sUrl = "/Tenwa/platform/PfTaskAllocationUserInfo.jsp";
AsControl.OpenView(sUrl,'roleid=<%=roleid%>','_self','');
}
function viewAndEdit(){
var sUrl = "/Tenwa/platform/PfTaskAllocationUserInfo.jsp";
var id = getItemValue(0,getRow(0),'ID');
var roleid = getItemValue(0,getRow(0),'ROLEID');
if(typeof(id)=="undefined" || id.length==0 ){
alert("参数不能为空!");
return ;
}
AsControl.OpenView(sUrl,'id='+id+"&roleid="+roleid ,'_self','');
}
function returnList(){
AsControl.OpenView("<%=sPrevUrl%>", "","_self","");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,26 @@
package com.tenwa.platform.controller;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.util.SqlObject;
import com.amarsoft.awe.util.Transaction;
public class PfTaskAllocationRoleDelete {
private String roleid;
public String getRoleid() {
return roleid;
}
public void setRoleid(String roleid) {
this.roleid = roleid;
}
public String deleteRole(JBOTransaction tx) throws Exception{
Transaction Sqlca = null;
Sqlca = Transaction.createTransaction(tx);
Sqlca.executeSQL(new SqlObject("delete from pf_task_allocation_role where ROLEID='"+roleid+"'"));
Sqlca.executeSQL(new SqlObject("delete from pf_task_allocation_user where ROLEID='"+roleid+"'"));
return "½Çɫɾ³ý³É¹¦!";
}
}