jz.kai 4 лет назад
Родитель
Сommit
f11d128231

+ 4 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/MessageNotice.java

@@ -24,8 +24,10 @@ public class MessageNotice {
     private String content;
         @ApiModelProperty(value = "收件人ID")
     private String recipientId;
+    private String recipientName;
         @ApiModelProperty(value = "审核状态是否")
     private Boolean status;
+    private String statusName;
         @ApiModelProperty(value = "是否删除")
     private Boolean delFlag;
         @ApiModelProperty(value = "创建人")
@@ -44,8 +46,10 @@ public class MessageNotice {
     private Date updateTime;
         @ApiModelProperty(value = "分类(字典:通知分类")
     private String classify;
+    private String classifyName;
         @ApiModelProperty(value = "类型:1站内通告,2微信")
     private String type;
+    private String typeName;
         @ApiModelProperty(value = "点击超链接")
     private String noticeLink;
         @ApiModelProperty(value = "是否发送微信消息")

+ 20 - 1
web/src/main/java/com/jpsoft/employment/modules/base/controller/MessageNoticeController.java

@@ -6,6 +6,7 @@ import com.jpsoft.employment.modules.common.dto.Sort;
 import com.jpsoft.employment.modules.common.dto.MessageResult;
 import com.jpsoft.employment.modules.base.entity.MessageNotice;
 import com.jpsoft.employment.modules.base.service.MessageNoticeService;
+import com.jpsoft.employment.modules.sys.service.DataDictionaryService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -26,6 +27,8 @@ public class MessageNoticeController {
 
     @Autowired
     private MessageNoticeService messageNoticeService;
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -206,6 +209,7 @@ public class MessageNoticeController {
         MessageResult<Map> msgResult = new MessageResult<>();
 
         Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("classify","3");
 
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("id_","asc"));
@@ -217,13 +221,28 @@ public class MessageNoticeController {
             searchParams.put("status",status);
         }
         if (StringUtils.isNotEmpty(classify)) {
-            searchParams.put("classify",classify);
+//            searchParams.put("classify",classify);
         }
         if (StringUtils.isNotEmpty(type)) {
             searchParams.put("type",type);
         }
 
         Page<MessageNotice> page = messageNoticeService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        for(MessageNotice messageNotice : page.getResult()){
+            if(messageNotice.getStatus()){
+                messageNotice.setStatusName("已审核");
+            }
+            else{
+                messageNotice.setStatusName("未审核");
+            }
+            if(messageNotice.getType().equals("1")){
+                messageNotice.setTypeName("站内通告");
+            }
+            else{
+                messageNotice.setTypeName("微信");
+            }
+            messageNotice.setClassifyName(dataDictionaryService.findNameByCatalogNameAndValue("消息分类",messageNotice.getClassify()));
+        }
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));