Преглед на файлове

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.2

zhulu преди 2 години
родител
ревизия
b0445a1a89

+ 1 - 0
project_data/sql/0.0.2/quartz/quartz.sql

@@ -0,0 +1 @@
+INSERT INTO `sys_job`(`job_id`, `job_name`, `job_group`, `invoke_target`, `cron_expression`, `misfire_policy`, `concurrent`, `status`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES (129, '恶劣天气预警', 'DEFAULT', 'WeatherTask.getDataFromApi', '0 0 7,10,14,17 * * ? *', '1', '1', '0', '超级管理员', '2023-09-25 11:46:50', '', NULL);

+ 27 - 9
project_data/sql/0.0.2/soc/soc.sql

@@ -207,13 +207,31 @@ INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type
 INSERT INTO `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '已发布', '1', 'message_status', NULL, 'default', 'N', '0', '超级管理员', '2023-09-13 17:09:19', '', NULL, NULL);
 
 delete from sys_menu where menu_name in('公告通知','公告通知详情','公告通知编辑','新增公告通知','删除公告通知','发布公告通知','取消发布');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2196, '公告通知', 2168, 1, 'core/message', 'core/message/index', NULL, 1, 0, 'C', '0', '0', 'core:notification:list', '1', 'dashboard', NULL, '超级管理员', '2023-09-13 17:50:26', '超级管理员', '2023-09-15 16:47:45', '');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2208, '公告通知详情', 2196, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:query', '1', '#', NULL, '超级管理员', '2023-09-19 15:17:27', '', NULL, '');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2209, '公告通知编辑', 2196, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:edit', '1', '#', NULL, '超级管理员', '2023-09-19 15:17:56', '', NULL, '');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2210, '新增公告通知', 2196, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:add', '1', '#', NULL, '超级管理员', '2023-09-19 15:18:18', '', NULL, '');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2211, '删除公告通知', 2196, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:remove', '1', '#', NULL, '超级管理员', '2023-09-19 15:18:42', '', NULL, '');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2212, '发布公告通知', 2196, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:publish', '1', '#', NULL, '超级管理员', '2023-09-19 15:19:03', '', NULL, '');
-INSERT INTO `sys_menu`( `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2213, '取消发布', 2196, 6, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:cancelPublish', '1', '#', NULL, '超级管理员', '2023-09-19 15:19:25', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2196, '公告通知', 2207, 1, 'core/message', 'core/message/index', NULL, 1, 0, 'C', '0', '0', 'core:notification:list', '1', 'dashboard', NULL, '超级管理员', '2023-09-13 17:50:26', '超级管理员', '2023-09-15 16:47:45', '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2208, '公告通知详情', 2196, 1, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:query', '1', '#', NULL, '超级管理员', '2023-09-19 15:17:27', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2209, '公告通知编辑', 2196, 2, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:edit', '1', '#', NULL, '超级管理员', '2023-09-19 15:17:56', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2210, '新增公告通知', 2196, 3, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:add', '1', '#', NULL, '超级管理员', '2023-09-19 15:18:18', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2211, '删除公告通知', 2196, 4, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:remove', '1', '#', NULL, '超级管理员', '2023-09-19 15:18:42', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2212, '发布公告通知', 2196, 5, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:publish', '1', '#', NULL, '超级管理员', '2023-09-19 15:19:03', '', NULL, '');
+INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2213, '取消发布', 2196, 6, '', NULL, NULL, 1, 0, 'F', '0', '0', 'core:notification:cancelPublish', '1', '#', NULL, '超级管理员', '2023-09-19 15:19:25', '', NULL, '');
+
+delete from sys_role_menu where menu_id in(2208,2209,2210,2211,2212,2213,2196) ;
+
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2196);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2208);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2209);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2210);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2211);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2212);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (116, 2213);
+
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2196);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2208);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2209);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2210);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2211);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2212);
+INSERT INTO `sys_role_menu`(`role_id`, `menu_id`) VALUES (120, 2213);
 
 DROP TABLE IF EXISTS `core_announcement_notification`;
 CREATE TABLE `core_announcement_notification`  (
@@ -272,10 +290,10 @@ INDEX `announcement_notification_id_index`(`announcement_notification_id`) USING
 
 
 -- 天气预警start
-delete from sys_menu where id=2166;
+delete from sys_menu where menu_name='天气预警数据';
 INSERT INTO `sys_menu`(`id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `platform_type`, `icon`, `image_path`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2166, '天气预警数据', 1, 100, 'core/weather', 'core/weather/index', NULL, 1, 0, 'C', '0', '0', 'core:weather:list', '1', 'color', NULL, '超级管理员', '2023-09-12 11:40:46', '超级管理员', '2023-09-12 11:43:45', '');
 delete from sys_config where config_key='WEATHER_APP_CODE';
-INSERT INTO `sys_config`(`config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('天气接口AppCode', 'WEATHER_APP_CODE', '3ea812b74f67479e9ab0b3d1969a18d2...0', 'N', '超级管理员', '2023-09-13 14:08:42', '超级管理员', '2023-09-13 14:38:32', '天气接口的appcode(请根据购买的api接口填写)');
+INSERT INTO `sys_config`(`config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('天气接口AppCode', 'WEATHER_APP_CODE', '3ea812b74f67479e9ab0b3d1969a18d2', 'N', '超级管理员', '2023-09-13 14:08:42', '超级管理员', '2023-09-13 14:38:32', '天气接口的appcode(请根据购买的api接口填写)');
 DROP TABLE IF EXISTS `core_weather_warning`;
 CREATE TABLE `core_weather_warning`  (
  `id` bigint(0) NOT NULL AUTO_INCREMENT,

+ 54 - 0
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/message/vo/MessageAppPageVo.java

@@ -0,0 +1,54 @@
+package com.xunmei.common.core.domain.message.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 公告通知对象 core_announcement_notification
+ *
+ * @author xunmei
+ * @date 2023-09-13
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+
+@ApiModel(value = "CoreAnnouncementNotification对象" , description = "公告通知")
+public class MessageAppPageVo
+        {
+private static final long serialVersionUID=1L;
+
+    /**  */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    /** 标题 */
+    private String title;
+
+    /** 内容 */
+            @ApiModelProperty(value = "内容")
+    private String content;
+    /** 发布时间 */
+            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+            @ApiModelProperty(value = "发布时间")
+    private Date publishTime;
+
+
+
+            @ApiModelProperty(value = "附件")
+            private List<String> fileList;
+
+            @ApiModelProperty(value = "附件")
+            private String strFileList;
+
+   private Integer isRead;
+        }

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/message/controller/CoreAnnouncementNotificationController.java

@@ -6,6 +6,7 @@ import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationDto
 import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationPageDto;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationAppPageVo;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationPageVo;
+import com.xunmei.common.core.domain.message.vo.MessageAppPageVo;
 import com.xunmei.common.core.web.controller.BaseController;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
@@ -105,7 +106,7 @@ public class CoreAnnouncementNotificationController extends BaseController {
 
     @ApiOperation(value = "App查询消息列表")
     @PostMapping("/appList")
-    public TableDataInfo<CoreAnnouncementNotificationAppPageVo> appList(@RequestBody CoreAnnouncementNotificationAppPageDto request) {
+    public TableDataInfo<MessageAppPageVo> appList(@RequestBody CoreAnnouncementNotificationAppPageDto request) {
         return coreAnnouncementNotificationService.selectAppPage(request);
     }
 

+ 3 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/message/mapper/CoreAnnouncementNotificationMapper.java

@@ -10,6 +10,7 @@ import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationApp
 import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationPageDto;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationAppPageVo;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationPageVo;
+import com.xunmei.common.core.domain.message.vo.MessageAppPageVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -83,9 +84,9 @@ public interface CoreAnnouncementNotificationMapper extends BaseMapper<CoreAnnou
 
     void deleteNotificationToUsers(@Param("notificationId")  Long notificationId);
 
-    Page<CoreAnnouncementNotificationAppPageVo> selectAppPage(@Param("page")Page<CoreAnnouncementNotificationAppPageVo> page, @Param("request")CoreAnnouncementNotificationAppPageDto request);
+    Page<MessageAppPageVo> selectAppPage(@Param("page")Page<MessageAppPageVo> page, @Param("request")CoreAnnouncementNotificationAppPageDto request);
 
-    List<CoreAnnouncementNotificationToUser> selectNotificationToUsers(@Param("request")CoreAnnouncementNotificationAppPageDto request, @Param("records")List<CoreAnnouncementNotificationAppPageVo> records);
+    List<CoreAnnouncementNotificationToUser> selectNotificationToUsers(@Param("request")CoreAnnouncementNotificationAppPageDto request, @Param("records")List<MessageAppPageVo> records);
 
     CoreAnnouncementNotificationToUser checkIsRead(@Param("request") CoreAnnouncementNotificationAppPageDto request);
 

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/message/service/ICoreAnnouncementNotificationService.java

@@ -7,6 +7,7 @@ import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationDto
 import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationPageDto;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationAppPageVo;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationPageVo;
+import com.xunmei.common.core.domain.message.vo.MessageAppPageVo;
 import com.xunmei.common.core.web.page.TableDataInfo;
 
 import java.util.List;
@@ -76,7 +77,7 @@ public interface ICoreAnnouncementNotificationService extends IService<CoreAnnou
 
     void publish(Long id);
 
-    TableDataInfo<CoreAnnouncementNotificationAppPageVo> selectAppPage(CoreAnnouncementNotificationAppPageDto request);
+    TableDataInfo<MessageAppPageVo> selectAppPage(CoreAnnouncementNotificationAppPageDto request);
 
     void markIsRead(CoreAnnouncementNotificationAppPageDto request);
 }

+ 5 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/message/service/impl/CoreAnnouncementNotificationServiceImpl.java

@@ -18,6 +18,7 @@ import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationDto
 import com.xunmei.common.core.domain.message.dto.CoreAnnouncementNotificationPageDto;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationAppPageVo;
 import com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationPageVo;
+import com.xunmei.common.core.domain.message.vo.MessageAppPageVo;
 import com.xunmei.common.core.util.BeanHelper;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.utils.bean.BeanUtils;
@@ -103,8 +104,8 @@ public class CoreAnnouncementNotificationServiceImpl extends ServiceImpl<CoreAnn
     }
 
     @Override
-    public TableDataInfo<CoreAnnouncementNotificationAppPageVo> selectAppPage(CoreAnnouncementNotificationAppPageDto request) {
-        Page<CoreAnnouncementNotificationAppPageVo> page;
+    public TableDataInfo<MessageAppPageVo> selectAppPage(CoreAnnouncementNotificationAppPageDto request) {
+        Page<MessageAppPageVo> page;
         //分页
         if (request.getPageNum()!=null&&request.getPageSize()!=null)
         {
@@ -135,8 +136,8 @@ public class CoreAnnouncementNotificationServiceImpl extends ServiceImpl<CoreAnn
         coreAnnouncementNotificationMapper.insertNotificationUser(notificationUser);
     }
 
-    private Page<CoreAnnouncementNotificationAppPageVo> buildNewNotificationAppPageVo(Page<CoreAnnouncementNotificationAppPageVo> page, CoreAnnouncementNotificationAppPageDto request) {
-        List<CoreAnnouncementNotificationAppPageVo> records = page.getRecords();
+    private Page<MessageAppPageVo> buildNewNotificationAppPageVo(Page<MessageAppPageVo> page, CoreAnnouncementNotificationAppPageDto request) {
+        List<MessageAppPageVo> records = page.getRecords();
         List<CoreAnnouncementNotificationToUser> list = coreAnnouncementNotificationMapper.selectNotificationToUsers(request,records);
             records.forEach(r->{
                 int num = (int) list.stream().filter(a->a.getUserId().equals(request.getUserId())&&a.getAnnouncementNotificationId().equals(r.getId())).count();

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/message/CoreAnnouncementNotificationMapper.xml

@@ -81,7 +81,7 @@
         </foreach>
     </select>
     <select id="selectAppPage"
-            resultType="com.xunmei.common.core.domain.message.vo.CoreAnnouncementNotificationAppPageVo">
+            resultType="com.xunmei.common.core.domain.message.vo.MessageAppPageVo">
         select T.*,T.file_list as strFileList from (select a.* from core_announcement_notification a
                          left join core_announcement_notification_to_role b on a.id = b.announcement_notification_id
                          left join core_announcement_notification_to_org c on a.id = c.announcement_notification_id