This commit is contained in:
Paidax
2025-04-28 08:40:55 +08:00
parent 9b9e53056f
commit d046c3be5d
144 changed files with 2559 additions and 1222 deletions
@@ -9,7 +9,7 @@ package io.v.nutz.base.utils;
public class SmsTemplate {
//邀请附议人发送消息
// public static final String inviteSecondedTemplate = "{}邀请您附议[{}]提案,请您通过门户网站或企业微信登录智慧工会平台进行附议。";
// public static final String inviteSecondedTemplate = "{}邀请您附议[{}]提案,请您通过门户网站或钉钉登录智慧工会平台进行附议。";
public static final String inviteSecondedTemplate = "{}代表,您好,{}代表的提案《{}》,邀请您作为附议人,请您登陆学校智慧工会系统-提案管理系统-附议提案进行附议,感谢您对教代会提案工作的大力支持!";
//附议人通过或者拒绝给提案人发送消息
@@ -18,7 +18,7 @@ public class SmsTemplate {
//附议完给团长发送消息
// public static final String TZ_TEMPLATE = "[{}]提案待您审核,请您通过门户网站或企业微信登录智慧工会平台进行审核";
// public static final String TZ_TEMPLATE = "[{}]提案待您审核,请您通过门户网站或钉钉登录智慧工会平台进行审核";
public static final String TZ_TEMPLATE = "{}代表团团长,您好,{}代表的提案《{}》,已经完成附议,请您登陆学校智慧工会系统-提案管理系统-附议提案进行审核,感谢您对教代会提案工作的大力支持!";
//团长审核给提案人发送消息
@@ -72,7 +72,7 @@ public class ClubMyApplyController {
Sql sql = Sqls.create("""
SELECT
c.*,
d.NAME AS typeName,
d.`name` AS typeName,
u.username,
u.unitname as fzr_unit_name,
s.stateName,
@@ -112,7 +112,9 @@ public class ClubRegistApplyController {
Sql sql = Sqls.create("""
SELECT
u.loginname,
u.username
u.username,
u.unionid,
u.unionname
FROM
`sys_user_role` userRole
LEFT JOIN sys_role role ON role.id = userRole.roleId
@@ -123,6 +125,11 @@ public class ClubRegistApplyController {
""").setParam("unionId", Vi.getUnionId());
List<NutMap> list = memberCommonService.listMap(sql);
// 如果是基层单位申请,记录归属的协会
NutMap nutMap = list.stream().findFirst().orElse(NutMap.NEW());
club.setUnionId(nutMap.getString("unionid"));
club.setUnionName(nutMap.getString("unionname"));
List<String> unionLeaderLoginNames = list.stream().map(v -> v.getString("loginname")).toList();
//分工会审核
ClubRegisterApplyToDoHandler.CREATE_UNION_TASK.exec(club, NutMap.NEW().addv("unionLeaderLoginNames", unionLeaderLoginNames));
@@ -95,22 +95,22 @@ public class ClubXghReplyController {
audit = dao.insert(audit);
Sys_club club = dao.fetch(Sys_club.class, clubId);
ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, NutMap.NEW().addv("nodeName", "校工会批复完成"));
ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, NutMap.NEW().addv("nodeName", "校工会审核完成"));
if (pass == 1) {
club.setState(ClubRegistAuditState.XGH_REJECTED);
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", clubId)
.and("roleid", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
ClubRegisterApplyToDoHandler.REFUSE_UNION_TASK.exec(club, NutMap.NEW().addv("nodeName","校工会批复拒绝"));
ClubRegisterApplyToDoHandler.REFUSE_UNION_TASK.exec(club, NutMap.NEW().addv("nodeName","校工会审核拒绝"));
} else if (pass == 2) {
club.setState(ClubRegistAuditState.XGH_BACK_MODIFY);
dao.clear(Sys_user_role.class, Cnd.where("stid", "=", clubId)
.and("roleid", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04)));
//退回修改
ClubRegisterApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(club, NutMap.NEW().addv("nodeName","校工会批复退回修改"));
ClubRegisterApplyToDoHandler.CREATE_APPLY_RE_MODIFY_TASK.exec(club, NutMap.NEW().addv("nodeName","校工会退回修改"));
} else {
club.setState(ClubRegistAuditState.SCHOOL_PASS);
//审核通过
ClubRegisterApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(club, null);
ClubRegisterApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(club, NutMap.NEW().addv("nodeName","校工会审核通过"));
ClubRegisterApplyToDoHandler.COMPLETE_PROCESS.exec(club, null);
//审核通过加角色
List<Sys_user_role> userRoles = new ArrayList<>();
@@ -0,0 +1,154 @@
package io.v.nutz.task.job.proposal;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.zhgh.jdh.model.cb.Jdh_jdhxx;
import io.v.nutz.zhgh.proposal.constants.ProposalState;
import io.v.nutz.zhgh.proposal.models.ProposalInfo;
import io.v.nutz.zhgh.proposal.models.ProposalSeconded;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
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.util.NutMap;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import java.util.List;
/**
* @version 1.0
* @Author zzr
* @nameProposalPromptJob
* @Date 2025/4/22 10:03
* @注释 提案,邀请附议人,附议人附议,团长审核超过24小时提醒一次,超过三天提醒一次
*/
@IocBean
public class ProposalPromptJob implements Job {
@Inject
private Dao dao;
@Inject
private MsgApi msgApi;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
// 查询最新届次的教代会
Jdh_jdhxx jdhxx = dao.fetch(Jdh_jdhxx.class, Cnd.where("jdhkqzt", "=", 1).desc("jdhkqsj"));
// 当前时间
DateTime now = DateUtil.date();
// 邀请附议人链接
String unSubmitLinkUrl = "https://zhgh.hmc.edu.cn/mobile/proposal/compose";
// 附议人附议链接
String secondedLinkUrl = "https://zhgh.hmc.edu.cn/mobile/proposal/seconded";
// 团长审核链接
String delegationLinkUrl = "https://zhgh.hmc.edu.cn/mobile/proposal/delegation";
// 待邀请附议人的提案
List<ProposalInfo> unSubmitProposalInfos = dao.query(ProposalInfo.class,
Cnd.where("stateCode", "=", ProposalState.UNSUBMIT)
.and("teacherMeetingId", "=", jdhxx.getId()));
for (ProposalInfo info : unSubmitProposalInfos) {
DateTime createDate = DateUtil.date(info.getOpAt());
// 首次进来的时候,lastReminderTime 为空
DateTime lastReminderTime = DateUtil.date(info.getLastReminderTime());
// 判断是否过了24小时或三天,并且上次提醒时间是否为空或超过24小时/三天
if ((DateUtil.betweenDay(createDate, now, true) == 1 || DateUtil.betweenDay(createDate, now, true) == 3)
&& (lastReminderTime == null || DateUtil.betweenDay(lastReminderTime, now, true) >= 1)) {
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", info.getCreateUser()));
String content = StrUtil.format("{}代表,您好,您撰写的《{}》提案还未邀请附议人,请点击邀请!", user.getUsername(), info.getProposalName());
// msgApi.sendMsg(List.of("DingTalk"), user.getLoginname(), 2, "提案邀请附议人提醒", content, "", unSubmitLinkUrl);
// 更新 lastReminderTime 为当前时间
info.setLastReminderTime(now);
}
}
// dao.update(unSubmitProposalInfos);
// 附议人还没附议的提案
Sql noSecondedSql = Sqls.create("""
SELECT
ps.*,
info.proposalName,
u.username,
u.loginname
FROM
`proposal_seconded` ps
LEFT JOIN proposal_info info ON info.id = ps.proposalId
LEFT JOIN sys_user u ON u.id = ps.seconderId
WHERE
ps.secondedTime IS NULL AND info.teacherMeetingId = @teacherMeetingId
GROUP BY
ps.id
""").setParam("teacherMeetingId", jdhxx.getId());
noSecondedSql.setCallback(Sqls.callback.maps());
dao.execute(noSecondedSql);
List<NutMap> noSecondedList = (List<NutMap>) noSecondedSql.getResult();
for (NutMap seconded : noSecondedList) {
DateTime createDate = DateUtil.parse(seconded.getString("inviteTime"));
DateTime lastReminderTime = DateUtil.parse(seconded.getString("lastReminderTime"));
// 判断是否过了24小时或三天,并且上次提醒时间是否为空或超过24小时/三天
if ((DateUtil.betweenDay(createDate, now, true) == 1 || DateUtil.betweenDay(createDate, now, true) == 3)
&& (lastReminderTime == null || DateUtil.betweenDay(lastReminderTime, now, true) >= 1)) {
String content = StrUtil.format("{}代表,您好,《{}》提案待您附议,请点击附议!",
seconded.getString("username"), seconded.getString("proposalName"));
// msgApi.sendMsg(List.of("DingTalk"), seconded.getString("loginname"), 2, "提案附议提醒", content, "", secondedLinkUrl);
// 更新 lastReminderTime 为当前时间
// dao.update(ProposalSeconded.class, Chain.make("lastReminderTime", now), Cnd.where("id", "=", seconded.getString("id")));
}
}
// 待团长审核的提案超过24小时提醒一次,超过三天提醒一次
Sql delegationSql = Sqls.create("""
SELECT
info.*,
u.loginname,
u.username
FROM
proposal_info info
LEFT JOIN sys_user_role role ON role.dbtid = info.delegationId
AND role.jdhid = info.teacherMeetingId
AND role.roleId = @roleId
LEFT JOIN sys_user u ON u.id = role.userId
WHERE
info.stateCode = @stateCode
AND info.teacherMeetingId = @teacherMeetingId
AND info.delegationId IS NOT NULL
AND info.delegationAuditId IS NULL
""").setParam("roleId", Roles.DBT_TZ)
.setParam("stateCode", ProposalState.DELEGATION)
.setParam("teacherMeetingId", jdhxx.getId());
delegationSql.setCallback(Sqls.callback.maps());
dao.execute(delegationSql);
List<NutMap> delegationList = (List<NutMap>) delegationSql.getResult();
for (NutMap delegation : delegationList) {
DateTime createDate = DateUtil.parse(delegation.getString("secondReminderTime"));
DateTime lastReminderTime = DateUtil.parse(delegation.getString("lastDelegationReminderTime"));
// 判断是否过了24小时或三天,并且上次提醒时间是否为空或超过24小时/三天
if ((DateUtil.betweenDay(createDate, now, true) == 1 || DateUtil.betweenDay(createDate, now, true) == 3)
&& (lastReminderTime == null || DateUtil.betweenDay(lastReminderTime, now, true) >= 1)) {
String content = StrUtil.format("{}团长,您好,《{}》提案待您审核,请点击审核!",
delegation.getString("username"), delegation.getString("proposalName"));
// msgApi.sendMsg(List.of("DingTalk"), delegation.getString("loginname"), 2, "提案审核提醒", content, "", delegationLinkUrl);
}
// dao.update(ProposalInfo.class, Chain.make("lastDelegationReminderTime", now), Cnd.where("id", "=", delegation.getString("id")));
}
}
}
@@ -126,6 +126,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object queryUserByIds(String[] ids) {
Sql sql = Sqls.create("select id,loginname,username,unitname,unionname,sex,mobile from user where id in (@id)");
sql.setParam("id", ids);
@@ -140,6 +141,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object queryUserById(String id) {
Sql sql = Sqls.create("""
select
@@ -171,6 +173,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getCampus() {
return sysUnitService.list(Sqls.create("""
SELECT
@@ -189,6 +192,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object dictOptions(String code) {
return sysDictService.getSubListByCode(code);
}
@@ -200,6 +204,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getSystemNameByDict() {
return sysDictService.query(Cnd.where("parentId", "=", DICT_SYSTEM_ID).and("disabled", "=", false).asc("location"));
}
@@ -211,6 +216,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getJcByDict() {
return sysDictService.query(Cnd.where("parentId", "=", DICT_JC_ID).and("disabled", "=", false).asc("location"));
}
@@ -222,6 +228,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getFileTypeByDict() {
return sysDictService.query(Cnd.where("parentId", "=", DICT_FILETYPE_ID).and("disabled", "=", false).asc("location"));
}
@@ -233,6 +240,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getJcgbJsByDict() {
return sysDictService.list(Sqls.create("SELECT\n" +
"\tdict.id,\n" +
@@ -256,6 +264,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getSpyJsByDict() {
return sysDictService.list(Sqls.create("SELECT\n" +
"\tdict.id,\n" +
@@ -278,6 +287,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object welfareUnits() {
return sysWelfareUnitService.query(Cnd.orderBy().asc("welfare_unit_code"));
}
@@ -302,6 +312,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getDbt(String jdhId) {
Sql sql = Sqls.create("""
SELECT
@@ -327,6 +338,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object unions(@Param(value = "delegationId", required = false) String delegationId, boolean isPermission) {
if (Strings.isBlank(delegationId)) {
Cnd cndX = Cnd.NEW();
@@ -349,6 +361,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object unionList(@Param(value = "unionId", required = false) String unionId) {
if (Strings.isBlank(unionId)) {
return sysUnionService.query(Cnd.orderBy().asc("unioncode"));
@@ -380,12 +393,14 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object clubs() {
return sysClubService.query(Cnd.where("state", "=", 930).asc("code"));
}
@At
@ViReturn
@RequiresAuthentication
public Object getGroup(@Param(value = "jdhId", required = false) String jdhId) {
Sql sql = Sqls.create("""
SELECT
@@ -402,6 +417,7 @@ public class ViCommonCon {
}
@At
@RequiresAuthentication
public Object getUnit(String unionid) {
try {
if (Strings.isBlank(unionid)) {
@@ -422,6 +438,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getClubsByRole() {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
@@ -457,6 +474,7 @@ public class ViCommonCon {
@At
@ViReturn
@RequiresAuthentication
public Object getClubsByUser() {
Sql sql = Sqls.create("""
SELECT
@@ -484,6 +502,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getClubTypeByDict() {
return sysDictService.query(Cnd.where("parentId", "=", DICT_CLUBTYPE_ID).and("disabled", "=", false).asc("location"));
}
@@ -494,6 +513,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object units(@Param(value = "unionId", required = false) String unionId) {
Cnd cnd = Cnd.NEW();
cnd.and("unitlevel", "=", 2);
@@ -519,6 +539,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getUnitsByUnions(@Param(value = "unionId", required = false) String[] unionId) {
Cnd cnd = Cnd.NEW();
cnd.and("unitlevel", "=", 2);
@@ -544,6 +565,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object threeUnitsByUnionGroupOrUnitId(@Param(value = "unitId", required = false) String unitId,
@Param(value = "groupId", required = false) String groupId) {
if (Strings.isNotBlank(groupId)) {
@@ -561,6 +583,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getThreeUnitsByUnionGroupsOrUnitIds(@Param(value = "unitId", required = false) String[] unitId,
@Param(value = "groupId", required = false) String[] groupId) {
if (groupId != null && groupId.length > 0) {
@@ -577,6 +600,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object unionGroupsByUnionId(@Param(value = "unionId", required = false) String unionId) {
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,flwyh01,H04")) {
List<Sys_user_role> userRole = sysUserService.dao().query(Sys_user_role.class, Cnd.where("roleId", "=", Roles.ghxzzz)
@@ -599,6 +623,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getUnionGroupsByUnions(@Param(value = "unionId", required = false) String[] unionId) {
if (!ShiroUtil.hasAnyRoles("sysadmin,SchoolUnionAdmin,flwyh01,H04")) {
List<Sys_user_role> userRole = sysUserService.dao().query(Sys_user_role.class, Cnd.where("roleId", "=", Roles.ghxzzz)
@@ -619,6 +644,7 @@ public class ViCommonCon {
//协会负责人登录获取成员所在的单位
@At
@ViReturn
@RequiresAuthentication
public Object getClubUnits() {
Sql sql = Sqls.create("""
select
@@ -637,6 +663,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object unionUnits() {
Cnd cnd = Cnd.NEW();
cnd.and("unitlevel", "=", 2);
@@ -660,6 +687,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object searchUser(@Param(value = "query", required = false) String query,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@@ -696,7 +724,7 @@ public class ViCommonCon {
cnd.andEX("unit.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.sex", "=", sex);
if (member) {
if (member != null && member) {
cnd.and("u.member", "=", member);
}
sql.setCondition(cnd);
@@ -711,6 +739,7 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object getGdh(Boolean open) {
Cnd cnd = Cnd.NEW();
cnd.and("startState", "=", open).desc("year");
@@ -726,12 +755,14 @@ public class ViCommonCon {
*/
@At
@ViReturn
@RequiresAuthentication
public Object dictState(String code) {
return baseService.dao().fetch("sys_dict", Cnd.where("code", "=", code));
}
@At
@ViReturn
@RequiresAuthentication
public Object getActivityUnions() {
return sysUnionService.query();
}
@@ -739,6 +770,7 @@ public class ViCommonCon {
@At
@ViReturn
@RequiresAuthentication
public Object getActivityUnits(@Param(value = "unionId", required = false) String unionId) {
if (Strings.isBlank(unionId)) {
return sysUnitService.dao().query(ActivityBasicUnit.class, Cnd.where("unitlevel", "=", 2).asc("id"));
@@ -747,6 +779,7 @@ public class ViCommonCon {
}
@At
@RequiresAuthentication
public Object getUnion() {
try {
List<Record> unionList;
@@ -799,6 +832,7 @@ public class ViCommonCon {
*/
@At(value = "/platform/basics/downloadTemplate", top = true)
@Ok("void")
@RequiresAuthentication
public void downloadTemplate(String filePath, String fileName, HttpServletResponse response) {
String TEMPLATE_PATH = "templates";
try {
@@ -128,11 +128,12 @@ public class ActivityUnionManageController {
SELECT id userId,username userName,loginname loginName,sex,mobile,unitname unitName,unionname unionName FROM `user` $condition
""");
if (!ShiroUtil.hasRole("sysadmin")) {
if (activity_type == 40002) {
cnd.and("unionId", "=", vi.getUnionId());
} else if (activity_type == 40003) {
cnd.and("id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
}
// if (activity_type == 40002) {
// cnd.and("unionId", "=", vi.getUnionId());
// } else if (activity_type == 40003) {
// cnd.and("id", "in", " SELECT userid FROM sys_club_user WHERE clubid = '%s' ".formatted(vi.getClubId()));
// }
cnd.and("unionId", "=", vi.getUnionId());
}
if (Strings.isNotBlank(serachWord)) {
@@ -218,7 +219,7 @@ public class ActivityUnionManageController {
if (tissue.getIsEnrollSystem()) {
Sys_home_activity sysHomeActivity = tissue.covertToSysHomeActivity();
sysHomeActivity.setEnable(true);
sysHomeActivity.setEnable(ShiroUtil.hasAnyRoles("sysadmin,A06"));
activitySchoolService.dao().insertOrUpdate(sysHomeActivity);
}
return null;
@@ -107,6 +107,8 @@ public class ActivityUnionPlanController {
activityPlan.setType("40001");
}
activityPlanService.insert(activityPlan);
return null;
}
@@ -144,7 +144,7 @@ public class HMCFieldCode {
put("15", "因公出国");
put("16", "停薪留职");
put("17", "待岗");
put("99", "其他");
put("99", "其他减员");
}};
/**
* 校区码
@@ -54,7 +54,7 @@ public interface SourceData {
put("MZMC", new String[]{"nation"});// 民族码
put("SJ", new String[]{"mobile"}); // 手机号
put("ZZMMM", new String[]{"political"}); // 政治面貌码
put("DQZTM", new String[]{"userState"}); // 在职状态码
put("DQZTM", new String[]{"userState", "personalStatus"}); // 在职状态码
put("RYFLMC", new String[]{"personType"}); // 人员类型码
put("ZGXLM", new String[]{"education"}); // 最高学历码
put("ZGXWM", new String[]{"academicDegree"}); // 最高学位码
@@ -66,14 +66,14 @@ public interface SourceData {
put("ZYJSZWDJ", new String[]{"professionalTechnicalLevel"}); // 专业技术等级
put("JZGLBM", new String[]{"userCategory"}); // 教职工类别
put("GWLBM", new String[]{"jobCategory"}); // 岗位类别
put("LXRQ", new String[]{"schoolTime"}); // 岗位类别
put("LXRQ", new String[]{"schoolTime", "memberJoinTime"}); // 来校日期
put("LTQSRQ", new String[]{"retireDate"}); // 离退起始日期
}};
/**
* 字段插件
*/
Map<String, Exp4> USER_FIELD_PLUGIN = new HashMap<String, Exp4>() {{
// put("ZZZTMC", v -> Strings.sBlank(USER_STATE_CODE.get(v), ""));
put("XBM", v -> Strings.sBlank(HMCFieldCode.SEX_CODE.get(v), ""));
put("ZZMMM", v -> Strings.sBlank(HMCFieldCode.POLITICAL_CODE.get(v), ""));
put("DQZTM", v -> Strings.sBlank(HMCFieldCode.USER_STATE_CODE.get(v), ""));
@@ -154,8 +154,6 @@ public interface SourceData {
int page = 1;
String body = HttpUtil.createPost(DATA_URL).body(JSON.toJSONString(new NutMap().addv("address", "rsxt_dwjbsj").addv("params", new NutMap())
.addv("token", "3318a5a9-c2f2-4c8b-a8ea-e99dd68c165c").addv("pageIndex", page).addv("pageSize", 100))).execute().body();
// String body = HttpUtil.get(DATA_URL, new NutMap().addv("address", "rsxt_dwjbsj").addv("params", new NutMap())
// .addv("token", "3318a5a9-c2f2-4c8b-a8ea-e99dd68c165c").addv("pageIndex", page).addv("pageSize", 1000));
NutMap map = Json.fromJson(NutMap.class, body);
// checkSuccess(map);
List<NutMap> data = map.getAsList("data", NutMap.class);
@@ -72,9 +72,9 @@ public class SourceUserController {
CndPlus cnd = CndPlus.create();
cnd.and(pageForm);
cnd.andEx("unitid", "=", unitId);
cnd.andEx("personType", "=", personType);
cnd.andEx("userState", "=", userState);
cnd.andEX("unitid", "=", unitId);
cnd.andEX("personType", "=", personType);
cnd.andEX("userState", "=", userState);
if(!StringUtils.isEmpty(importDate)){
cnd.and("DATE(u.pullTime)", "=", importDate);
@@ -3,6 +3,7 @@ package io.v.nutz.zhgh.data.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.utils.ViResource;
@@ -77,12 +78,14 @@ public class UpdateUserController {
CndPlus cnd = CndPlus.create();
cnd.and(pageForm);
cnd.andEx("u.unitid", "=", unitId);
cnd.andEx("u.personType", "=", personType);
cnd.andEx("u.userState", "=", userState);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("u.personType", "=", personType);
cnd.andEX("u.userState", "=", userState);
cnd.andEx("Date(his.changeTime)", "=", changeDate);
cnd.andEx("his.changeType", "=", changeType);
if (StrUtil.isNotBlank(changeDate)) {
cnd.and("DATE(his.changeTime)", "=", changeDate);
}
cnd.andEX("his.changeType", "=", changeType);
sql.setCondition(cnd);
@@ -195,6 +195,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
continue;
}
// 这里是杭医的不进系统人员的判断,其他学校用不到的话删掉
boolean isNotEnterUser = NOT_ENTERING_PERSON_TYPE.contains(source.getPersonType())
|| NOT_ENTERING_USER_LOGIN_NAME.contains(source.getLoginname())
|| NOT_ENTERING_USER_STATE.contains(source.getUserState());
@@ -243,7 +244,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
if (user != null) {
histories.add(history);
}
if (!isNotEnterUser && history.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
if (!isNotEnterUser && Lang.isNotEmpty(history.getChangeTypes()) && history.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
needInitUserList.add(u);
histories.add(history);
}
@@ -255,7 +256,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
if (user != null) {
middleTables.add(table);
}
if (!isNotEnterUser && table.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
if (!isNotEnterUser && Lang.isNotEmpty(table.getChangeTypes()) && table.getChangeTypes().contains(MemberChangeType.NEW.getType())) {
needInitUserList.add(u);
middleTables.add(table);
}
@@ -287,7 +288,7 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
// 加入进行中的福利项目,暂时没写
// 历史记录表插入数据
// 历史记录表插入数据 artificial
if ("automatic".equals(changeConfig.getSourceChangeType())) {
// 自动更新,修改数据表,存储历史记录
if ("part".equals(sourceType)) {
@@ -528,6 +529,9 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
// 变更记录
List<NutMap> changeList = new ArrayList<>();
for (String fieldName : allowChangeFieldNames) {
if (allowChangeFieldNames.contains("retireDate") || allowChangeFieldNames.contains("welfareStopDate")) {
continue;
}
memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList);
}
if (Lang.isEmpty(changeList)) {
@@ -573,6 +577,9 @@ public class SourceUserServiceImpl extends ViServiceImpl<UserSource> implements
NutMap sourceMap = Lang.obj2nutmap(user);
List<NutMap> changeList = new ArrayList<>();
for (String fieldName : allowChangeFieldNames) {
if (allowChangeFieldNames.contains("retireDate") || allowChangeFieldNames.contains("welfareStopDate")) {
continue;
}
memberCommonService.extractChange(newMap, sourceMap, fieldName, dictMap, changeList);
}
if (Lang.isEmpty(changeList)) {
@@ -53,14 +53,14 @@ public enum ProposalAuditEnum {
if (flag == 0) {
newStateCode = ProposalState.DELEGATION_BACK;
proposalSecondedService.clear(Cnd.where("proposalId", "=", audit.getProposalId()));
String rollBackTemplate = "{}团长审核并退回了您的[{}]提案,请您通过门户网站或企业微信登录到智慧工会平台修改并重新邀请附议人";
String rollBackTemplate = "{}团长审核并退回了您的[{}]提案,请您通过门户网站或钉钉登录到智慧工会平台修改并重新邀请附议人";
} else if (flag == 1) {
//通过
newStateCode = proposalProcessService.getStateCode(info.getId(), ProposalStateDirectionEnum.NEXT, false);
} else {
//建议撤销
newStateCode = ProposalState.DELEGATION_REVOKE;
String rollBackTemplate = "{}团长审核并建议撤销了您的[{}]提案,请您通过门户网站或企业微信登录到智慧工会平台修改并重新邀请附议人";
String rollBackTemplate = "{}团长审核并建议撤销了您的[{}]提案,请您通过门户网站或钉钉登录到智慧工会平台修改并重新邀请附议人";
// msgApi.sendMsg(StrUtil.format(rollBackTemplate, audit.getUsername(), info.getProposalName()), List.of(proposalCreater.getLoginname()));
}
audit.setFlag(flag == 1);
@@ -77,7 +77,7 @@ public enum ProposalAuditEnum {
//退回
ProposalToDoHandler.CREATE_TEAM_LEADER_BACK_TASK.exec(info.getId(), nutMap);
} else if (flag == 1) {
//通过
//通过,杭医是到提案工作组组长审阅
ProposalToDoHandler.CREATE_CASE_TASK.exec(info.getId(), nutMap);
} else if (flag == 2) {
//建议撤销
@@ -52,16 +52,16 @@ public interface ProposalState {
*/
Integer UNITREPLY = 500;
/**
* 待反馈评分
*/
Integer FEEDBACKSCORE = 600;
/**
* 分管校领导审批
*/
Integer LEADER_SUFFIX_AUDIT = 700;
/**
* 待反馈评分
*/
Integer FEEDBACKSCORE = 800;
/**
* 已完结
*/
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.proposal.constants;
import cn.hutool.core.util.ObjectUtil;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.ViResource;
import io.v.nutz.sys.models.Sys_user;
@@ -164,6 +165,48 @@ public enum ProposalToDoHandler {
}
},
/**
* 提案工作组组长审阅待办
*/
CREATE_PROPOSAL_TEAM_LEADER_REVIEW_TASK() {
@Override
public void exec(String proposalId, NutMap extra) {
localProcessService.createTask(
"proposal_info@" + proposalId,
"proposalTeamLeaderRAuditId",
"待提案工作组组长查阅",
ShiroUtil.getUserId(),
proposalCommonService.getCommitteeLeader(proposalId),
"/platform/proposal/transact/caseRead",
"/platform/proposal/transact/caseRead",
null,
null
);
localProcessService.updateProcessNodeName(
"proposal_info@" + proposalId,
"待提案工作组组长查阅"
);
}
},
/**
* 提案工作组组长完成待办
*/
COMPLETE_PROPOSAL_TEAM_LEADER_REVIEW_TASK() {
@Override
public void exec(String proposalId, NutMap extra) {
//完成待办
localProcessService.completeTask(
"proposalTeamLeaderRAuditId",
"proposal_info@" + proposalId,
ShiroUtil.getUserId(),
extra.getString("opinion")
);
}
},
/**
* 创建委员会待办
*/
@@ -173,7 +216,7 @@ public enum ProposalToDoHandler {
localProcessService.createTask(
"proposal_info@" + proposalId,
"caseAuditId",
"待提案委员会立案",
"待提案工作组立案审核",
ShiroUtil.getUserId(),
proposalCommonService.getCommitteeLeader(proposalId),
"/platform/proposal/transact/case/case",
@@ -183,7 +226,7 @@ public enum ProposalToDoHandler {
);
localProcessService.updateProcessNodeName(
"proposal_info@" + proposalId,
"待提案委员会立案"
ObjectUtil.defaultIfBlank(extra.getString("opinion"), "待提案工作组立案审核")
);
}
@@ -303,4 +303,40 @@ public class ProposalUndertakeController {
sql.setCondition(cnd);
return sysUserService.list(sql);
}
/**
* 设置其他单位为承办单位负责人
* @param id 单位Id
* @param userId 用户Id
* @return
*/
@At
@ViReturn
@RequiresPermissions("proposal.basics.undertake")
@Aop(TransAop.READ_COMMITTED)
public Object doAdminOtherUnit(@Param("unitId") String id, @Param("userId") String userId){
// 删除该用户在承办单位负责人
sysUserRoleService.clear(Cnd.where("userId", "=", userId).and("cbdwid", "=", id)
.and("roleId", "=", Roles.CONTRACTOR_PERSON));
Sys_user_role sysUserRole = new Sys_user_role();
sysUserRole.setUserId(userId);
sysUserRole.setCbdwid(id);
sysUserRole.setRoleId(Roles.CONTRACTOR_PERSON);
sysUserRoleService.insert(sysUserRole);
// 删除该用户二级单位负责人
ProposalUndertake proposalUndertake = dao.fetch(ProposalUndertake.class, id);
dao.clear(Sys_user_role.class, Cnd.where("userId", "=", userId).and("roleId", "=", Roles.UNIT_MANGER)
.and("unitid", "=", proposalUndertake.getUnitCode()));
sysUserRole.setRoleId(Roles.UNIT_MANGER);
sysUserRole.setCbdwid(null);
sysUserRole.setUnitid(proposalUndertake.getUnitCode());
sysUserRoleService.insert(sysUserRole);
// 清缓存
sysUserService.deleteCacheAndUpdate(userId);
return null;
}
}
@@ -55,7 +55,7 @@ public class ProposalAllFinishedQueryController {
@Param(value = "searchKeyword2",required = false)String searchKeyword2) {
CndPlus cnd = CndPlus.create();
cnd.andEx("info.stateCode", "=", stateCode);
// cnd.andEx("info.stateCode", "=", stateCode);
if (!ShiroUtil.hasAnyRoles(new String[]{"sysadmin", "A06", "tamange"})) {
if (ShiroUtil.hasAnyRoles("jdhdbt01,jdhdbt02")) {
@@ -146,9 +146,9 @@ public class ProposalAllFinishedQueryController {
group.orLike("su.loginname", search.getCreateUser());
cnd.and(group);
}
cnd.andEx("info.delegationId", "=", search.getDelegationId());
cnd.andEx("su.unionId", "=", search.getUnionId());
cnd.andEx("su.unitId", "=", search.getUnitId());
cnd.andEX("info.delegationId", "=", search.getDelegationId());
cnd.andEX("su.unionId", "=", search.getUnionId());
cnd.andEX("su.unitId", "=", search.getUnitId());
cnd.groupBy("info.id");
cnd.desc("info.proposalCode");
sql.setCondition(cnd);
@@ -133,9 +133,11 @@ public class ProposalBranchLeaderSuffixAuditController {
@POST
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("proposal.transact.branchLeaderPrefixAudit")
// @RequiresPermissions("proposal.transact.branchLeaderPrefixAudit")
@RequiresPermissions("proposal.transact.branchLeaderSuffixAudit")
@SLog(type = "proposal", tag = "分管领导审批答复", msg = "分管领导审批答复")
public Object doAudit(@Param(value = "sign", required = false) String sign, @Param("audit") ProposalAudit proposalAudit, @Param("pblsaId") String pblsaId) {
String proposalId = proposalAudit.getProposalId();
//签字
String signId = null;
if (StrUtil.isNotBlank(sign)) {
@@ -150,10 +152,12 @@ public class ProposalBranchLeaderSuffixAuditController {
.add("auditId", proposalAudit.getId()),
Cnd.where("id", "=", pblsaId));
dao.update(ProposalInfo.class, Chain.make("stateCode", ProposalState.FINISH), Cnd.where("id", "=", proposalAudit.getProposalId()));
dao.update(ProposalInfo.class, Chain.make("stateCode", ProposalState.FEEDBACKSCORE), Cnd.where("id", "=", proposalId));
ProposalToDoHandler.COMPLETE_BRANCH_LEADER_SUFFIX_AUDIT_TASK.exec(proposalId, NutMap.NEW().addv("pblsaId", pblsaId).addv("opinion", proposalAudit.getOpinion()));
//反馈评分待办
ProposalToDoHandler.CREATE_FEEDBACK_TASK.exec(proposalId, null);
ProposalToDoHandler.COMPLETE_BRANCH_LEADER_SUFFIX_AUDIT_TASK.exec(proposalAudit.getProposalId(), NutMap.NEW().addv("pblsaId", pblsaId).addv("opinion", proposalAudit.getOpinion()));
ProposalToDoHandler.COMPLETE_PROCESS.exec(proposalAudit.getProposalId(), null);
return null;
}
@@ -10,6 +10,8 @@ import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.proposal.constants.ProposalConstant;
import io.v.nutz.zhgh.proposal.constants.ProposalState;
import io.v.nutz.zhgh.proposal.constants.ProposalStateDirectionEnum;
import io.v.nutz.zhgh.proposal.constants.ProposalToDoHandler;
import io.v.nutz.zhgh.proposal.models.ProposalAudit;
import io.v.nutz.zhgh.proposal.models.ProposalInfo;
import io.v.nutz.zhgh.proposal.models.ProposalSearch;
@@ -19,6 +21,7 @@ import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.models.User;
import io.v.nutz.sys.services.SysSignatureService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.proposal.services.ProposalProcessService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
@@ -46,6 +49,8 @@ public class ProposalCaseReadController {
@Inject
private ProposalInfoService proposalInfoService;
@Inject
private ProposalProcessService proposalProcessService;
@Inject
private Dao dao;
@@ -114,17 +119,17 @@ public class ProposalCaseReadController {
// proposalInfoService.sortAndSearch(cnd,page,search);
Pagination pagination = (Pagination) proposalInfoService.initSql(sql, page, search, cnd);
List<NutMap> list = pagination.getList();
for (NutMap map : list) {
if (StrUtil.isNotBlank(search.getIsAudit()) && "true".equals(search.getIsAudit())) {
String membersOpinions = map.getString("membersOpinions");
List<String> mlist = Json.fromJsonAsList(String.class, membersOpinions);
map.putAll(getCommitteeOpinion(mlist));
} else {
map.putAll(NutMap.NEW().addv("caseNum", "暂无")
.addv("opinionNum", "暂无").addv("notGiveNum", "暂无"));
}
}
// List<NutMap> list = pagination.getList();
// for (NutMap map : list) {
// if (StrUtil.isNotBlank(search.getIsAudit()) && "true".equals(search.getIsAudit())) {
// String membersOpinions = map.getString("membersOpinions");
// List<String> mlist = Json.fromJsonAsList(String.class, membersOpinions);
// map.putAll(getCommitteeOpinion(mlist));
// } else {
// map.putAll(NutMap.NEW().addv("caseNum", "暂无")
// .addv("opinionNum", "暂无").addv("notGiveNum", "暂无"));
// }
// }
// pagination.setList(list);
return pagination;
}
@@ -180,6 +185,11 @@ public class ProposalCaseReadController {
membersOpinions.add(proposalAudit.getId());
proposalInfo.setMembersOpinions(membersOpinions);
proposalInfoService.updateIgnoreNull(proposalInfo);
// // 提案小组组长审核后修改提案状态之后流程开始往下走
// proposalInfo.setStateCode(proposalProcessService.getStateCode(proposalId, ProposalStateDirectionEnum.NEXT, false));
// ProposalToDoHandler.COMPLETE_PROPOSAL_TEAM_LEADER_REVIEW_TASK.exec(proposalInfo.getId(), NutMap.NEW().setv("opinion", "提案工作组组长审阅完成"));
// // 创建校党委审议待办
// ProposalToDoHandler.CREATE_CASE_TASK.exec(proposalInfo.getId(), NutMap.NEW().setv("opinion", "提案工作组组长审阅完成"));
return null;
}
@@ -200,18 +200,9 @@ public class ProposalFeedbackScoreController {
ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(proposalFeedback.getProposalId(), null);
} else {
dao.update(ProposalInfo.class, Chain.make("stateCode", ProposalState.LEADER_SUFFIX_AUDIT), Cnd.where("id", "=", proposalFeedback.getProposalId()));
//插入领导审批记录
ProposalBranchLeaderSuffixAudit leaderSuffixAudit = new ProposalBranchLeaderSuffixAudit();
leaderSuffixAudit.setProposalId(proposalFeedback.getProposalId());
leaderSuffixAudit.setUnderTakeId(lastReply.getReplyUnitId());
leaderSuffixAudit.setIsMaster(true);
leaderSuffixAudit.setIsAudit(false);
dao.insert(leaderSuffixAudit);
ProposalToDoHandler.CREATE_BRANCH_LEADER_SUFFIX_AUDIT_TASK.exec(proposalFeedback.getProposalId(), NutMap.NEW().addv("leaderSuffixAudit", leaderSuffixAudit));
// 流程结束
dao.update(ProposalInfo.class, Chain.make("stateCode", ProposalState.FINISH), Cnd.where("id", "=", lastReply.getProposalId()));
ProposalToDoHandler.COMPLETE_PROCESS.exec(lastReply.getProposalId(), null);
}
return null;
}
@@ -1,16 +1,19 @@
package io.v.nutz.zhgh.proposal.controller.transact;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_local_process_instance;
import io.v.nutz.sys.models.Sys_local_process_instance_task;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.zhgh.proposal.constants.ProposalMannerEnum;
import io.v.nutz.zhgh.proposal.constants.ProposalState;
import io.v.nutz.zhgh.proposal.constants.ProposalStateDirectionEnum;
import io.v.nutz.zhgh.proposal.constants.ProposalToDoHandler;
import io.v.nutz.zhgh.proposal.models.ProposalInfo;
import io.v.nutz.zhgh.proposal.models.ProposalSearch;
@@ -41,11 +44,8 @@ import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@@ -62,25 +62,20 @@ public class ProposalMineController {
@Inject
private Dao dao;
@Inject
private MsgApi msgApi;
@Inject
private BaseService baseService;
@Inject
private SysUserService sysUserService;
@Inject
private SysSignatureService sysSignatureService;
@Inject
private ProposalInfoService proposalInfoService;
@Inject("ProposalSeconded")
private ViService<ProposalSeconded> secondedService;
@Inject
private ProposalProcessService proposalProcessService;
@Inject
private SysLocalProcessService sysLocalProcessService;
@@ -235,11 +230,23 @@ public class ProposalMineController {
ProposalSeconded seconded = new ProposalSeconded();
seconded.setProposalId(proposalId);
seconded.setSeconderId(userId);
seconded.setInviteTime(DateUtil.getDate());
seconded.setInviteTime(cn.hutool.core.date.DateUtil.now());
return seconded;
}).collect(Collectors.toList());
dao.insert(secondedList);
String linkUrl = Globals.AppDomain + "/mobile/proposal/seconded";
// 提案人信息
Sys_user sysUser = dao.fetch(Sys_user.class, Cnd.where("id", "=", proposalInfo.getCreateUser()));
// 附议人发送短信
List<Sys_user> userList = dao.query(Sys_user.class, Cnd.where("id", "in", users));
for (Sys_user user : userList) {
String template = "{}代表,您好,{}代表的提案《{}》邀请您作为附议人,请您点击此消息或登录“智慧工会”系统进行附议,感谢您对教代会提案工作的大力支持!";
String content = StrUtil.format(template, user.getUsername(), sysUser.getUsername(), proposalInfo.getProposalName());
System.out.println(content);
msgApi.sendMsg(List.of("DingTalk"), user.getLoginname(), 2, "提案附议邀请", content, "", linkUrl);
}
ProposalToDoHandler.CREATE_SECONDED_TASK.exec(proposalId, NutMap.NEW().addv("secondedList", secondedList));
return null;
@@ -485,4 +492,82 @@ public class ProposalMineController {
return secondedService.listMap(sql);
}
/**
* 撤回提案
* @param proposalId
* @return
*/
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
@RequiresPermissions("proposal.transact.compose")
public Object doRevoke(String proposalId) {
// 提案撰写人信息
Sql userSql = Sqls.create("""
SELECT
u.loginname,
u.username,
info.id AS proposalId,
info.proposalName
FROM
proposal_info info
LEFT JOIN sys_user u ON info.createUser = u.id
WHERE
info.id = @proposalId
""").setParam("proposalId", proposalId);
userSql.setCallback(Sqls.callback.map());
dao.execute(userSql);
NutMap userMap = (NutMap) userSql.getResult();
// 查询出这个提案下的所有附议人,发送提案撤销消息
Sql sql = Sqls.create("""
SELECT
ps.*,
u.loginname,
u.username
FROM
proposal_seconded ps
LEFT JOIN sys_user u ON ps.seconderId = u.id
WHERE
ps.proposalId = @proposalId
""").setParam("proposalId", proposalId);
sql.setCallback(Sqls.callback.maps());
dao.execute(sql);
List<NutMap> secondedList = (List<NutMap>) sql.getResult();
// 同意的附议人
List<NutMap> agreeList = secondedList.stream().filter(v -> "1".equals(v.getString("isAgree"))).toList();
// 没有附议的人员
List<NutMap> noSecondedList = secondedList.stream().filter(v -> StrUtil.isBlank(v.getString("isAgree"))).toList();
if (Lang.isNotEmpty(agreeList)) {
// 循环发送消息
for (NutMap map : agreeList) {
String template = "{}代表,您好,您附议的提案《{}》已被{}代表(起草人)撤回重新修改,特此告知,烦请知悉。感谢您对教代会提案工作的大力支持!";
String content = StrUtil.format(template, map.getString("username"),
userMap.getString("proposalName"), userMap.getString("username"));
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "提案重新起草通知", content, "", "");
}
}
if (Lang.isNotEmpty(noSecondedList)) {
for (NutMap map : noSecondedList) {
String template = "{}代表,您好,您附议的提案《{}》已被{}代表(起草人)撤回重新修改,您已无需附议。特此告知,烦请知悉。感谢您对教代会提案工作的大力支持!";
String content = StrUtil.format(template, map.getString("username"),
userMap.getString("proposalName"), userMap.getString("username"));
msgApi.sendMsg(List.of("DingTalk"), map.getString("loginname"), 1, "提案无需附议通知", content, "", "");
}
}
dao.update(ProposalInfo.class, Chain.make("stateCode", ProposalState.UNSUBMIT), Cnd.where("id", "=", proposalId));
dao.clear(ProposalSeconded.class, Cnd.where("proposalId", "=", proposalId));
dao.clear(Sys_local_process_instance.class, Cnd.where("processUniqueId", "=", "proposal_info@" + proposalId));
dao.clear(Sys_local_process_instance_task.class, Cnd.where("processUniqueId", "=", "proposal_info@" + proposalId));
ProposalToDoHandler.START_PROCESS.exec(proposalId, null);
return null;
}
}
@@ -1,9 +1,9 @@
package io.v.nutz.zhgh.proposal.controller.transact;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
@@ -210,7 +210,7 @@ public class ProposalSecondedController {
ProposalConfig proposalConfig = dao.fetch(ProposalConfig.class);
//签字
String seconderSignId = sysSignatureService.insert(new Sys_signature(seconderSign)).getId();
dao.update(ProposalSeconded.class, Chain.make("isAgree", flag).add("seconderSignId", seconderSignId).add("secondedTime", DateUtil.getDate()), Cnd.where("id", "=", secondedId));
dao.update(ProposalSeconded.class, Chain.make("isAgree", flag).add("seconderSignId", seconderSignId).add("secondedTime", DateUtil.now()), Cnd.where("id", "=", secondedId));
//完成附议待办
ProposalToDoHandler.COMPLETE_SECONDED_TASK.exec(proposalId, NutMap.NEW().addv("secondedId", secondedId));
@@ -224,7 +224,7 @@ public class ProposalSecondedController {
long agreeCount = secondedList.stream().filter(v -> v.getInt("isAgree") == 1).count();
if (agreeCount == proposalConfig.getSeconderNum() || (proposalInfo.getStateCode().equals(ProposalState.INVIRTE) && agreeCount > proposalConfig.getSeconderNum())) {
int stateCode = proposalProcessService.getSomeNodeNextStateCode(ProposalState.INVIRTE, ProposalStateDirectionEnum.NEXT);
dao.update(ProposalInfo.class, Chain.make("stateCode", stateCode), Cnd.where("id", "=", proposalId));
dao.update(ProposalInfo.class, Chain.make("stateCode", stateCode).add("secondReminderTime", DateUtil.date()), Cnd.where("id", "=", proposalId));
ProposalToDoHandler.CREATE_TEAM_LEADER_TASK.exec(proposalId, null);
}
@@ -9,6 +9,7 @@ import org.nutz.lang.util.NutMap;
import java.io.Serializable;
import java.util.Collections;
import java.util.Date;
import java.util.List;
/**
@@ -247,6 +248,21 @@ public class ProposalInfo extends BaseModel implements Serializable {
@ColDefine(type = ColType.BOOLEAN)
private Boolean caseCheckNeedSecondAudit;
@Column
@Comment("上次催办时间")
@ColDefine(type = ColType.DATETIME)
private Date lastReminderTime;
@Column
@Comment("附议完成的时间")
@ColDefine(type = ColType.DATETIME)
private Date secondReminderTime;
@Column
@Comment("上次团长催办的时间")
@ColDefine(type = ColType.DATETIME)
private Date lastDelegationReminderTime;
/*---------------审核相关 end ---------------*/
public List<NutMap> emptyList() {
@@ -3,6 +3,8 @@ package io.v.nutz.zhgh.proposal.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.util.Date;
/**
* @author: Aaron
* @create: 2021-01-25 11:03
@@ -49,4 +51,8 @@ public class ProposalSeconded {
@ColDefine(type = ColType.BOOLEAN)
private Boolean isAgree;
@Column
@Comment("上次催办时间")
@ColDefine(type = ColType.DATETIME)
private Date lastReminderTime;
}
@@ -7,7 +7,7 @@ package io.v.nutz.zhgh.proposal.services;
*/
public interface ProposalSecondedService {
String TZ_TEMPLATE = "[{}]提案待您审核,请您通过门户网站或企业微信登录智慧工会平台进行审核";
String TZ_TEMPLATE = "[{}]提案待您审核,请您通过门户网站或钉钉登录智慧工会平台进行审核";
/**
* 发送信息给提案人的团长
@@ -196,13 +196,15 @@ public class ProposalCaseConfirmServiceImpl extends ViServiceImpl implements Pro
//完成审核待办
ProposalToDoHandler.COMPLETE_CASE_UNIT_TASK.exec(id, null);
if (resultCode.equals(ProposalConstant.DETERMINE)) {
//推送分管校领导审批待办
ProposalToDoHandler.CREATE_BRANCH_LEADER_PREFIX_AUDIT_TASK.exec(id, NutMap.NEW().addv("hostBranchAudit", hostBranchAudit));
} else if (resultCode.equals(ProposalConstant.OPINION)) {
//推送承办单位答复待办
ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(id, null);
}
// if (resultCode.equals(ProposalConstant.DETERMINE)) {
// //推送分管校领导审批待办
// ProposalToDoHandler.CREATE_BRANCH_LEADER_PREFIX_AUDIT_TASK.exec(id, NutMap.NEW().addv("hostBranchAudit", hostBranchAudit));
// } else if (resultCode.equals(ProposalConstant.OPINION)) {
// //推送承办单位答复待办
// ProposalToDoHandler.CREATE_UNDERTAKE_TASK.exec(id, null);
// }
//推送承办单位答复待办
ProposalToDoHandler.CREATE_CASE_UNIT_TASK.exec(id, null);
}
}
@@ -229,12 +229,9 @@ public class ProposalCaseServiceImpl extends ViServiceImpl implements ProposalCa
ProposalToDoHandler.COMPLETE_CASE_TASK.exec(id,NutMap.NEW().addv("opinion",audit.getOpinion()));
if (resultCode.equals(ProposalConstant.NOTGIVE)) {
sysLocalProcessService.completeProcess("proposal_info@" + id);
} else if (resultCode.equals(ProposalConstant.DETERMINE)) {
ProposalToDoHandler.CREATE_CASE_UNIT_TASK.exec(id,null);
} else if (resultCode.equals(ProposalConstant.OPINION)) {
ProposalToDoHandler.CREATE_CASE_UNIT_TASK.exec(id,null);
switch (resultCode) {
case ProposalConstant.NOTGIVE -> sysLocalProcessService.completeProcess("proposal_info@" + id);
case ProposalConstant.DETERMINE, ProposalConstant.OPINION -> ProposalToDoHandler.CREATE_CASE_UNIT_TASK.exec(id, null);
}
}
}
@@ -26,9 +26,7 @@ import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@@ -216,11 +214,30 @@ public class ProposalCommonServiceImpl extends ViServiceImpl implements Proposal
basicInfo.setv("caseUnitAudit", null);
}
// 承办单位提出意见
Sql underTakeFirstOpinionSql = Sqls.create("""
SELECT
po.*,
pu.unitName AS underTakeName
FROM
proposal_under_take_first_opinion po
LEFT JOIN proposal_undertake pu ON pu.id = po.underTakeId
WHERE
po.proposalId = @proposalId
""").setParam("proposalId", proposalId);
List<NutMap> underTakeFirstOpinionList = proposalAuditService.listMap(underTakeFirstOpinionSql);
if (Lang.isNotEmpty(underTakeFirstOpinionList)) {
basicInfo.setv("underTakeFirstOpinion", underTakeFirstOpinionList);
} else {
basicInfo.setv("underTakeFirstOpinion", null);
}
//分管校领导审批立案
Sql branchCaseSql = Sqls.create("select auditId from proposal_branch_leader_audit where proposalId = @proposalId");
branchCaseSql.setParam("proposalId", proposalId);
String[] branchCaseArray = (String[]) Daos.query(dao(), branchCaseSql.toString(), Sqls.callback.strs());
if (Lang.isNotEmpty(branchCaseArray)) {
if (Lang.isNotEmpty(branchCaseArray) && !Arrays.stream(branchCaseArray).allMatch(Objects::isNull)) {
basicInfo.setv("branchLeaderOpinion", CollectionUtil.addAll(new ArrayList<>(), proposalAuditService.getAuditRecordList(branchCaseArray)));
} else {
basicInfo.setv("branchLeaderOpinion", Collections.emptyList());
@@ -66,11 +66,11 @@ public class ProposalConfigServiceImpl extends ViServiceImpl<ProposalConfig> imp
dao().updateWith(config, null);
Sys_dict dict = sysDictService.fetch(Cnd.where("code", "=", "proposal_manner"));
sysDictService.update(Chain.make("disabled", true), Cnd.where("parentId", "=", Strings.sNull(dict.getId())));
for (String s : mannerList) {
sysDictService.update(Chain.make("disabled", false), Cnd.where("id", "=", s));
}
// Sys_dict dict = sysDictService.fetch(Cnd.where("code", "=", "proposal_manner"));
// sysDictService.update(Chain.make("disabled", true), Cnd.where("parentId", "=", Strings.sNull(dict.getId())));
// for (String s : mannerList) {
// sysDictService.update(Chain.make("disabled", false), Cnd.where("id", "=", s));
// }
Jdh_jdhxx latestJdh = dao().fetch(Jdh_jdhxx.class, Cnd.where("jdhkqzt", "=", 1).desc("jdhkqsj"));
if (latestJdh != null) {
@@ -171,7 +171,9 @@ public class ProposalExportServiceImpl extends BaseServiceImpl implements Propos
}
Sql oneAuditRecordSql = Sqls.create("""
List<NutMap> oneAuditRecordList = new ArrayList<>();
if (StrUtil.isNotBlank(nutMap.getString("caseAuditId"))) {
Sql oneAuditRecordSql = Sqls.create("""
SELECT
pa.*,
sign.`data` auditSign
@@ -180,22 +182,23 @@ public class ProposalExportServiceImpl extends BaseServiceImpl implements Propos
LEFT JOIN sys_signature sign ON sign.id = pa.signId
where pa.id in (@id)
""").setParam("id", Json.fromJsonAsList(String.class, nutMap.getString("caseAuditId")));
List<NutMap> oneAuditRecordList = proposalInfoService.listMap(oneAuditRecordSql);
if (Lang.isNotEmpty(oneAuditRecordList)) {
oneAuditRecordList.forEach(v -> {
try {
v.setv("auditSign", StrUtil.isNotBlank(v.getString("auditSign")) ? getImg(v.getString("auditSign")) : null);
} catch (IOException e) {
e.printStackTrace();
}
if (nutMap.getString("resultCode").equals("determine")) {
v.setv("resultAudit", "经提案工作委员会研究,符合提案立案条件,予以立案,此提案建议由%s办理,%s协办。".formatted(nutMap.getString("under1Unit"), (Strings.isNotBlank(nutMap.getString("under2Unit")) ? nutMap.getString("under2Unit") : "暂无")));
} else if (nutMap.getString("resultCode").equals("opinion")) {
v.setv("resultAudit", "作为意见建议转送参考");
} else {
v.setv("resultAudit", "该提案不予立项,不予立案原因属于以下提案内容");
}
});
oneAuditRecordList = proposalInfoService.listMap(oneAuditRecordSql);
if (Lang.isNotEmpty(oneAuditRecordList)) {
oneAuditRecordList.forEach(v -> {
try {
v.setv("auditSign", StrUtil.isNotBlank(v.getString("auditSign")) ? getImg(v.getString("auditSign")) : null);
} catch (IOException e) {
e.printStackTrace();
}
if ("determine".equals(nutMap.getString("resultCode"))) {
v.setv("resultAudit", "经提案工作组审理,符合提案立案条件,予以立案,此提案建议由%s办理,%s协办。".formatted(nutMap.getString("under1Unit"), (Strings.isNotBlank(nutMap.getString("under2Unit")) ? nutMap.getString("under2Unit") : "暂无")));
} else if ("opinion".equals(nutMap.getString("resultCode"))) {
v.setv("resultAudit", "作为意见建议转送参考");
} else {
v.setv("resultAudit", "该提案不予立项,不予立案原因属于以下提案内容");
}
});
}
}
Sql branchCaseSql = Sqls.create("select auditId from proposal_branch_leader_audit where proposalId = @proposalId AND isMaster=true").setParam("proposalId", proposalId);
@@ -302,30 +305,53 @@ public class ProposalExportServiceImpl extends BaseServiceImpl implements Propos
}
// Sql leaderListSql = Sqls.create("""
// SELECT
// pr.*,
// pu.unitName,
// u.username,
// u.loginname,
// sign.`data`
// FROM
// proposal_reply pr
// LEFT JOIN proposal_undertake pu ON pu.id = pr.replyUnitId
// LEFT JOIN `user` u ON u.id = pr.leaderId
// LEFT JOIN sys_signature sign ON sign.id=pr.leaderSignId
// WHERE
// pr.proposalId = @proposalId
// AND pr.leaderId IS NOT NULL
// And pr.undertakeType=1
// ORDER BY
// pr.undertakeType ASC,
// pr.leaderCheckNumber ASC
// """).setParam("proposalId", proposalId);
// List<NutMap> leaderList = proposalInfoService.listMap(leaderListSql);
// if (Lang.isNotEmpty(leaderList)) {
// leaderList.forEach(v -> {
// v.setv("replyContent", Html2Text.toPlainText(v.getString("replyContent")));
// });
// }
Sql leaderListSql = Sqls.create("""
SELECT
pr.*,
pu.unitName,
u.username,
u.loginname,
sign.`data`
pa.username,
sign.`data`,
pa.auditTime AS replyTime,
pa.opinion AS leaderCheckOpinion
FROM
proposal_reply pr
LEFT JOIN proposal_undertake pu ON pu.id = pr.replyUnitId
LEFT JOIN `user` u ON u.id = pr.leaderId
LEFT JOIN sys_signature sign ON sign.id=pr.leaderSignId
proposal_branch_leader_suffix_audit pblsa
LEFT JOIN `proposal_audit` pa ON pa.id = pblsa.auditId
LEFT JOIN `sys_signature` sign ON sign.id = pa.signId
WHERE
pr.proposalId = @proposalId
AND pr.leaderId IS NOT NULL
And pr.undertakeType=1
ORDER BY
pr.undertakeType ASC,
pr.leaderCheckNumber ASC
pblsa.proposalId = @proposalId
AND pblsa.isAudit = 1
ORDER BY
createdAt DESC
""").setParam("proposalId", proposalId);
List<NutMap> leaderList = proposalInfoService.listMap(leaderListSql);
if (Lang.isNotEmpty(leaderList)) {
leaderList.forEach(v -> {
v.setv("replyContent", Html2Text.toPlainText(v.getString("replyContent")));
v.setv("leaderCheckOpinion", Html2Text.toPlainText(v.getString("leaderCheckOpinion")));
});
}
@@ -81,9 +81,9 @@ public class ProposalReplyServiceImpl extends ViServiceImpl<ProposalReply> imple
Sql sql = Sqls.create(COMMON_SQL);
if (StrUtil.isNotBlank(search.getIsAudit())) {
int isReply = search.getIsAudit().equals("true") ? 1 : 0;
int isReply = "true".equals(search.getIsAudit()) ? 1 : 0;
sql.setVar("temp_sql", "AND isReply = %d group by proposalId".formatted(isReply));
cnd.and("info.stateCode", search.getIsAudit().equals("true") ? ">=" : "=", ProposalState.UNITREPLY);
cnd.and("info.stateCode", "true".equals(search.getIsAudit()) ? ">=" : "=", ProposalState.UNITREPLY);
} else {
sql.setVar("temp_sql", "group by proposalId");
cnd.and("info.stateCode", ">=", ProposalState.UNITREPLY);
@@ -137,8 +137,8 @@ public class ProposalReplyServiceImpl extends ViServiceImpl<ProposalReply> imple
// cnd.and("pr.replyUnitId", "in", manageUnderTakeIds);
if (Strings.isNotBlank(search.getIsAudit())) {
cnd.and("pr.isReply", "=", search.getIsAudit().equals("true") ? 1 : 0);
cnd.and("info.stateCode", search.getIsAudit().equals("true") ? ">=" : "=", ProposalState.UNITREPLY);
cnd.and("pr.isReply", "=", "true".equals(search.getIsAudit()) ? 1 : 0);
cnd.and("info.stateCode", "true".equals(search.getIsAudit()) ? ">=" : "=", ProposalState.UNITREPLY);
} else {
cnd.and("info.stateCode", ">=", ProposalState.UNITREPLY);
}
@@ -307,7 +307,6 @@ public class ProposalReplyServiceImpl extends ViServiceImpl<ProposalReply> imple
chain.add("isReply", isSave ? 0 : 1);
chain.add("replyFiles", reply.getReplyFiles());
List<String> conjoin = proposalCommonService.findConjoin(proposalId);
Cnd cnd = Cnd.NEW();
cnd.and("proposalId", "in", conjoin);
@@ -325,9 +324,15 @@ public class ProposalReplyServiceImpl extends ViServiceImpl<ProposalReply> imple
if (proposalInfo.getResultCode().equals(ProposalConstant.DETERMINE)) {
int stateCode = proposalProcessService.getStateCode(proposalId, ProposalStateDirectionEnum.NEXT, false);
proposalInfo.setStateCode(stateCode);
//插入领导审批记录
ProposalBranchLeaderSuffixAudit leaderSuffixAudit = new ProposalBranchLeaderSuffixAudit();
leaderSuffixAudit.setProposalId(proposalId);
leaderSuffixAudit.setUnderTakeId(replyUnitId);
leaderSuffixAudit.setIsMaster(true);
leaderSuffixAudit.setIsAudit(false);
dao().insert(leaderSuffixAudit);
//反馈评分待办
ProposalToDoHandler.CREATE_FEEDBACK_TASK.exec(proposalId, null);
ProposalToDoHandler.CREATE_BRANCH_LEADER_SUFFIX_AUDIT_TASK.exec(proposalId, NutMap.NEW().addv("leaderSuffixAudit", leaderSuffixAudit));
} else {
proposalInfo.setStateCode(ProposalState.FINISH);
//流程完结
@@ -59,6 +59,15 @@ public class QsvSurveyController {
return Result.success(report);
}
@At
@Ok("void")
@RequiresPermissions("qsv.survey")
public void exportReportXlsx(String activityId, HttpServletResponse response){
qsvSurveyService.exportReportXlsx(activityId, response);
}
// 选项选择详情
@At
@RequiresPermissions("qsv.survey")
@@ -72,8 +81,9 @@ public class QsvSurveyController {
// 用户答题
@At
@RequiresPermissions("qsv.survey")
public Result userAnswer(@Valid String activityId) {
NutMap map = qsvSurveyService.userAnswer(activityId);
public Result userAnswer(PageForm pageForm, @Valid String activityId) { //@Valid String activityId
// NutMap map = qsvSurveyService.userAnswer(activityId);
NutMap map = qsvSurveyService.userAnswer(pageForm, activityId);
return Result.success(map);
}
@@ -89,6 +99,7 @@ public class QsvSurveyController {
// 导出用户答题记录xlsx
@At
@Ok("void")
@RequiresPermissions("qsv.survey")
public void exportUserAnswerXlsx(@Valid String activityId, HttpServletResponse response) {
qsvSurveyService.exportUserAnswerXlsx(activityId, response);
@@ -56,7 +56,7 @@ public class H5QsvSurveyController {
QsvUserAnswerRecord answerRecord = dao.fetch(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("userId", "=", ShiroUtil.getUserId()));
if (answerRecord == null) {
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId));
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("activityId", "=", activityId).asc("sortNum"));
qsvUserAnswerRecordService.insertRecord(activityId, subjects.stream().map(QsvSubject::getId).toList());
}
@@ -66,7 +66,7 @@ public class H5QsvSurveyController {
answerRecordId = answerRecord2.getId();
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("id", "in", answerRecord2.getSubjectIds()));
List<QsvSubject> subjects = dao.query(QsvSubject.class, Cnd.where("id", "in", answerRecord2.getSubjectIds()).asc("sortNum"));
dao.fetchLinks(subjects, "options", Cnd.NEW().asc("sortNum"));
for (QsvSubject subject : subjects) {
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.qsv.service;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.zhgh.qsv.models.QsvUserAnswerRecord;
import org.nutz.lang.util.NutMap;
@@ -11,7 +12,10 @@ public interface QsvSurveyService extends BaseService<QsvUserAnswerRecord> {
List<NutMap> report(String activityId);
void exportReportXlsx(String activityId, HttpServletResponse response);
void exportUserAnswerXlsx(String activityId, HttpServletResponse response);
NutMap userAnswer(String activityId);
// NutMap userAnswer(String activityId);
NutMap userAnswer(PageForm pageForm, String activityId);
}
@@ -4,9 +4,12 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.export.ExcelExportService;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.base.utils.CommonDownloadUtil;
import io.v.nutz.zhgh.qsv.models.QsvActivity;
@@ -16,6 +19,7 @@ import io.v.nutz.zhgh.qsv.models.QsvUserAnswerRecord;
import io.v.nutz.zhgh.qsv.service.QsvSurveyService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
@@ -79,6 +83,10 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
}
// 处理单选类型题目 处理多选类型题目
else if ("radio".equals(subjectType) || "checkbox".equals(subjectType)) {
long selectTotal = answerExtList.stream()
.filter(ext -> ext.containsKey(subject.getString("id")))
.count();
subjectOptions.forEach(subjectOption -> {
long selectCount = answerExtList.stream()
.filter(ext ->
@@ -89,15 +97,22 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
&& jsonObject.getJSONArray("optionIds").contains(subjectOption.getString("id"));
})
.count();
long round = Math.round((double) selectCount / selectTotal * 100);
subjectOption.put("selectPercent", round + "%");
subjectOption.put("selectCount", selectCount);
});
long selectTotal = answerExtList.stream()
.filter(ext -> ext.containsKey(subject.getString("id")))
.count();
subjectOptions.sort((o1, o2) -> {
int count1 = o1.getInt("selectCount");
int count2 = o2.getInt("selectCount");
if (count1 == count2) {
return Integer.compare(o1.getInt("sortNum"), o2.getInt("sortNum"));
}
return Integer.compare(count2, count1);
});
subject.put("selectTotal", selectTotal);
}
// 添加选项到题目中
subject.addv("options", subjectOptions);
}
@@ -109,6 +124,32 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
}
}
@Override
public void exportReportXlsx(String activityId, HttpServletResponse response) {
List<NutMap> report = report(activityId);
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("选项名称", "text", 20));
exportEntities.add(new ExcelExportEntity("选择人数", "selectCount", 20));
exportEntities.add(new ExcelExportEntity("选择比例", "selectPercent", 20));
Map<String, List<NutMap>> listMap = report.stream().collect(Collectors.groupingBy(v -> v.getString("id")));
Workbook workbook = new XSSFWorkbook();
listMap.forEach((k, v) -> {
NutMap nutMap = v.get(0);
ExcelExportService service = new ExcelExportService();
ExportParams exportParams = new ExportParams();
exportParams.setTitle(nutMap.getString("title"));
exportParams.setSheetName(nutMap.getString("title"));
exportParams.setType(ExcelType.XSSF);
service.createSheetForMap(workbook, exportParams, exportEntities, nutMap.getList("options", NutMap.class));
});
CommonDownloadUtil.download("调研分析.xlsx", workbook, response);
}
@Override
public void exportUserAnswerXlsx(String activityId, HttpServletResponse response) {
// 检查活动ID是否为空
@@ -160,16 +201,24 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
}
@Override
public NutMap userAnswer(String activityId) {
public NutMap userAnswer(PageForm pageForm, String activityId) {
// 检查活动ID是否为空
if (activityId == null || activityId.isEmpty()) {
throw new IllegalArgumentException("活动ID不能为空");
}
try {
Cnd cnd = Cnd.NEW();
cnd.and("activityId", "=", activityId);
cnd.and("isFinish", "=", true);
// Cnd.where("activityId", "=", activityId)
// .and("isFinish", "=", true)
Pagination pagination = listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
List<NutMap> answerRecords = pagination.getList();
// 查询用户答题记录
List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
.and("isFinish", "=", true));
// List<QsvUserAnswerRecord> answerRecords = dao().query(QsvUserAnswerRecord.class, Cnd.where("activityId", "=", activityId)
// .and("isFinish", "=", true));
// 将答题记录的扩展JSON转换为JSONObject列表
// List<JSONObject> answerExtList = answerRecords.stream().map(QsvUserAnswerRecord::getExtJson).toList();
@@ -188,7 +237,33 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
// 构建Excel导出实体
List<ExcelExportEntity> excelExportEntities = buildExcelExportEntities(subjects);
// 构建答题记录列表
List<NutMap> list = buildAnswerRecords(answerRecords, subjectMap, options);
List<NutMap> list = answerRecords.stream().map(record -> {
NutMap map = NutMap.NEW()
.addv("id", record.getString("id"))
.addv("loginName", record.getString("loginName"))
.addv("userName", record.getString("userName"))
.addv("unitName", record.getString("unitName"))
.addv("unionName", record.getString("unionName"));
JSONObject extJson = record.getAs("extJson", JSONObject.class);
extJson.forEach((k, v) -> {
JSONObject jsonVal = (JSONObject) v;
String type = subjectMap.get(k).getType();
if (type.equals("text")) {
map.addv(k, jsonVal.getStr("text"));
} else if (type.equals("radio") || type.equals("checkbox")) {
JSONArray optionIds = jsonVal.getJSONArray("optionIds");
String selectOptionTexts = options.stream().filter(option -> optionIds.contains(option.getId()))
.map(QsvOption::getText).collect(Collectors.joining(";"));
map.addv(k, selectOptionTexts);
}
});
return map;
}).toList();
pagination.setList(list);
// List<NutMap> list = buildAnswerRecords(answerRecords, subjectMap, options);
// 构建表格列信息
List<NutMap> tableColumns = excelExportEntities.stream()
@@ -197,7 +272,7 @@ public class QsvSurveyServiceImpl extends BaseServiceImpl<QsvUserAnswerRecord> i
return NutMap.NEW()
.addv("tableColumns", tableColumns)
.addv("tableData", list);
.addv("tableData", pagination);
} catch (Exception e) {
throw new RuntimeException("获取用户答题记录失败", e);
}
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.staffmanage.member.constant;
import com.aspose.slides.internal.og.and;
import io.v.nutz.base.annontation.SelectEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -26,7 +27,7 @@ public enum MemberChangeType {
RESIGN("RESIGN","辞职"),
OUT("OUT","调出"),
LEAVE_OFFICE("LEAVE_OFFICE","离职"),
OTHER("OTHER","其他"),
OTHER("OTHER","其他减员"),
UNIT_CHANGE("UNIT_CHANGE","单位异动"),
UNION_CHANGE("UNION_CHANGE","工会关系异动"),
BASIC_CHANGE("BASIC_CHANGE","基本信息异动");
@@ -8,9 +8,11 @@ import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.model.Audit;
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.sys.models.Sys_union;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.models.User;
import io.v.nutz.sys.services.SysLocalProcessService;
import io.v.nutz.sys.services.SysUserService;
@@ -166,6 +168,17 @@ public class MemberApplyBranchUnionAuditController {
sysUser.setId(user.getId());
dao.updateIgnoreNull(sysUser);
// 还要设置会员角色
int count = dao.count(Sys_user_role.class, Cnd.where("userId", "=", user.getId()).and("roleId", "=", Roles.MEMBER));
if (count == 0) {
Sys_user_role userRole = new Sys_user_role();
userRole.setUserId(user.getId());
userRole.setRoleId(Roles.MEMBER);
dao.insert(userRole);
}
sysUserService.deleteCacheAndUpdate(user.getId());
MemberApplyToDoHandler.COMPLETE_PROCESS.exec(record, null);
String content = "尊敬的%s老师,您已正式成为杭医工会会员,会员关系在%s,欢迎您的加入!"
.formatted(user.getUsername(), union.getUnionname());
@@ -362,6 +362,7 @@ public class MemberChangeManageController {
public Object allIsWelfareMember(PageForm pageForm,
@Param(value = "startDate", required = false) String startDate,
@Param(value = "endDate", required = false) String endDate,
@Param(value = "birthMonth", required = false) String birthMonth,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String[] unionId,
@Param(value = "unitId", required = false) String[] unitId,
@@ -380,7 +381,7 @@ public class MemberChangeManageController {
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord,
@Param(value = "isAppendWelfareMember", required = false) Boolean isAppendWelfareMember) {
int yyyy = Calendar.getInstance().get(Calendar.YEAR);
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, null, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, birthMonth, unionId, unitId, personTypes, userStates, null, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Sql sql = Sqls.create("""
SELECT u.id from $table
LEFT JOIN sys_user_role sur ON sur.userid = u.id
@@ -420,9 +421,9 @@ public class MemberChangeManageController {
Trans.exec(() -> {
// if (!isAppendWelfareMember) {
// memberService.update(Chain.make("welfareMember", WelfareMemberMode.NONE.getCode()), Cnd.where("welfareMember", "=", WelfareMemberMode.NORMAL.getCode()));
// }
if (!isAppendWelfareMember) {
memberService.update(Chain.make("welfareMember", WelfareMemberMode.NONE.getCode()), Cnd.where("welfareMember", "=", WelfareMemberMode.NORMAL.getCode()));
}
// memberService.update(Chain.make("welfareMember", WelfareMemberMode.NORMAL.getCode()), Cnd.where("member", "=", MemberMode.NORMAL.getCode()).and("id", "in", ids));
dao.update(Sys_user.class, Chain.make("welfareMember", true), Cnd.where("id", "in", ids));
});
@@ -729,6 +730,8 @@ public class MemberChangeManageController {
} catch (Exception e) {
log.error(e.getMessage());
return Result.error();
} finally {
lock.unlock();
}
}
@@ -73,6 +73,7 @@ public class MemberInquireIntegrateController {
@Param(value = "isUnion", required = false) String isUnion,
@Param(value = "startDate", required = false) String startDate,
@Param(value = "endDate", required = false) String endDate,
@Param(value = "birthMonth", required = false) String birthMonth,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String[] unionId,
@Param(value = "unitId", required = false) String[] unitId,
@@ -93,7 +94,7 @@ public class MemberInquireIntegrateController {
@Param(value = "memberSearchKeyWord", required = false) String memberSearchKeyWord) {
int yyyy = Calendar.getInstance().get(Calendar.YEAR);
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Cnd cnd = MemberUtils.getCnd(pageForm, startDate, endDate, birthMonth, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Sql sql = Sqls.create("""
SELECT u.* from $table
@@ -442,6 +443,7 @@ public class MemberInquireIntegrateController {
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "startDate", required = false) String startDate,
@Param(value = "endDate", required = false) String endDate,
@Param(value = "birthMonth", required = false) String birthMonth,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String[] unionId,
@Param(value = "unitId", required = false) String[] unitId,
@@ -464,7 +466,7 @@ public class MemberInquireIntegrateController {
try {
int yyyy = Calendar.getInstance().get(Calendar.YEAR);
Cnd cnd = MemberUtils.getCnd(null, startDate, endDate, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Cnd cnd = MemberUtils.getCnd(null, startDate, endDate, birthMonth, unionId, unitId, personTypes, userStates, preparedBys, memberTypes, sexTypes, age, null, roleIds, null, null, memberStatus, threeUnitId, unionGroupId, reverseSelection, null, null, campus);
Sql sql = Sqls.create("""
SELECT u.* from $table
@@ -239,5 +239,10 @@ public class MemberChangeRecord {
@PrevInsert(now = true)
private Date applyDateTime;
@Column
@Comment("福利享受截止日期")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String welfareStopDate;
private Boolean edit;
}
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.staffmanage.member.utils;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.activity.models.ActivityUserCnd;
@@ -22,6 +23,7 @@ public class MemberUtils {
public static Cnd getCnd(PageForm pageForm,
String startDate,
String endDate,
String birthMonth,
String[] unionId,
String[] unitId,
String[] personTypes,
@@ -76,7 +78,7 @@ public class MemberUtils {
}
if (!Lang.isEmptyArray(age)) {
if (!age[1].equals("0")) {
if (!"0".equals(age[1])) {
if (reverseSelection) {
cnd.andNot("TIMESTAMPDIFF(YEAR, u.birthday, CURDATE())", "between", age);
} else {
@@ -117,6 +119,9 @@ public class MemberUtils {
cnd.and(group);*/
}
if (StrUtil.isNotBlank(birthMonth)) {
cnd.and("MONTH(birthday)", EQ_OR_NEQ_OP, NumberUtil.parseInt(birthMonth));
}
cnd.andEX("u.unionid", IN_OR_NIN_OP, unionId);
cnd.andEX("u.unitid", IN_OR_NIN_OP, unitId);
cnd.andEX("u.threeUnitId", IN_OR_NIN_OP, threeUnitId);
@@ -106,13 +106,13 @@ public class SourceChangeManageController {
cnd.and(seg);
}
cnd.andEX("unionId", "=", pageForm.getUnionId());
cnd.andEX("unitId", "=", pageForm.getUnitId());
cnd.andEX("sex", "=", pageForm.getSex());
cnd.andEX("personType", "=", pageForm.getPersonType());
cnd.andEX("preparedBy", "=", pageForm.getPreparedBy());
cnd.andEX("userState", "=", pageForm.getUserState());
cnd.andEX("isOperate", "=", pageForm.getIsOperate());
cnd.andEX("u.unionId", "=", pageForm.getUnionId());
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
cnd.andEX("u.sex", "=", pageForm.getSex());
cnd.andEX("scmt.personType", "=", pageForm.getPersonType());
cnd.andEX("scmt.preparedBy", "=", pageForm.getPreparedBy());
cnd.andEX("scmt.userState", "=", pageForm.getUserState());
cnd.andEX("scmt.isOperate", "=", pageForm.getIsOperate());
if (StrUtil.isAllNotBlank(pageForm.getChangeDateBefore(), pageForm.getChangeDateEnd())) {
cnd.and(new Static(String.format("Date(changeTime) >= '%s' and Date(changeTime) <= '%s'", pageForm.getChangeDateBefore(), pageForm.getChangeDateEnd())));
} else {
@@ -133,7 +133,7 @@ public class SpecialStaffManageController {
@At
@RequiresPermissions("staff.special.manage")
public Result queryUser(String keyWord) {
public Result queryUser(String keyWord, Boolean flag) {
Sql sql = Sqls.create("""
select
id,
@@ -148,7 +148,9 @@ public class SpecialStaffManageController {
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("id", "not in", "(select userId from special_staff)");
if (flag) {
cnd.and("id", "not in", "(select userId from special_staff)");
}
if (StrUtil.isNotBlank(keyWord)) {
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("username", keyWord);
@@ -13,11 +13,14 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.base.utils.MsgApi;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.base.utils.ViTool;
import io.v.nutz.sys.models.User;
import io.v.nutz.web.commons.base.Globals;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.welfare.feature.WelfareFeature;
@@ -42,6 +45,7 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
@@ -71,15 +75,15 @@ import java.util.stream.Collectors;
@At("/platform/welfare/list/mange")
public class WelfareListController {
@Inject
private Dao dao;
@Inject
private MsgApi msgApi;
@Inject
private WelfareListService welfareListService;
@Inject
private WelfareProjectService projectService;
@Inject
private Dao dao;
@At("")
@Ok("beetl:/platform/welfare/list/ListMange.html")
@RequiresPermissions("welfare.list.mange")
@@ -116,7 +120,7 @@ public class WelfareListController {
wus.userSign,
wus.courierNumber,
wus.receiveAddress,
GROUP_CONCAT( DISTINCT wuso.optionName, '', wus.selectNum, '' ) AS gist_list
GROUP_CONCAT( DISTINCT wuso.optionName, IF(wus.selectSpecs is not null, (CONCAT('规格:', wus.selectSpecs)), ''), '', wus.selectNum, '' ) AS gist_list
FROM
view_welfare_list wl
LEFT JOIN welfare_project_user_selection wus ON wus.welfareId = wl.projectId
@@ -276,8 +280,9 @@ public class WelfareListController {
selection.setSubjectId(v.getString("subjectId"));
selection.setSelectNum(v.getInt("selectNum"));
selection.setUserSign(finalSign);
selection.setSelectSpecs(v.getString("selectSpecs"));
return selection;
}).collect(Collectors.toList());
}).toList();
List<WelfareUserSelection> userSelections1 = userSelections.stream().filter(v -> v.getSelectNum() > 0).collect(Collectors.toList());
dao.insert(userSelections1);
@@ -394,8 +399,7 @@ public class WelfareListController {
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object importCourierNumber(@Param("file") TempFile file,
@Param("projectId") String projectId,
@Param("optionId") String optionId
) {
@Param("optionId") String optionId) {
if (Lang.isEmpty(file)) {
return Result.error("上传的文件不能为空");
}
@@ -668,4 +672,80 @@ public class WelfareListController {
}
}
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object queryNotWelfareListUsers(@Param("projectId") String projectId, @Param("query") String query){
if (StrUtil.isBlank(query)) {
return null;
}
Sql sql = Sqls.create("""
SELECT
id,
loginname,
username,
unitid,
unitname
FROM
`user`
$condition
AND id not in (select userId from welfare_list where projectId = @projectId)
""").setParam("projectId", projectId);
Cnd cnd = Cnd.NEW();
SqlExpressionGroup seg = new SqlExpressionGroup();
seg.orLike("loginname", query);
seg.orLike("username", query);
cnd.and(seg);
sql.setCondition(cnd);
Pagination pagination = welfareListService.listPageMap(1, 10, sql);
return pagination;
}
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object addWelfareList(@Param("projectId") String projectId, @Param("userIds") String[] userIds) {
List<String> userIdList = Arrays.stream(userIds).toList();
Sql sql = Sqls.create("select id,loginname,username,unionid,unitid,userState,personType from `user` where id in (@userIdList)")
.setParam("userIdList", userIdList);
sql.setCallback(Sqls.callback.maps());
dao.execute(sql);
List<NutMap> userInfoList = (List<NutMap>) sql.getResult();
List<WelfareList> welfareLists = userInfoList.stream().map(v -> {
WelfareList welfareList = new WelfareList();
welfareList.setId(R.UU32());
welfareList.setProjectId(projectId);
welfareList.setUserId(v.getString("id"));
welfareList.setWelfareUnitId(v.getString("unionid"));
welfareList.setWelfareSecondLevelUnitId(v.getString("unitid"));
welfareList.setIsReceive(null);
welfareList.setIsAutoSelect(null);
welfareList.setUserState(v.getString("userState"));
welfareList.setPersonType(v.getString("personType"));
return welfareList;
}).toList();
dao.fastInsert(welfareLists);
return null;
}
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object sendMsg(@Param("projectId") String projectId, @Param("title") String title,
@Param("content") String content, @Param("loginname") String loginname){
if (StrUtil.isNotBlank(loginname)) {
String link = Globals.AppDomain + "/mobile/welfare/list/receive?projectId=%s".formatted(projectId);
msgApi.sendMsg(List.of("DingTalk"), loginname, 2, title, content, "", link);
}
return null;
}
}
@@ -71,7 +71,7 @@ public class WelfareMineController {
WHEN wus.selectUserId IS NOT NULL THEN 1
ELSE 0
END AS isChoose,
GROUP_CONCAT(DISTINCT wuso.optionName,wus.selectNum) AS gist_list,
GROUP_CONCAT( DISTINCT wuso.optionName, IF(wus.selectSpecs is not null, (CONCAT('规格:', wus.selectSpecs)), ''), '', wus.selectNum, '' ) AS gist_list,
wus.receiveAddress,
wcn.courierNumber,
wl.userId
@@ -121,7 +121,7 @@ public class WelfareMineController {
@At
@ViReturn
@RequiresPermissions("welfare.mine")
public Object getUserSelection(String projectId, String userId) {
public Object getUserSelection(String projectId, @Param(value = "userId", required = false) String userId) {
Sql sql = Sqls.create("""
SELECT
wpus.id AS selectId,
@@ -133,6 +133,7 @@ public class WelfareMineController {
wpus.userSign,
wpus.courierNumber,
wpus.selectTime,
wpus.selectSpecs,
wpso.imgUrl,
wpso.simpleDesc,
wpso.simpleDesc,
@@ -22,6 +22,7 @@ import io.v.nutz.zhgh.welfare.model.WelfareProjectSubjectOption;
import io.v.nutz.zhgh.welfare.model.WelfareUserSelection;
import io.v.nutz.zhgh.welfare.service.WelfareListService;
import io.v.nutz.zhgh.welfare.service.WelfareProjectService;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
@@ -53,6 +54,7 @@ import java.util.stream.Collectors;
* @date: 2021/2/3
* @since 1.0
*/
@Slf4j
@IocBean
@Ok("json")
@At("/platform/welfare/project/mange")
@@ -120,6 +122,7 @@ public class WelfareProjectMangeController {
@RequiresPermissions("welfare.project.mange")
public Object save(WelfareProject project) {
System.out.println(project);
Trans.exec(() -> {
project.setYear(DateUtil.thisYear());
@@ -202,6 +205,7 @@ public class WelfareProjectMangeController {
optionChain.add("shoppingName", o.getShoppingName());
optionChain.add("supplier", o.getSupplier());
optionChain.add("simpleDesc", o.getSimpleDesc());
optionChain.add("specs", o.getSpecs());
dao.insert(WelfareProjectSubjectOption.class, optionChain);
});
});
@@ -296,7 +300,7 @@ public class WelfareProjectMangeController {
@At
@ViReturn
@RequiresPermissions("welfare.list.mange")
public Object sendMsgToNotWelfareUsers(String projectId, String sendMsgValue) {
public Object sendMsgToNotWelfareUsers(String projectId, String title, String sendMsgValue) {
Sql sql = Sqls.create("""
SELECT
u.loginname
@@ -326,7 +330,7 @@ public class WelfareProjectMangeController {
if ("51e3449b5f234dd58757de63142d6b48".equals(projectId)) {
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "答题纪念品!点开有惊喜!", sendMsgValue, "", link);
} else {
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, "职工福利", sendMsgValue, "", link);
msgApi.sendMsg(List.of("DingTalk"), loginNames, 2, title, sendMsgValue, "", link);
}
return null;
}
@@ -65,7 +65,7 @@ public class WelfareUserChooseController {
ELSE 0
END AS isChoose,
wus.selectTime,
GROUP_CONCAT(DISTINCT wuso.optionName ,'',wus.selectNum,'') AS gist_list,
GROUP_CONCAT( DISTINCT wuso.optionName, IF(wus.selectSpecs is not null, (CONCAT('规格:', wus.selectSpecs)), ''), '', wus.selectNum, '' ) AS gist_list,
wus.receiveAddress
FROM
welfare_project wp
@@ -99,8 +99,7 @@ public class WelfareSingleController {
@Param(value = "month", required = false) String month,
@Param(value = "welfareUnitCode", required = false) String welfareUnitCode,
@Param(value = "unionGroupId", required = false) String unionGroupId,
@Param(value = "personType", required = false) String personType
) {
@Param(value = "personType", required = false) String personType) {
return welfareSingleService.pageData(projectId, month, welfareUnitCode, unionGroupId, personType);
}
@@ -389,7 +388,7 @@ public class WelfareSingleController {
u.idcard AS idCard,
u.mobile,
IF(LOCATE('undefined',wpus.receiveAddress)>0,NULL,wpus.receiveAddress) as receiveAddress,
GROUP_CONCAT(DISTINCT wpso.optionName ,'',wpus.selectNum,'') optionName,
GROUP_CONCAT(DISTINCT wpso.optionName, IF(wpus.selectSpecs is not null, (CONCAT('规格:', wpus.selectSpecs)), ''), '',wpus.selectNum,'') optionName,
wpus.courierNumber
FROM
welfare_project_user_selection wpus
@@ -1,5 +1,6 @@
package io.v.nutz.zhgh.welfare.model;
import cn.hutool.json.JSONObject;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -7,6 +8,8 @@ import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @author zxy
* @Description TODO
@@ -90,6 +93,12 @@ public class WelfareProjectSubjectOption extends BaseModel {
@ColDefine(type = ColType.VARCHAR,width = 100)
private String simpleDesc;
@Column
@Comment("商品规格")
@ColDefine(type = ColType.MYSQL_JSON)
private List<JSONObject> specs;
private Integer rank;
private Long selectCount;
}
@@ -86,6 +86,11 @@ public class WelfareUserSelection {
@ColDefine(type = ColType.DATETIME)
private Date selectExpressDate;
@Column
@Comment("选择规格参数")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String selectSpecs;
@Data
public static class LogisticsTrace {
//运单号物流流转当前最新变更时间
@@ -470,7 +470,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
u.mobile,
IF(LOCATE('undefined',wpus.receiveAddress)>0,NULL,wpus.receiveAddress) as receiveAddress,
wpus.userSign,
GROUP_CONCAT(DISTINCT wpso.optionName ,'',wpus.selectNum,'') optionName,
GROUP_CONCAT(DISTINCT wpso.optionName, IF(wpus.selectSpecs is not null, (CONCAT('规格:', wpus.selectSpecs)), ''), '',wpus.selectNum,'') optionName,
wpus.courierNumber
FROM
welfare_project_user_selection wpus