Commit 75afabe0 by sunxin

角色新增

parent f8dc5b81
......@@ -66,6 +66,16 @@ public class ReportEntity extends DataEntity<ReportEntity> {
private String lStatus; //关闭修改状态
private String isAdmin; //是否管理员
private String isFzAdmin; //是否輔助管理员
private String isFzAdmin02; //是否輔助管理员2 反舞弊负责人岗
public String getIsFzAdmin02() {
return isFzAdmin02;
}
public void setIsFzAdmin02(String isFzAdmin02) {
this.isFzAdmin02 = isFzAdmin02;
}
private String oaarea; //账号区域
private String participants; //参与人
private String insider; //知情人
......
......@@ -945,10 +945,10 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
List<Role> roleList = roleDao.findList(roleEntity);
if (roleList != null && roleList.size() != 0) {
for (Role role : roleList) {
if (role.getName().equals("系统管理员")) {
if (role.getEnname().equals("admin")) {
roleNum = "1";
break;
} else if (role.getName().equals("辅助管理员")) {
} else if (role.getEnname().equals("fuzhuadmin") || role.getEnname().equals("fuzhuadmin02")) {
roleNum = "2";
break;
}
......@@ -959,6 +959,34 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
}
/**
* 检验是否是 反舞弊负责人岗
* @param user
* @return
*/
public Boolean checkRole02(User user) {
boolean flag=false;
Role roleEntity = new Role();
roleEntity.setUser(user);
List<Role> roleList = roleDao.findList(roleEntity);
if (roleList != null && roleList.size() != 0) {
for (Role role : roleList) {
if (role.getEnname().equals("admin")) {
flag=false;
break;
} else if (role.getEnname().equals("fuzhuadmin")) {
flag=false;
break;
}else if (role.getEnname().equals("fuzhuadmin02")) {
flag=true;
break;
}
}
}
return flag;
}
/**
* 判断当前用户角色 1管理员 2辅助管理员
*
* @param
......@@ -972,7 +1000,7 @@ public class ReportService extends CrudService<ReportDao, ReportEntity> {
List<Role> roleList = roleDao.findList(roleEntity);
if (roleList != null && roleList.size() != 0) {
for (Role role : roleList) {
if (role.getName().equals("辅助管理员")) {
if (role.getName().equals("反舞弊内控员工岗")|| role.getName().equals("反舞弊负责人岗")) {
roleName = "辅助管理员";
break;
}
......
......@@ -11,6 +11,7 @@ import com.ejweb.core.utils.StringUtils;
import com.ejweb.core.utils.excel.ExportExcel;
import com.ejweb.core.utils.excel.ImportExcel;
import com.ejweb.core.validator.BeanValidators;
import com.ejweb.modules.report.service.ReportService;
import com.ejweb.modules.sys.entity.Office;
import com.ejweb.modules.sys.entity.Role;
import com.ejweb.modules.sys.entity.User;
......@@ -44,6 +45,9 @@ public class SysUserController extends BaseController {
@Autowired
private SystemService systemService;
@Autowired
private ReportService reportService;
@ModelAttribute
public User get(@RequestParam(required=false) String id) {
if (StringUtils.isNotBlank(id)){
......@@ -78,6 +82,7 @@ public class SysUserController extends BaseController {
@RequiresPermissions("sys:user:view")
@RequestMapping(value = "form")
public String form(User user, Model model) {
if (user.getCompany()==null || user.getCompany().getId()==null){
user.setCompany(UserUtils.getUser().getCompany());
}
......@@ -88,9 +93,31 @@ public class SysUserController extends BaseController {
if(StringUtils.isNotBlank(user.getId())){
user = systemService.getUser(user.getId());
}
model.addAttribute("user", user);
List<Role> roleList = systemService.findAllRole();
//判断登录人的角色 如果是新角色 反舞弊负责人 去掉集团审查。。。角色
User userr = UserUtils.getUser();
Boolean isAdmin = reportService.checkRole02(userr);
//当角色为 反舞弊负责人岗位时 不能让其修改系统管理员的人员资料
String show_save="0";
List<Role> roleList1 = user.getRoleList();
if(isAdmin){
for (int i = roleList.size() - 1 ; i>0 ; i--) {
if("admin".equals(roleList.get(i).getEnname())) {
System.out.println(roleList.get(i).getName()+"==========");
roleList.remove(roleList.get(i));
}
}
for (Role role:roleList1) {
if( "admin".equals(role.getEnname())){
show_save="1";
}
}
}
model.addAttribute("show_save", show_save);
for (int i = roleList.size() - 1 ; i>0 ; i--) {
if("1".equals(roleList.get(i).getUnChecked())) {
roleList.remove(roleList.get(i));
......
......@@ -99,7 +99,7 @@
LEFT JOIN ct_bbtc_region CR2 ON r.transferArea = CR2.id
<where>
1 = 1
<if test="isAdmin == null and isFzAdmin == null">
<if test="isAdmin == null and isFzAdmin == null and isFzAdmin02 == null" >
AND r.exchange_after_user = #{exchangeAfterUser} AND r.create_by != #{exchangeAfterUser}
</if>
<if test="isAdmin != null">
......@@ -110,6 +110,11 @@
R.EXCHANGE_AFTER_USER = #{exchangeBeforeUser}
OR R.CREATE_BY = #{exchangeBeforeUser})) AND SU.AREA IS NULL
</if>
<if test="isFzAdmin02 != null">
AND ((R.EXCHANGE_BEFORE_USER = #{exchangeBeforeUser} OR
R.EXCHANGE_AFTER_USER = #{exchangeBeforeUser}
OR R.CREATE_BY = #{exchangeBeforeUser})) AND SU.AREA IS NULL
</if>
<if test="reportStatus != null and reportStatus != ''">
AND r.report_status = #{reportStatus}
</if>
......@@ -298,7 +303,7 @@
ON R.supplement_type = CC.type*/
<where>
1 = 1
<if test="isAdmin == null and isFzAdmin == null">
<if test="isAdmin == null and isFzAdmin == null and isFzAdmin02 == null">
AND r.exchange_after_user = #{exchangeAfterUser} AND r.create_by = #{exchangeAfterUser}
</if>
<if test="isAdmin != null">
......@@ -333,6 +338,23 @@
*/
AND su.area IS NOT NULL
</if>
<if test="isFzAdmin02 != null">
AND r.Exchange_After_User = #{exchangeBeforeUser}
AND r.create_by != #{exchangeBeforeUser}
/*
AND su.area IN ('North China',
'BeiJing',
'ShangHai',
'SouthWest',
'SouthEast',
'Central China',
'GuangShen',
'Hainan',
'Group',
'PropertyGroup')
*/
AND su.area IS NOT NULL
</if>
<if test="reportStatus != null and reportStatus != ''">
AND r.report_status = #{reportStatus}
</if>
......
......@@ -241,11 +241,20 @@
</div>
</div>
</c:if>--%>
<c:if test="${show_save eq 1}">
<div class="form-actions">
<h3>您暂时没有权限修改集团审计监察部门负责人岗角色人员资料!!!</h3>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>
</c:if>
<c:if test="${show_save eq 0}">
<div class="form-actions">
<shiro:hasPermission name="sys:user:edit"><input id="btnSubmit" class="btn btn-primary" type="submit"
value="保 存"/>&nbsp;</shiro:hasPermission>
<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
</div>
</c:if>
</form:form>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment