Kaynağa Gözat

消息未读list和阅读消息的接口

dzx 1 yıl önce
ebeveyn
işleme
d3615b89f9

+ 17 - 5
src/main/java/com/xjrsoft/module/student/service/impl/StudentManagerServiceImpl.java

@@ -427,16 +427,26 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
                 baseStudent.setNation(dictionary.get(dataMaps.get(14).toString()));//民族
             }
             if(dataMaps.get(15).toString() != null && "".equals(dataMaps.get(15).toString())){
-                baseStudent.setNation(dictionary.get(dataMaps.get(15).toString()));//血型
+                baseStudent.setBloodType(dictionary.get(dataMaps.get(15).toString()));//血型
+            }
+            if(dataMaps.get(16).toString() != null && "".equals(dataMaps.get(16).toString())){
+                baseStudent.setHealth(dictionary.get(dataMaps.get(16).toString()));//健康状况
+            }
+            if(dataMaps.get(17).toString() != null && "".equals(dataMaps.get(17).toString())){
+                baseStudent.setMaritalState(dictionary.get(dataMaps.get(17).toString()));//婚姻状况
+            }
+            if(dataMaps.get(18).toString() != null && "".equals(dataMaps.get(18).toString())){
+                baseStudent.setPoliticalState(dictionary.get(dataMaps.get(18).toString()));//政治面貌
+            }
+            if(dataMaps.get(19).toString() != null && "".equals(dataMaps.get(19).toString())){
+                baseStudent.setPoliticalState(dictionary.get(dataMaps.get(19).toString()));//国籍地区
             }
-
 
             if(studentUserMap.containsKey(credentialNumber)){
                 updateStudentUserList.add(user);
                 updateBaseStudentList.add(baseStudent);
             }else{
-                user = new BaseStudentUser();
-                baseStudent = new BaseStudent();
+
             }
         }
         return null;
@@ -449,7 +459,9 @@ public class StudentManagerServiceImpl extends MPJBaseServiceImpl<BaseStudentUse
     private Map<String, String> initDictionary(){
         List<String> codeList = new ArrayList<>();
         codeList.add("credential_type");codeList.add("nation");
-        codeList.add("blood_type");
+        codeList.add("blood_type");codeList.add("health");
+        codeList.add("marital_state");codeList.add("political_state");
+        codeList.add("nationality");
         List<DictionaryDetail> detailList = dictionarydetailMapper.selectJoinList(DictionaryDetail.class,
             new MPJLambdaWrapper<DictionaryDetail>()
             .leftJoin(DictionaryItem.class, DictionaryItem::getId, DictionaryDetail::getItemId)

+ 29 - 1
src/main/java/com/xjrsoft/module/system/controller/SystemUpdateMessageController.java

@@ -37,6 +37,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;
 
 /**
@@ -102,7 +103,7 @@ public class SystemUpdateMessageController {
         return RT.ok(systemUpdateMessageService.removeBatchByIds(ids));
     }
 
-    @GetMapping(value = "/release")
+    @PostMapping(value = "/release")
     @ApiOperation(value = "发布")
     @SaCheckPermission("systemupdatemessage:release")
     public RT<Boolean> release(@Valid SystemUpdateMessageReleaseDto dto) {
@@ -156,4 +157,31 @@ public class SystemUpdateMessageController {
         return RT.ok(pageOutput);
     }
 
+    @GetMapping(value = "/personal-list")
+    @ApiOperation(value="个人未读系统消息列表(分页)")
+    @SaCheckPermission("systemupdatemessage:detail")
+    public RT<List<SystemUpdateMessagePageVo>> personalList(@Valid SystemUpdateMessagePageDto dto){
+        List<SystemUpdateMessagePageVo> systemUpdateMessagePageVos = systemUpdateMessageService.selectJoinList(SystemUpdateMessagePageVo.class,
+                MPJWrappers.<SystemUpdateMessage>lambdaJoin()
+                        .leftJoin(SystemUpdateMessageNotice.class, SystemUpdateMessageNotice::getSystemUpdateMessageId, SystemUpdateMessage::getId)
+                        .eq(SystemUpdateMessageNotice::getUserId, StpUtil.getLoginIdAsLong())
+                        .eq(SystemUpdateMessage::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(SystemUpdateMessage::getStatus, 1)
+                        .eq(SystemUpdateMessageNotice::getStatus, 0)
+        );
+        return RT.ok(systemUpdateMessagePageVos);
+    }
+
+    @PostMapping(value = "/read-msg")
+    @ApiOperation(value = "阅读系统消息")
+    @SaCheckPermission("systemupdatemessage:read-msg")
+    public RT<Boolean> readMsg(@Valid SystemUpdateMessageReleaseDto dto) {
+
+        SystemUpdateMessageNotice messageNotice = systemUpdateMessageNoticeService.getById(dto.getId());
+        messageNotice.setStatus(1);
+        messageNotice.setModifyDate(new Date());
+        messageNotice.setModifyUserId(StpUtil.getLoginIdAsLong());
+        return RT.ok(systemUpdateMessageNoticeService.updateById(messageNotice));
+    }
+
 }