ソースを参照

摄像头绑定

ChenSir 1 年間 前
コミット
4d312ac0a9
39 ファイル変更774 行追加180 行削除
  1. 6 6
      aidex-admin/src/main/resources/application-druid.yml
  2. 4 4
      aidex-admin/src/main/resources/application.yml
  3. 29 8
      aidex-controller/src/main/java/com/aidex/web/controller/app/AppController.java
  4. 71 0
      aidex-controller/src/main/java/com/aidex/web/controller/system/SysIndexController.java
  5. 20 0
      aidex-controller/src/main/java/com/aidex/web/controller/system/SysReservationConfigController.java
  6. 18 0
      aidex-controller/src/main/java/com/aidex/web/controller/system/SysShipController.java
  7. 0 5
      aidex-quartz/src/main/java/com/aidex/quartz/task/RefreshMdsTask.java
  8. 1 0
      aidex-system/pom.xml
  9. 3 0
      aidex-system/src/main/java/com/aidex/common/app/server/IAppService.java
  10. 10 7
      aidex-system/src/main/java/com/aidex/common/app/server/impl/AppService.java
  11. 1 1
      aidex-system/src/main/java/com/aidex/system/domain/Message.java
  12. 9 1
      aidex-system/src/main/java/com/aidex/system/domain/SysNotice.java
  13. 13 0
      aidex-system/src/main/java/com/aidex/system/domain/SysReservationConfig.java
  14. 2 0
      aidex-system/src/main/java/com/aidex/system/mapper/SysAlarmMapper.java
  15. 10 0
      aidex-system/src/main/java/com/aidex/system/mapper/SysAlarmMapper.xml
  16. 16 1
      aidex-system/src/main/java/com/aidex/system/mapper/SysNoticeMapper.xml
  17. 15 0
      aidex-system/src/main/java/com/aidex/system/mapper/SysReservationConfigMapper.java
  18. 17 1
      aidex-system/src/main/java/com/aidex/system/mapper/SysReservationConfigMapper.xml
  19. 9 1
      aidex-system/src/main/java/com/aidex/system/mapper/SysReservationDataMapper.java
  20. 20 2
      aidex-system/src/main/java/com/aidex/system/mapper/SysReservationDataMapper.xml
  21. 12 0
      aidex-system/src/main/java/com/aidex/system/mapper/SysShipMapper.java
  22. 26 0
      aidex-system/src/main/java/com/aidex/system/mapper/SysShipMapper.xml
  23. 2 0
      aidex-system/src/main/java/com/aidex/system/service/SysAlarmService.java
  24. 5 0
      aidex-system/src/main/java/com/aidex/system/service/SysReservationConfigService.java
  25. 40 1
      aidex-system/src/main/java/com/aidex/system/service/SysShipService.java
  26. 5 0
      aidex-system/src/main/java/com/aidex/system/service/impl/SysAlarmServiceImpl.java
  27. 40 2
      aidex-system/src/main/java/com/aidex/system/service/impl/SysReservationConfigServiceImpl.java
  28. 78 10
      aidex-system/src/main/java/com/aidex/system/service/impl/SysShipServiceImpl.java
  29. 2 0
      aidex-ui/package.json
  30. 8 0
      aidex-ui/src/api/menu.js
  31. 18 0
      aidex-ui/src/api/system/sysReservationConfig.js
  32. 26 0
      aidex-ui/src/api/system/sysShip.js
  33. 22 6
      aidex-ui/src/views/dashboard/portal/About.vue
  34. 6 2
      aidex-ui/src/views/system/notice/NoticeIndex.vue
  35. 23 1
      aidex-ui/src/views/system/notice/modules/NoticeAddForm.vue
  36. 21 1
      aidex-ui/src/views/system/notice/modules/NoticeEditForm.vue
  37. 47 86
      aidex-ui/src/views/system/notice/modules/NoticeForm.js
  38. 68 18
      aidex-ui/src/views/system/sysreservationconfig/index.vue
  39. 51 16
      aidex-ui/src/views/system/sysship/index.vue

+ 6 - 6
aidex-admin/src/main/resources/application-druid.yml

@@ -6,12 +6,12 @@ spring:
         druid:
             # 主库数据源
             master:
-#                url: jdbc:mysql://152.136.217.148:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
-#                username: site
-#                password: admin@2022.cn
-                url: jdbc:mysql://192.168.0.116:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
-                username: root
-                password: Gshk@ssbs@8551398
+                url: jdbc:mysql://152.136.217.148:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
+                username: site
+                password: admin@2022.cn
+#                url: jdbc:mysql://192.168.0.116:3306/water_bus?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&&allowMultiQueries=true
+#                username: root
+#                password: Gshk@ssbs@8551398
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 4 - 4
aidex-admin/src/main/resources/application.yml

@@ -72,7 +72,7 @@ spring:
     # 地址
     host: 127.0.0.1
     # 端口,默认为6379
-    port: 6379
+    port: 16379
     # 数据库索引
     database: 0
     # 密码
@@ -123,7 +123,7 @@ pagehelper:
 # Swagger配置
 swagger:
   # 是否开启swagger
-  enabled: false
+  enabled: true
   # 请求前缀
   pathMapping: /api
 
@@ -138,8 +138,8 @@ xss:
 
 wx:
   miniapp:
-    appid: wx89863f6cc3943d04 #微信小程序的appid
-    secret: 1d8a4519dd92e626e183c4c7e2dad14e  #微信小程序的Secret
+    appid: wx43371b1687d52c06 #微信小程序的appid
+    secret: 98444ae0dfb97e12eb262bea10a5fbd5  #微信小程序的Secret
     msgDataFormat: JSON
     token:
     aesKey:

+ 29 - 8
aidex-controller/src/main/java/com/aidex/web/controller/app/AppController.java

@@ -3,6 +3,8 @@ package com.aidex.web.controller.app;
 
 import cn.binarywang.wx.miniapp.api.WxMaService;
 import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
 import com.aidex.common.app.domain.vo.LocationVO;
 import com.aidex.common.app.domain.vo.SysWharfVO;
 import com.aidex.common.app.server.IAppService;
@@ -15,6 +17,7 @@ import com.aidex.common.plush.domain.vo.SysShipExtendListVO;
 import com.aidex.common.plush.domain.vo.SysShipExtendVO;
 import com.aidex.common.plush.domain.vo.SysShipResVO;
 import com.aidex.common.utils.json.JSONObject;
+import com.aidex.common.utils.uuid.IdUtils;
 import com.aidex.quartz.task.RefreshAccessTokenTask;
 import com.aidex.system.domain.*;
 import com.aidex.system.domain.vo.SysReservationDataHistoryVO;
@@ -37,6 +40,7 @@ import org.springframework.web.bind.annotation.*;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -63,7 +67,9 @@ public class AppController {
 
     @Resource
     private WxMaService wxMaService;
-	private String code;
+
+    @Autowired
+    private SysShipService sysShipService;
 
 	@GetMapping("/carousel")
     @ApiOperation(value = "获取轮播信息", notes = "获取轮播信息", produces = "application/json")
@@ -233,7 +239,7 @@ public class AppController {
     }
 
     @PostMapping("/message")
-    public R<PageInfo> getMessage(@RequestBody Message message, HttpServletRequest request, HttpServletResponse response)
+    public R getMessage(@RequestBody Message message, HttpServletRequest request, HttpServletResponse response)
     {
         // 验证签名时使用
         // String timestamp = request.getHeader("timestamp");
@@ -241,20 +247,35 @@ public class AppController {
         // String type = request.getHeader("type");
         // String device_sn = request.getHeader("device_sn");
         // String message_id = request.getHeader("message_id");
+        // logger.info("webhook消息推送,消息-------{}", message);
         Map<String, Object> extend = message.getExtend();
+        logger.info("webhook消息推送,消息----extend---{}", extend);
         if (null != extend) {
+            logger.info("webhook消息推送,消息----extend-count--{}", extend.containsKey("count"));
             if (extend.containsKey("count")) {
-                int[] alarm_count = (int[]) extend.get("count");
-                if (alarm_count.length > 0){
-                    logger.info("webhook消息推送,告警人数----人数---{}", alarm_count[0]);
+                ArrayList<Integer> alarm_count = (ArrayList<Integer>) extend.get("count");
+                logger.info("webhook消息推送,消息----extend-alarm_count--{}", alarm_count);
+                if (alarm_count.size() > 0){
+                    logger.info("webhook消息推送,告警人数----人数---{}", alarm_count.get(0));
                     logger.info("webhook消息推送,请求头----时间戳---{}", message.getTimestamp());
                     logger.info("webhook消息推送,请求头----设备号---{}", message.getDevice_sn());
-
-
+                    String dateTime = DateUtil.s(DateUtil.timeToSecond(message.getTimestamp()));
+                    logger.info("webhook消息推送,请求头----时间戳转换---{}", dateTime);
+                    int row = iAppService.insertCameraAlarm(new SysCameraAlarm(IdUtils.fastSimpleUUID(), DateUtil.date(), message.getDevice_sn(), Integer.valueOf(alarm_count.get(0))));
+                    return R.status(row);
                 }
             }
         }
-        return R.data(null);
+        return R.status(false);
     }
 
+
+    /*@GetMapping("/test")
+    @ApiOperation(value = "获取信息类型", notes = "获取信息类型", produces = "application/json")
+    public R test()
+    {
+        sysShipService.getShipSurplusSeat("261836442bbb48659d40f716feaa470d", 300);
+        return R.status(true);
+    }*/
+
 }

+ 71 - 0
aidex-controller/src/main/java/com/aidex/web/controller/system/SysIndexController.java

@@ -1,11 +1,24 @@
 package com.aidex.web.controller.system;
 
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.analysis.WxMaRetainInfo;
+import cn.binarywang.wx.miniapp.bean.analysis.WxMaSummaryTrend;
+import cn.hutool.core.date.DateUtil;
 import com.aidex.common.config.AiDexConfig;
+import com.aidex.common.core.domain.R;
 import com.aidex.common.utils.StringUtils;
+import com.aidex.system.service.SysAlarmService;
+import com.aidex.system.service.SysShipService;
+import com.alibaba.fastjson2.JSONObject;
+import me.chanjar.weixin.common.error.WxErrorException;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * 首页
  *
@@ -18,6 +31,15 @@ public class SysIndexController
     @Autowired
     private AiDexConfig aidexConfig;
 
+    @Autowired
+    private SysShipService sysShipService;
+
+    @Autowired
+    private SysAlarmService alarmService;
+
+    @Autowired
+    private WxMaService wxMaService;
+
     /**
      * 访问首页,提示语
      */
@@ -26,4 +48,53 @@ public class SysIndexController
     {
         return StringUtils.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", aidexConfig.getName(), aidexConfig.getVersion());
     }
+
+
+    /**
+     * @Description: 首页统计数据<br/>
+     * @date: 2024/4/7 10:29<br/>
+     * @param: <br />
+     * @author: Chensir <br/>
+     * @since JDK 1.8
+     * @return
+     */
+    @GetMapping("/index/statistics")
+    public R statistics()
+    {
+        // 在线船只
+        int onlineShip = sysShipService.countSysShipByStatus();
+        // 今日报警数量
+        int todayAlarmNum = alarmService.countSysAlarmByDate();
+        // 新增用户
+        int uv_new_num = 0;
+        // 活跃用户
+        int uv_active_num = 0;
+        // 总用户
+        Long uv_all_num = 0L;
+        // 用户活跃量
+		try {
+            // 获取日留存数据
+			WxMaRetainInfo dailyRetainInfo = wxMaService.getAnalysisService().getDailyRetainInfo(DateUtil.yesterday(),DateUtil.yesterday());
+            // 获取用户访问小程序数据概况
+            List<WxMaSummaryTrend> dailySummaryTrend = wxMaService.getAnalysisService().getDailySummaryTrend(DateUtil.yesterday(), DateUtil.yesterday());
+            if (dailyRetainInfo != null){
+                uv_new_num = dailyRetainInfo.getVisitUvNew().get(0);
+                uv_active_num = dailyRetainInfo.getVisitUv().get(0);
+            }
+            if (dailySummaryTrend != null && dailySummaryTrend.size() > 0){
+                uv_all_num = dailySummaryTrend.get(0).getVisitTotal();
+            }
+		} catch (WxErrorException e) {
+			throw new RuntimeException(e);
+		}
+        JSONObject data = new JSONObject();
+        data.put("onlineShip", onlineShip);
+        data.put("todayAlarmNum", todayAlarmNum);
+        data.put("uv_new_num", uv_new_num);
+        data.put("uv_active_num", uv_active_num);
+        data.put("uv_all_num", uv_all_num);
+
+		return R.data(data);
+    }
+
 }

+ 20 - 0
aidex-controller/src/main/java/com/aidex/web/controller/system/SysReservationConfigController.java

@@ -103,6 +103,16 @@ public class SysReservationConfigController extends BaseController {
         return R.status(sysReservationConfigService.deleteSysReservationConfigByIds(ids));
     }
 
+    /**
+     * 按日期删除预约配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:sysReservationConfig:remove')")
+    @Log(title = "预约配置", businessType = BusinessType.DELETE)
+    @DeleteMapping("/removeByDate")
+    public R removeByDate(@RequestParam(value = "date", required = true) String date) {
+        return sysReservationConfigService.removeByDate(date);
+    }
+
 
     /**
      * 导出预约配置列表
@@ -126,4 +136,14 @@ public class SysReservationConfigController extends BaseController {
         return R.data(dataMap);
     }
 
+    /**
+     * 按日期修改预约配置
+     */
+    @PreAuthorize("@ss.hasPermi('system:sysReservationConfig:edit')")
+    @Log(title = "预约配置", businessType = BusinessType.UPDATE)
+    @PutMapping("/editByReservationDate")
+    public R editByReservationDate(@RequestBody  SysReservationConfig sysReservationConfig) {
+        return sysReservationConfigService.editByReservationDate(sysReservationConfig);
+    }
+
 }

+ 18 - 0
aidex-controller/src/main/java/com/aidex/web/controller/system/SysShipController.java

@@ -8,6 +8,7 @@ import com.aidex.common.enums.BusinessType;
 import com.aidex.common.utils.poi.ExcelUtil;
 import com.aidex.framework.cache.DictUtils;
 import com.aidex.system.domain.SysShip;
+import com.aidex.system.domain.SysShipCamera;
 import com.aidex.system.domain.vo.ShipVo;
 import com.aidex.system.service.SysShipService;
 import com.github.pagehelper.PageInfo;
@@ -113,4 +114,21 @@ public class SysShipController extends BaseController {
         return R.data(dataMap);
     }
 
+    @Log(title = "船只绑定摄像头", businessType = BusinessType.INSERT)
+    @PostMapping( "/bindCamera")
+    public R bindCamera(@RequestBody SysShipCamera sysShipCamera) {
+        return R.status(sysShipService.bindCamera(sysShipCamera));
+    }
+
+    @Log(title = "船只解绑摄像头", businessType = BusinessType.INSERT)
+    @PostMapping( "/unbindCamera")
+    public R unbindCamera(@RequestBody SysShipCamera sysShipCamera) {
+        return R.status(sysShipService.unbindCamera(sysShipCamera));
+    }
+
+    @GetMapping( "/getShipCameraList/{shipId}")
+    public R getShipCameraList(@PathVariable String shipId) {
+        return R.data(sysShipService.getShipCameraList(shipId));
+    }
+
 }

+ 0 - 5
aidex-quartz/src/main/java/com/aidex/quartz/task/RefreshMdsTask.java

@@ -1,13 +1,11 @@
 package com.aidex.quartz.task;
 
-import cn.hutool.core.date.DateUtil;
 import cn.hutool.http.HttpRequest;
 import com.aidex.common.constant.Constants;
 import com.aidex.common.core.domain.BaseEntity;
 import com.aidex.common.core.redis.RedisCache;
 import com.aidex.common.utils.StringUtils;
 import com.aidex.framework.cache.ConfigUtils;
-import com.aidex.system.domain.SysAlarm;
 import com.aidex.system.domain.SysConfig;
 import com.aidex.system.domain.SysShip;
 import com.aidex.system.service.SysShipService;
@@ -18,14 +16,11 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import static com.aidex.common.enums.AlarmType.*;
-
 /**
  * @author :ChenSir
  * @date :Created in 2024/3/17 20:07

+ 1 - 0
aidex-system/pom.xml

@@ -28,6 +28,7 @@
             <artifactId>aidex-common</artifactId>
         </dependency>
 
+
         <!--  引入mapstruct 2020-01-28  -->
         <dependency>
             <groupId>org.mapstruct</groupId>

+ 3 - 0
aidex-system/src/main/java/com/aidex/common/app/server/IAppService.java

@@ -8,6 +8,7 @@ import com.aidex.common.plush.domain.vo.SysShipExtendListResVO;
 import com.aidex.common.plush.domain.vo.SysShipExtendListVO;
 import com.aidex.common.plush.domain.vo.SysShipExtendVO;
 import com.aidex.common.plush.domain.vo.SysShipResVO;
+import com.aidex.system.domain.SysCameraAlarm;
 import com.aidex.system.domain.SysNotice;
 import com.aidex.system.domain.SysReservationData;
 import com.aidex.system.domain.SysWharf;
@@ -41,4 +42,6 @@ public interface IAppService {
     int cancelReservation(String id);
 
     List<SysReservationDataHistoryVO> getHistoryReservationList(String openid, String type);
+
+    int insertCameraAlarm(SysCameraAlarm sysCameraAlarm);
 }

+ 10 - 7
aidex-system/src/main/java/com/aidex/common/app/server/impl/AppService.java

@@ -22,6 +22,7 @@ import com.aidex.framework.cache.ConfigUtils;
 import com.aidex.system.domain.*;
 import com.aidex.system.domain.vo.SysReservationDataHistoryVO;
 import com.aidex.system.domain.vo.SysReservationDataNumVO;
+import com.aidex.system.mapper.SysCameraAlarmMapper;
 import com.aidex.system.mapper.SysReservationDataMapper;
 import com.aidex.system.service.SysNoticeService;
 import com.aidex.system.service.SysReservationConfigService;
@@ -46,12 +47,6 @@ public class AppService implements IAppService {
     private SysWharfService sysWharfService;
 
     @Autowired
-    private IGpsService iGpsService;
-
-    @Autowired
-    private SysShipService sysShipService;
-
-    @Autowired
     private SysShipExtendService sysShipExtendService;
 
     @Autowired
@@ -60,6 +55,9 @@ public class AppService implements IAppService {
     @Autowired
     private SysReservationDataMapper sysReservationDataMapper;
 
+    @Autowired
+    private SysCameraAlarmMapper sysCameraAlarmMapper;
+
 
     public List<SysNotice> getCarouselList(){
 
@@ -347,7 +345,7 @@ public class AppService implements IAppService {
 
     @Override
     public List<SysReservationDataHistoryVO> getHistoryReservationList(String openid, String type) {
-        List<SysReservationDataHistoryVO> historyData = sysReservationDataMapper.getHistoryData(openid, type);
+        List<SysReservationDataHistoryVO> historyData = sysReservationDataMapper.getHistoryData(openid, type, DateUtil.formatDate(DateUtil.date()));
         SysConfig configByKey = ConfigUtils.getConfigByKey("sys.before.open.minte");
         if (configByKey != null){
             String value = configByKey.getConfigValue();
@@ -358,4 +356,9 @@ public class AppService implements IAppService {
         return historyData;
     }
 
+    @Override
+    public int insertCameraAlarm(SysCameraAlarm sysCameraAlarm) {
+        return sysCameraAlarmMapper.insertCameraAlarm(sysCameraAlarm);
+    }
+
 }

+ 1 - 1
aidex-system/src/main/java/com/aidex/system/domain/Message.java

@@ -42,7 +42,7 @@ public class Message implements Serializable {
 	@JSONField(name = "extend")
 	private Map<String, Object> extend;
 
-	@ApiModelProperty(value = "mp4 文件")
+	@ApiModelProperty(value = "mp4文件")
 	@JSONField(name = "alarm_mp4")
 	private String[] alarm_mp4;
 

+ 9 - 1
aidex-system/src/main/java/com/aidex/system/domain/SysNotice.java

@@ -45,13 +45,21 @@ public class SysNotice extends BaseEntity<SysNotice>
 
 
     /** 是否置顶(0否 1是) */
-    @FieldRemark(field = "topping", name = "公告状态")
+    @FieldRemark(field = "topping", name = "是否置顶")
     private String topping;
 
     /** 是否轮播(0否 1是) */
     @FieldRemark(field = "carousel", name = "是否轮播")
     private String carousel;
 
+    /** 作者 */
+    @FieldRemark(field = "author", name = "作者")
+    private String author;
+
+    /** 摘要 */
+    @FieldRemark(field = "excerpt", name = "摘要")
+    private String excerpt;
+
 
     // 轮播图地址
     @FieldRemark(field = "carousel_img_url", name = "轮播图地址")

+ 13 - 0
aidex-system/src/main/java/com/aidex/system/domain/SysReservationConfig.java

@@ -67,6 +67,12 @@ public class SysReservationConfig extends BaseEntity<SysReservationConfig>
     @FieldRemark(name = "可预约人数",field = "enableNum")
     private Long enableNum;
 
+    /** 可预约人数 */
+    @Excel(name = "已预约人数")
+    @LogField
+    @FieldRemark(name = "已预约人数",field = "enableNum")
+    private Long reservationNum;
+
     /** 配置状态 0 保存 1 发布 */
     @Excel(name = "配置状态", dictType = "sys_normal_disable")
     @LogField
@@ -123,6 +129,13 @@ public class SysReservationConfig extends BaseEntity<SysReservationConfig>
         return status;
     }
 
+    public Long getReservationNum() {
+        return reservationNum;
+    }
+
+    public void setReservationNum(Long reservationNum) {
+        this.reservationNum = reservationNum;
+    }
 
     @Override
     public String toString() {

+ 2 - 0
aidex-system/src/main/java/com/aidex/system/mapper/SysAlarmMapper.java

@@ -20,5 +20,7 @@ public interface SysAlarmMapper extends BaseMapper<SysAlarm>
      */
     public int deleteSysAlarmByIds(@Param("ids") String[] ids, @Param("DEL_FLAG_DELETE") String DEL_FLAG_DELETE);
 
+    public int  countSysAlarmByDate();
+
 
 }

+ 10 - 0
aidex-system/src/main/java/com/aidex/system/mapper/SysAlarmMapper.xml

@@ -106,6 +106,16 @@
         </where>
     </select>
 
+    <select id="countSysAlarmByDate" resultType="java.lang.Integer">
+        SELECT
+            count( 1 )
+        FROM
+            sys_alarm a
+        WHERE
+            a.del_flag = 0
+          AND date_format( a.alarmime, '%Y-%m-%d' ) = date_format(NOW(),'%Y-%m-%d')
+    </select>
+
 
     <insert id="insert">
         INSERT INTO sys_alarm(

+ 16 - 1
aidex-system/src/main/java/com/aidex/system/mapper/SysNoticeMapper.xml

@@ -19,7 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		a.version AS "version",
         a.topping AS "topping",
         a.carousel_img_url AS "carouselImgUrl",
-        a.carousel AS "carousel"
+        a.carousel AS "carousel",
+        a.author AS "author",
+        a.excerpt AS "excerpt"
 	</sql>
 
     <sql id="sysNoticeJoins">
@@ -55,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="carousel != null and carousel != ''">
             AND a.carousel = #{carousel}
         </if>
+        <if test="status != null and status != ''">
+            AND a.status = #{status}
+        </if>
         <if test="createBy != null and createBy != ''">
             AND su.name like concat('%', #{createBy}, '%')
         </if>
@@ -71,6 +76,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			status,
             topping,
             carousel,
+            author,
+            excerpt,
             carousel_img_url,
 			remark,
  			create_by,
@@ -90,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			#{status},
             #{topping},
             #{carousel},
+            #{author},
+ 		    #{excerpt},
             #{carouselImgUrl},
 			#{remark},
  			#{createBy},
@@ -118,6 +127,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="carousel != null and carousel != ''">
                 carousel = #{carousel},
             </if>
+            <if test="author != null and author != ''">
+                author = #{author},
+            </if>
+            <if test="excerpt != null and excerpt != ''">
+                excerpt = #{excerpt},
+            </if>
             <if test="carouselImgUrl != null and carouselImgUrl != ''">
                 carousel_img_url = #{carouselImgUrl},
             </if>

+ 15 - 0
aidex-system/src/main/java/com/aidex/system/mapper/SysReservationConfigMapper.java

@@ -29,5 +29,20 @@ public interface SysReservationConfigMapper extends BaseMapper<SysReservationCon
      */
     public int batchInsert(List<SysReservationConfig> list);
 
+    /**
+     * 批量删除预约配置
+     * @param date 预约日期
+     * @return
+     */
+    public int deleteSysReservationConfigByDate(@Param("date") String date);
+
+
+
+    /**
+     * 批量删除预约配置
+     * @return
+     */
+    public int updateStatusByDate(SysReservationConfig sysReservationConfig);
+
 
 }

+ 17 - 1
aidex-system/src/main/java/com/aidex/system/mapper/SysReservationConfigMapper.xml

@@ -31,7 +31,9 @@
 
         a.version as "version",
 
-        a.del_flag as "delFlag"
+        a.del_flag as "delFlag",
+
+	    (SELECT COUNT(1) from sys_reservation_data d WHERE a.id = d.reservation_config_id)  as reservationNum
 
     </sql>
 
@@ -79,6 +81,10 @@
                 AND date_format(a.reservation_end_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endReservationEndTime},'%Y-%m-%d %H:%i:%s')
             </if>
 
+            <if test="reservationDate != null">
+                AND date_format(a.reservation_date, '%Y-%m-%d' ) = date_format( #{reservationDate},'%Y-%m-%d')
+            </if>
+
             <if test="enableNum != null ">
                 AND a.enable_num = #{enableNum}
             </if>
@@ -266,6 +272,12 @@
         WHERE id = #{id}
     </update>
 
+    <update id="updateStatusByDate">
+        UPDATE sys_reservation_config SET
+            status = #{status}
+        WHERE reservation_date = #{reservationDate}
+    </update>
+
     <delete id="deleteSysReservationConfigByIds">
         UPDATE sys_reservation_config SET
             del_flag = #{DEL_FLAG_DELETE}
@@ -275,4 +287,8 @@
         </foreach>
     </delete>
 
+    <delete id="deleteSysReservationConfigByDate">
+        delete from sys_reservation_config where reservation_date = #{date}
+    </delete>
+
 </mapper>

+ 9 - 1
aidex-system/src/main/java/com/aidex/system/mapper/SysReservationDataMapper.java

@@ -50,6 +50,14 @@ public interface SysReservationDataMapper
     public int getNumByOpenid(SysReservationData sysReservationData);
 
     /**
+     * 判断当日有无预约
+     *
+     * @param date 日期
+     * @return 结果
+     */
+    public int getNumByDate(String date);
+
+    /**
      * 判断小程序当日有无预约
      *
      * @param sysReservationData 预约数据
@@ -72,7 +80,7 @@ public interface SysReservationDataMapper
      *
      * @return 结果
      */
-    public List<SysReservationDataHistoryVO> getHistoryData(@Param("openid") String openid, @Param("type") String type);
+    public List<SysReservationDataHistoryVO> getHistoryData(@Param("openid") String openid, @Param("type") String type, @Param("date") String date);
 
     /**
      * 根据日期获取预约时间点

+ 20 - 2
aidex-system/src/main/java/com/aidex/system/mapper/SysReservationDataMapper.xml

@@ -65,6 +65,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		)
 	</select>
 
+	<select id="getNumByDate" resultType="java.lang.Integer">
+		SELECT
+			COUNT( 1 )
+		FROM
+			sys_reservation_data a
+		WHERE
+			a.reservation_config_id IN (
+				SELECT
+					z.id
+				FROM
+					sys_reservation_config z
+				WHERE
+					z.reservation_date = #{date}
+			)
+	</select>
+
+
+
 	<select id="getNumByReservationConfigId" resultType="java.lang.Integer">
 		SELECT
 			COUNT(1)
@@ -93,10 +111,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			a.openid = #{openid}
 		<choose>
 			<when test="type != 1">
-				and  c.reservation_start_time &gt;= NOW()
+				AND date_format(c.reservation_date,'%Y-%m-%d') &gt;=  date_format(#{date},'%Y-%m-%d')
 			</when>
 			<otherwise>
-				and  c.reservation_start_time &lt; now()
+				AND date_format(c.reservation_date,'%Y-%m-%d') &lt;  date_format(#{date},'%Y-%m-%d')
 			</otherwise>
 		</choose>
 	</select>

+ 12 - 0
aidex-system/src/main/java/com/aidex/system/mapper/SysShipMapper.java

@@ -2,8 +2,11 @@ package com.aidex.system.mapper;
 
 import com.aidex.common.core.mapper.BaseMapper;
 import com.aidex.system.domain.SysShip;
+import com.aidex.system.domain.SysShipCamera;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * 船只管理Mapper接口
  * @author ChenSir
@@ -30,4 +33,13 @@ public interface SysShipMapper extends BaseMapper<SysShip>
 
 
     int updateStatusByMacId(@Param("macId") String macId, @Param("status") String status);
+
+
+    int countSysShipByStatus();
+
+    int bindCamera(SysShipCamera sysShipCamera);
+
+    int unbindCamera( SysShipCamera sysShipCamera);
+
+    List<SysShipCamera> getShipCameraList(@Param("shipId") String shipId);
 }

+ 26 - 0
aidex-system/src/main/java/com/aidex/system/mapper/SysShipMapper.xml

@@ -108,6 +108,11 @@
         </where>
     </select>
 
+    <select id="countSysShipByStatus" resultType="java.lang.Integer">
+        select count(1) from sys_ship a where a.del_flag = 0 and (a.status = 1 or a.status = 2)
+    </select>
+
+
 
     <insert id="insert">
         INSERT INTO sys_ship(
@@ -183,6 +188,8 @@
         )
     </insert>
 
+
+
     <update id="update">
         UPDATE sys_ship SET
             ship_num = #{shipNum},
@@ -231,4 +238,23 @@
         </foreach>
     </delete>
 
+    <insert id="bindCamera" parameterType="com.aidex.system.domain.SysShipCamera">
+        INSERT INTO sys_ship_camera(ship_id,camera_device_sn, camera_device_name) VALUES(#{shipId}, #{cameraDeviceSn}, #{cameraDeviceName})
+    </insert>
+
+    <delete id="unbindCamera" parameterType="com.aidex.system.domain.SysShipCamera">
+        delete from sys_ship_camera where ship_id = #{shipId} and camera_device_sn = #{cameraDeviceSn}
+    </delete>
+
+    <select id="getShipCameraList" resultType="com.aidex.system.domain.SysShipCamera">
+        SELECT
+            ship_id AS shipId,
+            (SELECT ship_nanme from sys_ship WHERE ship_id = id) as shipName,
+            camera_device_sn AS cameraDeviceSn,
+            camera_device_name AS cameraDeviceName
+        FROM
+            sys_ship_camera
+        WHERE
+            ship_id = #{shipId}
+    </select>
 </mapper>

+ 2 - 0
aidex-system/src/main/java/com/aidex/system/service/SysAlarmService.java

@@ -18,4 +18,6 @@ public interface SysAlarmService extends BaseService<SysAlarm> {
      */
     public int deleteSysAlarmByIds(String[] ids);
 
+
+    public int countSysAlarmByDate();
 }

+ 5 - 0
aidex-system/src/main/java/com/aidex/system/service/SysReservationConfigService.java

@@ -1,5 +1,6 @@
 package com.aidex.system.service;
 
+import com.aidex.common.core.domain.R;
 import com.aidex.common.core.service.BaseService;
 import com.aidex.system.domain.SysReservationConfig;
 import com.aidex.system.req.SysReservationConfigReq;
@@ -52,4 +53,8 @@ public interface SysReservationConfigService extends BaseService<SysReservationC
      */
     public List<String> getStatiscColumns(String date);
 
+
+    public R removeByDate(String date);
+
+    public R editByReservationDate(SysReservationConfig sysReservationConfig);
 }

+ 40 - 1
aidex-system/src/main/java/com/aidex/system/service/SysShipService.java

@@ -2,6 +2,9 @@ package com.aidex.system.service;
 
 import com.aidex.common.core.service.BaseService;
 import com.aidex.system.domain.SysShip;
+import com.aidex.system.domain.SysShipCamera;
+
+import java.util.List;
 
 /**
  * 船只管理Service接口
@@ -26,11 +29,47 @@ public interface SysShipService extends BaseService<SysShip> {
     public SysShip getShipByMacId(String macId);
 
     /**
-     * 批量删除船只管理
+     * 更新船只状态
      * @param macId 船只编号
      * @return 结果
      */
     public int updateStatusByMacId(String macId, String status);
 
+    /**
+     * 按状态查询在线船只数量-包含在线静止与在线运行
+     * @return 结果
+     */
+    public int countSysShipByStatus();
+
+    /**
+     * 绑定船只与摄像头
+     * @param sysShipCamera
+     * @return
+     */
+    public int bindCamera(SysShipCamera sysShipCamera);
+
+    /**
+     * 解绑船只与摄像头
+     * @param sysShipCamera
+     * @return
+     */
+    public int unbindCamera(SysShipCamera sysShipCamera);
+
+    /**
+     * 查询船只与摄像头关联信息
+     * @param shipId 船只编号
+     * @return 结果
+     */
+    public List<SysShipCamera> getShipCameraList(String shipId);
+
+    /**
+     * 获取剩余座位数
+     * @param shipId 船只编号
+     * @param duration 持续时间
+     * @return 结果
+     */
+    public String getShipSurplusSeat(String shipId, int duration);
+
+
 
 }

+ 5 - 0
aidex-system/src/main/java/com/aidex/system/service/impl/SysAlarmServiceImpl.java

@@ -100,4 +100,9 @@ public class SysAlarmServiceImpl extends BaseServiceImpl<SysAlarmMapper, SysAlar
         return mapper.deleteSysAlarmByIds(ids, BaseEntity.DEL_FLAG_DELETE);
     }
 
+    @Override
+    public int countSysAlarmByDate() {
+        return mapper.countSysAlarmByDate();
+    }
+
 }

+ 40 - 2
aidex-system/src/main/java/com/aidex/system/service/impl/SysReservationConfigServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.IdUtil;
+import com.aidex.common.core.domain.R;
 import com.aidex.framework.cache.ConfigUtils;
 import com.aidex.system.domain.SysConfig;
 import com.aidex.system.domain.SysWharf;
@@ -166,7 +167,7 @@ public class SysReservationConfigServiceImpl extends BaseServiceImpl<SysReservat
                         endTime = DateUtil.offset(endTime, DateField.MINUTE, sysReservationConfigReq.getDuration());
                         dateTime  = DateUtil.offset(dateTime, DateField.MINUTE, sysReservationConfigReq.getDuration());
                     }
-                    if (endTime.getTime() > end.getTime()){
+                    if (last.getTime() > end.getTime()){
                         SysReservationConfig lastConfig = new SysReservationConfig();
                         lastConfig.setReservationDate(date);
                         lastConfig.setReservationStartTime(last);
@@ -205,7 +206,7 @@ public class SysReservationConfigServiceImpl extends BaseServiceImpl<SysReservat
                     endTime = DateUtil.offset(endTime, DateField.MINUTE, sysReservationConfigReq.getDuration());
                     dateTime  = DateUtil.offset(dateTime, DateField.MINUTE, sysReservationConfigReq.getDuration());
                 }
-                if (endTime.getTime() > end.getTime()){
+                if (last.getTime() > end.getTime()){
                     SysReservationConfig lastConfig = new SysReservationConfig();
                     lastConfig.setReservationDate(date);
                     lastConfig.setReservationStartTime(last);
@@ -251,4 +252,41 @@ public class SysReservationConfigServiceImpl extends BaseServiceImpl<SysReservat
         return sysReservationDataMapper.getDurationByDate(date);
     }
 
+    @Transactional(readOnly = false)
+    @Override
+    public R removeByDate(String date) {
+        SysReservationConfig config = new SysReservationConfig();
+        // 查询该日期已发布的配置
+        config.setStatus("1");
+        config.setReservationDate(DateUtil.parseDate(date).toJdkDate());
+        List<SysReservationConfig> list = mapper.findList(config);
+        if (list.size() > 0) {
+            return R.success("该日期存在已发布的配置信息,请修改后重试!");
+        }
+        SysReservationConfig configs = new SysReservationConfig();
+        configs.setReservationDate(DateUtil.parseDate(date).toJdkDate());
+        List<SysReservationConfig> lists = mapper.findList(configs);
+        if (lists.size() == 0) {
+            return R.success("该日期配置信息不存在!");
+        }
+        int i = mapper.deleteSysReservationConfigByDate(date);
+        return R.success(i>0?"删除成功!":"配置信息不存在!");
+    }
+
+    @Transactional(readOnly = false)
+    @Override
+    public R editByReservationDate(SysReservationConfig sysReservationConfig) {
+        if ("1".equals(sysReservationConfig.getStatus())){
+            //修改为发布状态
+            return R.status(mapper.updateStatusByDate(sysReservationConfig));
+        } else {
+            //修改为未发布状态
+            int numByDate = sysReservationDataMapper.getNumByDate(DateUtil.formatDate(sysReservationConfig.getReservationDate()));
+            if (numByDate > 0){
+                return R.success("该日期已预约,不可修改为【未发布】!");
+            }
+            return R.status(mapper.updateStatusByDate(sysReservationConfig));
+        }
+    }
+
 }

+ 78 - 10
aidex-system/src/main/java/com/aidex/system/service/impl/SysShipServiceImpl.java

@@ -1,25 +1,36 @@
 package com.aidex.system.service.impl;
 
-import java.util.List;
-
+import cn.hutool.core.date.DateField;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.http.HttpRequest;
+import com.aidex.common.core.domain.BaseEntity;
+import com.aidex.common.core.service.BaseServiceImpl;
 import com.aidex.common.plush.domain.SysShipExtend;
 import com.aidex.common.plush.service.SysShipExtendService;
+import com.aidex.common.utils.SecurityUtils;
 import com.aidex.common.utils.StringUtils;
+import com.aidex.system.domain.SysShip;
+import com.aidex.system.domain.SysShipCamera;
 import com.aidex.system.domain.vo.ShipVo;
+import com.aidex.system.mapper.SysShipMapper;
+import com.aidex.system.service.SysShipService;
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.github.pagehelper.PageInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import com.github.pagehelper.PageInfo;
-import com.aidex.common.core.domain.BaseEntity;
-import com.aidex.common.core.service.BaseServiceImpl;
-import com.aidex.system.mapper.SysShipMapper;
-import com.aidex.system.domain.SysShip;
-import com.aidex.system.service.SysShipService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * 船只管理Service业务层处理
  * @author ChenSir
@@ -35,6 +46,7 @@ public class SysShipServiceImpl extends BaseServiceImpl<SysShipMapper, SysShip>
     @Autowired
     private SysShipExtendService sysShipExtendService;
 
+
     /**
      * 获取单条数据
      * @param sysShip 船只管理
@@ -157,4 +169,60 @@ public class SysShipServiceImpl extends BaseServiceImpl<SysShipMapper, SysShip>
         return mapper.updateStatusByMacId(macId,status);
     }
 
+	@Override
+	public int countSysShipByStatus() {
+		return mapper.countSysShipByStatus();
+	}
+    @Transactional(readOnly = false)
+    @Override
+    public int bindCamera(SysShipCamera sysShipCamera) {
+        List<SysShipCamera> shipCameraList = getShipCameraList(sysShipCamera.getShipId());
+        if (shipCameraList.size() >= 2) {
+            return 0;
+        }
+        return mapper.bindCamera(sysShipCamera);
+    }
+    @Transactional(readOnly = false)
+    @Override
+    public int unbindCamera(SysShipCamera sysShipCamera) {
+        return mapper.unbindCamera(sysShipCamera);
+    }
+
+    @Override
+    public List<SysShipCamera> getShipCameraList(String shipId) {
+        return mapper.getShipCameraList(shipId);
+    }
+
+    @Override
+    public String getShipSurplusSeat(String shipId, int duration) {
+        // 获取船只关联的摄像头
+        List<SysShipCamera> shipCameraList = getShipCameraList(shipId);
+        if (shipCameraList.size() > 0){
+            String redisKey = IdUtil.fastSimpleUUID();
+            DateTime offset = DateUtil.offset(new Date(), DateField.SECOND, duration);
+            String corn = DateUtil.format(offset, "ss mm HH dd MM ? yyyy");
+            log.info("生成corn 表达式为---{}", corn);
+            // 构造带参定时任务
+            Map<String, String> params = new HashMap<>();
+            params.put("jobName", "定时获取船只剩余座位");
+            params.put("jobGroup", "DEFAULT");
+            params.put("invokeTarget", "cameraTask.getShipSurplusSeat('"+shipId+"','"+DateUtil.now()+"','"+redisKey+"')");
+            params.put("cronExpression",corn);
+            params.put("misfirePolicy","2");
+            params.put("concurrent","0");
+            params.put("status","0");
+            //链式构建请求
+            String result = HttpRequest.post("http://127.0.0.1:18080/monitor/job")
+                    .header("Authorization", "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjRiZjE4ZDQwLWQ1ZjEtNDk1Ny1hNjA0LTQwZDM2YzIxMWVlMiJ9.zxyPe8oKTYah13AfqzeJebXENGAzJdhd0BJPddSuqVkjk8pRB1Bxf6dSJfEUI9kgjRg9yfSrsjyq439cJBSSBg")
+                    .body(JSON.toJSONString(params))//表单内容
+                    .timeout(10000)//超时,毫秒
+                    .execute().body();
+            JSONObject resultJson = JSONObject.parseObject(result);
+            if (resultJson.containsKey("code") && resultJson.get("code").equals(200)){
+                return redisKey;
+            }
+		}
+        return null;
+    }
+
 }

+ 2 - 0
aidex-ui/package.json

@@ -11,6 +11,8 @@
     "lint:nofix": "vue-cli-service lint --no-fix"
   },
   "dependencies": {
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^1.0.2",
     "ant-design-vue": "1.7.2",
     "axios": "1.6.8",
     "core-js": "^3.1.2",

+ 8 - 0
aidex-ui/src/api/menu.js

@@ -7,3 +7,11 @@ export const getRouters = () => {
     method: 'get'
   })
 }
+
+// 首页统计数据获取
+export function indexStatistics () {
+  return request({
+    url: '/index/statistics',
+    method: 'get'
+  })
+}

+ 18 - 0
aidex-ui/src/api/system/sysReservationConfig.js

@@ -83,3 +83,21 @@ export function statiscColumns (query) {
     params: query
   })
 }
+
+// 删除预约配置
+export function delSysReservationConfigByDate (query) {
+  return request({
+    url: '/system/sysReservationConfig/removeByDate',
+    method: 'delete',
+    params: query
+  })
+}
+
+// 删除预约配置
+export function editByReservationDate (data) {
+  return request({
+    url: '/system/sysReservationConfig/editByReservationDate',
+    method: 'put',
+    data: data
+  })
+}

+ 26 - 0
aidex-ui/src/api/system/sysShip.js

@@ -68,3 +68,29 @@ export function getInitData (dictTypes) {
     method: 'get'
   })
 }
+
+// 船只绑定摄像头
+export function bindCamera (data) {
+  return request({
+    url: '/system/sysShip/bindCamera',
+    method: 'post',
+    data: data
+  })
+}
+
+// 船只解绑摄像头
+export function unbindCamera (data) {
+  return request({
+    url: '/system/sysShip/unbindCamera',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询船只绑定详情
+export function getShipCameraList (shipId) {
+  return request({
+    url: '/system/sysShip/getShipCameraList/' + shipId,
+    method: 'get'
+  })
+}

+ 22 - 6
aidex-ui/src/views/dashboard/portal/About.vue

@@ -3,13 +3,13 @@
     <a-row class="columns-list-ul" :gutter="24">
       <a-col :span="5">
         <a-card :bordered="false">
-          <div class="text-number">8</div>
+          <div class="text-number">{{ statisticsData.onlineShip }}</div>
           <div class="title-text">在线船只数量</div>
         </a-card>
       </a-col>
       <a-col :span="5">
         <a-card :bordered="false">
-          <div class="text-number">100</div>
+          <div class="text-number">{{ statisticsData.todayAlarmNum }}</div>
           <div class="title-text">
             当前报警数量
           </div>
@@ -17,7 +17,7 @@
       </a-col>
       <a-col :span="5">
         <a-card :bordered="false">
-          <div class="text-number">23</div>
+          <div class="text-number">{{ statisticsData.uv_active_num }}</div>
           <div class="title-text">
             用户活跃量
             <!-- 比昨日 <em class="drop">- 0.05%</em> -->
@@ -26,10 +26,10 @@
       </a-col>
       <a-col :span="5">
         <a-card :bordered="false">
-          <div class="text-number">100</div>
+          <div class="text-number">{{ statisticsData.uv_all_num }}</div>
           <div class="title-text">
             累计用户数
-            比昨日 <em class="rise">+ 1.25%</em>
+            比昨日 <em class="rise"> +{{ statisticsData.uv_new_num }}</em>
           </div>
         </a-card>
       </a-col>
@@ -47,13 +47,24 @@
 </template>
 
 <script>
+  import { indexStatistics } from '@/api/menu'
+
   export default {
     data () {
-      return {}
+      return {
+        statisticsData: {
+          onlineShip: 0,
+          todayAlarmNum: 0,
+          uv_new_num: 0,
+          uv_active_num: 0,
+          uv_all_num: 0
+        }
+      }
     },
     computed: {
     },
     created () {
+      this.statistics()
     },
     methods: {
       goTarget (url) {
@@ -64,6 +75,11 @@
           '案例正在研发中,目前尚未实现,敬请期待!',
           3
          )
+      },
+      statistics() {
+        indexStatistics().then(response => {
+            this.statisticsData = response.data
+        })
       }
     }
   }

+ 6 - 2
aidex-ui/src/views/system/notice/NoticeIndex.vue

@@ -201,6 +201,12 @@ export default {
           width: '8%'
         },
         {
+          title: '作者',
+          dataIndex: 'author',
+          ellipsis: true,
+          width: '8%'
+        },
+        {
           title: '创建时间',
           dataIndex: 'createTime',
           scopedSlots: { customRender: 'createTime' }
@@ -260,8 +266,6 @@ export default {
       )
     },
     toppingFormat (row) {
-      console.log('row.topping')
-      console.log(row.topping)
       return this.selectDictLabel(this.yesOrNoOptions, row.topping)
     },
     carouselFormat (row) {

+ 23 - 1
aidex-ui/src/views/system/notice/modules/NoticeAddForm.vue

@@ -42,6 +42,16 @@
           </a-form-model-item>
         </a-col>
 
+        <a-col :lg="12" :md="12" :sm="24">
+          <a-form-model-item label="作者" prop="author">
+            <a-input v-model="form.author" placeholder="请输入作者" />
+          </a-form-model-item>
+        </a-col>
+        <a-col :lg="24" :md="24" :sm="24">
+          <a-form-model-item label="摘要" prop="excerpt">
+            <a-textarea allow-clear :rows="4" v-model="form.excerpt" placeholder="请输入摘要" />
+          </a-form-model-item>
+        </a-col>
         <a-col :lg="24" :md="24" :sm="24">
           <label>轮播图</label>
           <div style="margin-top: 10px; margin-bottom: 10px;">
@@ -62,7 +72,19 @@
           </div>
 
           <a-form-model-item label="内容" prop="noticeContent" class="addModel">
-            <div id="vditor" name="description"></div>
+            <Toolbar
+              style="border-bottom: 1px solid #ccc"
+              :editor="editor"
+              :defaultConfig="toolbarConfig"
+              :mode="mode"
+            />
+            <Editor
+              style="height: 500px; overflow-y: hidden;"
+              v-model="form.noticeContentHtml"
+              :defaultConfig="editorConfig"
+              :mode="mode"
+              @onCreated="onCreated"
+            />
           </a-form-model-item>
         </a-col>
 

+ 21 - 1
aidex-ui/src/views/system/notice/modules/NoticeEditForm.vue

@@ -32,6 +32,12 @@
           <a-radio-button v-for="(d, index) in yesOrNoOptions" :key="index" :value="d.dictValue" >{{ d.dictLabel }}</a-radio-button>
         </a-radio-group>
       </a-form-model-item>
+      <a-form-model-item label="作者" prop="author">
+        <a-input v-model="form.author" placeholder="请输入作者" />
+      </a-form-model-item>
+      <a-form-model-item label="摘要" prop="excerpt">
+        <a-textarea allow-clear :rows="4" v-model="form.excerpt" placeholder="请输入摘要" />
+      </a-form-model-item>
       <a-form-model-item label="轮播图" prop="carousel">
         <div style="margin-top: 10px; margin-bottom: 10px;">
           <a-upload
@@ -51,7 +57,21 @@
         </div>
       </a-form-model-item>
       <a-form-model-item label="内容" prop="noticeContent" class="addModel">
-        <div id="vditorEdit" name="description" ></div>
+        <Toolbar
+          style="border-bottom: 1px solid #ccc"
+          :editor="editor"
+          :defaultConfig="toolbarConfig"
+          :mode="mode"
+        />
+        <Editor
+          style="height: 500px; overflow-y: hidden;"
+          v-model="form.noticeContentHtml"
+          :defaultConfig="editorConfig"
+          :mode="mode"
+          @onCreated="onCreated"
+          @onChange="onChange"
+          @onDestroyed="onDestroyed"
+        />
       </a-form-model-item>
       <div class="bottom-control" style="z-index: 9999;">
         <a-space>

+ 47 - 86
aidex-ui/src/views/system/notice/modules/NoticeForm.js

@@ -1,9 +1,11 @@
 import AntModal from '@/components/pt/dialog/AntModal'
 import { getNotice, saveNotice, getNoticeView } from '@/api/system/notice'
-import Vditor from 'vditor'
-import 'vditor/dist/index.css'
 import storage from 'store'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
+// 引入wangEditor
+import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
+import '@wangeditor/editor/dist/css/style.css'
+
 export default {
   name: 'CreateForm',
   props: {
@@ -22,7 +24,8 @@ export default {
   },
   components: {
     AntModal,
-    Vditor
+    Editor,
+    Toolbar
   },
   data () {
     return {
@@ -60,47 +63,27 @@ export default {
       upload_action: process.env.VUE_APP_BASE_API + '/common/upload',
       // 设置上传的请求头部
       headers: { Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN) },
-      vditorToolbar: [// 将上传图片和录音按钮隐藏
-                  'emoji',
-                  'headings',
-                  'bold',
-                  'italic',
-                  'strike',
-                  'link',
-                  '|',
-                  'list',
-                  'ordered-list',
-                  'check',
-                  'outdent',
-                  'indent',
-                  '|',
-                  'quote',
-                  'line',
-                  'code',
-                  'inline-code',
-                  'insert-before',
-                  'insert-after',
-                  '|',
-                  'table',
-                  '|',
-                  'undo',
-                  'redo',
-                  '|',
-                  'fullscreen',
-                  'edit-mode',
-                  {
-                    'name': 'more',
-                    'toolbar': [
-                      'both',
-                      'code-theme',
-                      'content-theme',
-                      'export',
-                      'outline',
-                      'preview',
-                      'devtools'
-                    ]
-                  }
-                ]
+      editor: null,
+      editorConfig: {
+        placeholder: '请输入内容...',
+        MENU_CONF: {
+          uploadImage: {
+            fieldName: 'file',
+            server: process.env.VUE_APP_BASE_API + '/common/upload',
+            headers: {
+              Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
+            },
+            // 单个文件的最大体积限制,默认为 2M
+            maxFileSize: 500 * 1024 * 1024, // 500M
+            customInsert(res, insertFn) {
+              // 从 res 中找到 url alt href ,然后插入图片
+              insertFn(res.url, res.fileName, res.url)
+            }
+          }
+        }
+      },
+      mode: 'default', // or 'simple'
+      toolbarConfig: { }
     }
   },
   filters: {
@@ -112,12 +95,25 @@ export default {
   watch: {
   },
   mounted () {
+
   },
   methods: {
+    onCreated(editor) {
+      this.editor = Object.seal(editor) // 一定要用 Object.seal() ,否则会报错
+    },
+    onChange(editor) {
+      console.log('onChange', editor.children)
+    },
+    onDestroyed(editor) {
+      console.log('onDestroyed', editor)
+    },
     // 取消按钮
     cancel () {
       this.open = false
       this.reset()
+      const editor = this.editor
+      if (editor == null) return
+      editor.destroy()
       this.$emit('close')
     },
     // 表单重置
@@ -130,7 +126,9 @@ export default {
         status: '0',
         topping: '0',
         carousel: '0',
-        carouselImgUrl: ''
+        carouselImgUrl: '',
+        author: '',
+        excerpt: ''
       }
        if (this.formId) {
          // 清空附件的formId
@@ -141,61 +139,25 @@ export default {
       this.reset()
       this.open = true
       this.formTitle = '信息发布'
-      this.$nextTick(() => {
-        if (this.contentEditorEdit === '') {
-          this.contentEditorEdit = new Vditor('vditor', {
-            height: 180,
-            toolbarConfig: {
-              pin: true
-            },
-            toolbar: this.vditorToolbar,
-            cache: {
-              enable: false
-            },
-            after: () => {
-              this.contentEditorEdit.setValue(this.form.noticeContent)
-            }
-          })
-        } else {
-          this.contentEditorEdit.setValue(this.form.noticeContent)
-        }
-      })
     },
     /** 修改按钮操作 */
     handleUpdate (row) {
       this.reset()
       const noticeId = row.id
+      this.fileList = []
       getNotice(noticeId).then(response => {
-        this.open = true
         this.form = response.data
         this.formId = response.data.id
         this.formTitle = '修改信息'
         if (this.form.carouselImgUrl) {
           this.fileList.push({
             uid: new Date().getTime(),
+            name: this.form.carouselImgUrl,
             status: 'done',
             url: this.form.carouselImgUrl
           })
         }
-        this.$nextTick(() => {
-          if (this.contentEditorEdit === '') {
-              this.contentEditorEdit = new Vditor('vditorEdit', {
-                height: 360,
-                toolbarConfig: {
-                  pin: true
-                },
-                toolbar: this.vditorToolbar,
-                cache: {
-                  enable: false
-                },
-                after: () => {
-                  this.contentEditorEdit.setValue(response.data.noticeContent)
-                }
-              })
-          } else {
-            this.contentEditorEdit.setValue(response.data.noticeContent)
-          }
-        })
+        this.open = true
       })
     },
     handleView (row) {
@@ -216,8 +178,7 @@ export default {
     /** 提交按钮 */
     submitForm: function () {
       const that = this
-      this.form.noticeContent = this.contentEditorEdit.getValue()
-      this.form.noticeContentHtml = this.contentEditorEdit.getHTML()
+      this.form.noticeContent = this.form.noticeContentHtml
       this.$refs.form.validate(valid => {
         if (valid) {
           this.uploaderButtonStatus = true

+ 68 - 18
aidex-ui/src/views/system/sysreservationconfig/index.vue

@@ -8,7 +8,7 @@
             <a-col :span="6" >
               <a-form-item label="预约日期">
                 <a-date-picker
-                  v-model="queryParam.beginReservationDate"
+                  v-model="queryParam.reservationDate"
                   valueFormat="YYYY-MM-DD"
                   :show-today="true"
                   placeholder="选择日期"
@@ -83,17 +83,17 @@
           <a-button type="primary" @click="handleBatchAdd" v-hasPermi="['system:sysReservationConfig:add']">
             <a-icon type="plus" />预约配置
           </a-button>
-          <a-button type="primary" @click="handleAdd" v-hasPermi="['system:sysReservationConfig:add']">
-            <a-icon type="plus" />新增
+          <a-button type="primary" @click="handleUpdateStatus" v-hasPermi="['system:sysReservationConfig:add']">
+            <a-icon type="edit" />按日期修改状态
           </a-button>
-          <a-button type="danger" v-if="!multiple" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:sysReservationConfig:remove']">
-            <a-icon type="delete" />删除
+          <a-button type="danger" @click="handleDelete" v-hasPermi="['system:sysReservationConfig:remove']">
+            <a-icon type="delete" />按日期删除
           </a-button>
           <a-button type="" @click="handleExport" v-hasPermi="['system:sysReservationConfig:export']">
             <a-icon type="download" />导出
           </a-button>
         </div>
-<!--        <span slot="statusRender" slot-scope="{record}">
+        <!--        <span slot="statusRender" slot-scope="{record}">
           <a-badge :status="record.status === '0' ? 'processing' : 'error'" :text=" statusFormat(record) " />
         </span>-->
         <span slot="statusRender" slot-scope="{record}">
@@ -118,7 +118,7 @@
   </div>
 </template>
 <script>
-import { listSysReservationConfig, delSysReservationConfig, exportSysReservationConfig, getInitData } from '@/api/system/sysReservationConfig'
+import { listSysReservationConfig, exportSysReservationConfig, getInitData, delSysReservationConfigByDate, editByReservationDate } from '@/api/system/sysReservationConfig'
 import AdvanceTable from '@/components/pt/table/AdvanceTable'
 import SysReservationConfigAddForm from '@/views/system/sysreservationconfig/modules/SysReservationConfigAddForm'
 import SysReservationConfigEditForm from '@/views/system/sysreservationconfig/modules/SysReservationConfigEditForm'
@@ -171,32 +171,38 @@ export default {
           title: '预约日期',
           dataIndex: 'reservationDate',
           align: 'center',
-          width: '18%'
+          width: '15%'
         },
         {
           title: '预约开始时段',
           dataIndex: 'reservationStartTime',
           align: 'center',
-          width: '18%'
+          width: '15%'
         },
         {
           title: '预约结束时段',
           dataIndex: 'reservationEndTime',
           align: 'center',
-          width: '18%'
+          width: '15%'
         },
         {
           title: '可预约人数',
           dataIndex: 'enableNum',
           align: 'center',
-          width: '18%'
+          width: '15%'
+        },
+        {
+          title: '已预约人数',
+          dataIndex: 'reservationNum',
+          align: 'center',
+          width: '15%'
         },
         {
           title: '配置状态',
           dataIndex: 'status',
           scopedSlots: { customRender: 'statusRender' },
           align: 'center',
-          width: '18%'
+          width: '15%'
         },
         {
           title: '操作',
@@ -205,7 +211,8 @@ export default {
           width: '10%',
           scopedSlots: { customRender: 'operation' }
         }
-      ]
+      ],
+      updateStatus: '0'
     }
   },
   created () {
@@ -291,16 +298,23 @@ export default {
     /** 删除按钮操作 */
     handleDelete (row) {
       var that = this
-      const sysReservationConfigIds = row.id || this.ids
+      if (!this.queryParam.reservationDate) {
+        that.$message.error(
+          '请选择预约日期',
+          3
+        )
+        return
+      }
       this.$confirm({
-        title: '确认删除所选中数据?',
+        title: '确认删除【' + this.queryParam.reservationDate + '】的数据?',
         onOk () {
-          return delSysReservationConfig(sysReservationConfigIds)
-            .then(() => {
+          return delSysReservationConfigByDate({ date: that.queryParam.reservationDate })
+            .then((res) => {
+              that.queryParam.reservationDate = ''
               that.onSelectChange([], [])
               that.getList()
               that.$message.success(
-                '删除成功',
+                res.msg,
                 3
               )
           })
@@ -308,6 +322,42 @@ export default {
         onCancel () {}
       })
     },
+    handleUpdateStatus () {
+      var that = this
+      if (!this.queryParam.reservationDate) {
+        that.$message.error(
+          '请选择预约日期',
+          3
+        )
+        return
+      }
+      this.$confirm({
+        title: '确认修改【' + this.queryParam.reservationDate + '】的数据状态?',
+        content: h => (
+          <div style="display:flex;align-items:center;padding-top:18px;">
+            <label style="flex:none;padding-right:16px">请选择状态:</label>
+            <a-radio-group v-model={that.updateStatus}>
+              <a-radio value="0">未发布</a-radio>
+              <a-radio value="1">已发布</a-radio>
+            </a-radio-group>
+          </div>
+        ),
+        onOk() {
+          const param = { reservationDate: that.queryParam.reservationDate, status: that.updateStatus }
+          return editByReservationDate(param)
+            .then((res) => {
+              that.queryParam.reservationDate = ''
+              that.onSelectChange([], [])
+              that.getList()
+              that.$message.success(
+                res.msg,
+                3
+              )
+            })
+        },
+        onCancel () {}
+      })
+    },
     /** 导出按钮操作 */
     handleExport () {
       var that = this

+ 51 - 16
aidex-ui/src/views/system/sysship/index.vue

@@ -56,6 +56,10 @@
         @ok="getList"
         @close="showEditModal = false"
       />
+      <sys-ship-camera v-if="showCameraModal" ref="sysShipCamera" :shipId="cameraShipId" @close="showCameraModal = false"/>
+
+      <sys-ship-camera-live v-if="showCameraLiveModal" ref="sysShipCameraLive" :shipId="cameraShipId" @close="showCameraLiveModal = false"/>
+
       <advance-table
         title="船只管理"
         :pagination="{
@@ -102,6 +106,14 @@
           <a @click="handleDelete(record)" v-hasPermi="['system:sysShip:remove']">
             删除
           </a>
+          <a-divider type="vertical"/>
+          <a @click="handleBindCamera(record)">
+            摄像头绑定
+          </a>
+          <a-divider type="vertical"/>
+          <a @click="handleCamera(record)">
+            视频查看
+          </a>
         </span>
       </advance-table>
     </a-card>
@@ -112,18 +124,25 @@ import { listSysShip, delSysShip, exportSysShip, getInitData } from '@/api/syste
 import AdvanceTable from '@/components/pt/table/AdvanceTable'
 import SysShipAddForm from '@/views/system/sysship/modules/SysShipAddForm'
 import SysShipEditForm from '@/views/system/sysship/modules/SysShipEditForm'
+import SysShipCamera from '@/views/system/sysship/modules/SysShipCamera.vue'
+import SysShipCameraLive from '@/views/system/sysship/modules/SysShipCameraLive.vue'
+
 export default {
   name: 'SysShip',
   components: {
     AdvanceTable,
     SysShipAddForm,
-    SysShipEditForm
-
+    SysShipEditForm,
+    SysShipCamera,
+    SysShipCameraLive
   },
   data () {
     return {
       showAddModal: false,
       showEditModal: false,
+      showCameraModal: false,
+      showCameraLiveModal: false,
+      cameraShipId: '',
       // 遮罩层
       loading: true,
       // 选中数组
@@ -163,54 +182,54 @@ export default {
           title: '船只编号',
           dataIndex: 'shipNum',
           ellipsis: true,
-          align: 'left',
-          width: '12.8%'
+          align: 'center',
+          width: '10%'
         },
         {
           title: '船只名称',
           dataIndex: 'shipNanme',
           ellipsis: true,
-          align: 'left',
-          width: '12.8%'
+          align: 'center',
+          width: '10%'
         },
         {
           title: '设备编号',
           dataIndex: 'gpsDeviceNum',
-          align: 'left',
-          width: '12.8%'
+          align: 'center',
+          width: '10%'
         },
         {
           title: '核载人数',
           dataIndex: 'nuclearLoadNum',
-          align: 'left',
-          width: '12.8%'
+          align: 'center',
+          width: '10%'
         },
         {
           title: '当前维度',
           dataIndex: 'lat',
           ellipsis: true,
-          align: 'left',
-          width: '12.8%'
+          align: 'center',
+          width: '10%'
         },
         {
           title: '当前维度',
           dataIndex: 'lng',
           ellipsis: true,
-          align: 'left',
-          width: '12.8%'
+          align: 'center',
+          width: '10%'
         },
         {
           title: '船只在线状态',
           dataIndex: 'status',
           scopedSlots: { customRender: 'status' },
           align: 'center',
-          width: '12.8%'
+          width: '10%'
         },
         {
           title: '操作',
           dataIndex: 'operation',
           align: 'center',
-          width: '10%',
+          width: '30%',
           scopedSlots: { customRender: 'operation' }
         }
       ]
@@ -347,6 +366,22 @@ export default {
         this.queryParam.isAsc = sorter.order
       }
       this.getList()
+    },
+    handleBindCamera (row) {
+      console.log(row)
+      this.cameraShipId = row.id
+      this.showCameraModal = true
+      this.$nextTick(() => (
+        this.$refs.sysShipCamera.openBind()
+      ))
+    },
+    handleCamera (row) {
+      console.log(row)
+      this.cameraShipId = row.id
+      this.showCameraLiveModal = true
+      this.$nextTick(() => (
+        this.$refs.sysShipCameraLive.open()
+      ))
     }
   }
 }