Browse Source

app我的页面

wyyay 2 years ago
parent
commit
e086a176a6

+ 2 - 2
.idea/compiler.xml

@@ -7,10 +7,10 @@
         <sourceOutputDir name="target/generated-sources/annotations" />
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
         <outputRelativeToContentRoot value="true" />
+        <module name="base-admin" />
+        <module name="hazard-admin" />
         <module name="hazard-sdk" />
         <module name="business-service" />
-        <module name="hazard-admin" />
-        <module name="base-admin" />
       </profile>
     </annotationProcessing>
     <bytecodeTargetLevel>

+ 15 - 15
.idea/jarRepositories.xml

@@ -2,8 +2,8 @@
 <project version="4">
   <component name="RemoteRepositoriesConfiguration">
     <remote-repository>
-      <option name="id" value="public" />
-      <option name="name" value="aliyun nexus" />
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
       <option name="url" value="https://maven.aliyun.com/repository/public" />
     </remote-repository>
     <remote-repository>
@@ -11,6 +11,16 @@
       <option name="name" value="Central Repository" />
       <option name="url" value="https://repo.maven.apache.org/maven2" />
     </remote-repository>
+    <remote-repository>
+      <option name="id" value="public" />
+      <option name="name" value="aliyun nexus" />
+      <option name="url" value="https://maven.aliyun.com/repository/public" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
     <remote-repository>
       <option name="id" value="central" />
       <option name="name" value="Central Repository" />
@@ -26,25 +36,15 @@
       <option name="name" value="Central Repository" />
       <option name="url" value="http://maven.aliyun.com/nexus/content/repositories/central/" />
     </remote-repository>
-    <remote-repository>
-      <option name="id" value="central" />
-      <option name="name" value="Maven Central repository" />
-      <option name="url" value="https://repo1.maven.org/maven2" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="jboss.community" />
-      <option name="name" value="JBoss Community repository" />
-      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
-    </remote-repository>
     <remote-repository>
       <option name="id" value="custom_group" />
       <option name="name" value="Nexus Repository" />
       <option name="url" value="http://124.71.171.71:18881/repository/custom_group/" />
     </remote-repository>
     <remote-repository>
-      <option name="id" value="central" />
-      <option name="name" value="Central Repository" />
-      <option name="url" value="https://maven.aliyun.com/repository/public" />
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
     </remote-repository>
   </component>
 </project>

+ 75 - 0
business-service/src/main/java/com/ozs/service/entity/MsgAppPush.java

@@ -0,0 +1,75 @@
+package com.ozs.service.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ozs.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+@ApiModel("app推送报警信息记录表")
+public class MsgAppPush extends BaseEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 报警唯一标识
+     */
+    private String alarmId;
+
+    /**
+     * 接收人
+     */
+    private Long recipient;
+
+    /**
+     * 状态:0未读;1已读
+     */
+    private Integer status;
+
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改人
+     */
+    private String updateBy;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 16 - 0
business-service/src/main/java/com/ozs/service/entity/vo/AlarmStatistic.java

@@ -0,0 +1,16 @@
+package com.ozs.service.entity.vo;
+
+import lombok.Data;
+
+/**统计管理页面强求参数
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+@Data
+public class AlarmStatistic {
+    /**
+     * 报警线路
+     */
+    private String alarmLine;
+}

+ 2 - 1
business-service/src/main/java/com/ozs/service/entity/vo/MsgAlarmVo.java

@@ -71,5 +71,6 @@ public class MsgAlarmVo extends PageVo implements Serializable {
      * 报警是否解除 1已解除2未解除
      */
     private Integer isLock;
-    
+
+
 }

+ 57 - 0
business-service/src/main/java/com/ozs/service/entity/vo/MsgAppPushVo.java

@@ -0,0 +1,57 @@
+package com.ozs.service.entity.vo;
+
+import com.ozs.common.vo.PageVo;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+@Data
+public class MsgAppPushVo extends PageVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 报警唯一标识
+     */
+    private String alarmId;
+
+    /**
+     * 接收人
+     */
+    private Long recipient;
+
+    /**
+     * 状态:0未读;1已读
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 修改人
+     */
+    private String updateBy;
+
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 15 - 0
business-service/src/main/java/com/ozs/service/mapper/MsgAppPushMapper.java

@@ -0,0 +1,15 @@
+package com.ozs.service.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ozs.service.entity.MsgAppPush;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+@Mapper
+public interface MsgAppPushMapper extends BaseMapper<MsgAppPush> {
+
+}

+ 28 - 0
business-service/src/main/java/com/ozs/service/params/UserLoginParams.java

@@ -0,0 +1,28 @@
+package com.ozs.service.params;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class UserLoginParams {
+
+    /**
+     * 用户名
+     */
+    @ApiModelProperty("用户名")
+    private String username;
+
+    /**
+     * 密码
+     */
+    @ApiModelProperty("密码")
+    private String password;
+
+    /**
+     * 验证码
+     */
+    @ApiModelProperty("验证码")
+    private String securityCode;
+}

+ 20 - 0
business-service/src/main/java/com/ozs/service/service/MsgAppPushService.java

@@ -0,0 +1,20 @@
+package com.ozs.service.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ozs.service.entity.MsgAppPush;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+public interface MsgAppPushService extends IService<MsgAppPush> {
+    /**
+     * 修改app推送报警信息记录为已读
+     * @param id
+     * @param
+     * @return
+     */
+    //MsgAppPush updateStatus(Long id);
+
+}

+ 17 - 0
business-service/src/main/java/com/ozs/service/service/impl/MsgAppPushServiceImpl.java

@@ -0,0 +1,17 @@
+package com.ozs.service.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ozs.service.entity.MsgAppPush;
+import com.ozs.service.mapper.MsgAppPushMapper;
+import com.ozs.service.service.MsgAppPushService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+@Service
+public class MsgAppPushServiceImpl extends ServiceImpl<MsgAppPushMapper, MsgAppPush> implements MsgAppPushService {
+
+}

+ 16 - 11
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -5,28 +5,20 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ozs.HazardApplication;
 import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.service.entity.MsgAlarm;
 import com.ozs.service.entity.MsgAlarmFrequency;
-import com.ozs.service.entity.vo.HistoricalAlarmVo;
 import com.ozs.service.entity.vo.MsgAlarmVo;
 import com.ozs.service.service.MsgAlarmFrequencyService;
 import com.ozs.service.service.MsgAlarmService;
 import com.ozs.web.core.config.WebSocketService;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.BeanUtils;
-import org.springframework.boot.SpringApplication;
 import org.springframework.util.ObjectUtils;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
@@ -147,5 +139,18 @@ public class MsgAlarmController extends BaseController {
         List<MsgAlarm> list = msgAlarmService.list(wrapper);
         return AjaxResult.success(list);
     }
+
+
+//    @RequestMapping(value = "alarmStatistic", method = RequestMethod.POST)
+//    @ApiOperation("报警信息数据统计")
+//    @ApiImplicitParams(value = {
+//            @ApiImplicitParam(paramType = "query", name = "", value = "分析年份"),
+//            @ApiImplicitParam(paramType = "query", name = "current", value = "当前页数"),
+//    })
+//    public AjaxResult alarmStatistic() {
+//        QueryWrapper<MsgAlarm> wrapper = new QueryWrapper<>();
+//
+//
+//    }
 }
 

+ 136 - 0
hazard-admin/src/main/java/com/ozs/web/controller/app/GeoHazardMineController.java

@@ -0,0 +1,136 @@
+package com.ozs.web.controller.app;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ozs.common.core.controller.BaseController;
+import com.ozs.common.core.domain.AjaxResult;
+
+import com.ozs.service.entity.MsgAppPush;
+import com.ozs.service.entity.vo.MsgAppPushVo;
+import com.ozs.service.service.MsgAppPushService;
+import com.ozs.system.service.ISysUserService;
+import com.ozs.web.controller.tool.ImgUtil;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.UUID;
+
+/**
+ * @author wyy
+ * @subject
+ * @creat 2023/3/6
+ */
+@RestController
+@RequestMapping("/app/mine")
+@Slf4j
+public class GeoHazardMineController extends BaseController {
+    @Value("${file.avatarUrl:#{null}}")
+    private String avatarURL;
+    @Value("${file.filreUrl:#{null}}")
+    private String fileUrl;
+    @Autowired
+    private ISysUserService sysUserService;
+    @Autowired
+    private MsgAppPushService msgAppPushService;
+
+    /**
+     * 修改头像
+     */
+    @PostMapping("/updateAvatar")
+    @ApiOperation("app修改头像")
+    public AjaxResult updateAvatar(MultipartFile image, Long userId) {
+
+        String imageUrl = null;
+        try {
+            if (image != null) {
+                //获取文件名
+                String fileName = image.getOriginalFilename();
+                if (org.springframework.util.StringUtils.isEmpty(fileName) || image.getSize() == 0) {
+                    throw new Exception("图像文件不能为空!");
+                }
+                //验证文件名是否合格
+                if (!ImgUtil.isImg(fileName)) {
+                    throw new Exception("图像文件必须是图片格式!");
+                }
+                String saveFileName = UUID.randomUUID().toString();
+                File saveDirFile = new File(avatarURL);
+                if (!saveDirFile.exists()) {
+                    saveDirFile.mkdirs();
+                }
+                File picFullFile = new File(saveDirFile.getAbsolutePath(), saveFileName);
+                FileOutputStream fos = new FileOutputStream(picFullFile);
+                fos.write(image.getBytes());
+                imageUrl = fileUrl + avatarURL + saveFileName;
+                sysUserService.updateUserAvatarById(userId, imageUrl);
+            } else {
+                throw new Exception("上传文件不能为空");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return AjaxResult.success(imageUrl);
+    }
+
+    /**
+     * 修改密码
+     */
+    @RequestMapping(value = "/updateAvatar", method = RequestMethod.POST)
+    @ApiOperation("app修改密码")
+    public AjaxResult updateAvatar(@RequestParam("userId") Long userId,@RequestParam("newPwd") String newPwd) {
+        sysUserService.updatePassword(userId,newPwd);
+        return AjaxResult.success();
+    }
+
+    /**
+     * app推送报警信息记录分页显示(全部信息)
+     */
+    @RequestMapping(value = "allList", method = RequestMethod.POST)
+    @ApiOperation("app推送报警信息记录分页显示(全部信息)")
+    public AjaxResult allList(@RequestBody MsgAppPushVo msgAppPushVo) {
+        QueryWrapper<MsgAppPush> queryWrapper = new QueryWrapper<MsgAppPush>();
+        IPage<MsgAppPush> page = msgAppPushService.page(new Page<>(msgAppPushVo.getPageNum(), msgAppPushVo.getPageSize()), queryWrapper);
+        return AjaxResult.success(page);
+    }
+    /**
+     * app推送报警信息记录分页显示(未读信息)
+     */
+    @RequestMapping(value = "unReadList", method = RequestMethod.POST)
+    @ApiOperation("app推送报警信息记录分页显示(未读信息)")
+    public AjaxResult unReadList(@RequestBody MsgAppPushVo msgAppPushVo) {
+        LambdaQueryWrapper<MsgAppPush> queryWrapper = new LambdaQueryWrapper<MsgAppPush>();
+        if (!ObjectUtils.isEmpty(msgAppPushVo.getStatus())) {
+            queryWrapper.eq(MsgAppPush::getStatus, 0);
+        }
+        IPage<MsgAppPush> page = msgAppPushService.page(new Page<>(msgAppPushVo.getPageNum(), msgAppPushVo.getPageSize()), queryWrapper);
+        return AjaxResult.success(page);
+    }
+    /**
+     * app推送报警信息记录分页显示(已读信息)
+     */
+    @RequestMapping(value = "readList", method = RequestMethod.POST)
+    @ApiOperation("app推送报警信息记录分页显示(已读信息)")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(paramType = "query", name = "caseMonth", value = "分析年份"),
+            @ApiImplicitParam(paramType = "query", name = "current", value = "当前页数"),
+    })
+    public AjaxResult readList(@RequestBody MsgAppPushVo msgAppPushVo) {
+        LambdaQueryWrapper<MsgAppPush> queryWrapper = new LambdaQueryWrapper<MsgAppPush>();
+        if (!ObjectUtils.isEmpty(msgAppPushVo.getStatus())) {
+            queryWrapper.eq(MsgAppPush::getStatus, 1);
+        }
+        IPage<MsgAppPush> page = msgAppPushService.page(new Page<>(msgAppPushVo.getPageNum(), msgAppPushVo.getPageSize()), queryWrapper);
+        return AjaxResult.success(page);
+    }
+}
+

+ 2 - 4
hazard-admin/src/main/java/com/ozs/web/controller/system/SysLoginController.java

@@ -3,10 +3,7 @@ package com.ozs.web.controller.system;
 import java.util.List;
 import java.util.Set;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ozs.common.constant.Constants;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.entity.SysMenu;
@@ -23,6 +20,7 @@ import com.ozs.system.service.ISysMenuService;
  * @author ruoyi
  */
 @RestController
+@RequestMapping("/app")
 public class SysLoginController
 {
     @Autowired

+ 5 - 0
hazard-admin/src/main/resources/application.yml

@@ -151,3 +151,8 @@ minio:
   bucketName: picbucket #存储桶名称
   accessKey: admin #访问的key
   secretKey: admin123 #访问的秘钥
+file:
+  #头像存储目录
+  avatarUrl: /data/service/avatar/
+  #文件访问前缀
+  filreUrl: http://124.71.171.71:18878