增加动态消息分享功能

This commit is contained in:
caozhen
2023-09-20 17:15:01 +08:00
parent 95221b166c
commit 73b67d7f75
4 changed files with 38 additions and 5 deletions
@@ -198,6 +198,37 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 添加
*/
@AutoLog(value = "标准分享-动态消息分享")
@ApiOperation(value="标准分享-动态消息分享", notes="标准分享-动态消息分享")
@PostMapping(value = "/dynamicMessages/add")
public Result<T> dynamicMessages(@RequestBody LawsStandardSharing lawsStandardSharing) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
SysUser user = sysUserService.getById(sysUser.getId());
String recipientId = lawsStandardSharing.getRecipientId();
Date date = new Date();
List<LawsStandardSharing> sharings = new ArrayList<>();
List<String> recipientIdList = Arrays.asList(recipientId.split(","));
for (int i = 0; i < recipientIdList.size(); i++) {
LawsStandardSharing sharing = new LawsStandardSharing();
sharing.setSource(CommonConstant.STANDARD_SOURCE_4);
sharing.setSharerId(sysUser.getId());
sharing.setSharerName(user.getNameWorkNo());
sharing.setRecipientId(recipientIdList.get(i));
SysUser userServiceById = sysUserService.getById(recipientIdList.get(i));
sharing.setRecipientName(userServiceById.getNameWorkNo());
sharing.setSharingTime(date);
sharing.setShareDescription(lawsStandardSharing.getShareDescription());
sharing.setReadingStatus("1");
sharing.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
sharings.add(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
* 批量删除
*/