提交 b4c1355a authored 作者: 邓砥奕's avatar 邓砥奕

修改维修bug

上级 5e141d45
......@@ -40,10 +40,5 @@
<groupId>com.tykj.dev</groupId>
<artifactId>rfid</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-read</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -13,10 +13,10 @@ import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......
......@@ -14,11 +14,11 @@ import com.tykj.dev.device.library.service.DeviceLogService;
import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......
......@@ -17,14 +17,14 @@ import com.tykj.dev.device.library.subject.vo.DeviceLibrarySelectVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.packing.service.PackingLibraryService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.task.repository.TaskDao;
import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.domin.Task;
import com.tykj.dev.device.task.subject.vo.TaskLogUserVo;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......@@ -202,6 +202,7 @@ public class DeviceApplyController {
//获取申请的业务
TaskBto applyTask = taskService.get(taskBto.getParentTaskId());
Integer userId = userUtils.getCurrentUserId();
taskService.addInvolveUser(taskBto,userId);
//获取申请账单
DeviceApplyBill deviceApplyBillEntity = deviceApplyBillService.getOne(applyTask.getBillId());
//添加配发单
......@@ -260,7 +261,7 @@ public class DeviceApplyController {
userIds.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(allotBillEntity.getReceiveUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
MessageBto messageBto = new MessageBto(taskBto1.getId(),taskBto1.getBusinessType(),"对" + allotBillEntity.getReceiveUnit() + "发起配发",userIds);
MessageBto messageBto = new MessageBto(taskBto1.getId(),taskBto1.getBusinessType(),allotBillEntity.getSendUnit() + "对" + allotBillEntity.getReceiveUnit() + "发起配发",userIds);
messageService.add(messageBto);
log.info("[申请模块]:装备申请后发起配发");
myWebSocket.sendMessage1();
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>equip</artifactId>
<groupId>com.tykj</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-read</artifactId>
<dependencies>
<dependency>
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-user</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.tykj.dev.device.read.controller;
/**
* @author dengdiyi
*/
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.read.service.MessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
/**
* @author dengdiyi
*/
@RestController
@Api(tags = "阅知模块", description = "阅知模块")
@AutoDocument
@RequestMapping("/read")
public class MessageController {
@Autowired
private MessageService messageService;
@ApiOperation(value = "阅知信息查询")
@GetMapping("/get")
public ResponseEntity getMessage(){
return ResponseEntity.ok(messageService.getList());
}
@ApiOperation(value = "提交已读阅知信息")
@PostMapping("/read/{id}")
public ResponseEntity readMessage(@PathVariable("id") int id){
return ResponseEntity.ok(messageService.read(id).parse2Bto().toVo());
}
@ApiOperation(value = "完成阅知信息")
@PostMapping("/complete/{id}")
public ResponseEntity completeMessage(@PathVariable("id") int id){
return ResponseEntity.ok(messageService.complete(id).parse2Bto().toVo());
}
}
package com.tykj.dev.device.read;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* @author zjm
* @version 1.0.0
* @ClassName userApp.java
* @Description TODO
* @createTime 2020年09月01日 14:32:00
*/
@SpringBootApplication(scanBasePackages = {
"com.tykj.dev.*",
}
)
public class readApp {
public static void main(String[] args) {
SpringApplication.run(readApp.class, args);
}
}
package com.tykj.dev.device.read.repository;
import com.tykj.dev.device.read.subject.domin.Message;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
/**
* @author dengdiyi
*/
@Repository
public interface MessageDao extends JpaRepository<Message,Integer>, JpaSpecificationExecutor<Message> {
}
package com.tykj.dev.device.read.service;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.read.subject.domin.Message;
import com.tykj.dev.device.read.subject.vo.MessageUserVo;
import java.util.List;
/**
* @author dengdiyi
*/
public interface MessageService {
MessageBto add(MessageBto messageBto);
Message update(Message message);
Message get(Integer id);
void delete(Integer id);
List<MessageUserVo> getList();
/**
* @param messageId 阅知信息id
* 阅读该信息
*/
Message read(Integer messageId);
/**
* @param messageId 阅知信息id
* 完成该阅知信息
*/
Message complete(Integer messageId);
}
package com.tykj.dev.device.read.service.impl;
import com.tykj.dev.device.read.repository.MessageDao;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.read.subject.domin.Message;
import com.tykj.dev.device.read.subject.vo.MessageUserVo;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* @author dengdiyi
*/
@Service
public class MessageServiceImpl implements MessageService {
@Autowired
private MessageDao messageDao;
@Autowired
private UserUtils userUtils;
@Override
public MessageBto add(MessageBto messageBto) {
return messageDao.save(messageBto.toDo()).parse2Bto();
}
@Override
public Message update(Message message) {
return messageDao.save(message);
}
@Override
public Message get(Integer id) {
Optional<Message> message = messageDao.findById(id);
if (message.isPresent()){
return message.get();
}
else {
throw new ApiException("Id不存在");
}
}
@Override
public void delete(Integer id) {
messageDao.deleteById(id);
}
@Override
public List<MessageUserVo> getList() {
Integer userId = userUtils.getCurrentUserId();
return messageDao.findAll().stream()
.map(Message::parse2Bto)
.filter(messageBto -> messageBto.getInvolveUserIdList().contains(userId)&&!messageBto.getCompleteUserIdList().contains(userId))
.map(MessageBto::toVo)
.sorted(Comparator.comparing(MessageUserVo::getCreateTime).reversed())
.collect(Collectors.toList());
}
/**
* @param messageId 阅知信息id
*/
@Override
public Message read(Integer messageId) {
Integer userId = userUtils.getCurrentUserId();
MessageBto messageBto = get(messageId).parse2Bto();
List<Integer> userIds = messageBto.getUserReadDetailList();
userIds.add(userId);
messageBto.setUserReadDetailList(userIds);
List<Integer> userIds2 = messageBto.getCompleteUserIdList();
userIds2.add(userId);
messageBto.setCompleteUserIdList(userIds2);
return messageDao.save(messageBto.toDo());
}
/**
* @param messageId 阅知信息id
* 完成该阅知信息
*/
@Override
public Message complete(Integer messageId) {
Integer userId = userUtils.getCurrentUserId();
MessageBto messageBto = get(messageId).parse2Bto();
List<Integer> userIds = messageBto.getCompleteUserIdList();
userIds.add(userId);
messageBto.setCompleteUserIdList(userIds);
return messageDao.save(messageBto.toDo());
}
}
package com.tykj.dev.device.read.subject.bto;
import com.tykj.dev.device.read.subject.domin.Message;
import com.tykj.dev.device.read.subject.vo.MessageUserVo;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.SpringUtils;
import com.tykj.dev.misc.utils.StringSplitUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.modelmapper.ModelMapper;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author dengdiyi
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageBto {
@ApiModelProperty(name = "主键id")
private Integer id;
@ApiModelProperty(name = "阅知信息对应业务Id")
private Integer taskId;
@ApiModelProperty(value = "业务类型主键id")
private Integer businessType;
@ApiModelProperty(value = "信息内容")
private String content;
@ApiModelProperty(value = "阅知人员id类别")
private List<Integer> involveUserIdList;
@ApiModelProperty(value = "已完成人员id列表")
private List<Integer> completeUserIdList = new ArrayList<>();
@ApiModelProperty(value = "用户已读列表")
private List<Integer> userReadDetailList = new ArrayList<>();
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
@ApiModelProperty(value = "创建时间")
@CreatedDate
private Date createTime;
@ApiModelProperty(value = "更新用户id")
@LastModifiedBy
private Integer updateUserId;
@ApiModelProperty(value = "更新时间")
@LastModifiedDate
private Date updateTime;
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
/**
* bto类转化为do类
*/
public Message toDo() {
//复制相同属性
ModelMapper modelMapper = BeanHelper.getUserMapper();
Message message = modelMapper.map(this, Message.class);
//set组合字段
message.setInvolveUsers(StringSplitUtil.idListToString(this.involveUserIdList));
message.setUserReadDetail(StringSplitUtil.idListToString(this.userReadDetailList));
message.setCompleteUsers(StringSplitUtil.idListToString(this.completeUserIdList));
return message;
}
/**
* bto类转化为vo类
*/
public MessageUserVo toVo() {
UserUtils userUtils = SpringUtils.getBean("userUtils");
//复制相同属性
ModelMapper modelMapper = BeanHelper.getUserMapper();
MessageUserVo messageUserVo = modelMapper.map(this, MessageUserVo.class);
//set vo字段
if (userUtils!=null&&userReadDetailList.contains(userUtils.getCurrentUserId())){
messageUserVo.setIsRead(1);
}
return messageUserVo;
}
public MessageBto(Integer taskId, Integer businessType, String content, List<Integer> involveUserIdList) {
this.taskId = taskId;
this.businessType = businessType;
this.content = content;
this.involveUserIdList = involveUserIdList;
}
}
package com.tykj.dev.device.read.subject.domin;
import com.tykj.dev.misc.base.BeanHelper;
import com.tykj.dev.misc.utils.StringSplitUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.modelmapper.ModelMapper;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import javax.persistence.*;
import java.util.Date;
/**
* 阅知信息表
* @author dengdiyi
*/
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@SQLDelete(sql = "update message set delete_tag = 1 where id = ?")
@Where(clause = "delete_tag = 0")
@ApiModel("阅知信息表")
public class Message {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty(name = "主键id")
private Integer id;
@ApiModelProperty(name = "阅知信息对应业务Id")
private Integer taskId;
@ApiModelProperty(value = "业务类型主键id")
private Integer businessType;
@ApiModelProperty(value = "信息内容")
private String content;
@ApiModelProperty(value = "阅知人员id(x作为分隔符),例如x1x2x,意为id为1,2的用户待阅知该信息")
private String involveUsers;
@ApiModelProperty(value = "已完成人员id(x作为分隔符),例如x1x2x,意为id为1,2的用户已完成阅知该信息")
private String completeUsers;
@ApiModelProperty(value = "用户阅读信息")
private String userReadDetail;
@ApiModelProperty(value = "创建用户id")
@CreatedBy
private Integer createUserId;
@ApiModelProperty(value = "创建时间")
@CreatedDate
private Date createTime;
@ApiModelProperty(value = "更新用户id")
@LastModifiedBy
private Integer updateUserId;
@ApiModelProperty(value = "更新时间")
@LastModifiedDate
private Date updateTime;
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0;
/**
* do类转化为bto类
*/
public MessageBto parse2Bto() {
//modelMap复制
ModelMapper mapper = BeanHelper.getUserMapper();
MessageBto messageBto = mapper.map(this, MessageBto.class);
//解析组合字段并添加
messageBto.setInvolveUserIdList(StringSplitUtil.userIdSplit(this.involveUsers));
messageBto.setUserReadDetailList(StringSplitUtil.userIdSplit(this.userReadDetail));
messageBto.setCompleteUserIdList(StringSplitUtil.userIdSplit(this.completeUsers));
return messageBto;
}
}
package com.tykj.dev.device.read.subject.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import java.util.Date;
/**
* @author dengdiyi
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageUserVo {
@ApiModelProperty(name = "主键id")
private Integer id;
@ApiModelProperty(name = "阅知信息对应业务Id")
private Integer taskId;
@ApiModelProperty(value = "业务类型主键id")
private Integer businessType;
@ApiModelProperty(value = "信息内容")
private String content;
@ApiModelProperty(name = "当前用户是否已阅读(0:未读,1:已读)")
private Integer isRead = 0;
@ApiModelProperty(value = "创建用户id")
private Integer createUserId;
@ApiModelProperty(value = "创建时间")
@CreatedDate
private Date createTime;
@ApiModelProperty(value = "更新用户id")
@LastModifiedBy
private Integer updateUserId;
@ApiModelProperty(value = "更新时间")
@LastModifiedDate
private Date updateTime;
}
......@@ -40,11 +40,6 @@
<groupId>com.tykj.dev</groupId>
<artifactId>rfid</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-read</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -9,8 +9,6 @@ import com.tykj.dev.device.library.subject.Dto.DeviceLogDto;
import com.tykj.dev.device.library.subject.domin.DeviceChange;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.repair.repository.RepairBackBillDao;
import com.tykj.dev.device.repair.repository.RepairDetailDao;
import com.tykj.dev.device.repair.repository.RepairSendBillDao;
......@@ -27,6 +25,8 @@ import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.dao.UserDao;
import com.tykj.dev.device.user.subject.entity.User;
import com.tykj.dev.device.user.subject.service.UserPublicService;
......@@ -765,13 +765,13 @@ public class RepairController {
RepairSendBill repairSendBill = deviceRepairSendBillDao.findByDeviceRepairBillId(taskBto.getBillId());
repairBackBill = new RepairBackBill();
repairBackBill.setSendUnit("中办");
repairBackBill.setReceiveUnit(userUtils.getCurrentUserUnitName());
repairBackBill.setBackCheckDetail(repairSendBill.getRepairDeviceCheckDetail());
repairBackBill.setDeviceRepairBillId(taskBto.getBillId());
}
String deviceIdDetail = repairReceiveVo.getReceiveCheckDetail();
if (repairBackBill.getReceiveUseraId() == null) {
repairBackBill.setReceiveUseraId(userId);
taskService.addInvolveUser(taskBto, userId);
}
List<FileVo> fileVoList = new ArrayList<>();
fileVoList.add(new FileVo("维修单", repairBackBill.getBillFileName(), repairBackBill.getBillFileUrl()));
......@@ -854,9 +854,11 @@ public class RepairController {
});
//发送阅知信息
List<Integer> ids = userPublicService.findOtherUser(userUtils.getCurrentUserId());
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(repairBackBill.getReceiveUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
if (level>1) {
ids.addAll(userDao.findAllByUnitsId(userPublicService.findUnitIdByName(repairBackBill.getReceiveUnit())).stream()
.map(User::getUserId)
.collect(Collectors.toList()));
}
MessageBto messageBto = new MessageBto(taskBto2.getId(),taskBto2.getBusinessType(),repairBackBill.getReceiveUnit()+"接收维修退回装备",ids);
messageService.add(messageBto);
myWebSocket.sendMessage1();
......
......@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.github.wenhao.jpa.Specifications;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.service.DeviceLibraryService;
import com.tykj.dev.device.library.service.DeviceLogService;
......@@ -34,7 +33,6 @@ import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.Snowflake;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
......
......@@ -32,11 +32,6 @@
<groupId>com.tykj.dev</groupId>
<artifactId>config</artifactId>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-read</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -8,10 +8,7 @@ import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.DeviceLibrarySaveVo;
import com.tykj.dev.device.library.subject.vo.FileVo;
import com.tykj.dev.device.packing.service.PackingLibraryService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.read.subject.bto.MessageBto;
import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.packing.subject.domin.PackingLibrary;import com.tykj.dev.device.storage.service.StorageBillService;
import com.tykj.dev.device.storage.subject.domin.StorageBill;
import com.tykj.dev.device.storage.subject.vo.StorageBillConfirmVo;
import com.tykj.dev.device.storage.subject.vo.StorageBillDetailVo;
......@@ -21,6 +18,8 @@ import com.tykj.dev.device.task.service.TaskLogService;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.task.subject.bto.TaskBto;
import com.tykj.dev.device.task.subject.bto.TaskLogBto;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.bto.MessageBto;
import com.tykj.dev.device.user.subject.service.UserPublicService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.base.BusinessEnum;
......
......@@ -381,11 +381,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.tykj</groupId>
<artifactId>dev-read</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- Spring Security Test -->
<dependency>
<groupId>org.springframework.security</groupId>
......
......@@ -5,13 +5,17 @@ package com.tykj.dev.device.user.read.controller;
*/
import com.tykj.dev.config.swagger.AutoDocument;
import com.tykj.dev.device.read.service.MessageService;
import com.tykj.dev.device.user.read.service.MessageService;
import com.tykj.dev.device.user.read.subject.vo.MessageUserVo;
import com.tykj.dev.socket.MyWebSocket;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
//import com.tykj.dev.device.read.service.MessageService;
/**
* @author dengdiyi
*/
......@@ -24,6 +28,9 @@ public class MessageController {
@Autowired
private MessageService messageService;
@Autowired
private MyWebSocket myWebSocket;
@ApiOperation(value = "阅知信息查询")
@GetMapping("/get")
public ResponseEntity getMessage(){
......@@ -33,7 +40,9 @@ public class MessageController {
@ApiOperation(value = "提交已读阅知信息")
@PostMapping("/read/{id}")
public ResponseEntity readMessage(@PathVariable("id") int id){
return ResponseEntity.ok(messageService.read(id).parse2Bto().toVo());
MessageUserVo m = messageService.read(id).parse2Bto().toVo();
myWebSocket.sendMessage1();
return ResponseEntity.ok(m);
}
@ApiOperation(value = "完成阅知信息")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论