update 标准分享发送消息
This commit is contained in:
+1
@@ -13,5 +13,6 @@ public class MessageTemplateCodeCommon {
|
|||||||
public static final String LAWS_PROBLEM_LIBRARY = "laws_problem_library"; // 【问答库】回答已置顶
|
public static final String LAWS_PROBLEM_LIBRARY = "laws_problem_library"; // 【问答库】回答已置顶
|
||||||
public static final String NEW_MODEL_IMPLEMENTATION = "new_model_implementation"; // 【新车型实施预警】
|
public static final String NEW_MODEL_IMPLEMENTATION = "new_model_implementation"; // 【新车型实施预警】
|
||||||
public static final String ON_THE_PRODUCTION = "on_the_production"; // 【在产车实施预警】
|
public static final String ON_THE_PRODUCTION = "on_the_production"; // 【在产车实施预警】
|
||||||
|
public static final String LAWS_STANDARD_SHARING = "laws_standard_sharing"; // 【分享】收到分享
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+27
@@ -1,7 +1,9 @@
|
|||||||
package com.jero.modules.personal.controller;
|
package com.jero.modules.personal.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.api.dto.message.SendMessageDTO;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.api.vo.SendMessageAPI;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
@@ -9,6 +11,8 @@ import com.jero.common.system.base.controller.JeroController;
|
|||||||
import com.jero.common.system.vo.LoginUser;
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.common.util.MessageUtils;
|
import com.jero.common.util.MessageUtils;
|
||||||
import com.jero.common.api.vo.ResultCommon;
|
import com.jero.common.api.vo.ResultCommon;
|
||||||
|
import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
|
||||||
|
import com.jero.modules.laws.common.util.CurrentUserUtil;
|
||||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||||
import com.jero.modules.laws.standard.entity.LawsNewsFeed;
|
import com.jero.modules.laws.standard.entity.LawsNewsFeed;
|
||||||
@@ -33,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -61,6 +66,8 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
|
private ILawsEnterpriseStandardService ILawsEnterpriseStandardService; //企业标准
|
||||||
@Autowired
|
@Autowired
|
||||||
private ILawsNewsFeedService lawsNewsFeedService;
|
private ILawsNewsFeedService lawsNewsFeedService;
|
||||||
|
@Resource
|
||||||
|
private SendMessageAPI sendMessageAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页列表查询
|
* 分页列表查询
|
||||||
@@ -106,6 +113,8 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
@ApiOperation(value = "标准分享-国内分享", notes = "标准分享-国内分享")
|
@ApiOperation(value = "标准分享-国内分享", notes = "标准分享-国内分享")
|
||||||
@PostMapping(value = "/domestic/add")
|
@PostMapping(value = "/domestic/add")
|
||||||
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
||||||
|
// 发送消息
|
||||||
|
sendMsg(lawsStandardSharing);
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
SysUser user = sysUserService.getById(sysUser.getId());
|
SysUser user = sysUserService.getById(sysUser.getId());
|
||||||
String recipientId = lawsStandardSharing.getRecipientId();
|
String recipientId = lawsStandardSharing.getRecipientId();
|
||||||
@@ -134,6 +143,23 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: liao
|
||||||
|
* @Date: 2023/11/10 18:50
|
||||||
|
* @Description: 发送消息
|
||||||
|
**/
|
||||||
|
private void sendMsg(LawsStandardSharing lawsStandardSharing) {
|
||||||
|
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||||
|
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.LAWS_STANDARD_SHARING);
|
||||||
|
sendMessageDTO.setToUserId(lawsStandardSharing.getRecipientId());
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("standardNumber", lawsStandardSharing.getStandardNumber());
|
||||||
|
map.put("standardName", lawsStandardSharing.getStandardName());
|
||||||
|
map.put("sender", CurrentUserUtil.getRealName());
|
||||||
|
sendMessageDTO.setMap(map);
|
||||||
|
sendMessageAPI.sendMessage(sendMessageDTO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
@@ -141,6 +167,7 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
|
|||||||
@ApiOperation(value = "标准分享-海外分享", notes = "标准分享-海外分享")
|
@ApiOperation(value = "标准分享-海外分享", notes = "标准分享-海外分享")
|
||||||
@PostMapping(value = "/overseas/add")
|
@PostMapping(value = "/overseas/add")
|
||||||
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardSharing lawsStandardSharing) {
|
||||||
|
// 发送消息
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
SysUser user = sysUserService.getById(sysUser.getId());
|
SysUser user = sysUserService.getById(sysUser.getId());
|
||||||
String recipientId = lawsStandardSharing.getRecipientId();
|
String recipientId = lawsStandardSharing.getRecipientId();
|
||||||
|
|||||||
Reference in New Issue
Block a user