Ver código fonte

系统消息增加发布人

dzx 1 ano atrás
pai
commit
c3a46dc8ea

+ 1 - 0
src/main/java/com/xjrsoft/module/student/service/impl/StudentManagerServiceImpl.java

@@ -536,6 +536,7 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
             }else{
                 user = new BaseStudentUser();
                 user.setId(userId);
+                user.setUserName(credentialNumber);
                 user.setCredentialNumber(credentialNumber);
                 user.setCreateUserId(createUserId);
                 user.setCreateDate(LocalDateTime.now());

+ 13 - 2
src/main/java/com/xjrsoft/module/system/controller/SystemUpdateMessageController.java

@@ -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));
 
     }

+ 3 - 0
src/main/java/com/xjrsoft/module/system/vo/SystemUpdateMessageVo.java

@@ -49,6 +49,9 @@ public class SystemUpdateMessageVo {
     @ApiModelProperty("状态(0:未发布 1:已发布)")
     private Integer status;
 
+    @ApiModelProperty("发布人")
+    private String createUserName;
+
 
 
 }