commit
This commit is contained in:
+10
-14
@@ -1,5 +1,6 @@
|
|||||||
package io.v.nutz.zhgh.staffmanage.birthday.controller;
|
package io.v.nutz.zhgh.staffmanage.birthday.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import io.v.nutz.base.page.Pagination;
|
import io.v.nutz.base.page.Pagination;
|
||||||
import io.v.nutz.base.result.Result;
|
import io.v.nutz.base.result.Result;
|
||||||
@@ -24,6 +25,7 @@ import org.nutz.lang.util.NutMap;
|
|||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -56,13 +58,10 @@ public class UserBirthdayManageController {
|
|||||||
@At("/h5")
|
@At("/h5")
|
||||||
@Ok("beetl:/mobile/staffmanage/birthday/index.html")
|
@Ok("beetl:/mobile/staffmanage/birthday/index.html")
|
||||||
@RequiresAuthentication
|
@RequiresAuthentication
|
||||||
public void h5() {
|
public void h5(String id, HttpServletRequest request) {
|
||||||
|
request.setAttribute("fileId", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresPermissions("staffManage.birthday.manage")
|
@RequiresPermissions("staffManage.birthday.manage")
|
||||||
public Result pageData(UserBirthdayPageVO page){
|
public Result pageData(UserBirthdayPageVO page){
|
||||||
@@ -71,7 +70,6 @@ public class UserBirthdayManageController {
|
|||||||
return Result.success(pagination);
|
return Result.success(pagination);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@Ok("void")
|
@Ok("void")
|
||||||
@RequiresPermissions("staffManage.birthday.manage")
|
@RequiresPermissions("staffManage.birthday.manage")
|
||||||
@@ -79,7 +77,6 @@ public class UserBirthdayManageController {
|
|||||||
userBirthdayService.exportXlsx(page, response);
|
userBirthdayService.exportXlsx(page, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresPermissions("staffManage.birthday.manage")
|
@RequiresPermissions("staffManage.birthday.manage")
|
||||||
public Result sendMsgByQueryUsers(UserBirthdaySendMsgVO vo) {
|
public Result sendMsgByQueryUsers(UserBirthdaySendMsgVO vo) {
|
||||||
@@ -95,7 +92,9 @@ public class UserBirthdayManageController {
|
|||||||
|
|
||||||
List<String> loginNameList = list.stream().map(v -> v.getString("loginname")).toList();
|
List<String> loginNameList = list.stream().map(v -> v.getString("loginname")).toList();
|
||||||
|
|
||||||
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5";
|
UserBirthdayConfig config = dao.fetch(UserBirthdayConfig.class, Cnd.NEW().desc("updatedAt"));
|
||||||
|
|
||||||
|
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5?id=" + ObjectUtil.defaultIfEmpty(config.getBirthdayUrl(), "");
|
||||||
|
|
||||||
msgApi.sendMsgByBirthday(List.of("DingTalk"), loginNameList, 2, vo.getTitle(),
|
msgApi.sendMsgByBirthday(List.of("DingTalk"), loginNameList, 2, vo.getTitle(),
|
||||||
vo.getContent(), "", link);
|
vo.getContent(), "", link);
|
||||||
@@ -103,7 +102,6 @@ public class UserBirthdayManageController {
|
|||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresPermissions("staffManage.birthday.manage")
|
@RequiresPermissions("staffManage.birthday.manage")
|
||||||
public Result sendMsgByUser(UserBirthdaySendMsgVO vo) {
|
public Result sendMsgByUser(UserBirthdaySendMsgVO vo) {
|
||||||
@@ -120,15 +118,15 @@ public class UserBirthdayManageController {
|
|||||||
return Result.error("未获取到消息接收人");
|
return Result.error("未获取到消息接收人");
|
||||||
}
|
}
|
||||||
|
|
||||||
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5";
|
UserBirthdayConfig config = dao.fetch(UserBirthdayConfig.class, Cnd.NEW().desc("updatedAt"));
|
||||||
|
|
||||||
|
String link = Globals.AppDomain + "/platform/staffManage/birthday/manage/h5?id=" + ObjectUtil.defaultIfEmpty(config.getBirthdayUrl(), "");
|
||||||
msgApi.sendMsgByBirthday(List.of("DingTalk"), List.of(user.getLoginname()), 2, vo.getTitle(),
|
msgApi.sendMsgByBirthday(List.of("DingTalk"), List.of(user.getLoginname()), 2, vo.getTitle(),
|
||||||
vo.getContent(), "", link);
|
vo.getContent(), "", link);
|
||||||
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresAuthentication
|
@RequiresAuthentication
|
||||||
public Result getConfig() {
|
public Result getConfig() {
|
||||||
@@ -139,12 +137,10 @@ public class UserBirthdayManageController {
|
|||||||
return Result.success().addData(config);
|
return Result.success().addData(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@RequiresPermissions("staffManage.birthday.manage")
|
@RequiresPermissions("staffManage.birthday.manage")
|
||||||
public Result saveOrModifyConfig(UserBirthdayConfig config) {
|
public Result saveOrModifyConfig(UserBirthdayConfig config) {
|
||||||
dao.insertOrUpdate(config);
|
dao.insertOrUpdate(config);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -749,7 +749,12 @@ layout("/mobile/platform.html"){
|
|||||||
this.config.customBg = '/file_server/fileStreamPreview?id=' + resp.data.picUrl
|
this.config.customBg = '/file_server/fileStreamPreview?id=' + resp.data.picUrl
|
||||||
}
|
}
|
||||||
if (resp.data.birthdayUrl) {
|
if (resp.data.birthdayUrl) {
|
||||||
this.config.couponImageSrc = window.location.origin + '/file_server/fileStreamPreview?id=' + resp.data.birthdayUrl
|
const fileId = "${fileId}"
|
||||||
|
if(fileId) {
|
||||||
|
this.config.couponImageSrc = window.location.origin + '/file_server/fileStreamPreview?id=' + fileId
|
||||||
|
} else {
|
||||||
|
this.config.couponImageSrc = window.location.origin + '/file_server/fileStreamPreview?id=' + resp.data.birthdayUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user