commit
This commit is contained in:
@@ -225,4 +225,13 @@ public interface Roles {
|
|||||||
*/
|
*/
|
||||||
String JDH_DB2 = "05e7a279f4274a1eb3a81adb5f8c2454";
|
String JDH_DB2 = "05e7a279f4274a1eb3a81adb5f8c2454";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位书记
|
||||||
|
*/
|
||||||
|
String GH03 = "428969eb99ff4b76883d83f847ee96a5";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工会组组长
|
||||||
|
*/
|
||||||
|
String ghxzzz = "308dfe9096f44a64a67b4714f67dcd96";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package io.v.nutz.sys.models;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.nutz.dao.entity.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* @Author zhf
|
||||||
|
* @Date 2022/12/25 10:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Table
|
||||||
|
public class SysUnionGroup {
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Name
|
||||||
|
@Comment("ID")
|
||||||
|
@Prev(els = {@EL("uuid()")})
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("小组名称")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("小组编码")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
private String groupCode;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("所属工会")
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
private String unionId;
|
||||||
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package io.v.nutz.sys.models;
|
package io.v.nutz.sys.models;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.nutz.dao.entity.annotation.*;
|
import org.nutz.dao.entity.annotation.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
@Table("sys_user_role")
|
@Table("sys_user_role")
|
||||||
public class Sys_user_role implements Serializable {
|
public class Sys_user_role implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -43,6 +45,21 @@ public class Sys_user_role implements Serializable {
|
|||||||
@Comment("工会id")
|
@Comment("工会id")
|
||||||
private String unionid;
|
private String unionid;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
@Comment("工会小组id")
|
||||||
|
private String unionGroupId;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
@Comment("代表小组id")
|
||||||
|
private String groupId;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
|
@Comment("离退办小组id")
|
||||||
|
private String ltbGroupId;
|
||||||
|
|
||||||
@Column
|
@Column
|
||||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
@Comment("承办单位id")
|
@Comment("承办单位id")
|
||||||
@@ -62,93 +79,5 @@ public class Sys_user_role implements Serializable {
|
|||||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||||
@Comment("提案教代会机构id")
|
@Comment("提案教代会机构id")
|
||||||
private String jgid;
|
private String jgid;
|
||||||
|
|
||||||
public String getGdhid() {
|
|
||||||
return gdhid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGdhid(String gdhid) {
|
|
||||||
this.gdhid = gdhid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getJc() {
|
|
||||||
return jc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJc(String jc) {
|
|
||||||
this.jc = jc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStid() {
|
|
||||||
return stid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStid(String stid) {
|
|
||||||
this.stid = stid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCbdwid() {
|
|
||||||
return cbdwid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCbdwid(String cbdwid) {
|
|
||||||
this.cbdwid = cbdwid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnionid() {
|
|
||||||
return unionid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUnionid(String unionid) {
|
|
||||||
this.unionid = unionid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRoleId() {
|
|
||||||
return roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleId(String roleId) {
|
|
||||||
this.roleId = roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(String userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getJdhid() {
|
|
||||||
return jdhid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJdhid(String jdhid) {
|
|
||||||
this.jdhid = jdhid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnitid() {
|
|
||||||
return unitid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUnitid(String unitid) {
|
|
||||||
this.unitid = unitid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDbtid() {
|
|
||||||
return dbtid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDbtid(String dbtid) {
|
|
||||||
this.dbtid = dbtid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getJgid() {
|
|
||||||
return jgid;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJgid(String jgid) {
|
|
||||||
this.jgid = jgid;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
import io.v.nutz.wakershome.model.WakesHomeApply;
|
import io.v.nutz.wakershome.model.WakesHomeApply;
|
||||||
import io.v.nutz.wakershome.service.IWakesHomeApplyService;
|
import io.v.nutz.wakershome.service.IWakesHomeApplyService;
|
||||||
|
import org.apache.shiro.authz.annotation.Logical;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
@@ -69,7 +70,9 @@ public class WakesHomeDeclarationApplyController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresPermissions("wakeshome.declaration.apply")
|
@RequiresPermissions(value = {"wakeshome.declaration.apply","wakeshome.declaration.mine",
|
||||||
|
"wakeshome.declaration.organization", "wakeshome.declaration.school",
|
||||||
|
"wakeshome.declaration.statistics"},logical = Logical.OR)
|
||||||
public Object getInfoById(String id){
|
public Object getInfoById(String id){
|
||||||
return wakesHomeApplyService.findById(id);
|
return wakesHomeApplyService.findById(id);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -114,7 +114,7 @@ public class WakesHomeDeclarationMineController {
|
|||||||
.bind("basicInformation", htmlRenderPolicy)
|
.bind("basicInformation", htmlRenderPolicy)
|
||||||
.bind("constructionPlan", htmlRenderPolicy).build();
|
.bind("constructionPlan", htmlRenderPolicy).build();
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
String fileName = Globals.schoolName + "教工小家”建设计划书";
|
String fileName = Globals.schoolName + "“教工小家”建设计划书";
|
||||||
map.put("fileName", fileName);
|
map.put("fileName", fileName);
|
||||||
map.put("schoolName", Globals.schoolName);
|
map.put("schoolName", Globals.schoolName);
|
||||||
map.put("unionName", nutMap.getString("unionName"));
|
map.put("unionName", nutMap.getString("unionName"));
|
||||||
|
|||||||
+1
-1
@@ -92,7 +92,7 @@ public class WakesHomeDeclarationSchoolController {
|
|||||||
public Object doRollBack(String id){
|
public Object doRollBack(String id){
|
||||||
WakesHomeApply wakesHome = wakesHomeApplyService.fetch(id);
|
WakesHomeApply wakesHome = wakesHomeApplyService.fetch(id);
|
||||||
wakesHomeApplyService.dao().clear(Audit.class,Cnd.where("id","=",wakesHome.getSchoolAuditId()));
|
wakesHomeApplyService.dao().clear(Audit.class,Cnd.where("id","=",wakesHome.getSchoolAuditId()));
|
||||||
wakesHomeApplyService.update(Chain.make("state",10010).add("schoolAuditId",null),Cnd.where("id","=",id));
|
wakesHomeApplyService.update(Chain.make("state",10020).add("schoolAuditId",null),Cnd.where("id","=",id));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ public class AddZbController {
|
|||||||
CommentZb zb = commentZbService.insert(commentZb);
|
CommentZb zb = commentZbService.insert(commentZb);
|
||||||
for (CommentNr nr : commentZb.getNrs()) {
|
for (CommentNr nr : commentZb.getNrs()) {
|
||||||
nr.setZb_id(zb.getId());
|
nr.setZb_id(zb.getId());
|
||||||
|
nr.getBzs().forEach(v->v.setZb_id(zb.getId()));
|
||||||
commentZbService.insertWith(nr, "bzs");
|
commentZbService.insertWith(nr, "bzs");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.deepoove.poi.XWPFTemplate;
|
|||||||
import com.deepoove.poi.config.Configure;
|
import com.deepoove.poi.config.Configure;
|
||||||
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
import com.deepoove.poi.policy.HackLoopTableRenderPolicy;
|
||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
|
import io.v.nutz.base.result.Result;
|
||||||
import io.v.nutz.base.utils.Vi;
|
import io.v.nutz.base.utils.Vi;
|
||||||
import io.v.nutz.modules.models.PageForm;
|
import io.v.nutz.modules.models.PageForm;
|
||||||
import io.v.nutz.sys.models.Sys_file;
|
import io.v.nutz.sys.models.Sys_file;
|
||||||
@@ -201,6 +202,7 @@ public class StatisticsZpController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 分工会下所有测评结果导出(多个)压缩包
|
* 分工会下所有测评结果导出(多个)压缩包
|
||||||
|
*
|
||||||
* @param zbId
|
* @param zbId
|
||||||
* @param unionId
|
* @param unionId
|
||||||
* @param response
|
* @param response
|
||||||
@@ -232,8 +234,41 @@ public class StatisticsZpController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验是否有附件
|
||||||
|
*
|
||||||
|
* @param peoId 测评结果Id
|
||||||
|
* @param zbId 指标Id
|
||||||
|
* @param unionId 分工会Id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@RequiresPermissions("wakeshome.review.statistics")
|
||||||
|
public Object validateHasFiles(@Param(value = "peoId", required = false) String peoId,
|
||||||
|
@Param(value = "zbId", required = false) String zbId,
|
||||||
|
@Param(value = "unionId", required = false) String unionId) {
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.andEX("id", "=", peoId);
|
||||||
|
cnd.andEX("zbId", "=", zbId);
|
||||||
|
cnd.andEX("unionId", "=", unionId);
|
||||||
|
List<CommentPeo> peoList = commentPeoService.dao().query(CommentPeo.class, cnd);
|
||||||
|
List<Sys_file> files;
|
||||||
|
try {
|
||||||
|
files = peoList.stream().flatMap(v -> v.getFiles().stream()).collect(Collectors.toList());
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
return Result.error();
|
||||||
|
}
|
||||||
|
if (Lang.isEmpty(files)) {
|
||||||
|
return Result.error();
|
||||||
|
} else {
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分工会导出附件
|
* 分工会导出附件
|
||||||
|
*
|
||||||
* @param zbId
|
* @param zbId
|
||||||
* @param unionId
|
* @param unionId
|
||||||
* @param response
|
* @param response
|
||||||
|
|||||||
@@ -30,26 +30,17 @@ public class CommentZbServiceImpl extends ViServiceImpl<CommentZb> implements Co
|
|||||||
private CommentNrService commentNrService;
|
private CommentNrService commentNrService;
|
||||||
|
|
||||||
|
|
||||||
private void setNrBz(List<CommentNr> nrs) {
|
|
||||||
for (CommentNr nr : nrs) {
|
|
||||||
nr = commentNrService.fetchLinks(nr, "bzs", Cnd.NEW().asc("location"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommentZb khzb(String zbid) {
|
public CommentZb khzb(String zbid) {
|
||||||
if (StrUtil.isBlank(zbid)) {
|
if (StrUtil.isBlank(zbid)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommentZb zb = dao().fetchLinks(fetch(zbid), "nrs");
|
CommentZb zb = dao().fetchLinks(fetch(zbid), "nrs", Cnd.NEW().asc("contentNumber"));
|
||||||
for (CommentNr nr : zb.getNrs()) {
|
for (CommentNr nr : zb.getNrs()) {
|
||||||
List<CommentBz> query = dao().query(CommentBz.class, Cnd.where("zb_id", "=", zbid).and("nr_id", "=", nr.getId()).asc("contentNumber"));
|
List<CommentBz> query = dao().query(CommentBz.class, Cnd.where("zb_id", "=", zbid).and("nr_id", "=", nr.getId()).asc("contentNumber"));
|
||||||
nr.setBzs(query);
|
nr.setBzs(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommentZb zb = fetchLinks(fetch(zbid), "nrs", Cnd.NEW().asc("contentNumber"));
|
|
||||||
// setNrBz(zb.getNrs());
|
|
||||||
return zb;
|
return zb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package io.v.nutz.web.controllers.platform.sys;
|
|||||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.wizzer.framework.base.Result;
|
import cn.wizzer.framework.base.Result;
|
||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
|
import io.v.nutz.base.page.Pagination;
|
||||||
import io.v.nutz.base.utils.PageUtil;
|
import io.v.nutz.base.utils.PageUtil;
|
||||||
import io.v.nutz.base.utils.Roles;
|
import io.v.nutz.base.utils.Roles;
|
||||||
import io.v.nutz.lang.Lang;
|
import io.v.nutz.modules.models.PageForm;
|
||||||
import io.v.nutz.service.ViService;
|
import io.v.nutz.service.ViService;
|
||||||
import io.v.nutz.sys.models.*;
|
import io.v.nutz.sys.models.*;
|
||||||
import io.v.nutz.sys.services.*;
|
import io.v.nutz.sys.services.*;
|
||||||
@@ -26,14 +28,21 @@ import org.nutz.dao.util.cri.Static;
|
|||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.json.Json;
|
import org.nutz.json.Json;
|
||||||
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.lang.Strings;
|
import org.nutz.lang.Strings;
|
||||||
import org.nutz.log.Log;
|
import org.nutz.log.Log;
|
||||||
import org.nutz.log.Logs;
|
import org.nutz.log.Logs;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
import org.nutz.trans.Trans;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: V
|
* @Author: V
|
||||||
@@ -78,7 +87,11 @@ public class SysUnionMangeCon {
|
|||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
public Object changeSchoolUnionRole(String unionid, String roleId, String roleCode, String userId, int type) {
|
public Object changeSchoolUnionRole(@Param(value = "unionid", required = false) String unionid,
|
||||||
|
@Param(value = "roleId", required = false) String roleId,
|
||||||
|
@Param(value = "roleCode", required = false) String roleCode,
|
||||||
|
@Param(value = "userId", required = false) String userId,
|
||||||
|
@Param(value = "type", required = false) int type) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
Sys_user_role role = new Sys_user_role();
|
Sys_user_role role = new Sys_user_role();
|
||||||
role.setUserId(userId);
|
role.setUserId(userId);
|
||||||
@@ -109,7 +122,9 @@ public class SysUnionMangeCon {
|
|||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
public Object schoolUnionRoles(String unionid, String searchName, String searchKeyword) {
|
public Object schoolUnionRoles(@Param(value = "unionid", required = false) String unionid,
|
||||||
|
@Param(value = "searchName", required = false) String searchName,
|
||||||
|
@Param(value = "searchKeyword", required = false) String searchKeyword) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
role.`name` rolename,
|
role.`name` rolename,
|
||||||
@@ -136,8 +151,8 @@ public class SysUnionMangeCon {
|
|||||||
cnd.and(new Static("dict.parentId = ( SELECT id FROM sys_dict WHERE `code` = 'SchoolRoles' LIMIT 1)"));
|
cnd.and(new Static("dict.parentId = ( SELECT id FROM sys_dict WHERE `code` = 'SchoolRoles' LIMIT 1)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Lang.notNull(searchName, searchKeyword)) {
|
if (StrUtil.isNotBlank(searchName) && StrUtil.isNotBlank(searchKeyword)) {
|
||||||
cnd.where().andLike(searchName, searchKeyword);
|
cnd.and(Cnd.likeEX(searchName, searchKeyword));
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
@@ -171,7 +186,10 @@ public class SysUnionMangeCon {
|
|||||||
@At("/unionPageData")
|
@At("/unionPageData")
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
@ViReturn
|
@ViReturn
|
||||||
public Object unionPageData(String searchName, String searchKeyword, int pageNumber, int pageSize, String pageOrderName, String pageOrderBy) {
|
public Object unionPageData(@Param(value = "searchName", required = false) String searchName,
|
||||||
|
@Param(value = "searchKeyword", required = false) String searchKeyword, int pageNumber, int pageSize,
|
||||||
|
@Param(value = "pageOrderName", required = false) String pageOrderName,
|
||||||
|
@Param(value = "pageOrderBy", required = false) String pageOrderBy) {
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
@@ -348,7 +366,9 @@ public class SysUnionMangeCon {
|
|||||||
|
|
||||||
|
|
||||||
@At // 会员档案
|
@At // 会员档案
|
||||||
public Object hyPageData(String unitid, String unionid, String searchName, String searchKeyword, int pageNumber, int pageSize, String pageOrderName, String pageOrderBy) {
|
public Object hyPageData(@Param(value = "unitid", required = false) String unitid,
|
||||||
|
@Param(value = "unionid", required = false) String unionid,
|
||||||
|
PageForm page) {
|
||||||
try {
|
try {
|
||||||
// Sql sql = Sqls.create("SELECT u.id,u.username,u.loginname,u.sex,un.`name` unitname,u.mobile from sys_user u left join sys_unit un on u.unitid = un.id $condition");
|
// Sql sql = Sqls.create("SELECT u.id,u.username,u.loginname,u.sex,un.`name` unitname,u.mobile from sys_user u left join sys_unit un on u.unitid = un.id $condition");
|
||||||
|
|
||||||
@@ -363,16 +383,16 @@ public class SysUnionMangeCon {
|
|||||||
if (Strings.isNotBlank(unitid)) {
|
if (Strings.isNotBlank(unitid)) {
|
||||||
cnd.and("u.unitid", "=", unitid);
|
cnd.and("u.unitid", "=", unitid);
|
||||||
}
|
}
|
||||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
|
||||||
cnd.and(searchName, "like", "%" + searchKeyword + "%");
|
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||||
}
|
}
|
||||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
|
if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) {
|
||||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
cnd.orderBy(page.getPageOrderName(), page.getPageOrderBy().equalsIgnoreCase("ascending") ? "ASC" : "DESC");
|
||||||
} else {
|
} else {
|
||||||
cnd.asc("u.unitid");
|
cnd.asc("u.unitid");
|
||||||
}
|
}
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
return Result.success().addData(sysUnionService.listPage(pageNumber, pageSize, sql));
|
return Result.success().addData(sysUnionService.listPage(page.getPageNumber(), page.getPageSize(), sql));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
return Result.error();
|
return Result.error();
|
||||||
@@ -418,7 +438,9 @@ public class SysUnionMangeCon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
public Object spyPageData(String qxid, String unionid, String searchName, String searchKeyword, int pageNumber, int pageSize, String pageOrderName, String pageOrderBy) {
|
public Object spyPageData(@Param(value = "qxid", required = false) String qxid,
|
||||||
|
@Param(value = "unionid", required = false) String unionid,
|
||||||
|
PageForm page) {
|
||||||
try {
|
try {
|
||||||
Sql sql = Sqls.create("SELECT\n" +
|
Sql sql = Sqls.create("SELECT\n" +
|
||||||
"\tsur.roleId,\n" +
|
"\tsur.roleId,\n" +
|
||||||
@@ -445,16 +467,16 @@ public class SysUnionMangeCon {
|
|||||||
cnd.and("sur.roleId in (SELECT role.id from sys_dict dict left join sys_role role on dict.`code` = role.`code` WHERE parentId = '" + ViCommonCon.DICT_SPYJS_ID + "') and 1", "=", 1);
|
cnd.and("sur.roleId in (SELECT role.id from sys_dict dict left join sys_role role on dict.`code` = role.`code` WHERE parentId = '" + ViCommonCon.DICT_SPYJS_ID + "') and 1", "=", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
|
||||||
cnd.where().andLike(searchName, searchKeyword);
|
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||||
}
|
}
|
||||||
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
|
if (StrUtil.isNotBlank(page.getPageOrderName()) && StrUtil.isNotBlank(page.getPageOrderBy())) {
|
||||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
|
||||||
} else {
|
} else {
|
||||||
cnd.asc("sur.roleId");
|
cnd.asc("sur.roleId");
|
||||||
}
|
}
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
return Result.success().addData(sysUnionService.listPage(pageNumber, pageSize, sql));
|
return Result.success().addData(sysUnionService.listPage(page.getPageNumber(), page.getPageSize(), sql));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
return Result.error();
|
return Result.error();
|
||||||
@@ -476,6 +498,233 @@ public class SysUnionMangeCon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询可选的三级单位,以及已选择了的单位
|
||||||
|
*
|
||||||
|
* @param unionId
|
||||||
|
* @param unionGroupId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object getXzDw(String unionId, @Param(value = "unionGroupId", required = false) String unionGroupId) {
|
||||||
|
List<Sys_unit> value = new ArrayList<>();
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
if (Strings.isNotBlank(unionGroupId)) {
|
||||||
|
//根据工会小组id查出小组下的单位
|
||||||
|
value = sysUnitService.query(Cnd.where("unionGroupId", "=", unionGroupId));
|
||||||
|
} else {
|
||||||
|
cnd.and("unionGroupId", "is", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查出这个工会下的二级单位
|
||||||
|
List<Sys_unit> unit2 = sysUnitService.query(Cnd.where("unitlevel", "=", 2).and("unionid", "=", unionId));
|
||||||
|
List<String> unit2Id = unit2.stream().map(v -> v.getId()).collect(Collectors.toList());
|
||||||
|
//根据二级单位id查出下面的三级单位
|
||||||
|
cnd.and("parentId", "in", unit2Id);
|
||||||
|
List<Sys_unit> data = sysUnitService.query(cnd);
|
||||||
|
return Map.of("data", data, "value", value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置工会小组
|
||||||
|
*
|
||||||
|
* @param sysUnionGroup
|
||||||
|
* @param xzValue
|
||||||
|
* @param oldGroupCode
|
||||||
|
* @param unionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
public Object doSzXz(@Param("SysUnionGroup") SysUnionGroup sysUnionGroup,
|
||||||
|
@Param(value = "xzValue", required = false) String[] xzValue,
|
||||||
|
@Param(value = "oldGroupCode", required = false) String oldGroupCode, String unionId) {
|
||||||
|
if (oldGroupCode != null && !oldGroupCode.equals(sysUnionGroup.getGroupCode())) {
|
||||||
|
int groupCode = sysUnitService.dao().count(SysUnionGroup.class, Cnd.where("groupCode", "=", sysUnionGroup.getGroupCode()));
|
||||||
|
if (groupCode > 0) {
|
||||||
|
return Result.error("编码重复");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sysUnionGroup.setUnionId(unionId);
|
||||||
|
sysUnitService.insertOrUpdate(sysUnionGroup);
|
||||||
|
|
||||||
|
if (Strings.isNotBlank(sysUnionGroup.getId())) {
|
||||||
|
sysUnitService.update(Chain.make("unionGroupId", null), Cnd.where("unionGroupId", "=", sysUnionGroup.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Lang.isNotEmpty(xzValue)) {
|
||||||
|
sysUnitService.update(Chain.make("unionGroupId", sysUnionGroup.getId()), Cnd.where("id", "in", xzValue));
|
||||||
|
}
|
||||||
|
return Result.success("操作成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工会查询他下面的工会小组分页
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param unionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object xzPageData(PageForm page, String unionId) {
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
g.*,(
|
||||||
|
SELECT
|
||||||
|
GROUP_CONCAT( us.username, '(', us.loginname, ')' )
|
||||||
|
FROM
|
||||||
|
sys_user_role ro
|
||||||
|
LEFT JOIN sys_user us ON us.id = ro.userId
|
||||||
|
WHERE
|
||||||
|
ro.unionGroupId = g.id
|
||||||
|
AND ro.roleId = @roleId
|
||||||
|
) groupLeader
|
||||||
|
FROM
|
||||||
|
`sys_union_group` g
|
||||||
|
$condition
|
||||||
|
""").setParam("roleId", Roles.ghxzzz);
|
||||||
|
if (StrUtil.isNotBlank(page.getSearchName()) && StrUtil.isNotBlank(page.getSearchKeyword())) {
|
||||||
|
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
|
||||||
|
}
|
||||||
|
cnd.and("g.unionId", "=", unionId);
|
||||||
|
cnd.asc("g.groupCode");
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
return sysUnitService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工会小组下面的组长
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object selectSzXzzz(String id) {
|
||||||
|
return sysUserRoleService.query(Cnd.where("roleId", "=", Roles.ghxzzz).and("unionGroupId", "=", id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加工会小组组长
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @param unionId
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object doSzXzzz(@Param("userId") String[] userId, String unionId, String id) {
|
||||||
|
Trans.exec(() -> {
|
||||||
|
sysUserRoleService.clear(Cnd.where("unionGroupId", "=", id).and("roleId", "=", io.v.nutz.base.utils.Roles.ghxzzz));
|
||||||
|
List<String> idList = Arrays.asList(userId);
|
||||||
|
List<Sys_user_role> roles = new ArrayList<>();
|
||||||
|
idList.forEach(v->{
|
||||||
|
Sys_user_role user_role = new Sys_user_role();
|
||||||
|
user_role.setRoleId(io.v.nutz.base.utils.Roles.ghxzzz);
|
||||||
|
user_role.setUnionGroupId(id);
|
||||||
|
user_role.setUserId(v);
|
||||||
|
user_role.setUnionid(unionId);
|
||||||
|
roles.add(user_role);
|
||||||
|
});
|
||||||
|
sysUserRoleService.insert(roles);
|
||||||
|
sysUserService.clearCache();
|
||||||
|
});
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工会小组id删除小组以及对应的角色
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object doDeleteXz(String id) {
|
||||||
|
Trans.exec(() -> {
|
||||||
|
sysUserRoleService.clear(Cnd.where("roleId", "=", Roles.ghxzzz).and("unionGroupId", "=", id));
|
||||||
|
sysUnitService.dao().delete(SysUnionGroup.class, id);
|
||||||
|
sysUnitService.update(Chain.make("unionGroupId", null), Cnd.where("unionGroupId", "=", id));
|
||||||
|
sysUserService.clearCache();
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工会小组会员
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param id
|
||||||
|
* @param threeUnitId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object selectXzcy(PageForm page, String id, @Param(value = "threeUnitId", required = false) String threeUnitId) {
|
||||||
|
//根据小组id查出这个小组对应的单位
|
||||||
|
List<Sys_unit> sysUnits = sysUnitService.query(Cnd.where("unionGroupId", "=", id));
|
||||||
|
//拿到单位id
|
||||||
|
List<String> unitIds = sysUnits.stream().map(v -> v.getId()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
u.id,
|
||||||
|
u.loginname,
|
||||||
|
u.username,
|
||||||
|
u.sex,
|
||||||
|
un.`name` threeUnitName,
|
||||||
|
u.mobile
|
||||||
|
FROM
|
||||||
|
sys_user u
|
||||||
|
LEFT JOIN sys_unit un ON u.threeUnitId = un.id
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
if (StrUtil.isNotBlank(page.getSearchName()) && StrUtil.isNotBlank(page.getSearchKeyword())) {
|
||||||
|
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
|
||||||
|
}
|
||||||
|
if (Strings.isNotBlank(threeUnitId)) {
|
||||||
|
cnd.and("threeUnitId", "=", threeUnitId);
|
||||||
|
} else {
|
||||||
|
cnd.and("threeUnitId", "in", unitIds);
|
||||||
|
}
|
||||||
|
cnd.and("member", "=", 1);
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
return sysUnitService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据小组id查询小组下面的三级单位
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object getThreeOptions(String id) {
|
||||||
|
return sysUnitService.query(Cnd.where("unionGroupId", "=", id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工会小组组长
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
public Object cancelXzzz(String id) {
|
||||||
|
sysUserRoleService.clear(Cnd.where("roleId", "=", Roles.ghxzzz).and("unionGroupId", "=", id));
|
||||||
|
sysUserService.clearCache();
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改工会组成单位
|
* 修改工会组成单位
|
||||||
*
|
*
|
||||||
@@ -511,8 +760,29 @@ public class SysUnionMangeCon {
|
|||||||
@At
|
@At
|
||||||
public Object getUserByUnionId(String query, String unionid) {
|
public Object getUserByUnionId(String query, String unionid) {
|
||||||
try {
|
try {
|
||||||
return Result.success().addData(sysUserService.listPage(1, 50, Sqls.create("SELECT u.id,u.username,u.loginname,u.sex,u.mobile,u.zw,u.email\n" +
|
Sql sql = Sqls.create("""
|
||||||
"from sys_user u left join sys_unit un on u.unitid = un.id WHERE un.unionid = @unionid and (u.username LIKE @query or u.loginname like @query)").setParam("unionid", unionid).setParam("query", "%" + query + "%")));
|
SELECT
|
||||||
|
u.id,
|
||||||
|
u.username,
|
||||||
|
u.loginname,
|
||||||
|
u.sex,
|
||||||
|
u.mobile,
|
||||||
|
u.email
|
||||||
|
from
|
||||||
|
"user" u
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.and("u.unionid", "=", unionid);
|
||||||
|
if (StrUtil.isNotBlank(query)) {
|
||||||
|
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||||
|
seg.orLike("u.username", query);
|
||||||
|
seg.orLike("u.loginname", query);
|
||||||
|
cnd.and(seg);
|
||||||
|
}
|
||||||
|
sql.setCondition(cnd);
|
||||||
|
Pagination pagination = sysUserService.listPage(1, 10, sql);
|
||||||
|
return Result.success().addData(pagination);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return Result.error();
|
return Result.error();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,30 +7,40 @@ import io.v.nutz.data.constant.SourceData;
|
|||||||
import io.v.nutz.annontation.ViReturn;
|
import io.v.nutz.annontation.ViReturn;
|
||||||
import io.v.nutz.dao.CndPlus;
|
import io.v.nutz.dao.CndPlus;
|
||||||
import io.v.nutz.modules.models.PageForm;
|
import io.v.nutz.modules.models.PageForm;
|
||||||
|
import io.v.nutz.proposal.models.ProposalConfig;
|
||||||
|
import io.v.nutz.proposal.models.ProposalUndertake;
|
||||||
import io.v.nutz.service.AsyncService;
|
import io.v.nutz.service.AsyncService;
|
||||||
import io.v.nutz.service.ViService;
|
import io.v.nutz.service.ViService;
|
||||||
import io.v.nutz.sys.models.Sys_unit;
|
import io.v.nutz.sys.models.Sys_unit;
|
||||||
import io.v.nutz.sys.models.Sys_user;
|
import io.v.nutz.sys.models.Sys_user;
|
||||||
|
import io.v.nutz.sys.models.Sys_user_role;
|
||||||
import io.v.nutz.sys.services.SysDqService;
|
import io.v.nutz.sys.services.SysDqService;
|
||||||
import io.v.nutz.sys.services.SysGxService;
|
import io.v.nutz.sys.services.SysGxService;
|
||||||
import io.v.nutz.sys.services.SysUnitClassService;
|
import io.v.nutz.sys.services.SysUnitClassService;
|
||||||
import io.v.nutz.sys.services.SysUserService;
|
import io.v.nutz.sys.services.SysUserService;
|
||||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||||
import org.nutz.dao.Chain;
|
import org.nutz.dao.Chain;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.dao.Dao;
|
||||||
import org.nutz.dao.Sqls;
|
import org.nutz.dao.Sqls;
|
||||||
import org.nutz.dao.sql.Sql;
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.dao.util.Daos;
|
||||||
|
import org.nutz.ioc.aop.Aop;
|
||||||
import org.nutz.ioc.loader.annotation.Inject;
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.lang.Lang;
|
||||||
import org.nutz.lang.Strings;
|
import org.nutz.lang.Strings;
|
||||||
import org.nutz.lang.util.NutMap;
|
import org.nutz.lang.util.NutMap;
|
||||||
import org.nutz.log.Log;
|
import org.nutz.log.Log;
|
||||||
import org.nutz.log.Logs;
|
import org.nutz.log.Logs;
|
||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -43,7 +53,6 @@ import java.util.stream.Collectors;
|
|||||||
@RequiresAuthentication
|
@RequiresAuthentication
|
||||||
@Ok("json:full")
|
@Ok("json:full")
|
||||||
public class SysUnitMangeController {
|
public class SysUnitMangeController {
|
||||||
private static final Log log = Logs.get();
|
|
||||||
|
|
||||||
@Inject("Sys_unit")
|
@Inject("Sys_unit")
|
||||||
private ViService<Sys_unit> sysUnitService;
|
private ViService<Sys_unit> sysUnitService;
|
||||||
@@ -52,11 +61,10 @@ public class SysUnitMangeController {
|
|||||||
private SysUnitClassService sysUnitClassService;
|
private SysUnitClassService sysUnitClassService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SysDqService sysDqService;
|
private SysUserService sysUserService;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SysGxService sysGxService;
|
private Dao dao;
|
||||||
|
|
||||||
|
|
||||||
@At("")
|
@At("")
|
||||||
@Ok("beetl:/platform/sys/unit/unitMange.html")
|
@Ok("beetl:/platform/sys/unit/unitMange.html")
|
||||||
@@ -68,6 +76,7 @@ public class SysUnitMangeController {
|
|||||||
// 单位数据更新
|
// 单位数据更新
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
public Object dataUpdate() {
|
public Object dataUpdate() {
|
||||||
// 从系统数据库中查询已有的单位
|
// 从系统数据库中查询已有的单位
|
||||||
List<Sys_unit> sys_units = sysUnitService.query();
|
List<Sys_unit> sys_units = sysUnitService.query();
|
||||||
@@ -75,7 +84,7 @@ public class SysUnitMangeController {
|
|||||||
// Map<String, String> map = sys_units.stream().collect(Collectors.toMap(sys_unit -> sys_unit.getId(), sys_unit -> sys_unit.getParentId()));
|
// Map<String, String> map = sys_units.stream().collect(Collectors.toMap(sys_unit -> sys_unit.getId(), sys_unit -> sys_unit.getParentId()));
|
||||||
List<String> list = sys_units.stream().map(v -> v.getId()).collect(Collectors.toList());
|
List<String> list = sys_units.stream().map(v -> v.getId()).collect(Collectors.toList());
|
||||||
// 从源数据中心拉取所有的单位
|
// 从源数据中心拉取所有的单位
|
||||||
List<Sys_unit> units = SourceData.units();
|
/* List<Sys_unit> units = SourceData.units();
|
||||||
for (Sys_unit unit : units) {
|
for (Sys_unit unit : units) {
|
||||||
if (list.contains(unit.getId())) { // 包含就修改
|
if (list.contains(unit.getId())) { // 包含就修改
|
||||||
sysUnitService.updateIgnoreNull(unit);
|
sysUnitService.updateIgnoreNull(unit);
|
||||||
@@ -84,7 +93,7 @@ public class SysUnitMangeController {
|
|||||||
beanMap.remove("child");
|
beanMap.remove("child");
|
||||||
sysUnitService.insert("sys_unit", Chain.from(beanMap));
|
sysUnitService.insert("sys_unit", Chain.from(beanMap));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
List<Sys_unit> query = sysUnitService.query();
|
List<Sys_unit> query = sysUnitService.query();
|
||||||
query.forEach(v -> {
|
query.forEach(v -> {
|
||||||
@@ -98,8 +107,16 @@ public class SysUnitMangeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位页面数据
|
||||||
|
*
|
||||||
|
* @param parentId 父id
|
||||||
|
* @param pageForm 页面形式
|
||||||
|
* @return {@link Object}
|
||||||
|
*/
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
public Object pageData(String parentId, PageForm pageForm) {
|
public Object pageData(String parentId, PageForm pageForm) {
|
||||||
CndPlus cnd = CndPlus.create();
|
CndPlus cnd = CndPlus.create();
|
||||||
cnd.andExcludeEmpty("parentId", "=", parentId);
|
cnd.andExcludeEmpty("parentId", "=", parentId);
|
||||||
@@ -108,39 +125,62 @@ public class SysUnitMangeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
public Object findOne(String id) {
|
public Object findOne(String id) {
|
||||||
return sysUnitService.fetch(id);
|
return sysUnitService.fetch(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public Object doAdd(Sys_unit sys_unit) {
|
public Object doAdd(Sys_unit sys_unit) {
|
||||||
|
sys_unit.setId(sys_unit.getUnitcode());
|
||||||
if (sysUnitService.count(Cnd.where("unitcode", "=", sys_unit.getUnitcode())) > 0) {
|
if (sysUnitService.count(Cnd.where("unitcode", "=", sys_unit.getUnitcode())) > 0) {
|
||||||
return Result.error("单位代码已存在");
|
return Result.error("单位代码已存在");
|
||||||
}
|
}
|
||||||
sysUnitService.update(Chain.make("hasChildren", true), Cnd.where("id", "=", sys_unit.getParentId()));
|
sysUnitService.update(Chain.make("hasChildren", true), Cnd.where("id", "=", sys_unit.getParentId()));
|
||||||
sysUnitService.insert(sys_unit);
|
sysUnitService.insert(sys_unit);
|
||||||
|
|
||||||
|
//添加承办单位
|
||||||
|
ProposalUndertake proposalUndertake = new ProposalUndertake();
|
||||||
|
proposalUndertake.setIsEnable(true);
|
||||||
|
proposalUndertake.setUnitName(sys_unit.getName());
|
||||||
|
proposalUndertake.setUnitCode(sys_unit.getUnitcode());
|
||||||
|
dao.insert(proposalUndertake);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public Object doEdit(Sys_unit sys_unit) {
|
public Object doEdit(Sys_unit sys_unit) {
|
||||||
if (sysUnitService.count(Cnd.where("unitcode", "=", sys_unit.getUnitcode()).and("id", "!=", sys_unit.getId())) > 0) {
|
if (sysUnitService.count(Cnd.where("unitcode", "=", sys_unit.getUnitcode()).and("id", "!=", sys_unit.getId())) > 0) {
|
||||||
return Result.error("单位代码已存在");
|
return Result.error("单位代码已存在");
|
||||||
}
|
}
|
||||||
|
sys_unit.setOpAt(String.valueOf(System.currentTimeMillis()));
|
||||||
sysUnitService.update(sys_unit);
|
sysUnitService.update(sys_unit);
|
||||||
|
|
||||||
|
//更新承办单位
|
||||||
|
dao.update(ProposalUndertake.class, Chain.make("unitName", sys_unit.getName()), Cnd.where("unitCode", "=", sys_unit.getUnitcode()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
public Object doDelete(String id) {
|
public Object doDelete(String id) {
|
||||||
Sys_unit unit = sysUnitService.fetch(id);
|
Sys_unit unit = sysUnitService.fetch(id);
|
||||||
int count = sysUnitService.count(Cnd.where("parentId", "=", unit.getParentId()).and("id", "!=", id));
|
int count = sysUnitService.count(Cnd.where("parentId", "=", unit.getParentId()).and("id", "!=", id));
|
||||||
sysUnitService.update(Chain.make("hasChildren", count > 0), Cnd.where("id", "=", unit.getParentId()));
|
sysUnitService.update(Chain.make("hasChildren", count > 0), Cnd.where("id", "=", unit.getParentId()));
|
||||||
delete(id);
|
delete(id);
|
||||||
|
|
||||||
|
//删除承办单位
|
||||||
|
dao.clear(ProposalUndertake.class, Cnd.where("unitCode", "=", unit.getUnitcode()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,11 +200,12 @@ public class SysUnitMangeController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@At
|
@At
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
public Object getUnitTreeData() {
|
public Object getUnitTreeData() {
|
||||||
try {
|
try {
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
|
|
||||||
Sys_unit school = sysUnitService.fetch(Cnd.NEW());
|
Sys_unit school = sysUnitService.fetch("00000");
|
||||||
school.setChild(child(school.getId()));
|
school.setChild(child(school.getId()));
|
||||||
|
|
||||||
list.add(school);
|
list.add(school);
|
||||||
@@ -182,7 +223,7 @@ public class SysUnitMangeController {
|
|||||||
private List<Sys_unit> child(String parentId) {
|
private List<Sys_unit> child(String parentId) {
|
||||||
List<Sys_unit> units = sysUnitService.query(Cnd.where("parentId", "=", parentId));
|
List<Sys_unit> units = sysUnitService.query(Cnd.where("parentId", "=", parentId));
|
||||||
|
|
||||||
asyncService.exe2(units, unit -> {
|
units.forEach(unit -> {
|
||||||
unit.setChild(child(unit.getId()));
|
unit.setChild(child(unit.getId()));
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -192,6 +233,7 @@ public class SysUnitMangeController {
|
|||||||
|
|
||||||
@At
|
@At
|
||||||
@Ok("json")
|
@Ok("json")
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
public Object getUnit2() {
|
public Object getUnit2() {
|
||||||
try {
|
try {
|
||||||
return Result.success().addData(sysUnitService.query(Cnd.where("unitlevel", "=", 2).asc("location")));
|
return Result.success().addData(sysUnitService.query(Cnd.where("unitlevel", "=", 2).asc("location")));
|
||||||
@@ -200,43 +242,307 @@ public class SysUnitMangeController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
/**
|
||||||
private SysUserService sysUserService;
|
* 查找单位下的用户
|
||||||
|
*
|
||||||
|
* @param pageForm 页面形式
|
||||||
|
* @param unitId 单位id
|
||||||
|
* @param threeUnitId 三个单元id
|
||||||
|
* @return {@link Object}
|
||||||
|
*/
|
||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
public Object findPersonByUnitId(PageForm pageForm, String unitId) {
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object findPersonByUnitId(PageForm pageForm, @Param(value = "unitId", required = false) String unitId, @Param(value = "threeUnitId", required = false) String threeUnitId) {
|
||||||
NutMap map = new NutMap();
|
NutMap map = new NutMap();
|
||||||
|
|
||||||
CndPlus cndPlus = CndPlus.create();
|
Sql userSql = Sqls.create("""
|
||||||
cndPlus.andExcludeEmpty("unitid", "=", unitId);
|
select
|
||||||
|
u.id,
|
||||||
|
u.username,
|
||||||
|
u.loginname,
|
||||||
|
u.sex,
|
||||||
|
u.mobile,
|
||||||
|
u.member,
|
||||||
|
IFNULL( r.NAME, '普通用户' ) AS roleName,
|
||||||
|
r.code as roleCode
|
||||||
|
from `user` u
|
||||||
|
LEFT JOIN sys_user_role sur on sur.userId = u.id and sur.roleId = @roleId
|
||||||
|
LEFT JOIN sys_role r on r.id = sur.roleId
|
||||||
|
$condition
|
||||||
|
""");
|
||||||
|
userSql.setParam("roleId", Roles.UNIT_MANGER);
|
||||||
|
|
||||||
|
Cnd cnd = Cnd.NEW();
|
||||||
|
cnd.groupBy("u.id");
|
||||||
|
cnd.andEX("u.unitid", "=", unitId);
|
||||||
|
cnd.andEX("u.threeUnitId", "=", threeUnitId);
|
||||||
|
|
||||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
cndPlus.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
cnd.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||||
}
|
}
|
||||||
cndPlus.asc("member");
|
cnd.desc("r.code");
|
||||||
|
cnd.asc("member");
|
||||||
|
userSql.setCondition(cnd);
|
||||||
|
map.setv("userList", sysUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), userSql));
|
||||||
|
|
||||||
|
// Sql sql = Sqls.create("""
|
||||||
|
// SELECT
|
||||||
|
// su.*
|
||||||
|
// FROM
|
||||||
|
// sys_user su
|
||||||
|
// LEFT JOIN sys_user_role sur ON sur.userId = su.id
|
||||||
|
// $condition
|
||||||
|
// """);
|
||||||
|
//
|
||||||
|
// Cnd cnd2 = Cnd.NEW();
|
||||||
|
// cnd2.andEX("sur.roleId", "=", Roles.UNIT_MANGER);
|
||||||
|
// cnd2.andEX("su.unitid", "=", unitId);
|
||||||
|
// cnd.andEX("threeUnitId", "=", threeUnitId);
|
||||||
|
// if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||||
|
// cnd2.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
||||||
|
// }
|
||||||
|
// sql.setCondition(cnd2);
|
||||||
|
// map.setv("principal", sysUserService.listMap(sql));
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 找到提议人由单位id
|
||||||
|
*
|
||||||
|
* @param pageForm 页面形式
|
||||||
|
* @param unitId 单位id
|
||||||
|
* @param type 类型 1.校领导 2.答复人
|
||||||
|
* @return {@link Object}
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object findProposalPersonByUnitId(PageForm pageForm, @Param(value = "unitId", required = false) String unitId, Integer type) {
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
su.*
|
u.username,
|
||||||
|
u.loginname,
|
||||||
|
u.sex,
|
||||||
|
u.mobile
|
||||||
|
FROM
|
||||||
|
sys_user_role sur
|
||||||
|
LEFT JOIN proposal_undertake pu ON pu.id = sur.cbdwid
|
||||||
|
AND sur.roleId = @roleId
|
||||||
|
left join sys_user u on u.id = sur.userId
|
||||||
|
where pu.unitCode = @unitId
|
||||||
|
""");
|
||||||
|
sql.setParam("roleId", type == 1 ? Roles.IN_CHARGE_LEADER : Roles.CONTRACTOR_PERSON);
|
||||||
|
sql.setParam("unitId", unitId);
|
||||||
|
return sysUnitService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询管理员和公众用户
|
||||||
|
*
|
||||||
|
* @param unitId 单位id
|
||||||
|
* @param type 类型 1.校领导 2.答复人
|
||||||
|
* @return {@link Object}
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object findProposalAdminAndPublicUser(@Param(value = "unitId", required = false) String unitId, Integer type) {
|
||||||
|
ProposalConfig config = sysUnitService.dao().fetch(ProposalConfig.class);
|
||||||
|
String schoolLeaderUnitCode = config.getSchoolLeaderUnitCode();
|
||||||
|
|
||||||
|
Sql publicUserSql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
su.id,
|
||||||
|
CONCAT( su.username, '(', su.loginname, ')', '- ', un.`name` ) `name`
|
||||||
|
FROM
|
||||||
|
sys_user su
|
||||||
|
LEFT JOIN sys_unit un ON un.id = su.unitid
|
||||||
|
WHERE
|
||||||
|
su.unitid = @unitId
|
||||||
|
""").setParam("unitId", type == 1 ? schoolLeaderUnitCode : unitId);
|
||||||
|
List<NutMap> publicUsers = sysUnitService.listMap(publicUserSql);
|
||||||
|
|
||||||
|
|
||||||
|
Sql adminUserSql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
su.id,
|
||||||
|
su.username
|
||||||
FROM
|
FROM
|
||||||
sys_user su
|
sys_user su
|
||||||
LEFT JOIN sys_user_role sur ON sur.userId = su.id
|
LEFT JOIN sys_user_role sur ON sur.userId = su.id
|
||||||
|
LEFT JOIN proposal_undertake pun ON pun.id = sur.cbdwid
|
||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
|
Cnd adminCnd = Cnd.NEW();
|
||||||
|
// adminCnd.andEX("sur.cbdwid", "=", unitId);
|
||||||
|
adminCnd.andEX("pun.unitCode", "=", unitId);
|
||||||
|
adminCnd.andEX("sur.roleId", "=", type == 1 ? Roles.IN_CHARGE_LEADER : Roles.CONTRACTOR_PERSON);
|
||||||
|
adminUserSql.setCondition(adminCnd);
|
||||||
|
List<NutMap> adminUsers = sysUnitService.listMap(adminUserSql);
|
||||||
|
|
||||||
CndPlus cndPlus2 = CndPlus.create();
|
return Result.success(Map.of("publicUsers", publicUsers, "adminUsers", adminUsers));
|
||||||
cndPlus2.andExcludeEmpty("sur.roleId", "=", Roles.UNIT_MANGER);
|
|
||||||
cndPlus2.andExcludeEmpty("su.unitid", "=", unitId);
|
|
||||||
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
|
||||||
cndPlus2.where().andLike(pageForm.getSearchName(), pageForm.getSearchKeyword());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.setCondition(cndPlus2);
|
/**
|
||||||
|
* 做管理用户设置建议
|
||||||
|
*
|
||||||
|
* @param userIds 用户id
|
||||||
|
* @param unitId 单位id
|
||||||
|
* @param type 类型 1.校领导 2.答复人
|
||||||
|
* @return {@link Object}
|
||||||
|
*/
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object doSetProposalAdminUser(@Param(value = "userIds", required = false) String[] userIds, @Param(value = "unitId", required = false) String unitId, Integer type) {
|
||||||
|
String roleId = type == 1 ? Roles.IN_CHARGE_LEADER : Roles.CONTRACTOR_PERSON;
|
||||||
|
//清除此单位的角色
|
||||||
|
dao.clear(Sys_user_role.class, Cnd.where("roleId", "=", roleId).and("unitId", "=", unitId));
|
||||||
|
ProposalUndertake proposalUndertake = dao.fetch(ProposalUndertake.class, Cnd.where("unitCode", "=", unitId));
|
||||||
|
if (Lang.isNotEmpty(proposalUndertake)) {
|
||||||
|
dao.clear(Sys_user_role.class, Cnd.where("cbdwid", "=", proposalUndertake.getId()).and("roleId", "=", roleId));
|
||||||
|
}
|
||||||
|
|
||||||
map.setv("userList", sysUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cndPlus));
|
List<Sys_user_role> insertUserRoles = Arrays.stream(userIds).map(v -> {
|
||||||
map.setv("principal", sysUserService.listMap(sql));
|
Sys_user_role sysUserRole = new Sys_user_role();
|
||||||
|
sysUserRole.setUserId(v);
|
||||||
|
sysUserRole.setRoleId(roleId);
|
||||||
|
sysUserRole.setCbdwid(proposalUndertake.getId());
|
||||||
|
return sysUserRole;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
dao.insert(insertUserRoles);
|
||||||
|
|
||||||
return map;
|
//增加负责人角色
|
||||||
|
if (type == 2) {
|
||||||
|
List<Sys_user_role> roles = Arrays.stream(userIds).map(v -> {
|
||||||
|
Sys_user_role sysUserRole = new Sys_user_role();
|
||||||
|
sysUserRole.setUserId(v);
|
||||||
|
sysUserRole.setRoleId(Roles.UNIT_MANGER);
|
||||||
|
sysUserRole.setUnitid(unitId);
|
||||||
|
return sysUserRole;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
dao.insert(roles);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object findChargeUnits(@Param(value = "unitId", required = false) String unitId, String userId) {
|
||||||
|
List<Sys_unit> units = dao.query(Sys_unit.class, Cnd.where("unitlevel", "=", 2));
|
||||||
|
|
||||||
|
Sql chargeUnitSql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
n.id
|
||||||
|
FROM
|
||||||
|
sys_user_role sur
|
||||||
|
LEFT JOIN proposal_undertake pu ON pu.id = sur.cbdwid
|
||||||
|
LEFT JOIN sys_unit n on n.id = pu.unitCode
|
||||||
|
WHERE
|
||||||
|
sur.roleId = @roleId
|
||||||
|
AND sur.userId = @userId
|
||||||
|
""");
|
||||||
|
chargeUnitSql.setParam("roleId", Roles.IN_CHARGE_LEADER);
|
||||||
|
chargeUnitSql.setParam("userId", userId);
|
||||||
|
String[] chargeUnits = (String[]) Daos.query(dao, chargeUnitSql.toString(), Sqls.callback.strs());
|
||||||
|
|
||||||
|
return Result.success(Map.of("allUnits", units, "chargeUnits", chargeUnits));
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
@Aop(TransAop.READ_COMMITTED)
|
||||||
|
public Object doSetChargeUnit(String userId, @Param("chargeUnits") String[] chargeUnits) {
|
||||||
|
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", Roles.IN_CHARGE_LEADER));
|
||||||
|
|
||||||
|
if (Lang.isNotEmpty(chargeUnits)) {
|
||||||
|
List<ProposalUndertake> undertakes = dao.query(ProposalUndertake.class, Cnd.where("unitCode", "in", chargeUnits));
|
||||||
|
List<Sys_user_role> userRoles = new ArrayList<>();
|
||||||
|
for (ProposalUndertake undertake : undertakes) {
|
||||||
|
Sys_user_role sysUserRole = new Sys_user_role();
|
||||||
|
sysUserRole.setUserId(userId);
|
||||||
|
sysUserRole.setRoleId(Roles.IN_CHARGE_LEADER);
|
||||||
|
sysUserRole.setCbdwid(undertake.getId());
|
||||||
|
userRoles.add(sysUserRole);
|
||||||
|
}
|
||||||
|
dao.insert(userRoles);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object findOtherRoleUsers(String unitId, String type) {
|
||||||
|
Sql leftSql = Sqls.create("select id,username,loginname from sys_user where unitId = @unitId");
|
||||||
|
leftSql.setParam("unitId", unitId);
|
||||||
|
List<NutMap> leftUsers = sysUnitService.listMap(leftSql);
|
||||||
|
|
||||||
|
Sql rightSql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
u.id
|
||||||
|
FROM
|
||||||
|
sys_user_role sur
|
||||||
|
LEFT JOIN sys_user u ON u.id = sur.userId
|
||||||
|
WHERE
|
||||||
|
u.unitId = @unitId
|
||||||
|
AND sur.roleId = @roleId
|
||||||
|
""");
|
||||||
|
rightSql.setParam("unitId", unitId);
|
||||||
|
rightSql.setParam("roleId", getOtherRoleByType(type));
|
||||||
|
String[] rightUsers = (String[]) Daos.query(dao, rightSql.toString(), Sqls.callback.strs());
|
||||||
|
return Result.success(Map.of("leftUsers", leftUsers, "rightUsers", rightUsers));
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object otherRoleUserPageData(PageForm pageForm, String unitId, String type) {
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
u.username,
|
||||||
|
u.loginname,
|
||||||
|
u.sex,
|
||||||
|
u.mobile
|
||||||
|
FROM
|
||||||
|
sys_user_role sur
|
||||||
|
left join sys_user u on u.id = sur.userId
|
||||||
|
WHERE
|
||||||
|
u.unitId = @unitId
|
||||||
|
AND sur.roleId = @roleId
|
||||||
|
""");
|
||||||
|
sql.setParam("roleId", getOtherRoleByType(type));
|
||||||
|
sql.setParam("unitId", unitId);
|
||||||
|
return sysUnitService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@ViReturn
|
||||||
|
@RequiresPermissions("sys.manager.unit")
|
||||||
|
public Object doSetOtherRoleUser(String unitId, @Param(value = "users", required = false) String[] users, String type) {
|
||||||
|
String roleId = getOtherRoleByType(type);
|
||||||
|
dao.clear(Sys_user_role.class, Cnd.where("unitId", "=", unitId).and("roleId", "=", roleId));
|
||||||
|
|
||||||
|
List<Sys_user_role> userRoles = new ArrayList<>();
|
||||||
|
for (String user : users) {
|
||||||
|
Sys_user_role userRole = new Sys_user_role();
|
||||||
|
userRole.setUserId(user);
|
||||||
|
userRole.setUnitid(unitId);
|
||||||
|
userRole.setRoleId(roleId);
|
||||||
|
userRoles.add(userRole);
|
||||||
|
}
|
||||||
|
dao.insert(userRoles);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getOtherRoleByType(String type) {
|
||||||
|
if (type.equals("unitDwsj")) {
|
||||||
|
return Roles.GH03;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,6 +123,10 @@ module.exports = {
|
|||||||
this.viewData = resp.data
|
this.viewData = resp.data
|
||||||
this.organizationAudit = resp.data.organizationAudit
|
this.organizationAudit = resp.data.organizationAudit
|
||||||
this.schoolAudit = resp.data.schoolAudit
|
this.schoolAudit = resp.data.schoolAudit
|
||||||
|
} else {
|
||||||
|
this.viewData = {}
|
||||||
|
this.organizationAudit = {}
|
||||||
|
this.schoolAudit = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,37 +1,42 @@
|
|||||||
<!--#
|
<!--#
|
||||||
layout("/layouts/platform.html"){
|
layout("/layouts/platform.html"){
|
||||||
#-->
|
#-->
|
||||||
<style>
|
|
||||||
#app {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.w-e-text-container {
|
|
||||||
height: 200px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="file"] {
|
|
||||||
display: none
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-select-dropdown {
|
|
||||||
z-index: 99999999 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-loading-mask {
|
|
||||||
z-index: 99999999 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.el-transfer {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-transfer-panel {
|
||||||
|
text-align: left;
|
||||||
|
width: 35%;
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-transfer-panel__list.is-filterable {
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-tree-layout-left {
|
||||||
|
overflow: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
.v-tree-layout-left .v-tree {
|
.v-tree-layout-left .v-tree {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: calc(100vh - 170px);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-tree:hover::-webkit-scrollbar {
|
||||||
|
width: 3px;
|
||||||
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-tree-layout-left .custom-tree-node {
|
.v-tree-layout-left .custom-tree-node {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.v-tree-layout-left .v-tree .v-node {
|
.v-tree-layout-left .v-tree .v-node {
|
||||||
@@ -41,26 +46,36 @@ layout("/layouts/platform.html"){
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
/*width: 3px;*/
|
||||||
|
/*background-color: transparent;*/
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: rgba(0, 0, 0, 0.2);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
|
|
||||||
<guava ref="guava">
|
<guava ref="guava">
|
||||||
<template>
|
<template>
|
||||||
<tree-layout style="height: calc(100vh - 70px)">
|
<el-card shadow="never" style="height: calc(100vh - 70px)">
|
||||||
|
<tree-layout>
|
||||||
<template #tree>
|
<template #tree>
|
||||||
|
<div style="padding:0 20px 20px;">
|
||||||
<div style="padding: 20px;border-right: 2px solid rgb(240,240,240);padding-bottom: 20px">
|
|
||||||
<el-input
|
<el-input
|
||||||
placeholder="输入关键字进行查找" clearable
|
placeholder="输入关键字进行查找" clearable
|
||||||
v-model="filterText">
|
v-model="filterText">
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
|
<el-tree ref="tree" :data="treeData" class="v-tree" v-loading="treeLoading" node-key="id"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
default-expand-all :expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
|
:default-expanded-keys="['00000']"
|
||||||
@node-click="handleNodeClick" accordion @node-expand="nodeExpand"
|
@node-click="handleNodeClick" accordion @node-expand="nodeExpand"
|
||||||
highlight-current :filter-node-method="filterNode">
|
highlight-current :filter-node-method="filterNode">
|
||||||
<div class="custom-tree-node" slot-scope="{ node, data }">
|
<div class="custom-tree-node" slot-scope="{ node, data }">
|
||||||
@@ -95,11 +110,9 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template>
|
<template>
|
||||||
|
<div v-if="checkNode.level===1" style="padding:0 10px">
|
||||||
<div v-if="checkNode.level===1">
|
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<div class="btn-group tool-button mt5">
|
<div class="btn-group tool-button mt5">
|
||||||
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
|
||||||
@@ -118,21 +131,26 @@ layout("/layouts/platform.html"){
|
|||||||
<div class="pull-right offscreen-right mt5">
|
<div class="pull-right offscreen-right mt5">
|
||||||
<div class="btn-group tool-button" v-if="checkNode.level==1">
|
<div class="btn-group tool-button" v-if="checkNode.level==1">
|
||||||
<!--#if(@shiro.hasRole('sysadmin')){#-->
|
<!--#if(@shiro.hasRole('sysadmin')){#-->
|
||||||
<el-button icon="el-icon-refresh" v-loading="loading"
|
<!-- <el-button icon="el-icon-refresh" v-loading="loading"
|
||||||
element-loading-spinner="el-icon-loading"
|
element-loading-spinner="el-icon-loading"
|
||||||
element-loading-background="rgba(0, 0, 0, 0.8)" @click="dataUpdate">
|
element-loading-background="rgba(0, 0, 0, 0.8)" @click="dataUpdate">
|
||||||
更新组织机构
|
更新组织机构
|
||||||
</el-button>
|
</el-button>-->
|
||||||
<!--#}#-->
|
<!--#}#-->
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group tool-button">
|
<div class="btn-group tool-button">
|
||||||
<el-button icon="el-icon-plus" @click="openAdd">新建单位</el-button>
|
<el-button icon="el-icon-plus" type="primary" @click="openAdd">新建单位
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never" class="mt10">
|
<el-card shadow="never" class="mt10">
|
||||||
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
|
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||||
|
key="level1Table"
|
||||||
|
@sort-change="(column)=>{pageForm.pageOrderName = column.prop;pageForm.pageOrderBy = column.order;pageData()}"
|
||||||
|
ref="firstTable"
|
||||||
|
:height="firstTableHeight"
|
||||||
v-loading="tabLoading">
|
v-loading="tabLoading">
|
||||||
<el-table-column align="center" :key="1" header-align="center" label="序号"
|
<el-table-column align="center" :key="1" header-align="center" label="序号"
|
||||||
type="index">
|
type="index">
|
||||||
@@ -190,8 +208,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-table>
|
</el-table>
|
||||||
<el-row class="el-pagination-container">
|
<el-row class="el-pagination-container">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@size-change="pageSizeChange"
|
@size-change="(val)=>{pageForm.pageSize = val;pageData()}"
|
||||||
@current-change="pageNumberChange"
|
@current-change="(val)=>{pageForm.pageNumber = val;pageData()}"
|
||||||
:current-page="pageForm.pageNumber"
|
:current-page="pageForm.pageNumber"
|
||||||
:page-sizes="[10, 20, 30, 50]"
|
:page-sizes="[10, 20, 30, 50]"
|
||||||
:page-size="pageForm.pageSize"
|
:page-size="pageForm.pageSize"
|
||||||
@@ -202,51 +220,92 @@ layout("/layouts/platform.html"){
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="checkNode.level===2">
|
<div v-if="checkNode.level===2" style="padding:0 10px">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<div class="btn-group tool-button mt5">
|
<div class="btn-group tool-button mt5">
|
||||||
<el-input placeholder="请输入内容" clearable v-model="userPageForm.searchKeyword"
|
<el-input placeholder="请输入内容" clearable
|
||||||
@keyup.enter.native="doUserSearch">
|
v-model="secondaryPageForm.searchKeyword"
|
||||||
<el-select v-model="userPageForm.searchName" slot="prepend" placeholder="查询类型"
|
@keyup.enter.native="secondaryDataSearch">
|
||||||
|
<el-select v-model="secondaryPageForm.searchName"
|
||||||
|
v-if="['unitPersonnel','unitLeader'].includes(secondaryTabActiveName)"
|
||||||
|
slot="prepend"
|
||||||
|
placeholder="查询类型"
|
||||||
style="width: 80px;">
|
style="width: 80px;">
|
||||||
<el-option label="姓名" value="username"></el-option>
|
<el-option label="姓名" value="username"></el-option>
|
||||||
<el-option label="工号" value="loginname"></el-option>
|
<el-option label="工号" value="loginname"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
|
<el-select v-model="secondaryPageForm.searchName"
|
||||||
|
v-if="['thirdLevelUnit'].includes(secondaryTabActiveName)"
|
||||||
|
slot="prepend"
|
||||||
|
placeholder="查询类型"
|
||||||
|
style="width: 120px;">
|
||||||
|
<el-option label="单位名称" value="name"></el-option>
|
||||||
|
<el-option label="单位代码" value="unitcode"></el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group tool-button mt5">
|
<div class="btn-group tool-button mt5">
|
||||||
<el-button type="primary" icon="el-icon-search" @click="doUserSearch"></el-button>
|
<el-button type="primary" icon="el-icon-search"
|
||||||
|
@click="secondaryPageData"></el-button>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right offscreen-right mt5">
|
||||||
|
<div class="btn-group tool-button">
|
||||||
|
<el-button v-if="secondaryTabActiveName==='thirdLevelUnit'" icon="el-icon-plus"
|
||||||
|
type="primary" @click="openAdd">新建单位
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-if="secondaryTabActiveName==='unitLeader'"
|
||||||
|
icon="el-icon-plus" type="primary" @click="openAddUnitLeader">
|
||||||
|
设置单位负责人
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-if="secondaryTabActiveName==='unitSchoolLeader'"
|
||||||
|
icon="el-icon-plus" type="primary" @click="openAddUnitLeader">
|
||||||
|
设置单位分管校领导
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-if="secondaryTabActiveName==='unitDwsj'"
|
||||||
|
icon="el-icon-plus" type="primary" @click="openAddOtherRole">
|
||||||
|
设置单位党委书记
|
||||||
|
</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card shadow="never" class="mt10">
|
<el-card shadow="never" class="mt10">
|
||||||
<el-tabs v-model="activeName1" type="card" @tab-click="handleClick">
|
<el-tabs v-model="secondaryTabActiveName" type="card"
|
||||||
<el-tab-pane label="单位人员" name="first"></el-tab-pane>
|
@tab-click="secondaryDataSearch()">
|
||||||
<el-tab-pane label="单位负责人" name="second"></el-tab-pane>
|
<el-tab-pane label="三级单位" name="thirdLevelUnit"></el-tab-pane>
|
||||||
|
<el-tab-pane label="单位人员" name="unitPersonnel"></el-tab-pane>
|
||||||
|
<el-tab-pane label="单位负责人" name="unitLeader"></el-tab-pane>
|
||||||
|
<el-tab-pane label="单位分管校领导" name="unitSchoolLeader"></el-tab-pane>
|
||||||
|
<el-tab-pane label="单位党委书记" name="unitDwsj"></el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<el-table :data="userTableData" style="width: 100%" @sort-change="userPageOrder"
|
<template
|
||||||
|
v-if="['unitPersonnel','unitLeader','unitSchoolLeader','unitDwsj'].includes(secondaryTabActiveName)">
|
||||||
|
<el-table :data="secondaryTableData" style="width: 100%"
|
||||||
|
@sort-change="(column)=>{secondaryPageForm.pageOrderName = column.prop;secondaryPageForm.pageOrderBy = column.order;secondaryPageData();}"
|
||||||
|
height="600px"
|
||||||
size="medium">
|
size="medium">
|
||||||
<el-table-column align="center" header-align="center" label="序号" type="index">
|
<el-table-column align="center" header-align="center" label="序号" type="index">
|
||||||
<template scope="scope">
|
<template scope="scope">
|
||||||
<span>{{scope.$index+(userPageForm.pageNumber - 1) * userPageForm.pageSize + 1}} </span>
|
<span>{{scope.$index+(secondaryPageForm.pageNumber - 1) * secondaryPageForm.pageSize + 1}} </span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" header-align="center" label="姓名"
|
<el-table-column align="center" header-align="center" label="姓名"
|
||||||
prop="username"></el-table-column>
|
prop="username"></el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" header-align="center" label="工号"
|
<el-table-column align="center" header-align="center" label="工号"
|
||||||
prop="loginname"></el-table-column>
|
prop="loginname"></el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="性别" prop="sex">
|
||||||
<el-table-column align="center" header-align="center" label="性别"
|
|
||||||
prop="sex">
|
|
||||||
<template scope="{row:{sex}}">
|
<template scope="{row:{sex}}">
|
||||||
<span v-if="sex">{{sex}}</span>
|
<span v-if="sex">{{sex}}</span>
|
||||||
<span v-else>暂无</span>
|
<span v-else>暂无</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" header-align="center" label="手机号"
|
<el-table-column align="center" header-align="center" label="手机号"
|
||||||
prop="mobile">
|
prop="mobile">
|
||||||
<template scope="{row:{mobile}}">
|
<template scope="{row:{mobile}}">
|
||||||
@@ -254,8 +313,8 @@ layout("/layouts/platform.html"){
|
|||||||
<span v-else>暂无</span>
|
<span v-else>暂无</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" header-align="center" label="是否会员"
|
<el-table-column align="center" header-align="center" label="是否会员"
|
||||||
|
v-if="['unitPersonnel','unitLeader'].includes(secondaryTabActiveName)"
|
||||||
prop="member">
|
prop="member">
|
||||||
<template scope="{row:{member}}">
|
<template scope="{row:{member}}">
|
||||||
<span v-if="member==1" class="text-success">是</span>
|
<span v-if="member==1" class="text-success">是</span>
|
||||||
@@ -263,31 +322,181 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
v-if="checkData.id == schoolLeaderUnitCode && secondaryTabActiveName==='unitPersonnel'"
|
||||||
|
label="操作"
|
||||||
|
width="120px">
|
||||||
|
<template scope="{row}">
|
||||||
|
<el-button size="mini" type="primary" @click="openSetChargeUnit(row)">
|
||||||
|
设置分管单位
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column align="center" header-align="center" label="身份"
|
||||||
|
v-if="['unitPersonnel'].includes(secondaryTabActiveName)"
|
||||||
|
prop="roleName"></el-table-column>-->
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-row v-if="activeName1 === 'first'" class="el-pagination-container">
|
</template>
|
||||||
|
|
||||||
|
<template v-if="['thirdLevelUnit'].includes(secondaryTabActiveName)">
|
||||||
|
<el-table :data="secondaryTableData" style="width: 100%"
|
||||||
|
@sort-change="(column)=>{secondaryPageForm.pageOrderName = column.prop;secondaryPageForm.pageOrderBy = column.order;secondaryPageData();}"
|
||||||
|
max-height="600px"
|
||||||
|
size="medium">
|
||||||
|
<el-table-column align="center" header-align="center" label="序号" type="index">
|
||||||
|
<template scope="scope">
|
||||||
|
<span>{{scope.$index+(secondaryPageForm.pageNumber - 1) * secondaryPageForm.pageSize + 1}} </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="单位名称"
|
||||||
|
prop="name"></el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="单位代码"
|
||||||
|
prop="unitcode"></el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="单位等级" header-align="center" prop="unitlevel"
|
||||||
|
:show-overflow-tooltip="true" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-if="scope.row.unitlevel==1" size="mini" type="success"
|
||||||
|
round
|
||||||
|
style=" vertical-align: middle;">1级
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="scope.row.unitlevel==2" size="mini" type="warning"
|
||||||
|
round
|
||||||
|
style=" vertical-align: middle;">2级
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="scope.row.unitlevel==3" size="mini" type="danger" round
|
||||||
|
style=" vertical-align: middle;">3级
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="scope.row.unitlevel>3" size="mini" type="info" round
|
||||||
|
style=" vertical-align: middle;">{{scope.row.unitlevel}}级
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column align="center" header-align="center" prop="operating"
|
||||||
|
label="操作"
|
||||||
|
width="200px">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-dropdown @command="dropdownCommand">
|
||||||
|
<el-button size="mini">
|
||||||
|
<i class="ti-settings"></i>
|
||||||
|
<span class="ti-angle-down"></span>
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item :command="{type:'edit',data:row}">
|
||||||
|
编辑
|
||||||
|
</el-dropdown-item>
|
||||||
|
|
||||||
|
<el-dropdown-item :command="{type:'delete',data:row}">
|
||||||
|
删除
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-row v-if="['unitPersonnel','thirdLevelUnit','unitLeader','unitSchoolLeader','unitDwsj'].includes(secondaryTabActiveName)"
|
||||||
|
class="el-pagination-container">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@size-change="userPageSizeChange"
|
@size-change="(val)=>{secondaryPageForm.pageSize = val;secondaryPageData()}"
|
||||||
@current-change="userPageNumberChange"
|
@current-change="(val)=>{secondaryPageForm.pageNumber = val;secondaryPageData()}"
|
||||||
:current-page="userPageForm.pageNumber"
|
:current-page="secondaryPageForm.pageNumber"
|
||||||
:page-sizes="[10, 20, 30, 50]"
|
:page-sizes="[10, 20, 30, 50]"
|
||||||
:page-size="userPageForm.pageSize"
|
:page-size="secondaryPageForm.pageSize"
|
||||||
layout="total, sizes, prev, pager, next"
|
layout="total, sizes, prev, pager, next"
|
||||||
:total="userPageForm.totalCount">
|
:total="secondaryPageForm.totalCount">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="checkNode.level===3" style="padding: 0 10px">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<div class="btn-group tool-button mt5">
|
||||||
|
<el-input placeholder="请输入内容" clearable
|
||||||
|
v-model="thirdPageForm.searchKeyword"
|
||||||
|
@keyup.enter.native="secondaryDataSearch">
|
||||||
|
<el-select v-model="thirdPageForm.searchName"
|
||||||
|
v-if="['unitPersonnel','unitLeader'].includes(thirdTabActiveName)"
|
||||||
|
slot="prepend"
|
||||||
|
placeholder="查询类型"
|
||||||
|
style="width: 80px;">
|
||||||
|
<el-option label="姓名" value="username"></el-option>
|
||||||
|
<el-option label="工号" value="loginname"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="btn-group tool-button mt5">
|
||||||
|
<el-button type="primary" icon="el-icon-search" @click="thirdPageData"></el-button>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<el-card shadow="never" class="mt10">
|
||||||
|
<el-tabs v-model="thirdTabActiveName" type="card" @tab-click="thirdPageData">
|
||||||
|
<el-tab-pane label="单位人员" name="unitPersonnel"></el-tab-pane>
|
||||||
|
<!-- <el-tab-pane label="单位负责人" name="unitLeader"></el-tab-pane>-->
|
||||||
|
</el-tabs>
|
||||||
|
|
||||||
|
<el-table :data="thirdTableData" style="width: 100%"
|
||||||
|
@sort-change="(column)=>{thirdPageForm.pageOrderName = column.prop;thirdPageForm.pageOrderBy = column.order;thirdPageData();}"
|
||||||
|
height="600px"
|
||||||
|
size="medium">
|
||||||
|
<el-table-column align="center" header-align="center" label="序号" type="index">
|
||||||
|
<template scope="scope">
|
||||||
|
<span>{{scope.$index+(thirdPageForm.pageNumber - 1) * thirdPageForm.pageSize + 1}} </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="姓名"
|
||||||
|
prop="username"></el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="工号"
|
||||||
|
prop="loginname"></el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="性别" prop="sex">
|
||||||
|
<template scope="{row:{sex}}">
|
||||||
|
<span v-if="sex">{{sex}}</span>
|
||||||
|
<span v-else>暂无</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="手机号" prop="mobile">
|
||||||
|
<template scope="{row:{mobile}}">
|
||||||
|
<span v-if="mobile">{{mobile}}</span>
|
||||||
|
<span v-else>暂无</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" header-align="center" label="是否会员"
|
||||||
|
prop="member">
|
||||||
|
<template scope="{row:{member}}">
|
||||||
|
<span v-if="member==1" class="text-success">是</span>
|
||||||
|
<span v-else>否</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<el-row v-if="['unitPersonnel'].includes(thirdTabActiveName)"
|
||||||
|
class="el-pagination-container">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="(val)=>{thirdPageForm.pageSize = val;thirdPageData()}"
|
||||||
|
@current-change="(val)=>{thirdPageForm.pageNumber = val;thirdPageData()}"
|
||||||
|
:current-page="thirdPageForm.pageNumber"
|
||||||
|
:page-sizes="[10, 20, 30, 50]"
|
||||||
|
:page-size="thirdPageForm.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next"
|
||||||
|
:total="thirdPageForm.totalCount">
|
||||||
|
</el-pagination>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</tree-layout>
|
</tree-layout>
|
||||||
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<template #edit>
|
<template #edit>
|
||||||
|
<el-form :model="formData" ref="form" :rules="formRules"
|
||||||
<el-divider content-position="left"><span style="color: rgb(121, 187, 255)">请填写以下单位信息</span>
|
|
||||||
</el-divider>
|
|
||||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="top"
|
|
||||||
label-width="120px"
|
label-width="120px"
|
||||||
style="padding: 0 30px">
|
style="padding: 0 30px">
|
||||||
<el-row gutter="30">
|
<el-row gutter="30">
|
||||||
@@ -306,7 +515,8 @@ layout("/layouts/platform.html"){
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="单位代码" prop="unitcode">
|
<el-form-item label="单位代码" prop="unitcode">
|
||||||
<el-input maxlength="100" placeholder="请输入协会编码" v-model="formData.unitcode"
|
<el-input maxlength="100" placeholder="请输入单位编码" v-model="formData.unitcode"
|
||||||
|
:disabled="formData.id!='' && formData.id!=undefined"
|
||||||
type="text"></el-input>
|
type="text"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -359,25 +569,75 @@ layout("/layouts/platform.html"){
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<el-dialog :title="secondaryTabActiveName === 'unitSchoolLeader'?'设置单位分管校领导':'设置单位负责人'"
|
||||||
|
:visible.sync="proposalDialogVisible" width="55%">
|
||||||
|
<div style="width: 100%;">
|
||||||
|
<el-transfer :titles="['单位成员', '管理员']" filterable
|
||||||
|
:props="{key: 'id',label: 'name'}"
|
||||||
|
v-model="proposalAdminUserIds"
|
||||||
|
:data="proposalPublicUsers">
|
||||||
|
</el-transfer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="proposalDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="doSetProposalAdminUser">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="设置分管单位" width="50%" :visible.sync="chargeUnitDialogVisible">
|
||||||
|
<div style="width: 100%;">
|
||||||
|
<el-transfer :titles="['单位', '已分配单位']"
|
||||||
|
filterable
|
||||||
|
ref="chargeTransfer"
|
||||||
|
:props="{key: 'id',label: 'name'}"
|
||||||
|
v-model="chargeUnits"
|
||||||
|
:data="transferLeftUnits">
|
||||||
|
</el-transfer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="chargeUnitDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="doSetChargeUnit">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog title="分配人员" width="50%" :visible.sync="otherRoleDialogVisible">
|
||||||
|
<div style="width: 100%;">
|
||||||
|
<el-transfer :titles="['可分配人员', '已分配人员']"
|
||||||
|
filterable
|
||||||
|
ref="otherRoleTransfer"
|
||||||
|
:props="{key: 'id',label: 'username'}"
|
||||||
|
v-model="otherUsers"
|
||||||
|
:data="transferLeftOtherRoleUsers">
|
||||||
|
</el-transfer>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="otherRoleDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="doSetOtherRoleUser">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</guava>
|
</guava>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var E = window.wangEditor
|
|
||||||
|
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName1: 'first',
|
secondaryTabActiveName: 'thirdLevelUnit',
|
||||||
userTableData: [],
|
secondaryTableData: [],
|
||||||
userPageForm: {
|
secondaryPageForm: {
|
||||||
searchName: "username",
|
searchName: "username",
|
||||||
searchKeyword: "",
|
searchKeyword: null,
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
totalCount: 0,
|
totalCount: 0,
|
||||||
pageOrderName: "",
|
pageOrderName: null,
|
||||||
pageOrderBy: ""
|
pageOrderBy: null
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
filterText: '',
|
filterText: '',
|
||||||
@@ -410,9 +670,53 @@ layout("/layouts/platform.html"){
|
|||||||
checkNode: {level: 1},
|
checkNode: {level: 1},
|
||||||
checkData: {},
|
checkData: {},
|
||||||
campusOptions: [],
|
campusOptions: [],
|
||||||
loading: false,
|
|
||||||
|
thirdPageForm: {
|
||||||
|
searchName: "username",
|
||||||
|
searchKeyword: null,
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalCount: 0,
|
||||||
|
pageOrderName: null,
|
||||||
|
pageOrderBy: null
|
||||||
|
},
|
||||||
|
thirdTableData: [],
|
||||||
|
thirdTabActiveName: 'unitPersonnel',
|
||||||
|
|
||||||
|
proposalDialogVisible: false,
|
||||||
|
proposalPublicUsers: [],
|
||||||
|
proposalAdminUsers: [],
|
||||||
|
proposalAdminUserIds: [],
|
||||||
|
|
||||||
|
firstTableHeight: 673,
|
||||||
|
|
||||||
|
schoolLeaderUnitCode: null,
|
||||||
|
|
||||||
|
chargeUnitDialogVisible: false,
|
||||||
|
transferLeftUnits: [],
|
||||||
|
chargeUnits: [],
|
||||||
|
chargeUserId: null,
|
||||||
|
|
||||||
|
|
||||||
|
otherRoleDialogVisible: false,
|
||||||
|
transferLeftOtherRoleUsers: [],
|
||||||
|
otherUsers: []
|
||||||
|
|
||||||
|
|
||||||
|
// unitPublicUsers: [],
|
||||||
|
// unitAdminUsers: [],
|
||||||
|
// unitAdminUserIds: [],
|
||||||
|
// unitUserDialogVisible: false
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.$refs.firstTable) {
|
||||||
|
this.firstTableHeight = window.innerHeight - this.$refs.firstTable.$el.getBoundingClientRect().top - 80
|
||||||
|
}
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
|
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
|
||||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||||
@@ -423,9 +727,82 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClick(tab, event) {
|
async openAddOtherRole() {
|
||||||
this.doUserSearch()
|
this.otherRoleDialogVisible = true
|
||||||
|
if (this.$refs.otherRoleTransfer) {
|
||||||
|
this.$refs.otherRoleTransfer.clearQuery('right')
|
||||||
|
this.$refs.otherRoleTransfer.clearQuery('left')
|
||||||
|
}
|
||||||
|
const resp = await $.post(loc() + '/findOtherRoleUsers', {
|
||||||
|
unitId: this.checkData.id,
|
||||||
|
type: this.secondaryTabActiveName
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.transferLeftOtherRoleUsers = resp.data.leftUsers
|
||||||
|
this.otherUsers = resp.data.rightUsers
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
async doSetOtherRoleUser() {
|
||||||
|
const resp = await $.post(loc() + '/doSetOtherRoleUser', {
|
||||||
|
users: JSON.stringify(this.otherUsers),
|
||||||
|
unitId: this.checkData.id,
|
||||||
|
type: this.secondaryTabActiveName
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.otherRoleDialogVisible = false
|
||||||
|
this.$notify.success(resp.msg)
|
||||||
|
this.pageForm.pageNumber = 1
|
||||||
|
this.secondaryPageData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
async openSetChargeUnit(row) {
|
||||||
|
this.chargeUnitDialogVisible = true
|
||||||
|
this.chargeUserId = row.id
|
||||||
|
if (this.$refs.chargeTransfer) {
|
||||||
|
this.$refs.chargeTransfer.clearQuery('right')
|
||||||
|
this.$refs.chargeTransfer.clearQuery('left')
|
||||||
|
}
|
||||||
|
const resp = await $.post(loc() + '/findChargeUnits', {userId: row.id})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.transferLeftUnits = resp.data.allUnits
|
||||||
|
this.chargeUnits = resp.data.chargeUnits
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async doSetChargeUnit() {
|
||||||
|
const resp = await $.post(loc() + '/doSetChargeUnit', {
|
||||||
|
userId: this.chargeUserId,
|
||||||
|
chargeUnits: JSON.stringify(this.chargeUnits)
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.$notify.success(resp.msg)
|
||||||
|
this.chargeUnitDialogVisible = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
async openAddUnitLeader() {
|
||||||
|
const {data} = await $.post(loc() + '/findProposalAdminAndPublicUser', this.secondaryPageForm)
|
||||||
|
this.proposalPublicUsers = data.publicUsers
|
||||||
|
this.proposalAdminUsers = data.adminUsers
|
||||||
|
this.proposalAdminUserIds = data.adminUsers.map(v => v.id)
|
||||||
|
this.proposalDialogVisible = true
|
||||||
|
},
|
||||||
|
async doSetProposalAdminUser() {
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
msg
|
||||||
|
} = await $.post(loc() + '/doSetProposalAdminUser', {userIds: JSON.stringify(this.proposalAdminUserIds), ...this.secondaryPageForm})
|
||||||
|
if (code === 0) {
|
||||||
|
this.proposalDialogVisible = false
|
||||||
|
await this.secondaryPageData()
|
||||||
|
this.$notify.success(msg)
|
||||||
|
} else {
|
||||||
|
this.$notify.warning(msg)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
//单位数据更新
|
//单位数据更新
|
||||||
async dataUpdate() {
|
async dataUpdate() {
|
||||||
this.$confirm('您确定要更新组织机构吗, 是否继续?', '提示', {
|
this.$confirm('您确定要更新组织机构吗, 是否继续?', '提示', {
|
||||||
@@ -464,23 +841,23 @@ layout("/layouts/platform.html"){
|
|||||||
this.doDelete(data.id)
|
this.doDelete(data.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
filterNode(value, data, node) {
|
filterNode(value, data, node) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
|
|
||||||
return data.name.indexOf(value) !== -1
|
return data.name.indexOf(value) !== -1
|
||||||
|
|
||||||
return false
|
|
||||||
},
|
},
|
||||||
nodeExpand(data, node, e) {
|
nodeExpand(data, node, e) {
|
||||||
|
|
||||||
},
|
},
|
||||||
async handleNodeClick(data, node) {
|
handleNodeClick(data, node) {
|
||||||
this.checkData = data
|
this.checkData = data
|
||||||
this.checkNode = node
|
this.checkNode = node
|
||||||
if (node.level === 1) {
|
if (node.level === 1) {
|
||||||
this.doSearch()
|
this.doSearch()
|
||||||
} else if (node.level === 2) {
|
} else if (node.level === 2) {
|
||||||
this.doUserSearch()
|
this.secondaryDataSearch()
|
||||||
|
} else if (node.level === 3) {
|
||||||
|
this.thirdPageData()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
doDelete(id) {
|
doDelete(id) {
|
||||||
@@ -498,6 +875,8 @@ layout("/layouts/platform.html"){
|
|||||||
});
|
});
|
||||||
this.loadTree(false)
|
this.loadTree(false)
|
||||||
this.pageData()
|
this.pageData()
|
||||||
|
this.secondaryDataSearch()
|
||||||
|
this.thirdPageData()
|
||||||
} else {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: data.msg,
|
message: data.msg,
|
||||||
@@ -509,49 +888,52 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
doEdit() {
|
doEdit() {
|
||||||
this.$refs["form"].validate(async (valid) => {
|
this.$refs["form"].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const resp = await $.post(loc() + "/doEdit", this.formData)
|
const resp = await $.post(loc() + "/doEdit", this.formData)
|
||||||
requestLaterMsgFun(this, resp, () => {
|
this.loading = false
|
||||||
|
if (resp.code === 0) {
|
||||||
this.loadTree(false)
|
this.loadTree(false)
|
||||||
this.pageData();
|
this.pageData();
|
||||||
}, null, () => {
|
this.secondaryDataSearch()
|
||||||
this.loading = false
|
this.thirdPageData()
|
||||||
this.$refs.guava.index()
|
this.$refs.guava.index()
|
||||||
})
|
} else {
|
||||||
|
this.$notify.warning(resp.msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async openEdit(id) {
|
async openEdit(id) {
|
||||||
const resp = await $.get(loc() + "/findOne", {id})
|
const resp = await $.get(loc() + "/findOne", {id})
|
||||||
requestLaterFun(resp, (data) => {
|
if (resp.code === 0) {
|
||||||
|
const data = resp.data
|
||||||
this.formData = data
|
this.formData = data
|
||||||
this.$refs.guava.edit()
|
this.$refs.guava.edit()
|
||||||
if (this.$refs['form']) {
|
if (this.$refs['form']) {
|
||||||
this.$refs['form'].resetFields()
|
this.$refs['form'].resetFields()
|
||||||
}
|
}
|
||||||
}, (data, msg) => {
|
} else {
|
||||||
this.$message({
|
this.$notify.warning(resp.msg)
|
||||||
message: msg,
|
}
|
||||||
type: 'error'
|
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
doAdd() {
|
doAdd() {
|
||||||
this.$refs["form"].validate(async (valid) => {
|
this.$refs["form"].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const resp = await $.post(loc() + "/doAdd", this.formData)
|
const resp = await $.post(loc() + "/doAdd", this.formData)
|
||||||
requestLaterMsgFun(this, resp, () => {
|
this.loading = false
|
||||||
|
if (resp.code === 0) {
|
||||||
this.loadTree(false)
|
this.loadTree(false)
|
||||||
this.pageData();
|
this.pageData();
|
||||||
}, null, () => {
|
this.secondaryDataSearch()
|
||||||
this.loading = false
|
this.thirdPageData()
|
||||||
this.$refs.guava.index()
|
this.$refs.guava.index()
|
||||||
})
|
} else {
|
||||||
|
this.$notify.warning(resp.msg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -559,7 +941,7 @@ layout("/layouts/platform.html"){
|
|||||||
const {id, unitlevel} = this.checkData
|
const {id, unitlevel} = this.checkData
|
||||||
this.formData = {
|
this.formData = {
|
||||||
parentId: id,
|
parentId: id,
|
||||||
unitlevel: unitlevel + 1
|
unitlevel: unitlevel + 1,
|
||||||
}
|
}
|
||||||
this.$refs.guava.edit()
|
this.$refs.guava.edit()
|
||||||
if (this.$refs['form']) {
|
if (this.$refs['form']) {
|
||||||
@@ -571,19 +953,6 @@ layout("/layouts/platform.html"){
|
|||||||
this.pageForm.pageNumber = 1
|
this.pageForm.pageNumber = 1
|
||||||
this.pageData()
|
this.pageData()
|
||||||
},
|
},
|
||||||
pageOrder(column) {//按字段排序
|
|
||||||
this.pageForm.pageOrderName = column.prop;
|
|
||||||
this.pageForm.pageOrderBy = column.order;
|
|
||||||
this.pageData();
|
|
||||||
},
|
|
||||||
pageNumberChange(val) {//页码更新操作
|
|
||||||
this.pageForm.pageNumber = val;
|
|
||||||
this.pageData();
|
|
||||||
},
|
|
||||||
pageSizeChange(val) {//分页大小更新操作
|
|
||||||
this.pageForm.pageSize = val;
|
|
||||||
this.pageData();
|
|
||||||
},
|
|
||||||
pageData() {//加载分页数据
|
pageData() {//加载分页数据
|
||||||
sublime.showLoadingbar();//显示loading
|
sublime.showLoadingbar();//显示loading
|
||||||
this.tabLoading = true
|
this.tabLoading = true
|
||||||
@@ -610,7 +979,7 @@ layout("/layouts/platform.html"){
|
|||||||
this.treeData = data
|
this.treeData = data
|
||||||
} else {
|
} else {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: data.msg,
|
message: msg,
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -621,48 +990,80 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
doUserSearch() {
|
secondaryDataSearch() {
|
||||||
this.tabKey = new Date().getTime()
|
this.tabKey = new Date().getTime()
|
||||||
this.userPageForm.pageNumber = 1
|
this.secondaryPageForm.pageNumber = 1
|
||||||
this.userPageData()
|
this.secondaryPageData()
|
||||||
},
|
},
|
||||||
userPageOrder(column) {
|
async secondaryPageData() {
|
||||||
this.userPageForm.pageOrderName = column.prop;
|
sublime.showLoadingbar()
|
||||||
this.userPageForm.pageOrderBy = column.order;
|
let resp = null
|
||||||
this.userPageData();
|
if (this.secondaryTabActiveName === 'thirdLevelUnit') {
|
||||||
},
|
if (!['name', 'unitcode'].includes(this.secondaryPageForm.searchName)) {
|
||||||
userPageNumberChange(val) {
|
this.secondaryPageForm.searchName = 'name'
|
||||||
this.userPageForm.pageNumber = val;
|
}
|
||||||
this.userPageData();
|
this.secondaryPageForm.parentId = this.checkData.id
|
||||||
},
|
resp = await $.post(loc() + "/pageData", this.secondaryPageForm)
|
||||||
userPageSizeChange(val) {
|
} else if (['unitPersonnel'].includes(this.secondaryTabActiveName)) {
|
||||||
this.userPageForm.pageSize = val;
|
if (!['username', 'loginname'].includes(this.secondaryPageForm.searchName)) {
|
||||||
this.userPageData();
|
this.secondaryPageForm.searchName = 'username'
|
||||||
|
}
|
||||||
|
this.secondaryPageForm.unitId = this.checkData.id
|
||||||
|
resp = await $.post(loc() + "/findPersonByUnitId", this.secondaryPageForm)
|
||||||
|
} else if (['unitLeader', 'unitSchoolLeader'].includes(this.secondaryTabActiveName)) {
|
||||||
|
if (!['username', 'loginname'].includes(this.secondaryPageForm.searchName)) {
|
||||||
|
this.secondaryPageForm.searchName = 'username'
|
||||||
|
}
|
||||||
|
this.secondaryPageForm.unitId = this.checkData.id
|
||||||
|
this.secondaryPageForm.type = this.secondaryTabActiveName === 'unitSchoolLeader' ? 1 : 2
|
||||||
|
resp = await $.post(loc() + "/findProposalPersonByUnitId", this.secondaryPageForm)
|
||||||
|
} else if (['unitDwsj'].includes(this.secondaryTabActiveName)) {
|
||||||
|
this.secondaryPageForm.unitId = this.checkData.id
|
||||||
|
this.secondaryPageForm.type = this.secondaryTabActiveName
|
||||||
|
resp = await $.post(loc() + "/otherRoleUserPageData", this.secondaryPageForm)
|
||||||
|
}
|
||||||
|
sublime.closeLoadingbar()
|
||||||
|
if (resp.code === 0) {
|
||||||
|
const data = resp.data
|
||||||
|
if (this.secondaryTabActiveName === 'unitPersonnel') {
|
||||||
|
this.secondaryTableData = data.userList.list
|
||||||
|
this.secondaryPageForm.totalCount = data.userList.totalCount
|
||||||
|
} else if (this.secondaryTabActiveName === 'thirdLevelUnit') {
|
||||||
|
this.secondaryTableData = data.list
|
||||||
|
this.secondaryPageForm.totalCount = data.totalCount
|
||||||
|
} else if (['unitLeader', 'unitSchoolLeader'].includes(this.secondaryTabActiveName)) {
|
||||||
|
this.secondaryTableData = data.list
|
||||||
|
this.secondaryPageForm.totalCount = data.totalCount
|
||||||
|
} else if (['unitDwsj'].includes(this.secondaryTabActiveName)) {
|
||||||
|
this.secondaryTableData = data.list
|
||||||
|
this.secondaryPageForm.totalCount = data.totalCount
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$notify.warning(resp.msg)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async userPageData() {
|
async thirdPageData() {
|
||||||
sublime.showLoadingbar();
|
sublime.showLoadingbar()
|
||||||
this.userPageForm.unitId = this.checkData.id
|
this.thirdPageForm.threeUnitId = this.checkData.id
|
||||||
|
const resp = await $.post(loc() + "/findPersonByUnitId", this.thirdPageForm)
|
||||||
const resp = await $.post(loc() + "/findPersonByUnitId", this.userPageForm)
|
sublime.closeLoadingbar()
|
||||||
|
if (resp.code === 0) {
|
||||||
requestLaterFun(resp, (data) => {
|
const data = resp.data
|
||||||
if (this.activeName1 === 'first') {
|
if (this.thirdTabActiveName === 'unitPersonnel') {
|
||||||
this.userTableData = data.userList.list
|
this.thirdTableData = data.userList.list
|
||||||
this.userPageForm.totalCount = data.userList.totalCount;
|
this.thirdPageForm.totalCount = data.userList.totalCount
|
||||||
|
} else if (this.thirdTabActiveName === 'unitLeader') {
|
||||||
|
this.thirdTableData = data.principal
|
||||||
|
this.thirdPageForm.totalCount = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.userTableData = data.principal
|
this.$notify.warning(resp.msg)
|
||||||
this.userPageForm.totalCount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}, () => {
|
|
||||||
this.$notify.error({title: '错误', message: '操作失败'});
|
|
||||||
}, () => {
|
|
||||||
sublime.closeLoadingbar();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
this.loadTree(true)
|
this.loadTree(true)
|
||||||
|
this.schoolLeaderUnitCode = '${config.schoolLeaderUnitCode!}'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ layout("/layouts/platform.html"){
|
|||||||
<el-form-item class="is-required" label="基层工会简况"
|
<el-form-item class="is-required" label="基层工会简况"
|
||||||
prop="basicInformation">
|
prop="basicInformation">
|
||||||
<text-editor v-model="formData.basicInformation"></text-editor>
|
<text-editor v-model="formData.basicInformation"></text-editor>
|
||||||
|
<div style="text-align: right">
|
||||||
|
<span style="color: #0a84ff">当前字数:{{ formData.basicInformation ? (dd3s.html2txt(formData.basicInformation).length) : 0 }}</span>
|
||||||
|
<span>{{ ';最多500字' }}</span>
|
||||||
|
</div>
|
||||||
<!-- <el-input type="textarea" v-model="formData.basicInformation" maxlength="500" show-word-limit :rows="10"></el-input>-->
|
<!-- <el-input type="textarea" v-model="formData.basicInformation" maxlength="500" show-word-limit :rows="10"></el-input>-->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ layout("/layouts/platform.html"){
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="150px">
|
<el-table-column align="center" header-align="center" label="操作" fixed="right" width="150px">
|
||||||
<template scope="{row}">
|
<template scope="{row}">
|
||||||
<el-button @click="openView(row)" v-if="![8120].includes(row.state) && row.state" size="mini" type="primary">查看</el-button>
|
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||||
<el-button @click="openAudit(row)" v-if="[8120].includes(row.state) || !row.state" size="mini" type="primary">审核</el-button>
|
<el-button @click="openAudit(row)" v-if="[8120].includes(row.state) || !row.state" size="mini" type="primary">审核</el-button>
|
||||||
<el-button @click="doRollBack(row.id)" v-if="[8125,8130].includes(row.state) || !row.state" size="mini" type="danger">撤回</el-button>
|
<el-button @click="doRollBack(row.id)" v-if="[8125,8130].includes(row.state) || !row.state" size="mini" type="danger">撤回</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -81,8 +81,12 @@ layout("/layouts/platform.html"){
|
|||||||
width="240px" fixed="right">
|
width="240px" fixed="right">
|
||||||
<template scope="{row}">
|
<template scope="{row}">
|
||||||
<el-button size="mini" @click="openView(row)">查看</el-button>
|
<el-button size="mini" @click="openView(row)">查看</el-button>
|
||||||
<el-tooltip :content="canDownload ? ('导出【'+ row.unionName +'】管理员自我评议的评议结果') : ('导出【'+ row.unionName +'】下所有评议结果的压缩包') " placement="top">
|
<el-tooltip
|
||||||
<el-button v-if="canDownload" size="mini" type="primary" @click="doDownLoad(row,canDownload)">导出</el-button>
|
:content="canDownload ? ('导出【'+ row.unionName +'】管理员自我评议的评议结果') : ('导出【'+ row.unionName +'】下所有评议结果的压缩包') "
|
||||||
|
placement="top">
|
||||||
|
<el-button v-if="canDownload" size="mini" type="primary"
|
||||||
|
@click="doDownLoad(row,canDownload)">导出
|
||||||
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-button size="mini" type="primary" @click="downloadFilesByUnion(row)">导出附件</el-button>
|
<el-button size="mini" type="primary" @click="downloadFilesByUnion(row)">导出附件</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -155,9 +159,10 @@ layout("/layouts/platform.html"){
|
|||||||
<el-table-column prop="userOnline" align="center" header-align="center"
|
<el-table-column prop="userOnline" align="center" header-align="center"
|
||||||
label="操作" width="240px" fixed="right">
|
label="操作" width="240px" fixed="right">
|
||||||
<template scope="{row}">
|
<template scope="{row}">
|
||||||
<el-button plain size="mini" @click="openUserView(row)">查看</el-button>
|
<el-button size="mini" @click="openUserView(row)">查看</el-button>
|
||||||
<el-button plain size="mini" type="primary" @click="downloadByPeoId(row)">导出</el-button>
|
<el-button size="mini" type="primary" @click="downloadByPeoId(row)">导出</el-button>
|
||||||
<el-button plain size="mini" type="primary" @click="downloadFilesByPeoId(row)">导出附件</el-button>
|
<el-button size="mini" type="primary" @click="downloadFilesByPeoId(row)">导出附件
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -247,14 +252,36 @@ layout("/layouts/platform.html"){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
downloadFilesByUnion(row) {
|
downloadFilesByUnion(row) {
|
||||||
|
const result = this.validateHasFiles({unionId: row.id, zbId: this.pageForm.zbId})
|
||||||
|
if (!result) {
|
||||||
|
return
|
||||||
|
}
|
||||||
window.open(loc() + '/exportFilesByUnionId?zbId=' + this.pageForm.zbId + '&unionId=' + row.id)
|
window.open(loc() + '/exportFilesByUnionId?zbId=' + this.pageForm.zbId + '&unionId=' + row.id)
|
||||||
},
|
},
|
||||||
downloadByPeoId(row) {
|
downloadByPeoId(row) {
|
||||||
window.open(loc() + '/exportByPeoId?peoId=' + row.id)
|
window.open(loc() + '/exportByPeoId?peoId=' + row.id)
|
||||||
},
|
},
|
||||||
downloadFilesByPeoId(){
|
downloadFilesByPeoId(row) {
|
||||||
|
const result = this.validateHasFiles({peoId: row.id})
|
||||||
|
if (!result) {
|
||||||
|
return
|
||||||
|
}
|
||||||
window.open(loc() + '/exportFilesByPeoId?peoId=' + row.id)
|
window.open(loc() + '/exportFilesByPeoId?peoId=' + row.id)
|
||||||
},
|
},
|
||||||
|
validateHasFiles(data) {
|
||||||
|
$.post('/platform/wakeshome/review/statistics/validateHasFiles', {
|
||||||
|
peoId: data.peoId ? data.peoId : '',
|
||||||
|
zbId: data.zbId ? data.zbId : '',
|
||||||
|
unionId: data.unionId ? data.unionId : ''
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
this.$message.warning("未上传附件,无法导出")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
async getReviewResultNum(row) {
|
async getReviewResultNum(row) {
|
||||||
const res = await $.post(loc() + "/getReviewResultNum", {
|
const res = await $.post(loc() + "/getReviewResultNum", {
|
||||||
zbId: this.userPageForm.zbId,
|
zbId: this.userPageForm.zbId,
|
||||||
|
|||||||
Reference in New Issue
Block a user