commit
This commit is contained in:
+10
-14
@@ -1,5 +1,6 @@
|
||||
package io.v.nutz.zhgh.staffmanage.birthday.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
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.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@@ -56,13 +58,10 @@ public class UserBirthdayManageController {
|
||||
@At("/h5")
|
||||
@Ok("beetl:/mobile/staffmanage/birthday/index.html")
|
||||
@RequiresAuthentication
|
||||
public void h5() {
|
||||
|
||||
public void h5(String id, HttpServletRequest request) {
|
||||
request.setAttribute("fileId", id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result pageData(UserBirthdayPageVO page){
|
||||
@@ -71,7 +70,6 @@ public class UserBirthdayManageController {
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
@@ -79,7 +77,6 @@ public class UserBirthdayManageController {
|
||||
userBirthdayService.exportXlsx(page, response);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result sendMsgByQueryUsers(UserBirthdaySendMsgVO vo) {
|
||||
@@ -95,7 +92,9 @@ public class UserBirthdayManageController {
|
||||
|
||||
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(),
|
||||
vo.getContent(), "", link);
|
||||
@@ -103,7 +102,6 @@ public class UserBirthdayManageController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result sendMsgByUser(UserBirthdaySendMsgVO vo) {
|
||||
@@ -120,15 +118,15 @@ public class UserBirthdayManageController {
|
||||
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(),
|
||||
vo.getContent(), "", link);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@RequiresAuthentication
|
||||
public Result getConfig() {
|
||||
@@ -139,12 +137,10 @@ public class UserBirthdayManageController {
|
||||
return Result.success().addData(config);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("staffManage.birthday.manage")
|
||||
public Result saveOrModifyConfig(UserBirthdayConfig config) {
|
||||
dao.insertOrUpdate(config);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -749,7 +749,12 @@ layout("/mobile/platform.html"){
|
||||
this.config.customBg = '/file_server/fileStreamPreview?id=' + resp.data.picUrl
|
||||
}
|
||||
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