提交 0122814f 编写于 作者: 扁舟科技's avatar 扁舟科技

Signed-off-by: wang dong <macplus@wcpdoc.com>

上级 d211d5af

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
INSERT INTO `alone_dictionary_entity` VALUES ('402881eb711570c7017115a662ce0008', '202003261502', '202003261502', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', 'LaTeX公式模板', 'LATEX_MODE', '{不同分母分式的加减:\\frac{{a}}{{b}} \\pm \\frac{{c}}{{d}}=\\frac{{ad \\pm bc}}{{bd}}, 乘积的方根:{\\sqrt[{n}]{{ab}}=\\sq...', '1');
INSERT INTO `alone_dictionary_type` VALUES ('202003261531', '202003261531', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '不同分母分式的加减', '', '\\frac{{a}}{{b}} \\pm \\frac{{c}}{{d}}=\\frac{{ad \\pm bc}}{{bd}}', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c0ce96001b', '1', 'NONE', '402881eb711570c7017115c0ce96001b');
INSERT INTO `alone_dictionary_type` VALUES ('202003261531', '202003261531', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '乘积的方根', '', '{\\sqrt[{n}]{{ab}}=\\sqrt[{n}]{{a}} \\cdot \\sqrt[{n}]{{b}},a \\ge 0,b \\ge 0}', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c11563001c', '1', 'NONE', '402881eb711570c7017115c11563001c');
INSERT INTO `alone_dictionary_type` VALUES ('202003261532', '202003261532', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '分式的乘方', '', '\\mathop{{ \\left( {\\frac{{a}}{{b}}} \\right) }}\\nolimits^{{n}}=\\frac{{\\mathop{{a}}\\nolimits^{{n}}}}{{\\mathop{{b}}\\nolimits^{{n}}}}', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c1d3d9001d', '3', 'NONE', '402881eb711570c7017115c1d3d9001d');
INSERT INTO `alone_dictionary_type` VALUES ('202003261532', '202003261532', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '分式的方根', '', '\n\\sqrt[{n}]{{\\frac{{a}}{{b}}}}=\\frac{{\\sqrt[{n}]{{a}}}}{{\\sqrt[{n}]{{b}}}},a\n\\ge 0,b \\ge 0', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c20970001e', '4', 'NONE', '402881eb711570c7017115c20970001e');
INSERT INTO `alone_dictionary_type` VALUES ('202003261533', '202003261533', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '分式的开方', '', '\n\\sqrt[{n}]{{\\frac{{a}}{{b}}}}=\\frac{{\\sqrt[{n}]{{a}}}}{{\\sqrt[{n}]{{b}}}}{\n\\left( {a &gt; 0,b &gt; 0} \\right) }', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c24c75001f', '5', 'NONE', '402881eb711570c7017115c24c75001f');
INSERT INTO `alone_dictionary_type` VALUES ('202003261533', '202003261533', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '分式的相乘', '', '\\frac{{a}}{{b}} \\cdot \\frac{{c}}{{d}}=\\frac{{ac}}{{bd}}', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c2863f0020', '6', 'NONE', '402881eb711570c7017115c2863f0020');
INSERT INTO `alone_dictionary_type` VALUES ('202003261533', '202003261533', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '根式的乘方', '', '\\sqrt[{n}]{{\\mathop{{a}}\\nolimits^{{m}}}}=\\mathop{{ \\left(\n{\\sqrt[{n}]{{a}}} \\right) }}\\nolimits^{{m}},a \\ge 0', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c2c5be0021', '7', 'NONE', '402881eb711570c7017115c2c5be0021');
INSERT INTO `alone_dictionary_type` VALUES ('202003261534', '202003261534', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '同分母相加减', '', '\\frac{{a}}{{b}} \\pm \\frac{{c}}{{b}}=\\frac{{a \\pm c}}{{b}}', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c3499e0022', '8', 'NONE', '402881eb711570c7017115c3499e0022');
INSERT INTO `alone_dictionary_type` VALUES ('202003261534', '202003261534', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '两直线平行', '', 'a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c3e8080023', '9', 'NONE', '402881eb711570c7017115c3e8080023');
INSERT INTO `alone_dictionary_type` VALUES ('202003261535', '202003261535', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '两直线垂直判定', '', 'l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c41c450024', '10', 'NONE', '402881eb711570c7017115c41c450024');
INSERT INTO `alone_dictionary_type` VALUES ('202003261535', '202003261535', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '线面垂直性质定理', '', '\\begin{array}{*{20}{l}} {a \\perp \\alpha }\\\\ {b \\perp \\alpha }\n\\end{array} \\left\\} a \\parallel b\\right.', '402881eb711570c7017115a662ce0008', '402881eb711570c7017115c465cd0025', '11', 'NONE', '402881eb711570c7017115c465cd0025');
INSERT INTO `alone_app_version` VALUES ('v0.4.0', now(), 'USERNAME');
alter table WTS_SUBJECT_USEROWN add CARDID varchar(32);
create table WTS_PAPER_USEROWN
(
ID varchar(32) not null,
CTIME varchar(16) not null,
CUSER varchar(32) not null,
CUSERNAME varchar(64) not null,
PSTATE varchar(2) not null,
PCONTENT varchar(128),
MODELTYPE varchar(2) not null,
PAPERID varchar(32) not null,
ROOMID varchar(32),
PAPERNAME varchar(128) not null,
ROOMNAME varchar(128),
constraint PK_WTS_PAPER_USEROWN primary key clustered (ID)
);
create table WTS_EXAM_STAT
(
ID varchar(32) not null,
CTIME varchar(16) not null,
ETIME varchar(16) not null,
CUSERNAME varchar(64) not null,
CUSER varchar(32) not null,
EUSERNAME varchar(64) not null,
EUSER varchar(32) not null,
PSTATE varchar(2) not null,
PCONTENT varchar(128),
SUBJECTNUM int not null,
ERRORSUBNUM int not null,
PAPERNUM int not null,
constraint PK_WTS_EXAM_STAT primary key clustered (ID)
);
alter table WTS_EXAM_STAT add TESTNUM int;
alter table WTS_PAPER_USEROWN add SCORE float;
alter table WTS_PAPER_USEROWN add RPCENT int;
alter table WTS_PAPER_USEROWN add CARDID varchar(32);
alter table WTS_PAPER add BOOKNUM int not null;
update WTS_PAPER set BOOKNUM=0;
update WTS_PAPER_USEROWN set SCORE=-1000;
update WTS_PAPER_USEROWN set RPCENT=-1000;
alter table WTS_SUBJECT add DONUM int not null;
alter table WTS_SUBJECT add RIGHTNUM int not null;
update WTS_SUBJECT set DONUM=0;
update WTS_SUBJECT set RIGHTNUM=0;
\ No newline at end of file
INSERT INTO `alone_app_version` VALUES ('v0.5.0', now(), 'USERNAME');
\ No newline at end of file
INSERT INTO `alone_app_version` VALUES ('v0.6.0', now(), 'USERNAME');
alter table WTS_ROOM add SSORTTYPE varchar(2) not null;
alter table WTS_ROOM add OSORTTYPE varchar(2) not null;
alter table WTS_ROOM add PSHOWTYPE varchar(2) not null;
update WTS_ROOM set SSORTTYPE='1';
update WTS_ROOM set OSORTTYPE='1';
update WTS_ROOM set PSHOWTYPE='1';
create table WTS_CARD_HIS
(
ID varchar(32) not null,
PAPERNAME varchar(128) not null,
PAPERID varchar(32) not null,
ROOMNAME varchar(64) not null,
ROOMID varchar(32) not null,
USERID varchar(32) not null,
POINT float not null,
ADJUDGEUSER varchar(32),
ADJUDGEUSERNAME varchar(64),
ADJUDGETIME varchar(16),
STARTTIME varchar(16),
ENDTIME varchar(16),
PSTATE varchar(2) not null,
PCONTENT varchar(256),
COMPLETENUM int,
ALLNUM int,
constraint PK_WTS_CARD_HIS primary key clustered (ID)
);
create table WTS_CARD_ANSWER_HIS
(
ID varchar(32) not null,
CARDID varchar(32) not null,
ANSWERID varchar(32),
VERSIONID varchar(32) not null,
CUSER varchar(32) not null,
VALSTR text not null,
CTIME varchar(16) not null,
PCONTENT varchar(256),
PSTATE varchar(2) not null,
constraint PK_WTS_CARD_ANSWER_HIS primary key clustered (ID)
);
create table WTS_CARD_POINT_HIS
(
ID character(32) not null,
POINT int,
CARDID character(32) not null,
VERSIONID character(32) not null,
COMPLETE character(1) not null,
constraint PK_WTS_CARD_POINT_HIS primary key clustered (ID)
);
alter table WTS_CARD_HIS add USERNAME varchar(64) not null;
INSERT INTO `alone_auth_action` VALUES ('402881ec70c6e4c10170c6ebbc830002', 'cardquery/hislist', '统计查询_归档成绩查询', '', '20200311080822', '20200311085424', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '1', '1');
INSERT INTO `alone_auth_action` VALUES ('402881ec70c6e4c10170c712b9960004', 'cardquery/livelist', '统计查询_未归档成绩查询', '', '20200311085058', '20200311085414', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '1', '1');
INSERT INTO `alone_auth_action` VALUES ('402881ec70c8c66b0170c8ca3e140000', 'randomitem/list', '答题管理_随机卷配置', null, '20200311165102', '20200311165102', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '1', '1');
INSERT INTO `alone_auth_actiontree` VALUES ('402881ec70c6e4c10170c6e97c510001', '3', 'NONE', '统计查询', '402881ec70c6e4c10170c6e97c510001', '', '1', '20200311080555', '20200311080555', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', null, 'alone', 'icon-statistics', null, '');
INSERT INTO `alone_auth_actiontree` VALUES ('402881ec70c6e4c10170c6ebbc840003', '1', '402881ec70c6e4c10170c6e97c510001', '已归档成绩查询', '402881ec70c6e4c10170c6e97c510001402881ec70c6e4c10170c6ebbc840003', '', '2', '20200311080822', '20200311085136', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '402881ec70c6e4c10170c6ebbc830002', 'alone', 'icon-tip', null, '');
INSERT INTO `alone_auth_actiontree` VALUES ('402881ec70c6e4c10170c712b9960005', '2', '402881ec70c6e4c10170c6e97c510001', '未归档成绩查询', '402881ec70c6e4c10170c6e97c510001402881ec70c6e4c10170c712b9960005', '', '2', '20200311085058', '20200311085058', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '402881ec70c6e4c10170c712b9960004', 'alone', 'icon-tip', null, '');
INSERT INTO `alone_auth_actiontree` VALUES ('402881ec70c8c66b0170c8ca3e220001', '5', '402881ec70c8c66b0170c8ce0b250002', '随机卷规则配置', '402881ec70c8c66b0170c8ce0b250002402881ec70c8c66b0170c8ca3e220001', '', '2', '20200311165102', '20200311165443', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '402881ec70c8c66b0170c8ca3e140000', 'alone', 'icon-application_osx_terminal', null, '');
INSERT INTO `alone_auth_actiontree` VALUES ('402881ec70c8c66b0170c8ce0b250002', '4', 'NONE', '规则管理', '402881ec70c8c66b0170c8ce0b250002', '', '1', '20200311165511', '20200311165532', '40288b854a329988014a329a12f30002', '40288b854a329988014a329a12f30002', '1', '', 'alone', 'icon-application_osx_terminal', null, '');
create table WTS_RANDOM_ITEM
(
ID varchar(32) not null,
CTIME varchar(16) not null,
CUSER varchar(32) not null,
PSTATE varchar(2) not null,
PCONTENT varchar(128),
NAME varchar(64) not null,
constraint PK_WTS_RANDOM_ITEM primary key clustered (ID)
);
create table WTS_RANDOM_STEP
(
ID varchar(32) not null,
TYPEID varchar(32) not null,
TIPTYPE varchar(2) not null,
SUBNUM int not null,
SUBPOINT int not null,
SORT int not null,
NAME varchar(64) not null,
PCONTENT varchar(128),
ITEMID varchar(32) not null,
constraint PK_WTS_RANDOM_STEP primary key clustered (ID)
);
alter table WTS_RANDOM_STEP
add constraint FK_WTS_RAND_REFERENCE_WTS_RAND foreign key (ITEMID)
references WTS_RANDOM_ITEM (ID)
on update restrict
on delete restrict;
\ No newline at end of file
INSERT INTO ALONE_APP_VERSION VALUES ('v0.7.0', now(), 'USERNAME');
alter table WTS_PAPER drop column MODELTYPE;
DELETE FROM WTS_SUBJECT_USEROWN WHERE CARDID is not null;
DELETE FROM WTS_PAPER_USEROWN ;
alter table WTS_ROOM_PAPER add NAME varchar(512);
INSERT INTO ALONE_APP_VERSION VALUES ('v0.8.0', now(), 'USERNAME');
ALTER TABLE alone_auth_userpost ADD INDEX USERPOST_USERID (USERID) ;
ALTER TABLE alone_auth_userorg ADD INDEX USERORG_USERID (USERID) ;
\ No newline at end of file
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.0', now(), 'USERNAME');
alter table WTS_MATERIAL add UUID varchar(32) not null;
alter table WTS_SUBJECT add UUID varchar(32) not null;
alter table WTS_PAPER add UUID varchar(32) not null;
alter table WTS_ROOM add UUID varchar(32) not null;
update WTS_MATERIAL set UUID=ID;
update WTS_SUBJECT set UUID=ID;
update WTS_PAPER set UUID=ID;
update WTS_ROOM set UUID=ID;
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.1', now(), 'USERNAME');
alter table WTS_CARD_POINT add MPOINT int;
alter table WTS_CARD_POINT_HIS add MPOINT int;
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.2', now(), 'USERNAME');
alter table WTS_CARD add OVERTIME varchar(2) not null;
update WTS_CARD set OVERTIME='1';
alter table WTS_CARD_HIS add OVERTIME varchar(2) not null;
update WTS_CARD_HIS set OVERTIME='1';
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.3', now(), 'USERNAME');
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.4', now(), 'USERNAME');
ALTER TABLE wts_subject_answer ADD INDEX SUBJECTANSWER_VERSIONID (VERSIONID);
ALTER TABLE wts_paper_subject ADD INDEX PAPERSUBJECT_PID_SID (PAPERID,SUBJECTID);
\ No newline at end of file
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.5', now(), 'USERNAME');
\ No newline at end of file
INSERT INTO ALONE_APP_VERSION VALUES ('v0.9.6', now(), 'USERNAME');
\ No newline at end of file
INSERT INTO ALONE_APP_VERSION VALUES ('v1.0.0', now(), 'USERNAME');
ALTER TABLE WTS_CARD ADD INDEX USER_PAPER_CARD (PAPERID,USERID,ROOMID);
ALTER TABLE wts_card_answer ADD INDEX USER_ANSWER (CARDID,VERSIONID,ANSWERID);
ALTER TABLE wts_card_answer ADD INDEX USER_SUBVERSION (CARDID,VERSIONID);
\ No newline at end of file
此差异已折叠。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.farm</groupId>
<artifactId>wts-authority</artifactId>
<version>${wcp.version}</version>
<name>用户和权限系统</name>
<properties>
<wcp.version>3.2.3</wcp.version>
<!-- 文件拷贝时的编码 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- 编译时的编码 -->
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<dependencies>
<dependency>
<groupId>com.farm</groupId>
<artifactId>wts-core</artifactId>
<version>${wcp.version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.farm</groupId>
<artifactId>wts-parameter</artifactId>
<version>${wcp.version}</version>
<exclusions>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.farm</groupId>
<artifactId>wts-report</artifactId>
<version>${wcp.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.farm.authority;
import javax.servlet.http.HttpSession;
import com.farm.authority.domain.Organization;
import com.farm.authority.service.UserServiceInter;
import com.farm.core.auth.domain.LoginUser;
import com.farm.util.spring.BeanFactory;
import com.farm.web.constant.FarmConstant;
public class AuthUtils {
public static Organization getCurrentOrganization(HttpSession session) {
UserServiceInter users = (UserServiceInter) BeanFactory.getBean("userServiceImpl");
LoginUser user = (LoginUser) session.getAttribute(FarmConstant.SESSION_USEROBJ);
return users.getOrg(user.getId());
}
}
package com.farm.authority;
import java.lang.reflect.InvocationTargetException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpSession;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.log4j.Logger;
import com.farm.authority.domain.Action;
import com.farm.authority.domain.User;
import com.farm.authority.service.ActionServiceInter;
import com.farm.authority.service.OutuserServiceInter;
import com.farm.authority.service.UserServiceInter;
import com.farm.core.AuthorityService;
import com.farm.core.ParameterService;
import com.farm.core.auth.domain.AuthKey;
import com.farm.core.auth.domain.LoginUser;
import com.farm.core.auth.domain.WebMenu;
import com.farm.core.auth.exception.LoginUserNoAuditException;
import com.farm.core.auth.exception.LoginUserNoExistException;
import com.farm.core.auth.util.AuthenticateInter;
import com.farm.core.auth.util.AuthenticateProvider;
import com.farm.core.auth.util.Urls;
import com.farm.parameter.FarmParameterService;
import com.farm.util.spring.BeanFactory;
import com.farm.web.WebUtils;
import com.farm.web.log.WcpLog;
import com.farm.web.online.OnlineUserOpImpl;
public class FarmAuthorityService implements AuthorityService {
// 人数限制
private static int PLOGS_USERNUM = 5000;
private UserServiceInter userServiceImpl;
private ActionServiceInter actionServiceImpl;
private OutuserServiceInter outuserServiceImpl;
private AuthenticateInter authUtil = AuthenticateProvider.getInstance();
private static FarmAuthorityService service;
private final static Logger log = Logger.getLogger(FarmAuthorityService.class);
public static int getPLOGS_USERNUM() {
return PLOGS_USERNUM;
}
public static AuthorityService getInstance() {
if (service == null) {
service = new FarmAuthorityService();
service.userServiceImpl = (UserServiceInter) BeanFactory.getBean("userServiceImpl");
service.outuserServiceImpl = (OutuserServiceInter) BeanFactory.getBean("outuserServiceImpl");
service.actionServiceImpl = (ActionServiceInter) BeanFactory.getBean("actionServiceImpl");
}
return service;
}
/**
* 将登录信息写进session
*
* @param session
* @param ip
* @param loginName
* @param note
* 备注(描述登录方式,将写在日志中)
* @return 上次登录时间/用户ID
*/
public static Map<String, String> loginIntoSession(HttpSession session, String ip, String loginName, String note) {
WebUtils webutils = new WebUtils();
// 清空session中的參數
initSession(session);
// 开始写入session用户信息
LoginUser user = getInstance().getUserByLoginName(loginName);
try {
BeanUtils.setProperty(user, "ip", ip);
} catch (IllegalAccessException | InvocationTargetException e) {
log.warn("loginIntoSession:set User Ip:" + e.getMessage());
}
WcpLog.info("用户登陆:" + note, user.getName(), user.getId());
webutils.setCurrentUser(user, session);
webutils.setLoginTime(session);
// 开始写入session用户权限
webutils.setCurrentUserAction(getInstance().getUserAuthKeys(WebUtils.getCurrentUser(session).getId()), session);
// 开始写入session用户菜单
webutils.setCurrentUserMenu(getInstance().getUserMenu(WebUtils.getCurrentUser(session).getId()), session);
// 写入用户上线信息
// OnlineUserOpInter ouop = null;
// ouop = OnlineUserOpImpl.getInstance(ip, loginName, session);
// ouop.userLoginHandle(FarmAuthorityService.getInstance().getUserByLoginName(loginName));
// 记录用户登录时间
String lastLoginTime = getInstance().loginHandle(WebUtils.getCurrentUser(session).getId());
Map<String, String> returnMap = new HashMap<>();
returnMap.put("lastLoginTime", lastLoginTime);
returnMap.put("UserId", user.getId());
OnlineUserOpImpl.getInstance(ip, session).userlogin();
return returnMap;
}
/**
* 清空session的attribute
*
* @param session
*/
private static void initSession(HttpSession session) {
@SuppressWarnings("rawtypes")
Enumeration em = session.getAttributeNames();
ParameterService parameterService = FarmParameterService.getInstance();
while (em.hasMoreElements()) {
String key = em.nextElement().toString();
if (!key.equals(parameterService.getParameter("farm.constant.session.key.go.url"))
&& !key.equals(parameterService.getParameter("farm.constant.session.key.from.url"))) {
session.removeAttribute(key);
}
}
}
@Override
public String loginHandle(String userId) {
String lastLoginTime = userServiceImpl.setLoginTime(userId);
return lastLoginTime;
}
@Override
public Set<String> getUserAuthKeys(String userId) {
User user = userServiceImpl.getUserEntity(userId);
List<Action> actions = null;
if (user.getType().equals("3")) {
actions = actionServiceImpl.getAllActions();
} else {
actions = userServiceImpl.getUserActions(userId);
}
Set<String> set = new HashSet<String>();
for (Action action : actions) {
// 添加自定义权限
set.add(action.getAuthkey());
String groupkey = Urls.getGroupKey(action.getAuthkey());
// 添加组权限
if (groupkey != null) {
set.add(groupkey);
}
}
return set;
}
@Override
public LoginUser getUserById(String userId) {
return userServiceImpl.getUserEntity(userId);
}
@Override
public LoginUser getUserByLoginName(String loginName) {
return userServiceImpl.getUserByLoginName(loginName);
}
@Override
public List<WebMenu> getUserMenu(String userId) {
User user = userServiceImpl.getUserEntity(userId);
List<WebMenu> list = null;
if (user.getType().equals("3")) {
list = actionServiceImpl.getAllMenus();
} else {
list = userServiceImpl.getUserMenus(userId);
}
return list;
}
@Override
public boolean isLegality(String loginName, String password)
throws LoginUserNoExistException, LoginUserNoAuditException {
User user = userServiceImpl.getUserByLoginName(loginName);
if (user == null) {
throw new LoginUserNoExistException("该登录名不存在!");
}
if (user.getType().equals("2")) {
throw new LoginUserNoExistException("该用户无登录权限!");
}
if (user.getState().equals("3")) {
throw new LoginUserNoAuditException("当前用户正在等待管理员审核!");
}
if (!user.getState().equals("1")) {
throw new LoginUserNoExistException("该用户已停用!");
}
if (authUtil.isMd5code(password)) {
if (password.toUpperCase().equals(user.getPassword())) {
return true;
}
} else {
if (authUtil.encodeLoginPasswordOnMd5(password, loginName).equals(user.getPassword())) {
return true;
}
}
return false;
}
@Override
public AuthKey getAuthKey(String key) {
return actionServiceImpl.getCacheAction(key);
}
@Override
public List<String> getUserPostKeys(String userId) {
return userServiceImpl.getUserPostIds(userId);
}
@Override
public String getUserOrgKey(String userId) {
return userServiceImpl.getUserOrganization(userId).getId();
}
public UserServiceInter getUserServiceImpl() {
return userServiceImpl;
}
public void setUserServiceImpl(UserServiceInter userServiceImpl) {
this.userServiceImpl = userServiceImpl;
}
public ActionServiceInter getActionServiceImpl() {
return actionServiceImpl;
}
public void setActionServiceImpl(ActionServiceInter actionServiceImpl) {
this.actionServiceImpl = actionServiceImpl;
}
@Override
public LoginUser getUserByOutUserId(String outuserid, String name, String content) {
return outuserServiceImpl.getUserByAccountId(outuserid, name, content);
}
}
package com.farm.authority.controller;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import com.farm.authority.domain.Action;
import com.farm.authority.service.ActionServiceInter;
import com.farm.core.page.OperateType;
import com.farm.core.page.RequestMode;
import com.farm.core.page.ViewMode;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import com.farm.web.WebUtils;
import com.farm.web.easyui.EasyUiUtils;
@RequestMapping("/action")
@Controller
public class ActionController extends WebUtils {
private final static Logger log = Logger.getLogger(ActionController.class);
@Resource
ActionServiceInter actionServiceImpl;
public ActionServiceInter getActionServiceImpl() {
return actionServiceImpl;
}
public void setActionServiceImpl(ActionServiceInter actionServiceImpl) {
this.actionServiceImpl = actionServiceImpl;
}
/**
* 查询结果集合
*
* @return
*/
@RequestMapping("/query")
@ResponseBody
public Map<String, Object> queryall(DataQuery query,
HttpServletRequest request) {
try {
query = EasyUiUtils.formatGridQuery(request, query);
DataResult result = actionServiceImpl
.createActionSimpleQuery(query).search();
result.runDictionary("1:是,0:否", "CHECKIS");
result.runDictionary("1:是,0:否", "LOGINIS");
result.runDictionary("1:可用,0:不可用", "STATE");
result.runformatTime("UTIME", "yyyy-MM-dd HH:mm");
return ViewMode.getInstance()
.putAttrs(EasyUiUtils.formatGridData(result))
.returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e)
.returnObjMode();
}
}
@RequestMapping("/list")
public ModelAndView index(HttpSession session) {
return ViewMode.getInstance()
.returnModelAndView("authority/ActionResult");
}
/**
* 提交修改数据
*
* @return
*/
@RequestMapping("/edit")
@ResponseBody
public Map<String, Object> editSubmit(Action entity, HttpSession session) {
try {
entity = actionServiceImpl.editActionEntity(entity,
getCurrentUser(session));
return ViewMode.getInstance().setOperate(OperateType.ADD)
.putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.ADD)
.setError(e.getMessage(),e).returnObjMode();
}
}
/**
* 提交新增数据
*
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Map<String, Object> addSubmit(Action entity, HttpSession session) {
try {
entity = actionServiceImpl.insertActionEntity(entity,
getCurrentUser(session));
return ViewMode.getInstance().putAttr("entity", entity)
.returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e)
.returnObjMode();
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/del")
@ResponseBody
public Map<String, Object> delSubmit(String ids, HttpSession session) {
try {
for (String id : parseIds(ids)) {
actionServiceImpl.deleteActionEntity(id,
getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e)
.returnObjMode();
}
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/info")
@ResponseBody
public Map<String, Object> view(String ids) {
try {
return ViewMode.getInstance()
.putAttr("entity", actionServiceImpl.getActionEntity(ids))
.returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e)
.returnObjMode();
}
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/form")
public ModelAndView view(RequestMode pageset, String ids) {
try {
switch (pageset.getOperateType()) {
case (0):{//查看
return ViewMode.getInstance().putAttr("pageset", pageset)
.putAttr("entity", actionServiceImpl.getActionEntity(ids))
.returnModelAndView("authority/ActionForm");
}
case (1): {// 新增
return ViewMode.getInstance().putAttr("pageset", pageset)
.returnModelAndView("authority/ActionForm");
}
case (2):{//修改
return ViewMode.getInstance().putAttr("pageset", pageset)
.putAttr("entity", actionServiceImpl.getActionEntity(ids))
.returnModelAndView("authority/ActionForm");
}
default:
break;
}
return ViewMode.getInstance().returnModelAndView("authority/ActionForm");
} catch (Exception e) {
return ViewMode.getInstance().setError(e + e.getMessage(),e)
.returnModelAndView("authority/UserForm");
}
}
}
package com.farm.authority.controller;
import com.farm.authority.domain.Action;
import com.farm.authority.domain.Actiontree;
import com.farm.authority.service.ActionServiceInter;
import com.farm.web.WebUtils;
import com.farm.web.easyui.EasyUiTreeNode;
import com.farm.web.easyui.EasyUiUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.farm.core.page.RequestMode;
import com.farm.core.page.ViewMode;
import com.farm.core.sql.result.DataResult;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.query.DataQuerys;
/* *
*功能:构造权限控制层
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20141122211253
*说明:
*/
@RequestMapping("/actiontree")
@Controller
public class ActiontreeController extends WebUtils {
private final static Logger log = Logger.getLogger(ActiontreeController.class);
@Resource
ActionServiceInter actionServiceImpl;
@RequestMapping("/list")
public ModelAndView index(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/ActiontreeResult");
}
@RequestMapping("/icons")
public ModelAndView icons(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/ActionCssIcon");
}
@RequestMapping("/actionsPage")
public ModelAndView actionsPage(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/ActionChoose");
}
@RequestMapping("/treePage")
public ModelAndView treePage(HttpSession session, String ids) {
return ViewMode.getInstance().putAttr("ids", ids).returnModelAndView("authority/ActiontreenodeChooseTreeWin");
}
/**
* 查询所有主菜单结果集合
*
* @return
*/
@RequestMapping("/query")
@ResponseBody
public Map<String, Object> queryall(DataQuery query, HttpServletRequest request) {
try {
query = EasyUiUtils.formatGridQuery(request, query);
if (query.getQueryRule().size() == 0) {
query.addRule(new DBRule("PARENTID", "NONE", "="));
}
DataResult result = actionServiceImpl.createActiontreeSimpleQuery(query).search();
result.runDictionary("1:分类,2:菜单,3:权限", "TYPE");
result.runDictionary("1:可用,0:禁用", "STATE");
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 加载页面所有菜单
*
* @return
*/
@RequestMapping("/queryMenu")
@ResponseBody
public Map<String, Object> loadAllMenu() {
try {
DataResult result = actionServiceImpl.searchAllMenu();
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 提交修改数据
*
* @return
*/
@RequestMapping("/edit")
@ResponseBody
public Map<String, Object> editSubmit(Actiontree entity, Action action, HttpSession session) {
try {
entity = actionServiceImpl.editActiontreeEntity(entity, getCurrentUser(session), action.getAuthkey());
return ViewMode.getInstance().putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 提交新增数据
*
* @param entity
* 表单
* @param authkey
* 权限uri
* @param session
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Map<String, Object> addSubmit(Actiontree entity, String authkey, HttpSession session) {
try {
entity = actionServiceImpl.insertActiontreeEntity(entity, getCurrentUser(session), authkey);
return ViewMode.getInstance().putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/del")
@ResponseBody
public Map<String, Object> delSubmit(String ids, HttpSession session) {
try {
for (String id : parseIds(ids)) {
actionServiceImpl.deleteActiontreeEntity(id, getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/form")
public ModelAndView view(RequestMode pageset, String domain, String ids, String parentid) {
ViewMode mode = ViewMode.getInstance();
try {
Actiontree parent = new Actiontree();
Actiontree entity = null;
switch (pageset.getOperateType()) {
case (1): {// 新增
break;
}
case (0): {// 展示
entity = actionServiceImpl.getActiontreeEntity(ids);
mode.putAttr("entity", entity);
break;
}
case (2): {// 修改
entity = actionServiceImpl.getActiontreeEntity(ids);
mode.putAttr("entity", entity);
break;
}
default:
break;
}
if (parentid != null && parentid.trim().length() > 0) {
parent = actionServiceImpl.getActiontreeEntity(parentid);
mode.putAttr("parent", parent);
}
if (entity != null && entity.getActionid() != null) {
Action treeAction = actionServiceImpl.getActionEntity(entity.getActionid());
mode.putAttr("treeAction", treeAction);
}
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnModelAndView("authority/ActiontreeForm");
}
return mode.putAttr("pageset", pageset).putAttr("domain", domain)
.returnModelAndView("authority/ActiontreeForm");
}
/**
* 移动节点
*
* @return
*/
@RequestMapping("/move")
@ResponseBody
public Map<String, Object> moveTreeNodeSubmit(String oid, String deid) {
try {
for (String id : parseIds(oid)) {
actionServiceImpl.moveActionTreeNode(id, deid);
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 加载子节点
*
* @param id
* @param domain
* @return
*/
@RequestMapping("/loadtree")
@ResponseBody
public List<EasyUiTreeNode> loadTreeNode(String id, String domain) {
try {
return actionServiceImpl.getSyncTree(id, domain);
} catch (Exception e) {
log.error(e.getMessage());
return new ArrayList<EasyUiTreeNode>();
}
}
/**
* 加载树节点根据用户权限
*
* @return
*/
@RequestMapping("/cuserMenus")
@ResponseBody
public Object loadTreeNodeForCurrentUser(String id, String domain, HttpSession session) {
try {
DataQuerys.wipeVirus(id);
DataQuerys.wipeVirus(domain);
List<EasyUiTreeNode> result = actionServiceImpl.searchAsynEasyUiTree(id, domain,
getCurrentUserMenus(session));
return result;
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
}
package com.farm.authority.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.farm.authority.AuthUtils;
import com.farm.authority.domain.Organization;
import com.farm.authority.service.OrganizationServiceInter;
import com.farm.authority.service.UserServiceInter;
import com.farm.core.page.OperateType;
import com.farm.core.page.RequestMode;
import com.farm.core.page.ViewMode;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import com.farm.web.WebUtils;
import com.farm.web.easyui.EasyUiTreeNode;
import com.farm.web.easyui.EasyUiUtils;
/* *
*功能:组织机构控制层
*详细:
*
* 版本:v0.1
* @author zhaonaixia
* @time 2015-6-26 上午10:19:25
* 说明:
*/
@RequestMapping("/organization")
@Controller
public class OrganizationController extends WebUtils {
private final static Logger log = Logger.getLogger(OrganizationController.class);
@Resource
private OrganizationServiceInter organizationServiceImpl;
@Resource
private UserServiceInter userServiceImpl;
public OrganizationServiceInter getOrganizationServiceImpl() {
return organizationServiceImpl;
}
public void setOrganizationServiceImpl(OrganizationServiceInter organizationServiceImpl) {
this.organizationServiceImpl = organizationServiceImpl;
}
/**
* 查询结果集合
*
* @return
*/
@RequestMapping("/query")
@ResponseBody
public Map<String, Object> queryall(@ModelAttribute("query") DataQuery query, HttpServletRequest request) {
try {
query = EasyUiUtils.formatGridQuery(request, query);
if (query.getQueryRule().size() == 0) {
query.addRule(new DBRule("PARENTID", "NONE", "="));
}
DataResult result = organizationServiceImpl.createOrganizationSimpleQuery(query).search();
result.runDictionary("1:可用,0:禁用", "STATE");
result.runDictionary("1:标准,0:同步", "TYPE");
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 进入组织机构管理界面
*
* @param session
* @return
*/
@RequestMapping("/list")
public ModelAndView index(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/OrganizationResult");
}
/**
* 进入组织机构管理界面
*
* @param session
* @return
*/
@RequestMapping("/chooseOrg")
public ModelAndView chooseOrg(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/ChooseOrgResult");
}
/**
* 组织机构tabs
*
* @param session
* @return
*/
@RequestMapping("/organizationTabs")
public ModelAndView orgTabs(RequestMode pageset, String ids, String parentID) {
if (pageset.getOperateType() == 1) {
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("parentId", parentID)
.returnModelAndView("authority/OrganizationTabs");
} else {
Organization entity = organizationServiceImpl.getOrganizationEntity(ids);
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("entity", entity)
.putAttr("parentId", entity.getParentid()).putAttr("ids", ids)
.returnModelAndView("authority/OrganizationTabs");
}
}
/**
* 岗位管理tabs
*
* @param session
* @return
*/
@RequestMapping("/postConsoleTabs")
public ModelAndView postConsoleTabs(RequestMode pageset, String ids) {
return ViewMode.getInstance().putAttr("pageset", pageset).returnModelAndView("authority/PostResult");
}
/**
* 设置岗位权限tabs
*
* @param session
* @return
*/
@RequestMapping("/postActionsTabs")
public ModelAndView postActionsTabs(RequestMode pageset, String ids) {
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("ids", ids)
.returnModelAndView("authority/OrgUserResult");
}
/**
* 移动节点
*
* @return
*/
@RequestMapping("/OrgTreeNodeSubmit")
@ResponseBody
public Object moveTreeNodeSubmit(String ids, String id, HttpSession session) {
try {
organizationServiceImpl.moveOrgTreeNode(ids, id, getCurrentUser(session));
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 提交修改数据
*
* @return
*/
@RequestMapping("/edit")
@ResponseBody
public Map<String, Object> editSubmit(Organization org, HttpSession session) {
try {
Organization entity = organizationServiceImpl.editOrganizationEntity(org, getCurrentUser(session));
return ViewMode.getInstance().setOperate(OperateType.ADD).putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.ADD).setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 提交新增数据
*
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Map<String, Object> addSubmit(Organization org, HttpSession session) {
try {
Organization entity = organizationServiceImpl.insertOrganizationEntity(org, getCurrentUser(session));
return ViewMode.getInstance().setOperate(OperateType.ADD).putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.ADD).setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/del")
@ResponseBody
public ModelAndView delSubmit(String ids, HttpSession session) {
try {
for (String id : parseIds(ids)) {
organizationServiceImpl.deleteOrganizationEntity(id, getCurrentUser(session));
}
return ViewMode.getInstance().returnModelAndView("authority/OrganizationResult");
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e)
.returnModelAndView("authority/OrganizationResult");
}
}
/**
* 移除岗位的用户
*
* @return
*/
@RequestMapping("/removeOrgUser")
@ResponseBody
public Object removeOrgUser(String id, String ids, HttpSession session) {
try {
organizationServiceImpl.removeOrgUsers(id, ids, getCurrentUser(session));
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 跳转
*
* @return
*/
@RequestMapping("/orgTreeNodeTreeView")
public ModelAndView forSend(String ids) {
return ViewMode.getInstance().putAttr("ids", ids)
.returnModelAndView("authority/OrganizationTreenodeChooseTreeWin");
}
/**
* 跳转到组织机构tree页面
*
* @return
*/
@RequestMapping("/userORGTreeView")
public ModelAndView userOrgTree(String ids) {
return ViewMode.getInstance().putAttr("ids", ids).returnModelAndView("authority/UserorgChooseTreeWin");
}
/**
* 增加用户岗位
*
* @return
*/
@RequestMapping("/userOrg")
@ResponseBody
public Object userORGSubmit(RequestMode pageset, String ids, String id, HttpSession session) {
try {
for (String userId : parseIds(ids)) {
organizationServiceImpl.addUserPost(userId, id, getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 增加机构用户
*
* @return
*/
@RequestMapping("/addOrgUser")
@ResponseBody
public Object addOrgUser(String userids, String id, HttpSession session) {
try {
for (String userId : parseIds(userids)) {
userServiceImpl.setUserOrganization(userId, id, getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 设置用户岗位
*
* @return
*/
@RequestMapping("/setOrgUserPost")
@ResponseBody
public Object setOrgUserPost(String userids, String postids, HttpSession session) {
try {
for (String userId : parseIds(userids)) {
userServiceImpl.setUserPost(userId, postids, getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 加载选择岗位树
*
* @return
*/
@RequestMapping("/postTree")
@ResponseBody
public Object userORGLoadTree(String id) {
return organizationServiceImpl.loadPostTree(id);
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/form")
public ModelAndView view(RequestMode pageset, String ids, String parentId) {
try {
Organization parent = null;
if (!parentId.equals("") && parentId != null) {
parent = organizationServiceImpl.getOrganizationEntity(parentId);
}
switch (pageset.getOperateType()) {
case (1): {// 新增
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("parent", parent)
.returnModelAndView("authority/OrganizationForm");
}
case (0): {// 展示
Organization entity = organizationServiceImpl.getOrganizationEntity(ids);
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("entity", entity)
.putAttr("parent", parent).returnModelAndView("authority/OrganizationForm");
}
case (2): {// 修改
Organization entity = organizationServiceImpl.getOrganizationEntity(ids);
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("entity", entity)
.putAttr("parent", parent).returnModelAndView("authority/OrganizationForm");
}
}
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnModelAndView("authority/OrganizationForm");
}
return ViewMode.getInstance().returnModelAndView("authority/OrganizationForm");
}
/**
* 组织机构节点
*/
@RequestMapping("/organizationTree")
@ResponseBody
public Object loadTreeNode(String id) {
// -------------原来没有固定节点的组织机构树,稳定后可删除--------------------
// if (id == null) {
// id = "NONE";
// }
// try {
// return EasyUiTreeNode
// .formatAsyncAjaxTree(
// EasyUiTreeNode.queryTreeNodeOne(id, "SORT",
// "alone_auth_organization", "ID", "PARENTID",
// "NAME", "CTIME").getResultList(),
// EasyUiTreeNode
// .queryTreeNodeTow(id, "SORT", "alone_auth_organization", "ID",
// "PARENTID", "NAME", "CTIME")
// .getResultList(), "PARENTID", "ID", "NAME", "CTIME");
// } catch (Exception e) {
// log.error(e.getMessage());
// return
// ViewMode.getInstance().setError(e.getMessage(),e).returnObjMode();
// }
// -------------原来没有固定节点的组织机构树,稳定后可删除--------------------
try {
if (id == null) {
// 如果是未传入id,就是根节点,就构造一个虚拟的上级节点
id = "NONE";
List<EasyUiTreeNode> list = new ArrayList<>();
EasyUiTreeNode nodes = new EasyUiTreeNode("NONE", "组织机构", "open", "icon-customers");
nodes.setChildren(EasyUiTreeNode.formatAsyncAjaxTree(
EasyUiTreeNode.queryTreeNodeOne(id, "SORT", "alone_auth_organization", "ID", "PARENTID", "NAME",
"CTIME").getResultList(),
EasyUiTreeNode.queryTreeNodeTow(id, "SORT", "alone_auth_organization", "ID", "PARENTID", "NAME",
"CTIME").getResultList(),
"PARENTID", "ID", "NAME", "CTIME"));
list.add(nodes);
return list;
}
return EasyUiTreeNode.formatAsyncAjaxTree(
EasyUiTreeNode
.queryTreeNodeOne(id, "SORT", "alone_auth_organization", "ID", "PARENTID", "NAME", "CTIME")
.getResultList(),
EasyUiTreeNode
.queryTreeNodeTow(id, "SORT", "alone_auth_organization", "ID", "PARENTID", "NAME", "CTIME")
.getResultList(),
"PARENTID", "ID", "NAME", "CTIME");
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 组织机构节点Auth
*/
@RequestMapping("/organizationTreeAuth")
@ResponseBody
public Object loadTreeNode(String id, HttpSession session) {
boolean authFlag = false;
Organization org = AuthUtils.getCurrentOrganization(session);
if (id == null) {
id = "NONE";
if (org != null) {
authFlag = true;
id = org.getParentid();
}
}
DataQuery query1 = EasyUiTreeNode.queryTreeNodeOneAuth(id, "SORT", "alone_auth_organization", "ID", "PARENTID",
"NAME", "CTIME", null, null, authFlag);
DataQuery query2 = EasyUiTreeNode.queryTreeNodeTowAuth(id, "SORT", "alone_auth_organization", "ID", "PARENTID",
"NAME", "CTIME", null, authFlag);
if (org != null) {
query1.addRule(new DBRule("treecode", AuthUtils.getCurrentOrganization(session).getTreecode(), "like-"));
query2.addRule(new DBRule("b.treecode", AuthUtils.getCurrentOrganization(session).getTreecode(), "like-"));
}
try {
return EasyUiTreeNode.formatAsyncAjaxTree(query1.search().getResultList(), query2.search().getResultList(),
"PARENTID", "ID", "NAME", "CTIME");
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 返回树数据 v1.0 zhanghc 2015年9月6日下午1:58:25
*
* @return List<Organization>
*/
@RequestMapping("/loadTree")
@ResponseBody
public List<Organization> loadTree() {
return organizationServiceImpl.getTree();
}
// ----------------------------------------------------------------------------------
/**
* 获取岗位 v1.0 zhanghc 2015年9月6日下午2:43:50
*
* @param orgId
* 机构ID
* @return List<Organization>
*/
@RequestMapping("/loadPost")
@ResponseBody
public List<Map<String, Object>> loadPost(String orgId) {
return organizationServiceImpl.getPostList(orgId);
}
/**
* 获取岗位,带父机构可用的岗位 v1.0 zhanghc 2015年9月7日下午1:48:14
*
* @param orgId
* @return List<Map<String,Object>>
*/
@RequestMapping("/loadPostWithPOrgPost")
@ResponseBody
public List<Map<String, Object>> loadPostWithPOrgPost(String orgId) {
return organizationServiceImpl.getPostListWithPOrgPost(orgId);
}
}
package com.farm.authority.controller;
import com.farm.authority.domain.Outuser;
import com.farm.authority.service.OutuserServiceInter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.annotation.Resource;
import com.farm.web.easyui.EasyUiUtils;
import java.util.Map;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpSession;
import com.farm.core.page.RequestMode;
import com.farm.core.page.OperateType;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import com.farm.core.page.ViewMode;
import com.farm.web.WebUtils;
/* *
*功能:外部账户控制层
*详细:
*
*版本:v0.1
*作者:FarmCode代码工程
*日期:20150707114057
*说明:
*/
@RequestMapping("/outuser")
@Controller
public class OutuserController extends WebUtils {
private final static Logger log = Logger.getLogger(OutuserController.class);
@Resource
OutuserServiceInter outUserServiceImpl;
public OutuserServiceInter getOutuserServiceImpl() {
return outUserServiceImpl;
}
public void setOutuserServiceImpl(OutuserServiceInter outUserServiceImpl) {
this.outUserServiceImpl = outUserServiceImpl;
}
/**
* 查询结果集合
*
* @return
*/
@RequestMapping("/query")
@ResponseBody
public Map<String, Object> queryall(DataQuery query, HttpServletRequest request) {
try {
query = EasyUiUtils.formatGridQuery(request, query);
DataResult result = outUserServiceImpl.createOutuserSimpleQuery(query).search();
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 提交修改数据
*
* @return
*/
@RequestMapping("/edit")
@ResponseBody
public Map<String, Object> editSubmit(Outuser entity, HttpSession session) {
// TODO 自动生成代码,修改后请去除本注释
try {
entity = outUserServiceImpl.editOutuserEntity(entity);
return ViewMode.getInstance().setOperate(OperateType.UPDATE).putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.UPDATE).setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 提交新增数据
*
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Map<String, Object> addSubmit(Outuser entity, HttpSession session) {
// TODO 自动生成代码,修改后请去除本注释
try {
entity = outUserServiceImpl.insertOutuserEntity(entity, getCurrentUser(session));
return ViewMode.getInstance().setOperate(OperateType.ADD).putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.ADD).setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/del")
@ResponseBody
public Map<String, Object> delSubmit(String ids, HttpSession session) {
try {
for (String id : parseIds(ids)) {
outUserServiceImpl.deleteOutuserEntity(id, getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
@RequestMapping("/list")
public ModelAndView index(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/OutuserResult");
}
/**
* 绑定到用户
*
* @return
*/
@RequestMapping("/bindUser")
public ModelAndView bindUser(HttpSession session) {
try {
return ViewMode.getInstance().returnModelAndView("authority/ChooseUserResult");
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnModelAndView("authority/ChooseUserResult");
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/doBind")
@ResponseBody
public Map<String, Object> doBind(String outid, String id, HttpSession session) {
try {
Outuser outuser = outUserServiceImpl.getOutuserEntity(outid);
outuser.setUserid(id);
outUserServiceImpl.editOutuserEntity(outuser);
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/form")
public ModelAndView view(RequestMode pageset, String ids) {
try {
switch (pageset.getOperateType()) {
case (0): {// 查看
return ViewMode.getInstance().putAttr("pageset", pageset)
.putAttr("entity", outUserServiceImpl.getOutuserEntity(ids))
.returnModelAndView("authority/OutuserForm");
}
case (1): {// 新增
return ViewMode.getInstance().putAttr("pageset", pageset).returnModelAndView("authority/OutuserForm");
}
case (2): {// 修改
return ViewMode.getInstance().putAttr("pageset", pageset)
.putAttr("entity", outUserServiceImpl.getOutuserEntity(ids))
.returnModelAndView("authority/OutuserForm");
}
default:
break;
}
return ViewMode.getInstance().returnModelAndView("authority/OutuserForm");
} catch (Exception e) {
return ViewMode.getInstance().setError(e.getMessage(), e).returnModelAndView("authority/OutuserForm");
}
}
}
package com.farm.authority.controller;
import com.farm.authority.service.PopServiceInter;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.annotation.Resource;
import com.farm.web.easyui.EasyUiUtils;
import java.util.Map;
import org.apache.log4j.Logger;
import javax.servlet.http.HttpSession;
import com.farm.core.page.RequestMode;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import com.farm.core.page.ViewMode;
import com.farm.web.WebUtils;
/* *-----------------------API请参考PopComponentController类-------------
*功能:业务权限控制层
*详细:
*
*版本:v0.1
*作者:FarmCode代码工程
*日期:20150707114057
*说明:
*/
@RequestMapping("/pop")
@Controller
public class PopController extends WebUtils {
private final static Logger log = Logger.getLogger(PopController.class);
@Resource
PopServiceInter popServiceImpl;
public PopServiceInter getPopServiceImpl() {
return popServiceImpl;
}
public void setPopServiceImpl(PopServiceInter popServiceImpl) {
this.popServiceImpl = popServiceImpl;
}
/**
* 查询结果集合
*
* @return
*/
@RequestMapping("/query")
@ResponseBody
public Map<String, Object> queryall(DataQuery query, HttpServletRequest request) {
// TODO 自动生成代码,修改后请去除本注释
try {
query = EasyUiUtils.formatGridQuery(request, query);
DataResult result = popServiceImpl.createPopSimpleQuery(query).search();
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/del")
@ResponseBody
public Map<String, Object> delSubmit(String ids, HttpSession session) {
try {
for (String id : parseIds(ids)) {
popServiceImpl.delPop(id, getCurrentUser(session));
}
return ViewMode.getInstance().returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(), e).returnObjMode();
}
}
@RequestMapping("/list")
public ModelAndView index(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/PopResult");
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/form")
public ModelAndView view(RequestMode pageset, String ids) {
try {
switch (pageset.getOperateType()) {
case (0): {// 查看
return ViewMode.getInstance().putAttr("pageset", pageset)
.putAttr("entity", popServiceImpl.getPopEntity(ids)).returnModelAndView("authority/PopForm");
}
case (1): {// 新增
return ViewMode.getInstance().putAttr("pageset", pageset).returnModelAndView("authority/PopForm");
}
case (2): {// 修改
return ViewMode.getInstance().putAttr("pageset", pageset)
.putAttr("entity", popServiceImpl.getPopEntity(ids)).returnModelAndView("authority/PopForm");
}
default:
break;
}
return ViewMode.getInstance().returnModelAndView("authority/PopForm");
} catch (Exception e) {
return ViewMode.getInstance().setError(e + e.getMessage(), e).returnModelAndView("authority/PopForm");
}
}
}
package com.farm.authority.controller;
import java.util.List;
import java.util.Map;
import com.farm.authority.domain.Organization;
import com.farm.authority.domain.Post;
import com.farm.authority.service.OrganizationServiceInter;
import com.farm.core.page.OperateType;
import com.farm.core.page.RequestMode;
import com.farm.core.page.ViewMode;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DBSort;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import com.farm.web.WebUtils;
import com.farm.web.easyui.EasyUiTreeNode;
import com.farm.web.easyui.EasyUiUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
/* *
*功能:岗位控制层
*详细:
*
* 版本:v0.1
* @author zhaonaixia
* @time 2015-6-26 上午10:19:25
* 说明:
*/
@RequestMapping("/post")
@Controller
public class PostController extends WebUtils {
private final static Logger log = Logger.getLogger(PostController.class);
@Resource
OrganizationServiceInter organizationServiceImpl;
public OrganizationServiceInter getOrganizationServiceImpl() {
return organizationServiceImpl;
}
public void setOrganizationServiceImpl(OrganizationServiceInter organizationServiceImpl) {
this.organizationServiceImpl = organizationServiceImpl;
}
/**
* 查询结果集合
*
* @return
*/
@RequestMapping("/query")
@ResponseBody
public Map<String, Object> queryall(@ModelAttribute("query") DataQuery query, HttpServletRequest request,
String ids) {
try {
query = EasyUiUtils.formatGridQuery(request, query);
if (ids != null) {
query.addRule(new DBRule("ORGANIZATIONID", ids, "="));
}
DataResult result = organizationServiceImpl.createPostSimpleQuery(query).search();
result.runDictionary("0:否,1:是", "EXTENDIS");
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e).returnObjMode();
}
}
/**
* 查询结果集合(查询组织机构下可用岗位)
*
* @return
*/
@RequestMapping("/queryOrgPost")
@ResponseBody
public Map<String, Object> queryOrgPost(@ModelAttribute("query") DataQuery query, String orgid,
HttpServletRequest request) {
try {
List<Organization> orgs = organizationServiceImpl.getParentOrgs(orgid);
String orgids = null;
for (Organization org : orgs) {
if (orgids == null) {
orgids = "'" + org.getId() + "'";
} else {
orgids = orgids + ",'" + org.getId() + "'";
}
}
query = EasyUiUtils.formatGridQuery(request, query);
if (orgid != null) {
query.addSqlRule(" and (ORGANIZATIONID='" + orgid + "' or (ORGANIZATIONID in (" + orgids
+ ") and EXTENDIS ='1'))");
}
DataResult result = organizationServiceImpl.createPostSimpleQuery(query).search();
result.runDictionary("0:否,1:是", "EXTENDIS");
return ViewMode.getInstance().putAttrs(EasyUiUtils.formatGridData(result)).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e).returnObjMode();
}
}
/**
* 选择岗位界面
*
* @param session
* @return
*/
@RequestMapping("/choosePost")
public ModelAndView choosePost(HttpSession session) {
return ViewMode.getInstance().returnModelAndView("authority/ChoosePostResult");
}
/**
* 选择组织机构下的岗位界面
*
* @param session
* @return
*/
@RequestMapping("/choosePostByOrg")
public ModelAndView choosePostByOrg(String orgid, HttpSession session) {
return ViewMode.getInstance().putAttr("orgid", orgid).returnModelAndView("authority/ChoosePostResultByOrg");
}
/**
* 进入机构岗位页面
*
* @param session
* @return
*/
@RequestMapping("/postActions")
public ModelAndView postActions(HttpSession session, String ids) {
return ViewMode.getInstance().putAttr("ids", ids).returnModelAndView("authority/PostActionsSeting");
}
/**
* 提交修改数据
*
* @return
*/
@RequestMapping("/edit")
@ResponseBody
public Map<String, Object> editSubmit(Post org, HttpSession session) {
try {
Post entity = organizationServiceImpl.editPost(org.getId(), org.getName(), org.getExtendis(),
getCurrentUser(session));
return ViewMode.getInstance().setOperate(OperateType.ADD).putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.ADD).setError(e.getMessage(),e).returnObjMode();
}
}
/**
* 提交新增数据
*
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Map<String, Object> addSubmit(Post org, HttpSession session, String ids) {
try {
Post entity = organizationServiceImpl.insertPost(ids, org.getName(), org.getExtendis(),
getCurrentUser(session));
return ViewMode.getInstance().setOperate(OperateType.ADD).putAttr("entity", entity).returnObjMode();
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setOperate(OperateType.ADD).setError(e.getMessage(),e).returnObjMode();
}
}
/**
* 设置角色权限树
*
* @return
*/
@RequestMapping("/ALONEROLEGROUP_SYSBASE_SETTREE")
@ResponseBody
public ModelAndView roleGroupSetTree(String ids, String id) {
try {
List<String> actions = parseIds(ids);
organizationServiceImpl.setPostActionTree(actions, id);
return ViewMode.getInstance().returnModelAndView("authority/PostActionsSeting");
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().returnModelAndView("authority/PostActionsSeting");
}
}
/**
* 删除数据
*
* @return
*/
@RequestMapping("/del")
@ResponseBody
public ModelAndView delSubmit(String ids, HttpSession session) {
try {
organizationServiceImpl.deletePostEntity(ids, getCurrentUser(session));
return ViewMode.getInstance().returnModelAndView("authority/PostResult");
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e).returnModelAndView("authority/PostResult");
}
}
/**
* 构造岗位权限树
*
* @return
*/
@RequestMapping("/ALONEMENU_RULEGROUP_TREENODE")
@ResponseBody
public Object postActionsTreeInit(DataQuery query, String ids) {
return EasyUiTreeNode.formatAjaxTree(initRoleGruopTreeNode(query, ids), "A_PARENTID", "A_ID", "A_NAME",
"C_POSTID", "A_ICON");
}
/**
* 查询菜单权限构造树形菜单
*
* @return
*/
private List<Map<String, Object>> initRoleGruopTreeNode(DataQuery query, String ids) {
DataResult result = null;
try {
query = DataQuery.init(query,
"alone_auth_actiontree A LEFT JOIN alone_auth_action B ON A.ACTIONID = B.ID LEFT JOIN (SELECT POSTID, MENUID FROM alone_auth_postaction WHERE POSTID = '"
+ ids + "') C ON A.id = C.menuid",
"A.NAME,A.DOMAIN,a.ICON,A.ID,A.SORT,A.PARENTID,A.TREECODE,B.AUTHKEY,A.name as B_LABLE,A.TYPE,c.postid");
query.setDistinct(true);
query.setPagesize(100);
query.addSort(new DBSort(" a.DOMAIN,LENGTH(A.TREECODE),a.SORT", "ASC", false));
query.setNoCount();
result = query.search();
for (Map<String, Object> node : result.getResultList()) {
node.put("A_NAME",
node.get("A_NAME").toString()
+ "&nbsp;&nbsp;&nbsp;&nbsp;<span style='color:gray;font-size:10px;'>"
+ (node.get("A_DOMAIN").toString()).toUpperCase() + "</span>");
}
} catch (Exception e) {
result = DataResult.setMessager(result, e + e.getMessage());
log.error(e.getMessage() + e);
}
return result.getResultList();
}
/**
* 显示详细信息(修改或浏览时)
*
* @return
*/
@RequestMapping("/form")
public ModelAndView view(RequestMode pageset, String ids) {
// TODO 自动生成代码,修改后请去除本注释
try {
switch (pageset.getOperateType()) {
case (1): {// 新增
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("ids", ids)
.returnModelAndView("authority/PostForm");
}
case (0): {// 展示
Post entity = organizationServiceImpl.getPostEntity(ids);
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("entity", entity)
.returnModelAndView("authority/PostForm");
}
case (2): {// 修改
Post entity = organizationServiceImpl.getPostEntity(ids);
return ViewMode.getInstance().putAttr("pageset", pageset).putAttr("entity", entity)
.returnModelAndView("authority/PostForm");
}
default:
break;
}
} catch (Exception e) {
log.error(e.getMessage());
return ViewMode.getInstance().setError(e.getMessage(),e).returnModelAndView("authority/OrganizationForm");
}
return ViewMode.getInstance().returnModelAndView("authority/OrganizationForm");
}
}
package com.farm.authority.dao;
import com.farm.authority.domain.Action;
import org.hibernate.Session;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import java.util.List;
import java.util.Map;
/* *
*功能:权限资源数据库持久层接口
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20141119144919
*说明:
*/
public interface ActionDaoInter {
/**
* 删除一个权限资源实体
*
* @param entity
* 实体
*/
public void deleteEntity(Action action);
/**
* 由权限资源id获得一个权限资源实体
*
* @param id
* @return
*/
public Action getEntity(String actionid);
/**
* 插入一条权限资源数据
*
* @param entity
*/
public Action insertEntity(Action action);
/**
* 获得记录数量
*
* @return
*/
public int getAllListNum();
/**
* 修改一个权限资源记录
*
* @param entity
*/
public void editEntity(Action action);
/**
* 获得一个session
*/
public Session getSession();
/**
* 执行一条权限资源查询语句
*/
public DataResult runSqlQuery(DataQuery query);
/**
* 条件删除权限资源实体,依据对象字段值(一般不建议使用该方法)
*
* @param rules
* 删除条件
*/
public void deleteEntitys(List<DBRule> rules);
/**
* 条件查询权限资源实体,依据对象字段值,当rules为空时查询全部(一般不建议使用该方法)
*
* @param rules
* 查询条件
* @return
*/
public List<Action> selectEntitys(List<DBRule> rules);
/**
* 条件修改权限资源实体,依据对象字段值(一般不建议使用该方法)
*
* @param values
* 被修改的键值对
* @param rules
* 修改条件
*/
public void updataEntitys(Map<String, Object> values, List<DBRule> rules);
/**
* 条件合计权限资源:count(*)
*
* @param rules
* 统计条件
*/
public int countEntitys(List<DBRule> rules);
/**
* @param authkey
* @return
*/
public Action getEntityByKey(String authkey);
/**
* @return
*/
public List<Action> getAllEntity();
}
\ No newline at end of file
package com.farm.authority.dao;
import com.farm.authority.domain.Actiontree;
import org.hibernate.Session;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import java.util.List;
import java.util.Map;
/* *
*功能:构造权限持久层接口
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20141122211253
*说明:
*/
public interface ActiontreeDaoInter {
/**
* 删除一个构造权限实体
*
* @param entity
* 实体
*/
public void deleteEntity(Actiontree actiontree);
/**
* 由构造权限id获得一个构造权限实体
*
* @param id
* @return
*/
public Actiontree getEntity(String actiontreeid);
/**
* 插入一条构造权限数据
*
* @param entity
*/
public Actiontree insertEntity(Actiontree actiontree);
/**
* 获得记录数量
*
* @return
*/
public int getAllListNum();
/**
* 修改一个构造权限记录
*
* @param entity
*/
public void editEntity(Actiontree actiontree);
/**
* 获得一个session
*/
public Session getSession();
/**
* 执行一条构造权限查询语句
*/
public DataResult runSqlQuery(DataQuery query);
/**
* 条件删除构造权限实体,依据对象字段值(一般不建议使用该方法)
*
* @param rules
* 删除条件
*/
public void deleteEntitys(List<DBRule> rules);
/**
* 条件查询构造权限实体,依据对象字段值,当rules为空时查询全部(一般不建议使用该方法)
*
* @param rules
* 查询条件
* @return
*/
public List<Actiontree> selectEntitys(List<DBRule> rules);
/**
* 条件修改构造权限实体,依据对象字段值(一般不建议使用该方法)
*
* @param values
* 被修改的键值对
* @param rules
* 修改条件
*/
public void updataEntitys(Map<String, Object> values, List<DBRule> rules);
/**
* 条件合计构造权限:count(*)
*
* @param rules
* 统计条件
*/
public int countEntitys(List<DBRule> rules);
/**
* 获得所有子节点
*
* @param treeNodeId
* @return
*/
public List<Actiontree> getAllSubNodes(String treeNodeId);
}
\ No newline at end of file
package com.farm.authority.dao;
import com.farm.authority.domain.Organization;
import org.hibernate.Session;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import java.util.List;
import java.util.Map;
/* *
*功能:组织机构持久层接口
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20141122211253
*说明:
*/
public interface OrganizationDaoInter {
/**
* 删除一个组织机构实体
*
* @param entity
* 实体
*/
public void deleteEntity(Organization organization);
/**
* 由组织机构id获得一个组织机构实体
*
* @param id
* @return
*/
public Organization getEntity(String organizationid);
/**
* 插入一条组织机构数据
*
* @param entity
*/
public Organization insertEntity(Organization organization);
/**
* 获得记录数量
*
* @return
*/
public int getAllListNum();
/**
* 修改一个组织机构记录
*
* @param entity
*/
public void editEntity(Organization organization);
/**
* 获得一个session
*/
public Session getSession();
/**
* 执行一条组织机构查询语句
*/
public DataResult runSqlQuery(DataQuery query);
/**
* 条件删除组织机构实体,依据对象字段值(一般不建议使用该方法)
*
* @param rules
* 删除条件
*/
public void deleteEntitys(List<DBRule> rules);
/**
* 条件查询组织机构实体,依据对象字段值,当rules为空时查询全部(一般不建议使用该方法)
*
* @param rules
* 查询条件
* @return
*/
public List<Organization> selectEntitys(List<DBRule> rules);
/**
* 条件修改组织机构实体,依据对象字段值(一般不建议使用该方法)
*
* @param values
* 被修改的键值对
* @param rules
* 修改条件
*/
public void updataEntitys(Map<String, Object> values, List<DBRule> rules);
/**
* 条件合计组织机构:count(*)
*
* @param rules
* 统计条件
*/
public int countEntitys(List<DBRule> rules);
/**
* 获得所有子节点
*
* @param orgId
* @return
*/
public List<Organization> getAllSubNodes(String orgId);
/**
* 获取所有组织机构
*
* @return List<Organization>
*/
public List<Organization> getList();
/**
* 通过sql插入组织机构
*
* @param org
*/
public void insertSqlEntity(Organization org);
/**
* 获得所有机构别名
*
* @return
*/
public List<String> getAllOrgComments();
}
\ No newline at end of file
package com.farm.authority.dao;
import com.farm.authority.domain.Outuser;
import org.hibernate.Session;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import java.util.List;
import java.util.Map;
/* *
*功能:外部账户数据库持久层接口
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20150707114057
*说明:
*/
public interface OutuserDaoInter {
/** 删除一个外部账户实体
* @param entity 实体
*/
public void deleteEntity(Outuser outuser) ;
/** 由外部账户id获得一个外部账户实体
* @param id
* @return
*/
public Outuser getEntity(String outuserid) ;
/** 插入一条外部账户数据
* @param entity
*/
public Outuser insertEntity(Outuser outuser);
/** 获得记录数量
* @return
*/
public int getAllListNum();
/**修改一个外部账户记录
* @param entity
*/
public void editEntity(Outuser outuser);
/**获得一个session
*/
public Session getSession();
/**执行一条外部账户查询语句
*/
public DataResult runSqlQuery(DataQuery query);
/**
* 条件删除外部账户实体,依据对象字段值(一般不建议使用该方法)
*
* @param rules
* 删除条件
*/
public void deleteEntitys(List<DBRule> rules);
/**
* 条件查询外部账户实体,依据对象字段值,当rules为空时查询全部(一般不建议使用该方法)
*
* @param rules
* 查询条件
* @return
*/
public List<Outuser> selectEntitys(List<DBRule> rules);
/**
* 条件修改外部账户实体,依据对象字段值(一般不建议使用该方法)
*
* @param values
* 被修改的键值对
* @param rules
* 修改条件
*/
public void updataEntitys(Map<String, Object> values, List<DBRule> rules);
/**
* 条件合计外部账户:count(*)
*
* @param rules
* 统计条件
*/
public int countEntitys(List<DBRule> rules);
}
\ No newline at end of file
package com.farm.authority.dao;
import com.farm.authority.domain.Pop;
import org.hibernate.Session;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import java.util.List;
import java.util.Map;
/* *
*功能:业务权限数据库持久层接口
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20150707114057
*说明:
*/
public interface PopDaoInter {
/** 删除一个业务权限实体
* @param entity 实体
*/
public void deleteEntity(Pop pop) ;
/** 由业务权限id获得一个业务权限实体
* @param id
* @return
*/
public Pop getEntity(String popid) ;
/** 插入一条业务权限数据
* @param entity
*/
public Pop insertEntity(Pop pop);
/** 获得记录数量
* @return
*/
public int getAllListNum();
/**修改一个业务权限记录
* @param entity
*/
public void editEntity(Pop pop);
/**获得一个session
*/
public Session getSession();
/**执行一条业务权限查询语句
*/
public DataResult runSqlQuery(DataQuery query);
/**
* 条件删除业务权限实体,依据对象字段值(一般不建议使用该方法)
*
* @param rules
* 删除条件
*/
public void deleteEntitys(List<DBRule> rules);
/**
* 条件查询业务权限实体,依据对象字段值,当rules为空时查询全部(一般不建议使用该方法)
*
* @param rules
* 查询条件
* @return
*/
public List<Pop> selectEntitys(List<DBRule> rules);
/**
* 条件修改业务权限实体,依据对象字段值(一般不建议使用该方法)
*
* @param values
* 被修改的键值对
* @param rules
* 修改条件
*/
public void updataEntitys(Map<String, Object> values, List<DBRule> rules);
/**
* 条件合计业务权限:count(*)
*
* @param rules
* 统计条件
*/
public int countEntitys(List<DBRule> rules);
}
\ No newline at end of file
package com.farm.authority.dao;
import com.farm.authority.domain.Postaction;
import org.hibernate.Session;
import com.farm.core.sql.query.DBRule;
import com.farm.core.sql.query.DataQuery;
import com.farm.core.sql.result.DataResult;
import java.util.List;
import java.util.Map;
/* *
*功能:岗位权限数据库持久层接口
*详细:
*
*版本:v0.1
*作者:Farm代码工程自动生成
*日期:20141204174206
*说明:
*/
public interface PostactionDaoInter {
/** 删除一个岗位权限实体
* @param entity 实体
*/
public void deleteEntity(Postaction postaction) ;
/** 由岗位权限id获得一个岗位权限实体
* @param id
* @return
*/
public Postaction getEntity(String postactionid) ;
/** 插入一条岗位权限数据
* @param entity
*/
public Postaction insertEntity(Postaction postaction);
/** 获得记录数量
* @return
*/
public int getAllListNum();
/**修改一个岗位权限记录
* @param entity
*/
public void editEntity(Postaction postaction);
/**获得一个session
*/
public Session getSession();
/**执行一条岗位权限查询语句
*/
public DataResult runSqlQuery(DataQuery query);
/**
* 条件删除岗位权限实体,依据对象字段值(一般不建议使用该方法)
*
* @param rules
* 删除条件
*/
public void deleteEntitys(List<DBRule> rules);
/**
* 条件查询岗位权限实体,依据对象字段值,当rules为空时查询全部(一般不建议使用该方法)
*
* @param rules
* 查询条件
* @return
*/
public List<Postaction> selectEntitys(List<DBRule> rules);
/**
* 条件修改岗位权限实体,依据对象字段值(一般不建议使用该方法)
*
* @param values
* 被修改的键值对
* @param rules
* 修改条件
*/
public void updataEntitys(Map<String, Object> values, List<DBRule> rules);
/**
* 条件合计岗位权限:count(*)
*
* @param rules
* 统计条件
*/
public int countEntitys(List<DBRule> rules);
}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册