Compare commits

..
10 Commits
Author SHA1 Message Date
c-chenxs1 8d584b66f7 fix: 来源:客户反馈 #69
孙飙已退休,我后台也已设置为非会员,系统里已看不到他了。可是这次“福享生活”后台勾选时,运动健康学院系统操作员魏震在勾选人员名单时,全选了,然后把孙飙也选上了。我这看不到,他那怎么会看到的呢?请修复Bug.
2026-10-27 15:42:53 +08:00
c-duxc1 a20c632093 慰问申请-校工会办公室审核:PC 进入审核时自动识别并清除 [object Object] 等异常签字缓存(localStorage.getItem('signature')),重新生成签字二维码; 2026-10-26 16:40:44 +08:00
c-duxc1 443e76e7a1 Merge remote-tracking branch 'origin/main' 2026-10-23 10:24:16 +08:00
c-duxc1 d24fba03da 慰问申请-校工会办公室审核:普通系统管理员不参与校工会办公室审核,超级管理员账号保留兜底权限;修复手机端首页‘我的待办’不显示‘校工会办公室审核’的待办提醒(慰问申请分工会审核未做兼容,保持手机端不显示待办提醒); 2026-10-23 10:22:45 +08:00
c-duxc1 16ea56524e 慰问申请-校工会办公室审核:普通系统管理员不参与校工会办公室审核,超级管理员账号保留兜底权限;修复手机端首页‘我都待办’不显示慰问审核提醒; 2026-10-23 09:56:09 +08:00
c-duxc1 3b5cde7bb1 慰问申请-校工会办公室审核:仅用新增的“校工会办公室审核员”来审核,移除校工会管理员角色的手机端审核权限(保留pc端不验证角色和系统管理员的审核权限)。 2026-10-23 08:56:08 +08:00
c-duxc1 f0cd566d31 慰问申请板块,1.“校工会审核”改名“校工会办公室审核”并且审核角色也改成新增的“校工会办公室审核员”来审核。2.在审批意见时不需要手写同意、不同意,改成勾选项。 2026-10-22 16:12:45 +08:00
c-duxc1 b2ffc17032 爱心帮扶-职工慰问-分工会审核(手机端):
1.superadmin(工号):查看并审核全部分工会数据;
2.gh01(分工会主席角色)、sp01(职工慰问审批员):只能查看并审核自己分工会的数据;
3.sysadmin(角色):不再自动拥有分工会审核权限。
2026-10-12 17:31:16 +08:00
c-duxc1 2b72da43f4 爱心帮扶-职工慰问-分工会审核:关闭系统管理员看所有申请的权限,保留superadmin工号的查看所有申请权限; 2026-10-09 20:38:59 +08:00
c-duxc1 2e83b7b90c 爱心帮扶-职工慰问-慰问申请:修复分工会主席工号可以无法写入待办 assignments字段(sql查询结果集没回调函数,导致查询结果永远是空); 2026-10-09 20:16:51 +08:00
16 changed files with 368 additions and 104 deletions
@@ -190,6 +190,11 @@ public interface Roles {
*/
String XGHKJ = "4f72d9259837486a8092c19897fa9dd6";
/**
* 校工会办公室审核员
*/
String CONDOLENCE_OFFICE = "c8d7e6f5a4b34c2291d0e8f7a6b5c4d3";
/**
* 校工会管理员
*/
@@ -186,14 +186,24 @@ public class MainPageNeedItemsController {
//查询数据库中的待办事项
List<NeedItems> needItemsList = dao.queryByJoin(NeedItems.class, "^needItemsSource$", Cnd.NEW());
// 普通系统管理员不参与校工会办公室审核,超级管理员账号保留兜底权限。
boolean superadmin = "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"));
if (!superadmin && ShiroUtil.hasRole("sysadmin") && !ShiroUtil.hasRole("condolence_office")) {
needItemsList.removeIf(item -> ("condolence".equals(item.getQueryTable())
&& "state_id".equals(item.getQueryColumn())
&& Integer.valueOf(2020).equals(item.getStateId()))
|| "/platform/fw/condolence/vcr".equals(item.getHref())
|| "/platform/fw/condolence/vcr/school".equals(item.getHref()));
}
//根据当前登录用户的角色查询可以看到哪些菜单
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasRole("sysadmin")) {
if (!superadmin && !ShiroUtil.hasRole("sysadmin")) {
Sql sql = Sqls.create("""
select menuId from sys_role_menu where roleId in (select roleId from sys_user_role where userId = @userId)
""").setParam("userId", ShiroUtil.getPlatformUid());
List<NutMap> menuIds = baseService.listMap(sql);
List<String> menuId = menuIds.stream().map(o -> o.getString("menuId")).collect(Collectors.toList());
List<String> menuId = menuIds.stream().map(o -> o.getString("menuid")).collect(Collectors.toList());
cnd.and("id", "in", menuId);
}
List<Sys_menu> menus = dao.query(Sys_menu.class, cnd);
@@ -1,5 +1,6 @@
package io.v.nutz.mobile.condolence;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
@@ -44,6 +45,9 @@ public class CondolenceAuditControll {
@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) {
if (!hasAuditPermission()) {
return Result.error("您没有慰问审核权限!");
}
Sql sql = Sqls.create("""
SELECT
con.*,
@@ -65,20 +69,28 @@ public class CondolenceAuditControll {
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
if (!"superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"))) {
SqlExpressionGroup group = new SqlExpressionGroup();
if (ShiroUtil.hasAnyRoles("A06")) {
group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2020).or("con.state_id", isAudit ? ">" : "=", 2000));
// cnd.and("con.state_id", isAudit ? ">" : "=", 2020);
boolean hasAuditRole = false;
if (ShiroUtil.hasAnyRoles("gh01,sp01")) {
group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2000)
.and("sqr.unionid", "=", Vi.getUnionId()));
hasAuditRole = true;
}
if (ShiroUtil.hasAnyRoles("H04")) {
group.and("con.state_id", isAudit ? ">" : "=", 2000);
group.and("be.unionid", "=", Vi.getUnionId());
if (ShiroUtil.hasAnyRoles("condolence_office")) {
group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2020));
hasAuditRole = true;
}
if (ShiroUtil.hasAnyRoles("xghkj")) {
group.and("con.state_id", isAudit ? ">" : "=", 2012);
group.or(Cnd.exps("con.state_id", isAudit ? ">" : "=", 2012));
hasAuditRole = true;
}
if (hasAuditRole) {
cnd.and(group);
} else {
// 非慰问审核角色不允许查看手机端慰问审核数据。
cnd.and("1", "=", 0);
}
cnd.and(group);
} else {
cnd.and("con.state_id", "in", isAudit ? "1990,2010,2014,2030,2040" : "2000,2012,2020");
}
@@ -104,15 +116,24 @@ public class CondolenceAuditControll {
return condolenceService.listPage(pageNumber, pageSize, sql);
}
/**
* 校验手机端慰问审核权限,超级管理员账号保留兜底权限。
*/
private boolean hasAuditPermission() {
return "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"))
|| ShiroUtil.hasAnyRoles("gh01,sp01,condolence_office,xghkj");
}
@At("/auditHtml")
@Ok("re")
public String auditHtml(Integer state_id) {
if (state_id == 2000 && ShiroUtil.hasAnyRoles("H04,A06,sysadmin")) {
boolean superadmin = "superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"));
if (state_id == 2000 && (superadmin || ShiroUtil.hasAnyRoles("gh01,sp01"))) {
return "beetl:/mobile/condolence/union_Audit.html";
} else if (state_id == 2012 && ShiroUtil.hasAnyRoles("gh03,xghkj,sysadmin")) {
} else if (state_id == 2012 && (superadmin || ShiroUtil.hasAnyRoles("gh03,xghkj"))) {
return "beetl:/mobile/condolence/fr_Audit.html";
} else if (state_id == 2020 && ShiroUtil.hasAnyRoles("A06,sysadmin")) {
} else if (state_id == 2020 && (superadmin || ShiroUtil.hasAnyRoles("condolence_office"))) {
return "beetl:/mobile/condolence/school_Audit.html";
}
return "beetl:/mobile/condolence/apply_info.html";
@@ -92,10 +92,12 @@ public class WelfareMemberEscalationController {
Cnd cnd = Cnd.NEW();
cnd.and("unionId", "=", Vi.getUnionId());
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.and("member","=",1);
seg.or(Cnd.exps("userState","=","退休").and(Cnd.exps("retiredTime",">=","2024-06-01").and("retiredTime","<","2024-12-30")));
cnd.and(seg);
// SqlExpressionGroup seg = new SqlExpressionGroup();
// seg.and("member","=",1);
// seg.or(Cnd.exps("userState","=","退休").and(Cnd.exps("retiredTime",">=","2024-06-01").and("retiredTime","<","2024-12-30")));
// cnd.and(seg);
cnd.and("member", "=", 1);
cnd.asc("userState").asc("unitname").asc("unionname");
// cnd.and("userState", "=", "在职");
@@ -55,7 +55,7 @@ public class CondolenceAgentController {
result.add(new NutMap().setv("title", title).setv("url", UCR).setv("iconClass", vi.getIconByPath(UCR)).setv("label", "待院级工会审核").setv("number", getUcrCount()));
result.add(new NutMap().setv("title", title).setv("url", FR).setv("iconClass", vi.getIconByPath(FR)).setv("label", "待二级党组织审核").setv("number", getFrCount()));
result.add(new NutMap().setv("title", title).setv("url", VCR).setv("iconClass", vi.getIconByPath(VCR)).setv("label", "待校工会审核").setv("number", getVcrCount()));
result.add(new NutMap().setv("title", title).setv("url", VCR).setv("iconClass", vi.getIconByPath(VCR)).setv("label", "待校工会办公室审核").setv("number", getVcrCount()));
result.add(new NutMap().setv("title", title).setv("url", ECR).setv("iconClass", vi.getIconByPath(ECR)).setv("label", "待工会常务副主席审核").setv("number", getEcrCount()));
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
List<Sys_menu> menus = Optional.ofNullable(user).orElse(new Sys_user()).getMenus();
@@ -92,7 +92,7 @@ public class CondolenceAgentController {
}
/**
* 待校工会主席审核
* 待校工会办公室审核
*
* @return
*/
@@ -1,5 +1,6 @@
package io.v.nutz.zgfw.controller.condolence;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
@@ -89,8 +90,13 @@ public class CondolenceUcrCon {
cnd.and("con.state_id", isAudit ? ">" : "=", 2000);
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
cnd.and("sqr.unionid", "=", vi.getUnionId());
if (!"superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"))) {
if (ShiroUtil.hasAnyRoles("gh01,sp01")) {
cnd.and("sqr.unionid", "=", vi.getUnionId());
} else {
// 非分工会主席、职工慰问审批员角色(包括sysadmin)不允许查看分工会审核数据。
cnd.and("1", "=", 0);
}
}
Vi.cndPlus(cnd, "YEAR(con.apply_time)", "=", year);
@@ -125,6 +131,10 @@ public class CondolenceUcrCon {
@ViReturn
@RequiresPermissions("fw.condolence.ucr")
public Object doEdit(String id) {
Condolence condolence = condolenceService.fetch(id);
if (!hasReviewPermission(condolence)) {
return Result.error("您没有分工会审核权限!");
}
condolenceService.update(Chain.make("state_id", 2000), Cnd.where("id", "=", id));
return null;
}
@@ -133,11 +143,14 @@ public class CondolenceUcrCon {
@ViReturn
@RequiresPermissions("fw.condolence.ucr")
public Object doReview(String id, Integer pass, Review review) {
Condolence condolence = condolenceService.fetch(id);
if (!hasReviewPermission(condolence)) {
return Result.error("您没有分工会审核权限!");
}
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
review.setTime(DateUtil.getDate());
review = reviewService.insert(review);
Condolence condolence = condolenceService.fetch(id);
condolence.setUnion_chairman_review(review.getId());
if (pass == 1) {
condolence.setState_id("2010");
@@ -167,5 +180,21 @@ public class CondolenceUcrCon {
return null;
}
/**
* 校验分工会审核权限:superadmin可审核全部,分工会主席和职工慰问审批员只能审核本分工会数据。
*/
private boolean hasReviewPermission(Condolence condolence) {
if ("superadmin".equals(ShiroUtil.getPrincipalProperty("loginname"))) {
return true;
}
if (condolence == null || !ShiroUtil.hasAnyRoles("gh01,sp01")) {
return false;
}
Sql sql = Sqls.fetchString(Sqls.create("select unionid from `user` where id = @id")
.setParam("id", condolence.getManager()).toString());
condolenceService.dao().execute(sql);
return vi.getUnionId().equals(sql.getString());
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.zgfw.controller.condolence;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.Vi;
@@ -17,6 +18,7 @@ import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@@ -25,7 +27,7 @@ import org.nutz.mvc.annotation.Param;
/**
* @Author: 1V
* @DateTime: 2020/11/20 11:49
* @Description: 校工会审核
* @Description: 校工会办公室审核
*/
@At({"/platform/fw/condolence/vcr","/platform/fw/condolence/vcr/school"})
@IocBean
@@ -112,9 +114,19 @@ public class CondolenceVcrCon {
@ViReturn
@RequiresPermissions("fw.condolence.vcr")
public Object doReview(String id, Integer pass, Review review) {
if (!Integer.valueOf(1).equals(pass) && !Integer.valueOf(2).equals(pass)
&& !Integer.valueOf(3).equals(pass)) {
return Result.error("请选择审批意见!");
}
String sign = review == null ? null : review.getSign();
if (Strings.isBlank(sign) || !sign.startsWith("data:image/") || !sign.contains(";base64,")) {
return Result.error("签字数据异常,请重新签字!");
}
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
review.setTime(DateUtil.getDate());
review.setOpinion(Integer.valueOf(3).equals(pass) ? "同意"
: Integer.valueOf(1).equals(pass) ? "不同意" : "返回修改");
review = reviewService.insert(review);
Condolence condolence = condolenceService.fetch(id);
condolence.setVice_chairman_review(review.getId());
@@ -1,6 +1,7 @@
package io.v.nutz.zgfw.handler.condolence;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.util.ViResource;
import io.v.nutz.web.commons.utils.ShiroUtil;
@@ -11,7 +12,6 @@ import lombok.Getter;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.List;
@@ -32,7 +32,7 @@ public enum CondolenceMsgHandler {
u.username,
u.unionname,
u.loginname,
type.`name` as typeName
type.`name` as typename
FROM
condolence c
LEFT JOIN `user` u ON u.id = c.manager
@@ -42,9 +42,8 @@ public enum CondolenceMsgHandler {
sql.setParam("id", id);
NutMap nutMap = condolenceService.fetch(sql);
String msg = "您好!" + nutMap.getString("unionname") + "的" + nutMap.getString("username") + "申请的"
+ nutMap.getString("typeName") + "慰问已经提交,请您登录到智慧工会系统职工服务>职工慰问下进行审核。";
List<String> schoolLoginNames = Lang.list("1996070092", "1987010012");
for (String loginname : schoolLoginNames) {
+ nutMap.getString("typename") + "慰问已经提交,请您登录到智慧工会系统职工服务>职工慰问下进行审核。";
for (String loginname : getRoleLoginNames(Roles.CONDOLENCE_OFFICE)) {
msgApi.sendMsg(loginname, msg);
}
} else {
@@ -83,7 +82,7 @@ public enum CondolenceMsgHandler {
u.username,
u.unionname,
u.loginname,
type.`name` as typeName
type.`name` as typename
FROM
condolence c
LEFT JOIN `user` u ON u.id = c.manager
@@ -93,9 +92,8 @@ public enum CondolenceMsgHandler {
sql.setParam("id", id);
NutMap nutMap = condolenceService.fetch(sql);
String msg = "您好!" + nutMap.getString("unionname") + "的" + nutMap.getString("username") + "申请的"
+ nutMap.getString("typeName") + "慰问分工会主席已经审批通过,请您登录到智慧工会系统职工服务>职工慰问下进行审核。";
List<String> schoolLoginNames = Lang.list("1986110082", "1996070092", "1987010012");
for (String loginname : schoolLoginNames) {
+ nutMap.getString("typename") + "慰问分工会主席已经审批通过,请您登录到智慧工会系统职工服务>职工慰问下进行审核。";
for (String loginname : getRoleLoginNames(Roles.CONDOLENCE_OFFICE)) {
msgApi.sendMsg(loginname, msg);
}
}
@@ -112,7 +110,7 @@ public enum CondolenceMsgHandler {
u.username,
u.unionname,
u.loginname,
type.`name` as typeName
type.`name` as typename
FROM
condolence c
LEFT JOIN `user` u ON u.id = c.manager
@@ -126,7 +124,7 @@ public enum CondolenceMsgHandler {
if (opinion == null) {
opinion = "";
}
String msg = "您好!您申请的" + nutMap.getString("typeName") + "慰问分工会主席拒绝了您的申请,拒绝理由:" +
String msg = "您好!您申请的" + nutMap.getString("typename") + "慰问分工会主席拒绝了您的申请,拒绝理由:" +
opinion + "请您登录到智慧工会系统重新修改提交!";
msgApi.sendMsg(nutMap.getString("loginname"), msg);
System.out.println(msg);
@@ -144,7 +142,7 @@ public enum CondolenceMsgHandler {
u.username,
u.unionname,
u.loginname,
type.`name` as typeName,
type.`name` as typename,
c.way
FROM
condolence c
@@ -154,7 +152,7 @@ public enum CondolenceMsgHandler {
""");
sql.setParam("id", id);
NutMap nutMap = condolenceService.fetch(sql);
String msg = "您好!您申请的" + nutMap.getString("typeName") + "的慰问校工会已经审批通过!";
String msg = "您好!您申请的" + nutMap.getString("typename") + "的慰问校工会办公室已经审批通过!";
// 慰问品审核通过后,提醒申请人等待礼品备好并按短信通知领取。
if ("慰问品 (C)".equals(nutMap.getString("way"))) {
msg += "礼品备好后会发短信通知您前来领取。";
@@ -175,7 +173,7 @@ public enum CondolenceMsgHandler {
u.username,
u.unionname,
u.loginname,
type.`name` as typeName
type.`name` as typename
FROM
condolence c
LEFT JOIN `user` u ON u.id = c.manager
@@ -184,7 +182,7 @@ public enum CondolenceMsgHandler {
""");
sql.setParam("id", id);
NutMap nutMap = condolenceService.fetch(sql);
String msg = "您好!您申请的" + nutMap.getString("typeName") + "的慰问校工会审批拒绝了,请您登录智慧工会系统查看详情!";
String msg = "您好!您申请的" + nutMap.getString("typename") + "的慰问校工会办公室审批拒绝了,请您登录智慧工会系统查看详情!";
String loginname = nutMap.getString("loginname");
msgApi.sendMsg(loginname, msg);
}
@@ -192,6 +190,26 @@ public enum CondolenceMsgHandler {
public abstract void exec(String id, NutMap extra);
/**
* 查询指定角色下的用户工号。
*/
public List<String> getRoleLoginNames(String roleId) {
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN `user` u ON u.id = sur.userid
WHERE
sur.roleId = @roleId
GROUP BY
sur.userId
""").setParam("roleId", roleId);
sql.setCallback(Sqls.callback.strs());
dao.execute(sql);
return sql.getList(String.class);
}
public Dao dao = ViResource.dao;
public MsgApi msgApi = ViResource.ioc.get(MsgApi.class);
public CondolenceService condolenceService = ViResource.ioc.get(CondolenceServiceImpl.class);
@@ -14,7 +14,6 @@ import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.lang.Lang;
import org.nutz.lang.util.NutMap;
import java.util.List;
@@ -100,7 +99,7 @@ public enum CondolenceToDoHandler {
GROUP BY
sur.userId
""").setParam("roleId", Roles.UNION_MANGER).setParam("userId", condolence.getManager());
Sqls.queryString(sql.toString());
sql.setCallback(Sqls.callback.strs());
dao.execute(sql);
List<String> loginNames = sql.getList(String.class);
localProcessService.createTask(
@@ -135,16 +134,29 @@ public enum CondolenceToDoHandler {
},
/**
* 创建校工会任务
* 创建校工会办公室审核任务
*/
CREATE_SCHOOL_TASK() {
@Override
public void exec(Condolence condolence, String option) {
List<String> schoolLoginNames = Lang.list("1996070092", "1987010012");
Sql sql = Sqls.create("""
SELECT
u.loginname
FROM
sys_user_role sur
LEFT JOIN `user` u ON u.id = sur.userid
WHERE
sur.roleId = @roleId
GROUP BY
sur.userId
""").setParam("roleId", Roles.CONDOLENCE_OFFICE);
sql.setCallback(Sqls.callback.strs());
dao.execute(sql);
List<String> schoolLoginNames = sql.getList(String.class);
localProcessService.createTask(
"condolence@" + condolence.getId(),
"vice_chairman_review",
"校工会审核",
"校工会办公室审核",
(String) ShiroUtil.getPrincipalProperty("id"),
schoolLoginNames,
"/platform/fw/condolence/vcr/school",
@@ -153,12 +165,12 @@ public enum CondolenceToDoHandler {
"/platform/fw/condolence/vcr/school"
);
localProcessService.updateProcessNodeName("condolence@" + condolence.getId(), "校工会审核");
localProcessService.updateProcessNodeName("condolence@" + condolence.getId(), "校工会办公室审核");
}
},
/**
* 校工会完成
* 校工会办公室审核完成
*/
COMPLETE_SCHOOL_TASK() {
@Override
@@ -0,0 +1,143 @@
-- 慰问申请:将原校工会审核改名为校工会办公室审核,并创建独立审核角色
-- 执行环境:MySQL
SET @condolence_office_role_fixed_id := 'c8d7e6f5a4b34c2291d0e8f7a6b5c4d3';
-- 创建校工会办公室审核员角色。
INSERT INTO `sys_role`
(`id`, `name`, `code`, `aliasName`, `disabled`, `unitid`, `system_name`, `note`, `serialNumber`,
`createdBy`, `createdAt`, `updatedBy`, `updatedAt`, `delFlag`)
SELECT
@condolence_office_role_fixed_id,
'校工会办公室审核员',
'condolence_office',
'CondolenceOfficeReviewer',
0,
'',
'',
'负责慰问申请的校工会办公室审核',
(SELECT IFNULL(MAX(r.`serialNumber`), 0) + 1 FROM (SELECT `serialNumber` FROM `sys_role`) r),
'',
UNIX_TIMESTAMP() * 1000,
'',
UNIX_TIMESTAMP() * 1000,
0
WHERE NOT EXISTS (
SELECT 1 FROM `sys_role` WHERE `code` = 'condolence_office'
);
SET @condolence_office_role_id := (
SELECT `id` FROM `sys_role` WHERE `code` = 'condolence_office' LIMIT 1
);
-- 复用原校工会审核菜单,不增加新的流程菜单。
SET @condolence_office_menu_id := (
SELECT `id`
FROM `sys_menu`
WHERE `permission` = 'fw.condolence.vcr'
OR `href` IN ('/platform/fw/condolence/vcr', '/platform/fw/condolence/vcr/school')
ORDER BY CASE WHEN `permission` = 'fw.condolence.vcr' THEN 1 ELSE 2 END
LIMIT 1
);
UPDATE `sys_menu`
SET `name` = '校工会办公室审核',
`aliasName` = 'CondolenceOfficeReview',
`note` = '慰问申请校工会办公室审核',
`href` = '/platform/fw/condolence/vcr/school',
`showit` = 1,
`disabled` = 0,
`updatedAt` = UNIX_TIMESTAMP() * 1000,
`delFlag` = 0
WHERE `id` = @condolence_office_menu_id;
-- 首页待办按菜单地址精确匹配,同步原待办配置并补充手机端入口。
SET @condolence_office_need_item_id := (
SELECT `id`
FROM `need_items`
WHERE `menuId` = @condolence_office_menu_id
OR `href` IN ('/platform/fw/condolence/vcr', '/platform/fw/condolence/vcr/school')
OR (`queryTable` = 'condolence' AND `queryColumn` = 'state_id' AND `stateId` = 2020)
LIMIT 1
);
SET @condolence_office_need_item_new_id := REPLACE(UUID(), '-', '');
INSERT INTO `need_items`
(`id`, `menuId`, `title`, `name`, `code`, `href`, `mobileHref`, `iconClass`, `color`,
`creatUser`, `creatTime`, `queryTable`, `queryColumn`, `stateId`, `userIdColumn`, `queryType`)
SELECT
@condolence_office_need_item_new_id,
@condolence_office_menu_id,
'【职工慰问】',
'待校工会办公室审核',
'condolence_office',
'/platform/fw/condolence/vcr/school',
'/mobile/condolence/audit',
'',
'',
'',
DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%s'),
'condolence',
'state_id',
2020,
'',
''
WHERE @condolence_office_need_item_id IS NULL
AND @condolence_office_menu_id IS NOT NULL;
SET @condolence_office_need_item_id := COALESCE(
@condolence_office_need_item_id,
@condolence_office_need_item_new_id
);
UPDATE `need_items`
SET `menuId` = @condolence_office_menu_id,
`name` = '待校工会办公室审核',
`href` = '/platform/fw/condolence/vcr/school',
`mobileHref` = '/mobile/condolence/audit',
`queryTable` = 'condolence',
`queryColumn` = 'state_id',
`stateId` = 2020,
`userIdColumn` = '',
`queryType` = ''
WHERE `id` = @condolence_office_need_item_id;
-- 同步原审核节点的状态名称,不新增状态。
UPDATE `state`
SET `state_name` = CASE `state_id`
WHEN 1995 THEN '校工会办公室返回修改'
WHEN 2020 THEN '待校工会办公室审核'
WHEN 2030 THEN '校工会办公室审核不通过'
WHEN 2040 THEN '校工会办公室审核通过'
ELSE `state_name`
END
WHERE `state_id` IN (1995, 2020, 2030, 2040);
-- 给新角色授权原审核菜单及其全部上级菜单,保证菜单树正常显示。
INSERT INTO `sys_role_menu` (`roleId`, `menuId`)
SELECT @condolence_office_role_id, ancestor.`id`
FROM `sys_menu` target
JOIN `sys_menu` ancestor ON target.`path` LIKE CONCAT(ancestor.`path`, '%')
WHERE target.`id` = @condolence_office_menu_id
AND NOT EXISTS (
SELECT 1
FROM `sys_role_menu` rm
WHERE rm.`roleId` = @condolence_office_role_id
AND rm.`menuId` = ancestor.`id`
);
-- 将工号为1986110082、姓名为路海松的人员分配为校工会办公室审核员。
INSERT INTO `sys_user_role` (`userId`, `roleId`)
SELECT u.`id`, @condolence_office_role_id
FROM `sys_user` u
WHERE u.`loginname` = '1986110082'
AND u.`username` = '路海松'
AND NOT EXISTS (
SELECT 1
FROM `sys_user_role` ur
WHERE ur.`userId` = u.`id`
AND ur.`roleId` = @condolence_office_role_id
);
SELECT @condolence_office_role_id AS `roleId`,
@condolence_office_menu_id AS `menuId`;
@@ -316,7 +316,7 @@
</el-form>
</el-tab-pane>
<el-tab-pane label="校工会主席审核信息" name="5" v-if="viewData.vcr">
<el-tab-pane label="校工会办公室审核信息" name="5" v-if="viewData.vcr">
<el-form label-width="130px" label-suffix=":" style="padding: 20px 0">
<vi-title title="审核信息"></vi-title>
<el-row gutter="20">
@@ -91,7 +91,7 @@
<template v-if="viewData.vcr">
<div class="van-cell-group__title mt20">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核信息
校工会办公室审核信息
</div>
</div>
<van-cell-group>
@@ -51,7 +51,7 @@ layout("/mobile/platform.html"){
<van-empty v-if="mLoading==false&&tableData.length==0" class="custom-image"
image="/none.svg"
description="暂无数据">
:description="permissionDenied ? '您没有慰问审核权限' : '暂无数据'">
</van-empty>
@@ -72,6 +72,7 @@ layout("/mobile/platform.html"){
{text: '已审核', value: true},
],
handle: true,
permissionDenied: false,
pageForm: {
year: new Date().getFullYear(),
isAudit: false,
@@ -90,6 +91,11 @@ layout("/mobile/platform.html"){
this.flushUnits()
},
pageData() {
if (this.permissionDenied) {
this.finished = true
this.mLoading = false
return
}
this.mLoading = true
$.get(loc() + '/pageData', this.pageForm, (res) => {
if (res.code === 0) {
@@ -99,14 +105,18 @@ layout("/mobile/platform.html"){
} else {
this.pageForm.pageNumber++
}
} else {
this.permissionDenied = true
this.finished = true
vant.Toast(res.msg || '您没有慰问审核权限!')
}
this.mLoading = false
})
this.mLoading = false
},
async flushUnits() {
//this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
if ("${@shiro.getPrincipalProperty('loginname')}" === 'superadmin' ||
"${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
await mCommon.getUnitList(this.pageForm.unionId)
} else {
await mCommon.getUnitList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
@@ -7,11 +7,11 @@ layout("/mobile/platform.html"){
@click-left="history.back()"></van-nav-bar>
<condolence-info ref="info" :id.sync="id" title="校工会审核" :handle="handle">
<condolence-info ref="info" :id.sync="id" title="校工会办公室审核" :handle="handle">
<template #handle>
<div class="van-cell-group__title mt10">
<div class="van-sidebar-item van-sidebar-item--select">
校工会审核
校工会办公室审核
</div>
</div>
<van-form>
@@ -26,15 +26,14 @@ layout("/mobile/platform.html"){
<van-field v-model="formData.time" label="审核时间" left-icon="clock-o"
readonly></van-field>
<van-field v-model="formData.opinion"
rows="1"
required
left-icon="chat-o"
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<van-field label="审批意见" required>
<template #input>
<van-radio-group v-model="formData.pass" direction="horizontal">
<van-radio :name="3" shape="square">同意</van-radio>
<van-radio :name="1" shape="square">不同意</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="签字" required style="flex-flow: column">
<template #label>
@@ -47,17 +46,12 @@ layout("/mobile/platform.html"){
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8">
<van-button :color="themeColor" plain block @click="doAudit(1)">拒 绝
</van-button>
</van-col>
<van-col span="8">
<van-col span="12">
<van-button color="red" block plain @click="doAudit(2)">返回修改
</van-button>
</van-col>
<van-col span="8">
<van-button :color="themeColor" block @click="doAudit(3)">通 过
<van-col span="12">
<van-button :color="themeColor" block @click="doAudit">提交
</van-button>
</van-col>
</van-row>
@@ -89,8 +83,11 @@ layout("/mobile/platform.html"){
methods: {
async doAudit(pass) {
if (!this.formData.opinion) {
this.$toast.fail('请填写审核意见');
if (pass === 2) {
this.formData.pass = pass
}
if (this.formData.pass === null) {
this.$toast.fail('请选择审批意见');
return
}
// 审核签字由独立画布维护,不能只依赖 van-field 的 required 属性。
@@ -104,9 +101,9 @@ layout("/mobile/platform.html"){
return
}*/
await this.$refs.signature.updateSign()
this.formData.pass = pass
const resp = await $.post("/platform/fw/condolence/vcr/doReview", this.formData)
if (resp.code === 0) {
await doCompletes();
this.$toast.success('审核成功');
setTimeout(() => {
history.back()
@@ -122,7 +119,7 @@ layout("/mobile/platform.html"){
id: this.id,
username: "${@shiro.getPrincipalProperty('username')}",
time: moment().format('YYYY-MM-DD'),
opinion: null,
pass: null,
sign: ""
}
}
@@ -23,7 +23,7 @@ layout("/layouts/platform.html"){
<span slot="label">
校工会直接慰问
<el-tooltip class="item" effect="dark"
content="直接慰问,由校工会直接慰问,无需经过分工会审核,直接由校工会主席审核。"
content="直接慰问,由校工会直接慰问,无需经过分工会审核,直接由校工会办公室审核。"
placement="top-start">
<i class="el-icon-question"></i>
</el-tooltip>
@@ -405,7 +405,7 @@ layout("/layouts/platform.html"){
occur_time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
jtzz: [{required: true, message: '必填', trigger: ['blur', 'change']}],
poszdw: [{required: true, message: '必填', trigger: ['blur', 'change']}],
files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// files: [{required: true, message: '必填', trigger: ['blur', 'change']}],
goods_desc: [{required: true, message: '请输入慰问品名称、编号、规格等', trigger: ['blur', 'change']}],
mobile: [
{required: true, message: '请输入慰问对象联系电话', trigger: ['blur', 'change']},
@@ -414,7 +414,7 @@ layout("/layouts/platform.html"){
birthday: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// job_title: [{required: true, message: '必填', trigger: ['blur', 'change']}],
birth_child_num: [{required: true, message: '必填', trigger: ['blur', 'change']}],
sign: [{required: true, message: '请扫码签字', trigger: ['blur', 'change']}],
// sign: [{required: true, message: '请扫码签字', trigger: ['blur', 'change']}],
payee: [{required: true, message: '请选择收款人', trigger: ['blur', 'change']}],
payee_bank_number: [{required: true, message: '请填写收款人银行卡', trigger: ['blur', 'change']}],
payee_bank_name: [{required: true, message: '请填写收款人开户行', trigger: ['blur', 'change']}],
@@ -557,10 +557,10 @@ layout("/layouts/platform.html"){
},
async doAdd() {
// 签字由自定义组件回写,提交前单独判断,避免 Element 表单漏过空签字。
if (!this.formData.sign) {
/*if (!this.formData.sign) {
this.$message.warning('请扫码签字')
return
}
}*/
this.$refs["form"].validate(async (valid) => {
if (valid) {
const formData = JSON.parse(JSON.stringify(this.formData))
@@ -151,7 +151,7 @@ layout("/layouts/platform.html"){
</template>
<template #edit>
<info ref="info2" handle label="校工会审核">
<info ref="info2" handle label="校工会办公室审核">
<template #handle>
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
@@ -171,10 +171,11 @@ layout("/layouts/platform.html"){
</el-col>
</el-row>
<el-form-item prop="opinion" label="审核意见">
<el-input type="textarea" v-model="formData.opinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
<el-form-item prop="pass" label="审批意见">
<el-radio-group v-model="formData.pass">
<el-radio :label="3">同意</el-radio>
<el-radio :label="1">不同意</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="sign" label="签&emsp;&emsp;字">
@@ -184,15 +185,11 @@ layout("/layouts/platform.html"){
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="doReview(1)" :disabled="subDis" :loading="subLoading1">拒
绝
</el-button>
<el-button type="danger" @click="doReview(2)" :disabled="subDis"
:loading="subLoading2">返回修改
</el-button>
<el-button type="primary" @click="doReview(3)" :disabled="subDis"
:loading="subLoading3">通
过
<el-button type="primary" @click="doReview" :disabled="subDis"
:loading="subLoading3">提交
</el-button>
</div>
@@ -223,7 +220,7 @@ layout("/layouts/platform.html"){
year: new Date().getFullYear() + ""
},
formRules: {
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
pass: [{required: true, message: '请选择审批意见', trigger: 'change'}],
sign: [{required: true, message: '请签字', trigger: ['blur', 'change']}],
},
subDis: false,
@@ -240,6 +237,9 @@ layout("/layouts/platform.html"){
'info': httpVueLoader('/components/condolence/Info.vue?v=1.0.2'),
},
methods: {
isValidSign(sign) {
return typeof sign === 'string' && /^data:image\/(png|jpeg|jpg);base64,/i.test(sign)
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
@@ -250,11 +250,18 @@ layout("/layouts/platform.html"){
},
async openReview(row) {
const {id} = row
const cachedSign = localStorage.getItem('signature')
if (cachedSign && !this.isValidSign(cachedSign)) {
// 仅清理当前浏览器中的异常签字缓存,避免 [object Object] 再次提交。
localStorage.removeItem('signature')
}
this.formData = {
id,
username: "${@shiro.getPrincipalProperty('username')}",
time: moment().format('YYYY-MM-DD'),
pass: null,
sign: '',
}
this.subLoading1 = false
this.subLoading2 = false
@@ -265,29 +272,27 @@ layout("/layouts/platform.html"){
this.$refs['form'].resetFields()
}
},
async doReview(flag) {
async doReview(pass) {
if (pass === 2) {
this.formData.pass = pass
}
// 签字由自定义组件回写,审核提交前单独判断,避免 Element 表单漏过空签字。
if (!this.formData.sign) {
this.$message.warning('请签字')
if (!this.isValidSign(this.formData.sign)) {
localStorage.removeItem('signature')
this.$set(this.formData, 'sign', '')
this.$message.warning('签字数据异常,请重新签字')
return
}
this.$refs["form"].validate(async (valid) => {
if (valid) {
this.formData.pass = flag
this.subDis = true
if (flag == 1) {
this.subLoading1 = true
} else if (flag == 2) {
this.subLoading2 = true
} else {
this.subLoading3 = true
}
pass === 2 ? this.subLoading2 = true : this.subLoading3 = true
const resp = await $.post(loc() + "/doReview", this.formData)
this.subDis = false
this.subLoading1 = false
this.subLoading2 = false
this.subLoading3 = false
if (resp.code === 0) {
this.pageData()
this.$refs.guava.index()