|
|
@@ -10,6 +10,7 @@ import com.xjrsoft.common.enums.DeleteMark;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
|
import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.module.concat.service.IXjrUserService;
|
|
|
import com.xjrsoft.module.system.dto.AddSystemUpdateMessageDto;
|
|
|
import com.xjrsoft.module.system.dto.SystemUpdateMessagePageDto;
|
|
|
import com.xjrsoft.module.system.dto.SystemUpdateMessageReleaseDto;
|
|
|
@@ -20,6 +21,7 @@ import com.xjrsoft.module.system.service.ISystemUpdateMessageNoticeService;
|
|
|
import com.xjrsoft.module.system.service.ISystemUpdateMessageService;
|
|
|
import com.xjrsoft.module.system.vo.SystemUpdateMessagePageVo;
|
|
|
import com.xjrsoft.module.system.vo.SystemUpdateMessageVo;
|
|
|
+import com.xjrsoft.module.teacher.entity.XjrUser;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
@@ -36,6 +38,7 @@ import javax.validation.Valid;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -52,6 +55,7 @@ public class SystemUpdateMessageController {
|
|
|
|
|
|
private final ISystemUpdateMessageNoticeService systemUpdateMessageNoticeService;
|
|
|
private final ISystemUpdateMessageService systemUpdateMessageService;
|
|
|
+ private final IXjrUserService xjrUserService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="系统消息列表(分页)")
|
|
|
@@ -71,7 +75,10 @@ public class SystemUpdateMessageController {
|
|
|
if (systemUpdateMessage == null) {
|
|
|
return RT.error("找不到此数据!");
|
|
|
}
|
|
|
- return RT.ok(BeanUtil.toBean(systemUpdateMessage, SystemUpdateMessageVo.class));
|
|
|
+ SystemUpdateMessageVo bean = BeanUtil.toBean(systemUpdateMessage, SystemUpdateMessageVo.class);
|
|
|
+ XjrUser xjrUser = xjrUserService.getById(systemUpdateMessage.getCreateUserId());
|
|
|
+ bean.setCreateUserName(xjrUser.getName());
|
|
|
+ return RT.ok(bean);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -80,8 +87,10 @@ public class SystemUpdateMessageController {
|
|
|
@SaCheckPermission("systemupdatemessage:add")
|
|
|
public RT<Boolean> add(@Valid @RequestBody AddSystemUpdateMessageDto dto){
|
|
|
SystemUpdateMessage systemUpdateMessage = BeanUtil.toBean(dto, SystemUpdateMessage.class);
|
|
|
+ systemUpdateMessage.setCreateDate(new Date());
|
|
|
+ systemUpdateMessage.setCreateUserId(StpUtil.getLoginIdAsLong());
|
|
|
boolean isSuccess = systemUpdateMessageService.save(systemUpdateMessage);
|
|
|
- return RT.ok(isSuccess);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
}
|
|
|
|
|
|
@PutMapping
|
|
|
@@ -90,6 +99,8 @@ public class SystemUpdateMessageController {
|
|
|
public RT<Boolean> update(@Valid @RequestBody UpdateSystemUpdateMessageDto dto){
|
|
|
|
|
|
SystemUpdateMessage systemUpdateMessage = BeanUtil.toBean(dto, SystemUpdateMessage.class);
|
|
|
+ systemUpdateMessage.setModifyDate(new Date());
|
|
|
+ systemUpdateMessage.setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
return RT.ok(systemUpdateMessageService.updateById(systemUpdateMessage));
|
|
|
|
|
|
}
|