提交 6a832218 authored 作者: xc's avatar xc

xc

上级 81349896
......@@ -4,10 +4,7 @@ import com.zjty.efs.bus.entity.Notice;
import com.zjty.efs.bus.entity.Paging;
import com.zjty.efs.bus.service.NoticeService;
import com.zjty.efs.misc.config.AutoDocument;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
......@@ -95,6 +92,8 @@ public class NoticeController {
}
@GetMapping("/unreadNum")
@ApiOperation(value = "已接收通知未读数量")
@ApiImplicitParam(name = "userId", value = "当前登录用户", paramType = "query", required = true, dataType = "String")
public ResponseEntity unreadNum(String userId){
log.info("已接收未读数量");
return ResponseEntity.ok(noticeService.unreadNum(userId));
......
......@@ -72,8 +72,8 @@ public class NoticeServiceImpl implements NoticeService {
}else {
List<Addressee> addresseeList2 = new ArrayList<>(); //接受者显示的接收列表
Notice notice1 = transform(notice); //发送通知
notice1.setId(notice.getId());
// Notice notice1 = transform(notice); //发送通知
// notice1.setId(notice.getId());
String dataList = "";
List<UserDo> stringList = new ArrayList<>();//收件人列表
for(String addressee:strings){
......@@ -90,8 +90,7 @@ public class NoticeServiceImpl implements NoticeService {
String data2 = "[" +userDo1.getUnit() + "][" + userDo1.getDepartment() + "]的[" + userDo1.getName()
+ "]收到了来自[" + userDo.getUnit() + "][" + userDo.getDepartment() + "]的[" + userDo.getName()
+ "]关于[" + notice.getTitle() + "的通知";
+ "]关于[" + notice.getTitle() + "]的通知";
dataList = dataList + "[" + userDo1.getUnit() + "][" + userDo1.getDepartment() + "]的[" + userDo1.getName()
+ "] ";
......@@ -109,9 +108,11 @@ public class NoticeServiceImpl implements NoticeService {
notice2.setReceiver(add.getId());
noticeDao.save(notice2);
String data2 = "[" +add.getUnit() + "][" + add.getDepartment() + "]的[" + add.getName()
+ "]收到了来自[" + userDo.getUnit() + "][" + userDo.getDepartment() + "]的[" + userDo.getName()
+ "]关于[" + notice.getTitle() + "]的通知";
// String data2 = "[" +add.getUnit() + "][" + add.getDepartment() + "]的[" + add.getName()
// + "]收到了来自[" + userDo.getUnit() + "][" + userDo.getDepartment() + "]的[" + userDo.getName()
// + "]关于[" + notice.getTitle() + "]的通知";
String data2 = "您收到了[" + userDo.getUnit() + "][" + userDo.getName() + "]的《" + notice.getTitle() + "》";
Attention attention = new Attention();
attention.setStatus(0);
......@@ -123,17 +124,20 @@ public class NoticeServiceImpl implements NoticeService {
}
notice1.setAddressee(add2);
noticeDao.save(notice1);
notice.setAddressee(add2);
noticeDao.save(notice);
String data1 = "[" +userDo.getUnit() + "][" + userDo.getDepartment() + "]的[" + userDo.getName()
+ "]给" + dataList
+ "发送了关于[" + notice.getTitle() + "]的通知";
String data3 = "[" +userDo.getUnit() + "][" + userDo.getName()
+ "]给您发送了《" + notice.getTitle() + "》";
Attention attention = new Attention();
attention.setStatus(0);
attention.setNoticeId(notice1.getId());
attention.setNoticeId(notice.getId());
attention.setUpdateTime(new Date());
attention.setData(data1);
attention.setData(data3);
attention.setUserId(userDo.getId());
attentionService.addAttention(attention);
efsLogUtil.addLog(new EfsLog(null, userDo.getId(), data1, new Date()));
......
......@@ -60,9 +60,9 @@ public class Job {
private void updateAtt(Notice notice, double days, int label){
String data = "";
Attention attention = new Attention();
data = "您收到来自["+ notice.getUnit() + "][" + notice.getName() +"]标题为[" + notice.getTitle() + "]的通知,没有查看";
if (notice.getStatus() == 1 && !"".equals(notice.getFileList())){
//通知为已读,且文件列表不为空
// data = "您收到来自["+ notice.getUnit() + "][" + notice.getName() +"]标题为[" + notice.getTitle() + "]的通知,没有查看";
if (!"".equals(notice.getFileList())){
//文件列表不为空
String file = notice.getFileList();
String[] files = file.split(",");
List<Integer> fileList = new ArrayList<>();
......@@ -78,15 +78,16 @@ public class Job {
// System.out.println(downLoadCounts);
for(DownLoadCount downLoadCount:downLoadCounts){
if(downLoadCount.getCount() == 0){
data = "您收到来自["+ notice.getUnit() + "][" + notice.getName() +"]标题为[" + notice.getTitle() + "]的通知,有文件没有下载";
data = "您收到["+ notice.getUnit() + "][" + notice.getName() +"]的《" + notice.getTitle() + "》,有文件没有下载";
add(days, attention, data, notice, label);
}
}
}else {
add(days, attention, data, notice, label);
}
// else {
// add(days, attention, data, notice, label);
// }
}
......@@ -100,7 +101,7 @@ public class Job {
*/
private void add(double days, Attention attention, String data, Notice notice, int label){
int d = (int)Math.ceil(days);
data = data + ",还有" + d + "天失效。";
data = data + ",还有" + d + "天失效。请尽快下载。";
attention.setData(data);
attention.setNoticeId(notice.getId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论