pref#hmc_生日祝福、短信优化
This commit is contained in:
@@ -10,7 +10,10 @@ import com.google.gson.JsonObject;
|
||||
import io.v.nutz.base.enums.Env;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.model.UserBirthdayMsgLog;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.service.UserBirthdayMsgLogService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.integration.jedis.RedisService;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -49,6 +52,8 @@ public class MsgApi {
|
||||
|
||||
@Inject
|
||||
private RedisService redisService;
|
||||
@Inject
|
||||
private UserBirthdayMsgLogService userBirthdayMsgLogService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -61,53 +66,20 @@ public class MsgApi {
|
||||
* @author zhf
|
||||
* @description
|
||||
*/
|
||||
@SLog(type = "api", tag = "消息发送", msg = "推送钉钉消息", param = true, result = true)
|
||||
public void sendMsg(List<String> channels, String loginNameStr, Integer mtype, String title, String content, String imageUrl,String link) {
|
||||
try {
|
||||
if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Globals.isEnv(Env.dev)) {
|
||||
log.info("开发模式不允许发送短信!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(title)||StrUtil.isBlank(content) ||Lang.isEmpty(channels) || Lang.isEmpty(loginNameStr)) {
|
||||
log.info("发送失败,缺少需要参数请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> loginNamesList = Arrays.stream(loginNameStr.split(",")).map(String::trim).filter(s -> !s.isEmpty()).toList();
|
||||
|
||||
if (Lang.isNotEmpty(loginNamesList)) {
|
||||
List<List<String>> splitList = ListUtil.split(loginNamesList, 100);
|
||||
|
||||
for (List<String> sublist : splitList) {
|
||||
// 获取token
|
||||
String msgToken = getMsgToken();
|
||||
// 封装发送消息的参数
|
||||
NutMap map = createMessageMap(channels, sublist, mtype, title, content, imageUrl, link);
|
||||
log.info("短信发送内容:{}", map);
|
||||
// 发送请求
|
||||
JSONObject jsonObject = sendRequest(msgToken, map);
|
||||
// 判断发送结果
|
||||
int status = jsonObject.getInteger("code");
|
||||
if (status == 200) {
|
||||
log.info("==================================================发送成功: {}", jsonObject.toJSONString());
|
||||
} else {
|
||||
log.error("==================================================发送失败: {}", jsonObject.toJSONString());
|
||||
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@SLog(type = "api", tag = "消息发送", msg = "推送消息", param = true, result = true)
|
||||
public void sendMsg(List<String> channels, String loginNameStr, Integer mtype, String title, String content, String imageUrl, String link) {
|
||||
if (StrUtil.isBlank(loginNameStr)) {
|
||||
log.warn("工号字符串为空,跳过发送");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> loginNamesList = Arrays.stream(loginNameStr.split(","))
|
||||
.map(String::trim)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
sendMsgInternal(channels, loginNamesList, mtype, title, content, imageUrl, link, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param channels 推送渠道 (INNER:站内消息; SMS:短信; Mail:邮件; WeChat:微信; DingTalk:钉钉;同时推送多个渠道用英文逗号分隔 )
|
||||
@@ -119,8 +91,22 @@ public class MsgApi {
|
||||
* @author zhf
|
||||
* @description
|
||||
*/
|
||||
@SLog(type = "api", tag = "消息发送", msg = "推送钉钉消息", param = true, result = true)
|
||||
public void sendMsg(List<String> channels, List<String> loginNameList, Integer mtype, String title, String content, String imageUrl,String link) {
|
||||
@SLog(type = "api", tag = "消息发送", msg = "推送消息", param = true, result = true)
|
||||
public void sendMsg(List<String> channels, List<String> loginNameList, Integer mtype, String title, String content, String imageUrl, String link) {
|
||||
sendMsgInternal(channels, loginNameList, mtype, title, content, imageUrl, link, null);
|
||||
}
|
||||
|
||||
|
||||
@SLog(type = "api", tag = "消息发送", msg = "推送消息", param = true, result = true)
|
||||
public void sendMsgByBirthday(List<String> channels, List<String> loginNameList, Integer mtype, String title, String content, String imageUrl, String link) {
|
||||
sendMsgInternal(channels, loginNameList, mtype, title, content, imageUrl, link, "birthday");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 核心私有方法:统一处理消息发送逻辑
|
||||
*/
|
||||
private void sendMsgInternal(List<String> channels, List<String> loginNameList, Integer mtype, String title, String content, String imageUrl, String link, String type) {
|
||||
try {
|
||||
if (!Globals.MyConfig.getBoolean("SendMsg")) {
|
||||
log.info("发送失败,消息暂未开启!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
@@ -128,40 +114,43 @@ public class MsgApi {
|
||||
}
|
||||
|
||||
if (Globals.isEnv(Env.dev)) {
|
||||
log.info("开发模式不允许发送短信!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
log.info("开发模式不允许发送消息!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(title)||StrUtil.isBlank(content) ||Lang.isEmpty(channels) || Lang.isEmpty(loginNameList)) {
|
||||
log.info("发送失败,缺少需要参数请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
if (StrUtil.isBlank(title) || StrUtil.isBlank(content) || Lang.isEmpty(channels) || Lang.isEmpty(loginNameList)) {
|
||||
log.info("发送失败,缺少必要参数,请检查!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(loginNameList)) {
|
||||
List<List<String>> splitList = ListUtil.split(loginNameList, 100);
|
||||
// 分批处理(每批最多100人)
|
||||
List<List<String>> splitList = ListUtil.split(loginNameList, 100);
|
||||
for (List<String> sublist : splitList) {
|
||||
String msgToken = getMsgToken();
|
||||
NutMap map = createMessageMap(channels, sublist, mtype, title, content, imageUrl, link);
|
||||
log.info("消息发送内容:{}", map);
|
||||
|
||||
JSONObject jsonObject = sendRequest(msgToken, map);
|
||||
int status = jsonObject.getInteger("code");
|
||||
|
||||
for (List<String> sublist : splitList) {
|
||||
// 获取token
|
||||
String msgToken = getMsgToken();
|
||||
// 封装发送消息的参数
|
||||
NutMap map = createMessageMap(channels, sublist, mtype, title, content, imageUrl, link);
|
||||
log.info("短信发送内容:{}", map);
|
||||
// 发送请求
|
||||
JSONObject jsonObject = sendRequest(msgToken, map);
|
||||
// 判断发送结果
|
||||
int status = jsonObject.getInteger("code");
|
||||
if (status == 200) {
|
||||
log.info("==================================================发送成功: {}", jsonObject.toJSONString());
|
||||
} else {
|
||||
log.error("==================================================发送失败: {}", jsonObject.toJSONString());
|
||||
throw new RuntimeException("Message sending failed with status code: " + status + ", Message: " + jsonObject.getString("message"));
|
||||
if (status == 200) {
|
||||
log.info("==================================================发送成功: {}", jsonObject.toJSONString());
|
||||
|
||||
if ("birthday".equals(type)) {
|
||||
userBirthdayMsgLogService.insertLog(loginNameList, title, content, imageUrl, link);
|
||||
}
|
||||
|
||||
} else {
|
||||
String errorMsg = jsonObject.getString("message");
|
||||
log.error("==================================================发送失败: {}", jsonObject.toJSONString());
|
||||
throw new RuntimeException("消息发送失败,状态码: " + status + ", 原因: " + errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("消息发送异常", e);
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("消息发送过程中发生异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,11 @@ public class SysHomeActivityController {
|
||||
Date today = DateUtil.date();
|
||||
for (Sys_home_activity activity : list) {
|
||||
// 该活动的时间范围
|
||||
|
||||
if (activity.getStartDate() == null || activity.getEndDate() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Date startDate = activity.getStartDate();
|
||||
Date endDate = activity.getEndDate();
|
||||
// 判断当前时间是否在活动范围内,不在就过滤掉
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package io.v.nutz.task.job.staffmanage;
|
||||
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
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 FKY
|
||||
* @name:UserBirthdayJob
|
||||
* @Date 2025/12/30 11:01
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
public class UserBirthdayJob implements Job {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
loginname,
|
||||
username,
|
||||
unitname,
|
||||
unionname,
|
||||
mobile
|
||||
FROM
|
||||
`user`
|
||||
WHERE
|
||||
MONTH ( birthday ) = MONTH (CURDATE())
|
||||
AND DAY ( birthday ) = DAY (CURDATE())
|
||||
AND member = 1 AND birthday != '' AND birthday is not null
|
||||
""");
|
||||
sql.setCallback(Sqls.callback.maps());
|
||||
dao.execute(sql);
|
||||
List<NutMap> list = sql.getList(NutMap.class);
|
||||
|
||||
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5";
|
||||
|
||||
List<String> loginNameList = list.stream().map(v -> v.getString("loginname")).toList();
|
||||
|
||||
msgApi.sendMsgByBirthday(List.of("DingTalk"), loginNameList, 2, "智慧工会", "请查收您的生日祝福。", null, link);
|
||||
}
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.model.UserBirthdayConfig;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.service.UserBirthdayService;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.vo.UserBirthdayPageVO;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.vo.UserBirthdaySendMsgVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayManageController
|
||||
* @Date 2025/12/23 11:20
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@At("/platform/staffManage/birthday/manage")
|
||||
public class UserBirthdayManageController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
@Inject
|
||||
private UserBirthdayService userBirthdayService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/staffmanage/birthday/manage/index.html")
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At("/h5")
|
||||
@Ok("beetl:/mobile/staffmanage/birthday/index.html")
|
||||
@RequiresAuthentication
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result pageData(UserBirthdayPageVO page){
|
||||
Sql sql = userBirthdayService.commonSql(page);
|
||||
Pagination pagination = userBirthdayService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public void doExport(UserBirthdayPageVO page, HttpServletResponse response) {
|
||||
userBirthdayService.exportXlsx(page, response);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result sendMsgByQueryUsers(UserBirthdaySendMsgVO vo) {
|
||||
if (StrUtil.isBlank(vo.getTitle())) {
|
||||
return Result.error("请输入标题");
|
||||
}
|
||||
if (StrUtil.isBlank(vo.getContent())) {
|
||||
return Result.error("请输入发送内容");
|
||||
}
|
||||
|
||||
Sql sql = userBirthdayService.commonSql(vo);
|
||||
List<NutMap> list = userBirthdayService.listMap(sql);
|
||||
|
||||
List<String> loginNameList = list.stream().map(v -> v.getString("loginname")).toList();
|
||||
|
||||
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5";
|
||||
|
||||
msgApi.sendMsgByBirthday(List.of("DingTalk"), loginNameList, 2, vo.getTitle(),
|
||||
vo.getContent(), "", link);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result sendMsgByUser(UserBirthdaySendMsgVO vo) {
|
||||
if (StrUtil.isBlank(vo.getTitle())) {
|
||||
return Result.error("请输入标题");
|
||||
}
|
||||
if (StrUtil.isBlank(vo.getContent())) {
|
||||
return Result.error("请输入发送内容");
|
||||
}
|
||||
|
||||
Sys_user user = dao.fetch(Sys_user.class, Cnd.where("id", "=", vo.getUserId()));
|
||||
|
||||
if (Lang.isEmpty(user)) {
|
||||
return Result.error("未获取到消息接收人");
|
||||
}
|
||||
|
||||
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5";
|
||||
msgApi.sendMsgByBirthday(List.of("DingTalk"), List.of(user.getLoginname()), 2, vo.getTitle(),
|
||||
vo.getContent(), "", link);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Result getConfig() {
|
||||
UserBirthdayConfig config = dao.fetch(UserBirthdayConfig.class, Cnd.NEW().desc("updatedAt"));
|
||||
if (Lang.isEmpty(config)) {
|
||||
config = new UserBirthdayConfig();
|
||||
}
|
||||
return Result.success().addData(config);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result saveOrModifyConfig(UserBirthdayConfig config) {
|
||||
dao.insertOrUpdate(config);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.controller;
|
||||
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.service.UserBirthdayMsgLogService;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.vo.UserBirthdayMsgLogPageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayMsgLogController
|
||||
* @Date 2025/12/29 16:27
|
||||
* @注释
|
||||
*/
|
||||
@IocBean
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@At("/platform/staffManage/birthday/msgLog")
|
||||
public class UserBirthdayMsgLogController {
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
@Inject
|
||||
private UserBirthdayMsgLogService userBirthdayMsgLogService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/staffmanage/birthday/msglog/index.html")
|
||||
@RequiresPermissions("staffManage.birthday.msgLog")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.msgLog")
|
||||
public Result pageData(UserBirthdayMsgLogPageVO page){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
log.*,
|
||||
u.loginname AS loginname,
|
||||
u.username AS username,
|
||||
unit.`name` AS unitName,
|
||||
un.`unionname` AS unionName
|
||||
FROM
|
||||
user_birthday_msg_log log
|
||||
LEFT JOIN sys_user u ON u.id = log.receiveBy
|
||||
LEFT JOIN sys_unit unit ON u.unitid = unit.id
|
||||
LEFT JOIN sys_union un ON un.id = unit.unionId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
page.buildSearch(cnd);
|
||||
cnd.desc("log.pushTime");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = userBirthdayMsgLogService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.model;
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayConfig
|
||||
* @Date 2025/12/29 9:41
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserBirthdayConfig extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("图片地址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String picUrl;
|
||||
|
||||
@Column
|
||||
@Comment("生日贺卡地址")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String birthdayUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.model;
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayMsgLog
|
||||
* @Date 2025/12/29 16:28
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@Table
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserBirthdayMsgLog extends BaseModel {
|
||||
|
||||
@Name
|
||||
@Comment("id")
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("推送时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String pushTime;
|
||||
|
||||
@Column
|
||||
@Comment("消息标题")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String msgTitle;
|
||||
|
||||
@Column
|
||||
@Comment("消息内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String msgContent;
|
||||
|
||||
@Column
|
||||
@Comment("接收人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String receiveBy;
|
||||
|
||||
@Column
|
||||
@Comment("接收人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String receiveName;
|
||||
|
||||
@Column
|
||||
@Comment("推送人")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String pushBy;
|
||||
|
||||
@Column
|
||||
@Comment("推送人姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String pushByName;
|
||||
|
||||
@Column
|
||||
@Comment("推送人类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String pushType;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.service;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.model.UserBirthdayMsgLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayMsgLogService
|
||||
* @Date 2025/12/29 16:52
|
||||
* @注释
|
||||
*/
|
||||
public interface UserBirthdayMsgLogService extends BaseService<UserBirthdayMsgLog> {
|
||||
|
||||
void insertLog(List<String> loginNameList, String title, String content, String imageUrl, String link);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.service;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.vo.UserBirthdayPageVO;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayService
|
||||
* @Date 2025/12/23 11:21
|
||||
* @注释
|
||||
*/
|
||||
public interface UserBirthdayService extends BaseService<Sys_user> {
|
||||
|
||||
Sql commonSql(UserBirthdayPageVO pageVO);
|
||||
|
||||
|
||||
void exportXlsx(UserBirthdayPageVO pageVO, HttpServletResponse response);
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.base.utils.ManyAddOrRenewUtil;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.model.UserBirthdayMsgLog;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.service.UserBirthdayMsgLogService;
|
||||
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.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayMsgLogServiceImpl
|
||||
* @Date 2025/12/29 16:52
|
||||
* @注释
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class UserBirthdayMsgLogServiceImpl extends BaseServiceImpl<UserBirthdayMsgLog> implements UserBirthdayMsgLogService {
|
||||
|
||||
public UserBirthdayMsgLogServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void insertLog(List<String> loginNameList, String title, String content, String imageUrl, String link) {
|
||||
String pushBy;
|
||||
String pushByName;
|
||||
String pushType;
|
||||
String pushTime = DateUtil.now();
|
||||
|
||||
try {
|
||||
pushBy = ShiroUtil.getUserId();
|
||||
pushByName = ShiroUtil.getPlatformUsername();
|
||||
pushType = "手动推送";
|
||||
} catch (Exception e) {
|
||||
pushBy = "system";
|
||||
pushByName = "系统推送";
|
||||
pushType = "系统推送";
|
||||
}
|
||||
|
||||
Sql sql = Sqls.create("select id,username from sys_user $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("loginname", "in", loginNameList);
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> listMap = this.listMap(sql);
|
||||
|
||||
String finalPushBy = pushBy;
|
||||
String finalPushByName = pushByName;
|
||||
String finalPushType = pushType;
|
||||
List<UserBirthdayMsgLog> list = listMap.stream().map(v -> {
|
||||
UserBirthdayMsgLog msgLog = new UserBirthdayMsgLog();
|
||||
msgLog.setId(R.UU32());
|
||||
msgLog.setReceiveBy(v.getString("id"));
|
||||
msgLog.setReceiveName(v.getString("username"));
|
||||
msgLog.setMsgTitle(title);
|
||||
msgLog.setMsgContent(content);
|
||||
msgLog.setPushBy(finalPushBy);
|
||||
msgLog.setPushByName(finalPushByName);
|
||||
msgLog.setPushType(finalPushType);
|
||||
msgLog.setPushTime(pushTime);
|
||||
return msgLog;
|
||||
}).toList();
|
||||
|
||||
dao().fastInsert(list);
|
||||
}
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.service.impl;
|
||||
|
||||
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 io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.base.utils.CommonDownloadUtil;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.service.UserBirthdayService;
|
||||
import io.v.nutz.zhgh.staffmanage.birthday.vo.UserBirthdayPageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
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.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayServiceImpl
|
||||
* @Date 2025/12/23 11:21
|
||||
* @注释
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class UserBirthdayServiceImpl extends BaseServiceImpl<Sys_user> implements UserBirthdayService {
|
||||
|
||||
public UserBirthdayServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql commonSql(UserBirthdayPageVO page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.loginname,
|
||||
u.username,
|
||||
u.sex,
|
||||
u.birthday,
|
||||
u.mobile,
|
||||
u.unitName,
|
||||
u.unionName,
|
||||
u.userState,
|
||||
u.personType,
|
||||
u.preparedBy,
|
||||
DATEDIFF(
|
||||
CASE
|
||||
WHEN DATE_FORMAT(u.birthday, '%m-%d') >= DATE_FORMAT(NOW(), '%m-%d')
|
||||
THEN CONCAT(YEAR(NOW()), '-', DATE_FORMAT(u.birthday, '%m-%d'))
|
||||
ELSE CONCAT(YEAR(NOW()) + 1, '-', DATE_FORMAT(u.birthday, '%m-%d'))
|
||||
END,
|
||||
CURDATE()
|
||||
) AS daysUntilBirthday
|
||||
FROM
|
||||
`user` u
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("u.birthday", "!=", "");
|
||||
cnd.and("u.birthday", "is not", null);
|
||||
cnd.and("u.member", "=", 1);
|
||||
page.buildSearch(cnd, "u.");
|
||||
cnd.asc("daysUntilBirthday");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportXlsx(UserBirthdayPageVO pageVO, HttpServletResponse response) {
|
||||
try {
|
||||
Sql sql = this.commonSql(pageVO);
|
||||
List<NutMap> list = this.listMap(sql);
|
||||
|
||||
List<ExcelExportEntity> excelExportEntities = new ArrayList<>();
|
||||
excelExportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("姓名", "username", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("性别", "sex", 10));
|
||||
excelExportEntities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("出生年月", "birthday", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("生日倒计时(天)", "daysUntilBirthday", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("在职状态", "userState", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("人员类型", "personType", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("人员性质", "preparedBy", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
excelExportEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
|
||||
// 设置导出参数
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
// 导出Excel并下载
|
||||
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, excelExportEntities, list)) {
|
||||
CommonDownloadUtil.download("答题记录.xlsx", workbook, response);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("导出Excel失败", e);
|
||||
throw new RuntimeException("导出Excel失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayMsgLogPageVO
|
||||
* @Date 2025/12/30 9:26
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserBirthdayMsgLogPageVO extends PageForm {
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String unitId;
|
||||
/**
|
||||
* 工会ID
|
||||
*/
|
||||
private String unionId;
|
||||
|
||||
|
||||
public void buildSearch(Cnd cnd) {
|
||||
if (cnd == null) {
|
||||
cnd = Cnd.NEW();
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(this.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("u.username", this.getSearchKeyword());
|
||||
seg.orLike("u.loginname", this.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
cnd.andEX("unit.id", "=", this.getUnitId());
|
||||
cnd.andEX("un.id", "=", this.getUnionId());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.vo;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdayPageVO
|
||||
* @Date 2025/12/23 11:45
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserBirthdayPageVO extends PageForm {
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private String unitId;
|
||||
/**
|
||||
* 工会ID
|
||||
*/
|
||||
private String unionId;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 是否会员
|
||||
*/
|
||||
private Boolean member;
|
||||
/**
|
||||
* 用户状态
|
||||
*/
|
||||
private List<String> userStates;
|
||||
/**
|
||||
* 人员类型
|
||||
*/
|
||||
private List<String> personTypes;
|
||||
/**
|
||||
* 编制类别
|
||||
*/
|
||||
private List<String> preparedBys;
|
||||
/**
|
||||
* 生日开始时间
|
||||
*/
|
||||
private String startDate;
|
||||
/**
|
||||
* 生日结束时间
|
||||
*/
|
||||
private String endDate;
|
||||
|
||||
|
||||
public void buildSearch(Cnd cnd, String prefix){
|
||||
if (cnd == null) {
|
||||
cnd = Cnd.NEW();
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(this.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike(prefix + "username", this.getSearchKeyword());
|
||||
seg.orLike(prefix + "loginname", this.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
|
||||
cnd.andEX(prefix + "unitId", "=", this.getUnitId());
|
||||
cnd.andEX(prefix + "unionId", "=", this.getUnionId());
|
||||
cnd.andEX(prefix + "sex", "=", this.getSex());
|
||||
cnd.andEX(prefix + "member", "=", this.getMember());
|
||||
cnd.andEX(prefix + "userState", "in", this.getUserStates());
|
||||
cnd.andEX(prefix + "preparedBy", "in", this.getPreparedBys());
|
||||
cnd.andEX(prefix + "personType", "in", this.getPersonTypes());
|
||||
|
||||
|
||||
// 查询出生年月,忽略年份
|
||||
if (StrUtil.isAllNotBlank(this.getStartDate(), this.getEndDate())) {
|
||||
String startDateStr = DateUtil.format(DateUtil.parse(this.getStartDate()), "MM-dd");
|
||||
String endDateStr = DateUtil.format(DateUtil.parse(this.getEndDate()), "MM-dd");
|
||||
if (startDateStr.compareTo(endDateStr) > 0) {
|
||||
cnd.and(new Static(String.format(
|
||||
"(DATE_FORMAT(birthday, '%%m-%%d') >= '%s' OR DATE_FORMAT(birthday, '%%m-%%d') <= '%s')",
|
||||
startDateStr, endDateStr
|
||||
)));
|
||||
} else {
|
||||
cnd.and(new Static(String.format(
|
||||
"DATE_FORMAT(birthday, '%%m-%%d') >= '%s' AND DATE_FORMAT(birthday, '%%m-%%d') <= '%s'",
|
||||
startDateStr, endDateStr
|
||||
)));
|
||||
}
|
||||
|
||||
} else if (StrUtil.isNotBlank(this.getStartDate())) {
|
||||
cnd.and(new Static(String.format(
|
||||
"DATE_FORMAT(birthday, '%%m-%%d') >= '%s'",
|
||||
DateUtil.format(DateUtil.parse(this.getStartDate()), "MM-dd")
|
||||
)));
|
||||
} else if (StrUtil.isNotBlank(this.getEndDate())) {
|
||||
cnd.and(new Static(String.format(
|
||||
"DATE_FORMAT(birthday, '%%m-%%d') <= '%s'",
|
||||
DateUtil.format(DateUtil.parse(this.getEndDate()), "MM-dd")
|
||||
)));
|
||||
} else {
|
||||
// 默认查询15天内的
|
||||
String today = DateUtil.format(DateUtil.date(), "MM-dd");
|
||||
String endDate = DateUtil.format(DateUtil.offsetDay(DateUtil.date(), 15), "MM-dd");
|
||||
|
||||
if (today.compareTo(endDate) > 0) {
|
||||
cnd.and(new Static(String.format(
|
||||
"(DATE_FORMAT(birthday, '%%m-%%d') >= '%s' OR DATE_FORMAT(birthday, '%%m-%%d') <= '%s')",
|
||||
today, endDate
|
||||
)));
|
||||
} else {
|
||||
cnd.and(new Static(String.format(
|
||||
"DATE_FORMAT(birthday, '%%m-%%d') >= '%s' AND DATE_FORMAT(birthday, '%%m-%%d') <= '%s'",
|
||||
today, endDate
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author FKY
|
||||
* @name:UserBirthdaySendMsgVO
|
||||
* @Date 2025/12/24 17:14
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class UserBirthdaySendMsgVO extends UserBirthdayPageVO {
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
private String userId;
|
||||
}
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class SpecialStaffManageServiceImpl extends BaseServiceImpl<SpecialStaff>
|
||||
cnd.andEX("u.unitId", "=", pageForm.getUnitId());
|
||||
cnd.andEX("u.personType", "=", pageForm.getPersonType());
|
||||
cnd.andEX("u.userState", "=", pageForm.getUserState());
|
||||
cnd.andEX("u.personType", "=", pageForm.getPersonType());
|
||||
cnd.andEX("u.preparedBy", "=", pageForm.getPersonType());
|
||||
cnd.andEX("s.specialStaffType", "=", pageForm.getSpecialStaffType());
|
||||
sql.setCondition(cnd);
|
||||
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.6 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+13
File diff suppressed because one or more lines are too long
+14
File diff suppressed because one or more lines are too long
@@ -1,103 +1,112 @@
|
||||
<template>
|
||||
<el-select v-model="valueAsString" :placeholder="placeholder" @change="onChange" :disabled="disabled" :clearable="clearable"
|
||||
:style="style"
|
||||
:multiple="multiple"
|
||||
:size="size">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
v-if="!item.disabled"
|
||||
:key="item[option_value]"
|
||||
:label="item[option_label]"
|
||||
:value="item[option_value]">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="valueAsString"
|
||||
:placeholder="placeholder"
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
:clearable="clearable"
|
||||
:style="style"
|
||||
:multiple="multiple"
|
||||
:size="size"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
v-if="!item.disabled"
|
||||
:key="item[option_value]"
|
||||
:label="item[option_label]"
|
||||
:value="item[option_value]"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
value: {type: String},
|
||||
code: {
|
||||
type: String,
|
||||
default: ""
|
||||
props: {
|
||||
value: { type: [String, Array] },
|
||||
code: {
|
||||
type: [String, Array],
|
||||
default: ""
|
||||
},
|
||||
option_value: {
|
||||
type: String,
|
||||
default: "code"
|
||||
},
|
||||
option_label: {
|
||||
type: String,
|
||||
default: "name"
|
||||
},
|
||||
style: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
option_value: {
|
||||
type: String,
|
||||
default: "code"
|
||||
model: {
|
||||
prop: "value",
|
||||
event: "change"
|
||||
},
|
||||
option_label: {
|
||||
type: String,
|
||||
default: "name"
|
||||
data() {
|
||||
return {
|
||||
options: []
|
||||
}
|
||||
},
|
||||
style: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "请选择"
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: []
|
||||
}
|
||||
},
|
||||
|
||||
computed:{
|
||||
valueAsString(){
|
||||
if(Array.isArray(this.value)){
|
||||
return this.value
|
||||
}else{
|
||||
return this.value ? this.value.toString() : ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
valueAsString: {
|
||||
get() {
|
||||
if (Array.isArray(this.value)) {
|
||||
return this.value
|
||||
} else {
|
||||
return this.value ? this.value.toString() : ""
|
||||
}
|
||||
},
|
||||
set(val) {}
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
code(val) {
|
||||
this.flushOptions()
|
||||
watch: {
|
||||
code(val) {
|
||||
this.flushOptions()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChange(val) {
|
||||
this.$emit("change", val)
|
||||
},
|
||||
async flushOptions() {
|
||||
if (!this.code) {
|
||||
this.options = []
|
||||
return
|
||||
}
|
||||
this.options = await getDictOptions(this.code)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.flushOptions()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onChange(val) {
|
||||
this.$emit("change", val)
|
||||
},
|
||||
async flushOptions() {
|
||||
if (!this.code) {
|
||||
this.options = []
|
||||
return
|
||||
}
|
||||
this.options = await getDictOptions(this.code)
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.flushOptions()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -109,14 +109,14 @@ layout("/mobile/platform.html"){
|
||||
|
||||
.right_content {
|
||||
width: calc(100% - 150px);
|
||||
padding-left: 20px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
position: relative;
|
||||
height: 100px
|
||||
}
|
||||
|
||||
.optionDesc {
|
||||
/*margin-top: -16px;*/
|
||||
/*margin-top: -10px;*/
|
||||
display: -webkit-box;
|
||||
/*-webkit-box-orient: vertical;*/
|
||||
/*-webkit-line-clamp: 3;*/
|
||||
@@ -125,7 +125,8 @@ layout("/mobile/platform.html"){
|
||||
text-overflow: ellipsis;
|
||||
font-size: 13px;
|
||||
color: #868282;
|
||||
height: 86%;
|
||||
height: 80%;
|
||||
margin-bottom: 10px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@@ -139,7 +140,6 @@ layout("/mobile/platform.html"){
|
||||
width: inherit;
|
||||
margin-top: -5px;
|
||||
position: absolute;
|
||||
font-family: "";
|
||||
top: 0;
|
||||
right: 0;
|
||||
transform: rotate(23deg);
|
||||
@@ -224,7 +224,7 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</van-cell>
|
||||
|
||||
<div class="selection" style="background: #FFF; margin-bottom: 80px"
|
||||
<div class="selection" style="background: #FFF; margin-bottom: 100px"
|
||||
v-for="(subject,sidx) in projectInfo.welfareProjectSubjects">
|
||||
<div style="display: flex;width: 100%;padding: 10px 0;flex-wrap: wrap;height: 130px"
|
||||
v-for="(option, oidx) in subject.options">
|
||||
@@ -240,14 +240,15 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
|
||||
<div class="right_content">
|
||||
<div style="display: flex;justify-content: space-between;align-items: center;font-size: 14px">
|
||||
<div style="width: 100%;display: flex;justify-content: space-between">
|
||||
<div>
|
||||
{{option.optionName}}
|
||||
</div>
|
||||
<div>
|
||||
<span style="color: rgb(10 132 255 / 70%)">套餐详情</span>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px; width: 100%;">
|
||||
<!-- 左侧:名称(允许收缩,不换行,溢出省略) -->
|
||||
<div style="flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||
{{ option.optionName }}
|
||||
</div>
|
||||
|
||||
<!-- 右侧:“详情” 固定宽度,不参与伸缩 -->
|
||||
<div style="flex-shrink: 0; margin-left: 8px;">
|
||||
<span style="color: rgb(10 132 255 / 70%)" @click="openViewDesc(option.description)">详情</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="optionDesc" @click="openViewDesc(option.description)">
|
||||
@@ -259,9 +260,7 @@ layout("/mobile/platform.html"){
|
||||
备注:{{option.simpleDesc}}
|
||||
</div>
|
||||
<div style="position: absolute;right: 10px;bottom: -30px;left: 0;display: flex;justify-content: space-between">
|
||||
<div style="width: 70px;font-size: 13px;color: #918a8a;text-align: right;"
|
||||
@click="openViewDesc(option.description)">
|
||||
|
||||
<div style="font-size: 13px;color: #918a8a;text-align: right;">
|
||||
</div>
|
||||
<van-stepper :default-value="0"
|
||||
:min="0"
|
||||
|
||||
@@ -182,7 +182,7 @@ layout("/layouts/platform.html"){
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<template v-if="formData.isManyUnit">
|
||||
<template v-if="formData.isManyUnit && formData.specialStaffType != 'HMC_RELATION'">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span=12>
|
||||
<el-form-item label="所属单位(工会关系)" prop="unionRelationUnitId">
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
const COMMON_QUERY = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名/工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入姓名或工号查询" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable filterable
|
||||
placeholder="请选择所属工会" style="width: 100%;" v-model="pageForm.unionId">
|
||||
<el-option :key="item.id" :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable filterable placeholder="请选择所属单位" style="width: 100%"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">在职状态</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.userStates" style="width: 100%" placeholder="在职状态" @change="doSearch"
|
||||
code="USER_STATE" multiple></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员类型</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.personTypes" style="width: 100%" placeholder="人员类型" @change="doSearch"
|
||||
code="PERSON_TYPE" multiple></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">人员性质</div>
|
||||
<div class="search-item-option">
|
||||
<dict-select v-model="pageForm.preparedBys" style="width: 100%" placeholder="人员性质" @change="doSearch"
|
||||
code="PREPARED_BY" multiple></dict-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">生日日期</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker :picker-options="pickerOptions" @change="changeDateRangeChange"
|
||||
align="right" end-placeholder="结束日期" format="yyyy-MM-dd"
|
||||
range-separator="-" start-placeholder="开始日期" style="width: 100%"
|
||||
type="datetimerange" v-model="pageForm.changeDateRange"
|
||||
value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: "未来一周",
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 7)
|
||||
picker.$emit("pick", [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "未来一个月",
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30)
|
||||
picker.$emit("pick", [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "未来三个月",
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
end.setTime(start.getTime() + 3600 * 1000 * 24 * 90)
|
||||
picker.$emit("pick", [start, end])
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchKeyword: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
userStates: [],
|
||||
personTypes: [],
|
||||
preparedBys: [],
|
||||
changeDateRange: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch(){
|
||||
const pageForm = clone(this.pageForm)
|
||||
pageForm.userStates = JSON.stringify(this.pageForm.userStates)
|
||||
pageForm.personTypes = JSON.stringify(this.pageForm.personTypes)
|
||||
pageForm.preparedBys = JSON.stringify(this.pageForm.preparedBys)
|
||||
this.$emit('search', pageForm)
|
||||
},
|
||||
changeDateRangeChange(val){
|
||||
if (val && val.length > 0) {
|
||||
this.pageForm.startDate = val[0]
|
||||
this.pageForm.endDate = val[1]
|
||||
} else {
|
||||
this.pageForm.startDate = null
|
||||
this.pageForm.endDate = null
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
async initData(){
|
||||
if (this.$auth.hasRoleOr('sysadmin, SchoolUnionMemberAdmin, SchoolUnionAdmin')) {
|
||||
this.unions = await getUnions(this.pageForm.unionId)
|
||||
this.units = await getUnits()
|
||||
} else {
|
||||
const user = JSON.parse(window.sessionStorage.getItem('user'))
|
||||
this.unions = await getUnions(user.union.id)
|
||||
this.units = await getUnits(user.union.id)
|
||||
}
|
||||
},
|
||||
async flushUnits(){
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.initData()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<common-query ref="commonQueryRef" @search="search"></common-query>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="数据列表(默认展示近15天的数据,搜索会忽略年份)">
|
||||
<template #func>
|
||||
<el-button type="primary" size="small" @click="doExport">导出Excel</el-button>
|
||||
<el-button type="primary" size="small" @click="openSendMsgByQuery">发送通知</el-button>
|
||||
<el-button type="primary" size="small" @click="openPicSet">配置图片</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||
row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod"
|
||||
header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="250px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">人员信息</el-button>
|
||||
<el-button @click="openSendMsgByUser(row)" size="mini" type="primary">发送通知</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<member-info ref="memberInfoRef"></member-info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="sendMsgByQueryDialogVisible"
|
||||
title="请在下方填写需要发送的内容"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="sendMsgByQueryFormData" label-width="80px" ref="sendMsgByQueryForm">
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请输入发送标题', trigger: ['blur', 'change']}]"
|
||||
label="发送标题"
|
||||
prop="title">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入发送标题"
|
||||
v-model="sendMsgByQueryFormData.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请选择发送内容', trigger: ['blur', 'change']}]"
|
||||
label="发送内容"
|
||||
prop="content">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="sendMsgByQueryFormData.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="sendMsgByQueryDialogVisible = false">取 消</el-button>
|
||||
<el-button @click="sendMsgByQueryUsers" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 根据行内数据发送消息 -->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="sendMsgByUserDialogVisible"
|
||||
title="请在下方填写需要发送的内容"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="sendMsgByUserFormData" label-width="80px" ref="sendForm">
|
||||
<el-form-item label="发送对象" prop="userInfo">
|
||||
<el-input placeholder="请输入发送对象" readonly v-model="sendMsgByUserFormData.userInfo"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请输入发送标题', trigger: ['blur', 'change']}]"
|
||||
label="发送标题"
|
||||
prop="title">
|
||||
<el-input
|
||||
placeholder="请输入发送标题"
|
||||
v-model="sendMsgByUserFormData.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请选择发送内容', trigger: ['blur', 'change']}]"
|
||||
label="发送内容"
|
||||
prop="content">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="sendMsgByUserFormData.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="sendMsgByUserDialogVisible = false">取 消</el-button>
|
||||
<el-button @click="sendMsgByUser" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="dialogVisible"
|
||||
title="生日贺卡图片设置"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="formData" label-width="80px" ref="formRef">
|
||||
<el-form-item label="背景图片" prop="picUrl">
|
||||
<image-Upload :file-size="5"
|
||||
:file-type="['png','jpg']"
|
||||
:height="100"
|
||||
:limit="1"
|
||||
:width="100"
|
||||
ref="imageUpload"
|
||||
v-model="formData.picUrl"></image-Upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="贺卡图片" prop="birthdayUrl">
|
||||
<image-Upload :file-size="5"
|
||||
:file-type="['png','jpg']"
|
||||
:height="100"
|
||||
:limit="1"
|
||||
:width="100"
|
||||
ref="imageUpload"
|
||||
v-model="formData.birthdayUrl"></image-Upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="doSubmit" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("commonQuery.js"){}#-->
|
||||
<!--#include("../../../member/common/memberInfo.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {},
|
||||
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "sex", label: "性别", sortable: true },
|
||||
{ prop: "mobile", label: "联系方式", sortable: true },
|
||||
{ prop: "birthday", label: "出生年月", sortable: true },
|
||||
{ prop: "daysUntilBirthday", label: "生日倒计时(天)", sortable: true },
|
||||
{ prop: "userState", label: "在职状态", sortable: true, width: "100px" },
|
||||
{ prop: "personType", label: "人员类型", sortable: true, width: "120px" },
|
||||
{ prop: "preparedBy", label: "人员性质", sortable: true, width: "120px" },
|
||||
{ prop: "unionname", label: "所属工会", sortable: true, width: "160px" },
|
||||
{ prop: "unitname", label: "所属单位", sortable: true, width: "160px" }
|
||||
],
|
||||
|
||||
// 根据查询条件推送消息相关
|
||||
sendMsgByQueryDialogVisible: false,
|
||||
sendMsgByQueryFormData: {},
|
||||
|
||||
// 根据行内发送消息相关
|
||||
sendMsgByUserDialogVisible: false,
|
||||
sendMsgByUserFormData: {},
|
||||
|
||||
// 图片配置
|
||||
dialogVisible: false,
|
||||
formData: {
|
||||
picUrl: '',
|
||||
birthdayUrl: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'common-query': COMMON_QUERY,
|
||||
'member-info': MEMBER_INFO,
|
||||
},
|
||||
methods: {
|
||||
async openPicSet() {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/getConfig')
|
||||
if (resp.code === 0) {
|
||||
this.formData = resp.data
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
doSubmit() {
|
||||
this.$confirm('确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/saveOrModifyConfig', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success('保存成功')
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.$message.error(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
openSendMsgByUser(row) {
|
||||
this.sendMsgByUserFormData.userId = row.id
|
||||
this.sendMsgByUserFormData.userInfo = row.username
|
||||
this.sendMsgByUserDialogVisible = true
|
||||
},
|
||||
async sendMsgByUser() {
|
||||
const valid = await this.$refs['sendForm'].validate()
|
||||
if (!valid) return
|
||||
const confirm = await this.$confirm('您确定要向' + this.sendMsgByUserFormData.userInfo + '数据发送信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonTest: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/sendMsgByUser',
|
||||
this.sendMsgByUserFormData
|
||||
)
|
||||
if (resp.code === 0) {
|
||||
this.sendMsgByUserDialogVisible = false
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
openSendMsgByQuery() {
|
||||
this.sendMsgByQueryFormData = JSON.parse(JSON.stringify(this.pageForm))
|
||||
this.sendMsgByQueryDialogVisible = true
|
||||
},
|
||||
async sendMsgByQueryUsers() {
|
||||
const valid = await this.$refs['sendMsgByQueryForm'].validate()
|
||||
if (!valid) return
|
||||
const confirm = await this.$confirm('您确定根据查询条件发送信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonTest: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post('/platform/staffManage/birthday/manage/sendMsgByQueryUsers', this.sendMsgByQueryFormData)
|
||||
if (resp.code === 0) {
|
||||
this.sendMsgByQueryDialogVisible = false
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
},
|
||||
doExport() {
|
||||
this.$downLoad("/platform/staffManage/birthday/manage/doExport", this.pageForm)
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.memberInfoRef.onOpen(row.id)
|
||||
})
|
||||
},
|
||||
search(pageForm){
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
this.pageData()
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,72 @@
|
||||
const COMMON_QUERY = {
|
||||
template: /*language=HTML*/ `
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">姓名/工号</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入姓名或工号查询" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable filterable
|
||||
placeholder="请选择所属工会" style="width: 100%;" v-model="pageForm.unionId">
|
||||
<el-option :key="item.id" :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable filterable placeholder="请选择所属单位" style="width: 100%"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchKeyword: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSearch(){
|
||||
this.$emit('search', this.pageForm)
|
||||
},
|
||||
async initData(){
|
||||
if (this.$auth.hasRoleOr('sysadmin, SchoolUnionMemberAdmin, SchoolUnionAdmin')) {
|
||||
this.unions = await getUnions(this.pageForm.unionId)
|
||||
this.units = await getUnits()
|
||||
} else {
|
||||
const user = JSON.parse(window.sessionStorage.getItem('user'))
|
||||
this.unions = await getUnions(user.union.id)
|
||||
this.units = await getUnits(user.union.id)
|
||||
}
|
||||
},
|
||||
async flushUnits(){
|
||||
this.$set(this.pageForm, "unitId", null)
|
||||
this.units = []
|
||||
if (this.pageForm.unionId) {
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.initData()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app">
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<common-query ref="commonQuery" @search="search"></common-query>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool :app="this" label="数据列表">
|
||||
<template #func>
|
||||
<!-- <el-button type="primary" size="small" @click="doExport">导出Excel</el-button>-->
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table"
|
||||
row-key="id" style="width: 100%">
|
||||
<el-table-column :index="indexMethod"
|
||||
header-align="center"
|
||||
label="序号" type="index" width="80px"></el-table-column>
|
||||
<el-table-column :label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("commonQuery.js"){}#-->
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data(){
|
||||
return{
|
||||
pageForm: {},
|
||||
|
||||
tableColumns: [
|
||||
{ prop: "loginname", label: "工号", sortable: true },
|
||||
{ prop: "username", label: "姓名", sortable: true },
|
||||
{ prop: "unionName", label: "所属工会", sortable: true, width: "160px" },
|
||||
{ prop: "unitName", label: "所属单位", sortable: true, width: "160px" },
|
||||
{ prop: "msgTitle", label: "消息标题", sortable: true },
|
||||
{ prop: "msgContent", label: "消息内容", sortable: true },
|
||||
{ prop: "pushByName", label: "推送人", sortable: true },
|
||||
{ prop: "pushTime", label: "推送时间", sortable: true },
|
||||
{ prop: "pushType", label: "推送类型", sortable: true },
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'common-query': COMMON_QUERY,
|
||||
},
|
||||
methods: {
|
||||
doExport(){
|
||||
|
||||
},
|
||||
search(pageForm){
|
||||
this.pageForm = { ...this.pageForm, ...pageForm }
|
||||
this.pageData()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -316,6 +316,10 @@ layout("/layouts/platform.html"){
|
||||
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
||||
@click="doExportWelfareBySearch">导出名单
|
||||
</el-button>
|
||||
|
||||
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
|
||||
@click="sendMsgNoChoice">通知未选择人员
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
@@ -717,6 +721,46 @@ layout("/layouts/platform.html"){
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="sendMsgNoChoiceDialogVisible"
|
||||
title="请在下方填写需要发送的内容"
|
||||
width="50%"
|
||||
>
|
||||
<el-form :model="noChoiceFormData" label-width="80px" ref="noChoiceSendForm">
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请输入发送标题', trigger: ['blur', 'change']}]"
|
||||
label="发送标题"
|
||||
prop="title">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入发送标题"
|
||||
v-model="noChoiceFormData.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:rules="[{required: true, message: '请选择发送内容', trigger: ['blur', 'change']}]"
|
||||
label="发送内容"
|
||||
prop="content">
|
||||
<el-input
|
||||
:rows="6"
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="noChoiceFormData.content">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="sendMsgNoChoiceDialogVisible = false">取 消</el-button>
|
||||
<el-button @click="sendMsgToNotWelfareUsers" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
<!--#include("/platform/welfare/include/common.js"){}#-->
|
||||
@@ -823,13 +867,48 @@ layout("/layouts/platform.html"){
|
||||
loginname: '',
|
||||
title: '',
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
|
||||
// 通知未选择相关
|
||||
sendMsgNoChoiceDialogVisible: false,
|
||||
noChoiceFormData: {},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'courier-number-info': httpVueLoader('/components/welfare/CourierNumberInfo.vue?v=' + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
sendMsgNoChoice(){
|
||||
this.$set(this.formData, "sendTypes", [])
|
||||
this.$set(this.formData, "url", `<a href="` + (APP_DOMAIN + '/mobile/welfare/list/receive?projectId=' + row.id) + `">点击参与</a>`)
|
||||
this.$set(this.formData, "content", "温馨提示:请尽快完成福利套餐的选择,逾期未选择视为默认发放XXXX。")
|
||||
this.$set(this.formData, "id", this.pageForm.projectId)
|
||||
this.sendMsgNoChoiceDialogVisible = true
|
||||
},
|
||||
async sendMsgToNotWelfareUsers() {
|
||||
const valid = await this.$refs['noChoiceSendForm'].validate()
|
||||
if (!valid) return
|
||||
const confirm = await this.$confirm('您确定要向未选福利的人员发送信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonTest: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
const resp = await $.post('/platform/welfare/project/mange/sendMsgToNotWelfareUsers', {
|
||||
title: this.noChoiceFormData.title,
|
||||
projectId: this.noChoiceFormData.id,
|
||||
sendMsgValue: this.noChoiceFormData.content,
|
||||
url: this.noChoiceFormData.url
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.sendMsgNoChoiceDialogVisible = false
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
doExportWelfareBySearch(){
|
||||
window.open(loc() + '/doExportWelfareBySearch?searchName=' + this.pageForm.searchName +
|
||||
'&searchKeyWord=' + this.pageForm.searchKeyword +
|
||||
|
||||
Reference in New Issue
Block a user