53 lines
1.6 KiB
Java
53 lines
1.6 KiB
Java
package com.yili.org;
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.SQLException;
|
|
|
|
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
|
import com.actionsoft.bpms.server.bind.annotation.Controller;
|
|
import com.actionsoft.bpms.server.bind.annotation.Mapping;
|
|
import com.actionsoft.bpms.util.DBSql;
|
|
import com.actionsoft.bpms.util.UtilString;
|
|
/**
|
|
* @Description 资产库菜单权限
|
|
* @author zlf
|
|
* @date 2022年7月29日
|
|
*
|
|
*/
|
|
@Controller
|
|
public class DisplayController {
|
|
@Mapping("com.actionsoft.apps.coe.pal.publisher_output_desk_display")
|
|
public String display(String sid,String uid) {
|
|
Connection open = DBSql.open();
|
|
ResponseObject ro = ResponseObject.newOkResponse();
|
|
try {
|
|
if("admin".equals(uid)) {
|
|
ro.put("roleType","true");
|
|
}else {
|
|
String roleType = DBSql.getString(open,"SELECT ROLETYPE FROM APP_ACT_COE_PAL_COOP_MEMBER R ,APP_ACT_COE_PAL_COOP_ROLE A WHERE R.ROLEID = A.ID AND USERID = ?", new Object[]{uid});
|
|
System.err.println("当前登录账号:"+uid+",用户权限:"+roleType);
|
|
if(UtilString.isEmpty(roleType)) {
|
|
ro.put("roleType","false");
|
|
}else {
|
|
if("1".equals(roleType)||"0".equals(roleType)||"2".equals(roleType)||"3".equals(roleType)) {
|
|
ro.put("roleType","true");
|
|
}else {
|
|
ro.put("roleType","false");
|
|
}
|
|
}
|
|
|
|
}
|
|
} catch (Exception e) {
|
|
// TODO: handle exception
|
|
}finally {
|
|
try {
|
|
open.close();
|
|
} catch (SQLException e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
return ro.toString();
|
|
}
|
|
}
|