Browse Source

第一版版自测

lyhzzz 2 years ago
parent
commit
4661c67a56
100 changed files with 5389 additions and 370 deletions
  1. 25 8
      pom.xml
  2. 16 0
      src/main/java/com/fdkankan/manage_jp/common/Constant.java
  3. 21 0
      src/main/java/com/fdkankan/manage_jp/common/DownloadStatusEnum.java
  4. 108 0
      src/main/java/com/fdkankan/manage_jp/common/Result.java
  5. 13 53
      src/main/java/com/fdkankan/manage_jp/common/ResultCode.java
  6. 0 72
      src/main/java/com/fdkankan/manage_jp/common/ResultData.java
  7. 0 133
      src/main/java/com/fdkankan/manage_jp/config/SaTokenConfigure.java
  8. 0 50
      src/main/java/com/fdkankan/manage_jp/config/StpInterfaceImpl.java
  9. 34 0
      src/main/java/com/fdkankan/manage_jp/config/WebAppConfig.java
  10. 86 0
      src/main/java/com/fdkankan/manage_jp/controller/BaseController.java
  11. 59 0
      src/main/java/com/fdkankan/manage_jp/controller/CameraController.java
  12. 204 3
      src/main/java/com/fdkankan/manage_jp/controller/CompanyController.java
  13. 21 0
      src/main/java/com/fdkankan/manage_jp/controller/RoleController.java
  14. 99 0
      src/main/java/com/fdkankan/manage_jp/controller/SceneProController.java
  15. 42 6
      src/main/java/com/fdkankan/manage_jp/controller/UserController.java
  16. 87 0
      src/main/java/com/fdkankan/manage_jp/entity/Camera.java
  17. 159 0
      src/main/java/com/fdkankan/manage_jp/entity/CameraDetail.java
  18. 55 25
      src/main/java/com/fdkankan/manage_jp/entity/Company.java
  19. 72 0
      src/main/java/com/fdkankan/manage_jp/entity/MailTemplate.java
  20. 72 0
      src/main/java/com/fdkankan/manage_jp/entity/Role.java
  21. 78 0
      src/main/java/com/fdkankan/manage_jp/entity/SceneDownloadLog.java
  22. 204 0
      src/main/java/com/fdkankan/manage_jp/entity/SceneEditInfo.java
  23. 123 0
      src/main/java/com/fdkankan/manage_jp/entity/ScenePlus.java
  24. 180 0
      src/main/java/com/fdkankan/manage_jp/entity/ScenePlusExt.java
  25. 237 0
      src/main/java/com/fdkankan/manage_jp/entity/ScenePro.java
  26. 285 0
      src/main/java/com/fdkankan/manage_jp/entity/SceneProEdit.java
  27. 3 3
      src/main/java/com/fdkankan/manage_jp/entity/User.java
  28. 63 0
      src/main/java/com/fdkankan/manage_jp/entity/UserRole.java
  29. 4 0
      src/main/java/com/fdkankan/manage_jp/exception/BusinessException.java
  30. 8 8
      src/main/java/com/fdkankan/manage_jp/exception/GlobalExceptionHandler.java
  31. 1 1
      src/main/java/com/fdkankan/manage_jp/generate/AutoGenerate.java
  32. 20 0
      src/main/java/com/fdkankan/manage_jp/httpClient/address/LaserAddressSource.java
  33. 72 0
      src/main/java/com/fdkankan/manage_jp/httpClient/client/LaserClient.java
  34. 13 0
      src/main/java/com/fdkankan/manage_jp/httpClient/param/LaserSceneMoveParam.java
  35. 20 0
      src/main/java/com/fdkankan/manage_jp/httpClient/param/LaserSceneParam.java
  36. 8 0
      src/main/java/com/fdkankan/manage_jp/httpClient/param/SSDownSceneParam.java
  37. 191 0
      src/main/java/com/fdkankan/manage_jp/httpClient/service/LaserService.java
  38. 11 0
      src/main/java/com/fdkankan/manage_jp/httpClient/vo/FdkkResponse.java
  39. 31 0
      src/main/java/com/fdkankan/manage_jp/httpClient/vo/OverallParam.java
  40. 10 0
      src/main/java/com/fdkankan/manage_jp/httpClient/vo/SSDownSceneVo.java
  41. 63 0
      src/main/java/com/fdkankan/manage_jp/interceptor/UcenterInterceptor.java
  42. 19 0
      src/main/java/com/fdkankan/manage_jp/mapper/ICameraDetailMapper.java
  43. 23 0
      src/main/java/com/fdkankan/manage_jp/mapper/ICameraMapper.java
  44. 1 1
      src/main/java/com/fdkankan/manage_jp/mapper/ICompanyMapper.java
  45. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/IMailTemplateMapper.java
  46. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/IRoleMapper.java
  47. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/ISceneDownloadLogMapper.java
  48. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/ISceneEditInfoMapper.java
  49. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/IScenePlusExtMapper.java
  50. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/IScenePlusMapper.java
  51. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/ISceneProEditMapper.java
  52. 22 0
      src/main/java/com/fdkankan/manage_jp/mapper/ISceneProMapper.java
  53. 1 1
      src/main/java/com/fdkankan/manage_jp/mapper/IUserMapper.java
  54. 18 0
      src/main/java/com/fdkankan/manage_jp/mapper/IUserRoleMapper.java
  55. 35 0
      src/main/java/com/fdkankan/manage_jp/service/ICameraDetailService.java
  56. 34 0
      src/main/java/com/fdkankan/manage_jp/service/ICameraService.java
  57. 18 1
      src/main/java/com/fdkankan/manage_jp/service/ICompanyService.java
  58. 13 0
      src/main/java/com/fdkankan/manage_jp/service/IDownService.java
  59. 17 0
      src/main/java/com/fdkankan/manage_jp/service/IMailTemplateService.java
  60. 16 0
      src/main/java/com/fdkankan/manage_jp/service/IRoleService.java
  61. 17 0
      src/main/java/com/fdkankan/manage_jp/service/ISceneDownloadLogService.java
  62. 17 0
      src/main/java/com/fdkankan/manage_jp/service/ISceneEditInfoService.java
  63. 16 0
      src/main/java/com/fdkankan/manage_jp/service/IScenePlusExtService.java
  64. 17 0
      src/main/java/com/fdkankan/manage_jp/service/IScenePlusService.java
  65. 17 0
      src/main/java/com/fdkankan/manage_jp/service/ISceneProEditService.java
  66. 28 0
      src/main/java/com/fdkankan/manage_jp/service/ISceneProService.java
  67. 23 0
      src/main/java/com/fdkankan/manage_jp/service/IUserRoleService.java
  68. 25 1
      src/main/java/com/fdkankan/manage_jp/service/IUserService.java
  69. 112 0
      src/main/java/com/fdkankan/manage_jp/service/impl/CameraDetailServiceImpl.java
  70. 150 0
      src/main/java/com/fdkankan/manage_jp/service/impl/CameraServiceImpl.java
  71. 295 3
      src/main/java/com/fdkankan/manage_jp/service/impl/CompanyServiceImpl.java
  72. 287 0
      src/main/java/com/fdkankan/manage_jp/service/impl/DownService.java
  73. 31 0
      src/main/java/com/fdkankan/manage_jp/service/impl/MailTemplateServiceImpl.java
  74. 20 0
      src/main/java/com/fdkankan/manage_jp/service/impl/RoleServiceImpl.java
  75. 40 0
      src/main/java/com/fdkankan/manage_jp/service/impl/SceneDownloadLogServiceImpl.java
  76. 25 0
      src/main/java/com/fdkankan/manage_jp/service/impl/SceneEditInfoServiceImpl.java
  77. 20 0
      src/main/java/com/fdkankan/manage_jp/service/impl/ScenePlusExtServiceImpl.java
  78. 33 0
      src/main/java/com/fdkankan/manage_jp/service/impl/ScenePlusServiceImpl.java
  79. 33 0
      src/main/java/com/fdkankan/manage_jp/service/impl/SceneProEditServiceImpl.java
  80. 112 0
      src/main/java/com/fdkankan/manage_jp/service/impl/SceneProServiceImpl.java
  81. 45 0
      src/main/java/com/fdkankan/manage_jp/service/impl/UserRoleServiceImpl.java
  82. 184 1
      src/main/java/com/fdkankan/manage_jp/service/impl/UserServiceImpl.java
  83. 17 0
      src/main/java/com/fdkankan/manage_jp/util/PasswordUtil.java
  84. 95 0
      src/main/java/com/fdkankan/manage_jp/util/SendMailUtils.java
  85. 20 0
      src/main/java/com/fdkankan/manage_jp/vo/request/CameraAddParam.java
  86. 10 0
      src/main/java/com/fdkankan/manage_jp/vo/request/CameraListParam.java
  87. 10 0
      src/main/java/com/fdkankan/manage_jp/vo/request/LoginParam.java
  88. 94 0
      src/main/java/com/fdkankan/manage_jp/vo/request/RequestCamera.java
  89. 63 0
      src/main/java/com/fdkankan/manage_jp/vo/request/RequestCompany.java
  90. 94 0
      src/main/java/com/fdkankan/manage_jp/vo/request/RequestUser.java
  91. 23 0
      src/main/java/com/fdkankan/manage_jp/vo/request/SceneParam.java
  92. 10 0
      src/main/java/com/fdkankan/manage_jp/vo/request/UserListParam.java
  93. 10 0
      src/main/java/com/fdkankan/manage_jp/vo/request/UserParam.java
  94. 9 0
      src/main/java/com/fdkankan/manage_jp/vo/response/DownVo.java
  95. 10 0
      src/main/java/com/fdkankan/manage_jp/vo/response/DownloadProcessVo.java
  96. 9 0
      src/main/java/com/fdkankan/manage_jp/vo/response/LoginVo.java
  97. 133 0
      src/main/java/com/fdkankan/manage_jp/vo/response/ResponseCamera.java
  98. 69 0
      src/main/java/com/fdkankan/manage_jp/vo/response/ResponseCompany.java
  99. 25 0
      src/main/java/com/fdkankan/manage_jp/vo/response/SceneVo.java
  100. 0 0
      src/main/java/com/fdkankan/manage_jp/vo/response/UserVo.java

+ 25 - 8
pom.xml

@@ -18,6 +18,7 @@
 
     <dependencies>
 
+
         <dependency>
             <groupId>com.fdkankan</groupId>
             <artifactId>4dkankan-utils-fyun-oss</artifactId>
@@ -125,17 +126,33 @@
             <version>3.1.0</version>
         </dependency>
 
-        <!-- Sa-Token 权限认证, 在线文档:http://sa-token.dev33.cn/ -->
         <dependency>
-            <groupId>cn.dev33</groupId>
-            <artifactId>sa-token-spring-boot-starter</artifactId>
-            <version>1.30.0</version>
+            <groupId>io.jsonwebtoken</groupId>
+            <artifactId>jjwt</artifactId>
+            <version>0.9.1</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.auth0</groupId>
+            <artifactId>java-jwt</artifactId>
+            <version>3.10.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sun.mail</groupId>
+            <artifactId>javax.mail</artifactId>
+            <version>1.5.4</version>
         </dependency>
-        <!-- Sa-Token 整合 jwt -->
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+
         <dependency>
-            <groupId>cn.dev33</groupId>
-            <artifactId>sa-token-jwt</artifactId>
-            <version>1.30.0</version>
+            <groupId>com.github.yulichang</groupId>
+            <artifactId>mybatis-plus-join-boot-starter</artifactId>
+            <version>1.4.2</version>
         </dependency>
 
         <dependency>

+ 16 - 0
src/main/java/com/fdkankan/manage_jp/common/Constant.java

@@ -0,0 +1,16 @@
+package com.fdkankan.manage_jp.common;
+
+public class Constant {
+
+    public static final String CHILD_PASSWORD_VALUE = "4dkankan@4dage";
+
+    public static final String WIFI_PASSWORD_VALUE = "12345678";
+
+    public static String CAMERA_BASE_SPACE_VALUE = "10737418240";
+
+    public static final String DEFAULT_AGENT = "4dage";
+
+
+    public static String AUDIT_COMPANY_EMAIL_SUBJECT="エンタープライズ認証監査結果のフィードバック";
+}
+

+ 21 - 0
src/main/java/com/fdkankan/manage_jp/common/DownloadStatusEnum.java

@@ -0,0 +1,21 @@
+package com.fdkankan.manage_jp.common;
+
+public enum DownloadStatusEnum {
+    DOWNLOADING(1000, "文件正在下载"),
+    DOWNLOAD_COMPRESSING(1001, "文件正在压缩"),
+    DOWNLOAD_SUCCESS(1002, "文件压缩成功/下载处理成功"),
+    DOWNLOAD_FAILED(1003, "下载处理失败");
+
+    public static final int DOWNLOADING_CODE = 1000;
+    public static final int DOWNLOAD_COMPRESSING_CODE = 1001;
+    public static final int DOWNLOAD_SUCCESS_CODE = 1002;
+    public static final int DOWNLOAD_FAILED_CODE = 1003;
+
+    private int status;
+    private String desc;
+
+    DownloadStatusEnum(int status, String desc) {
+        this.status = status;
+        this.desc = desc;
+    }
+}

+ 108 - 0
src/main/java/com/fdkankan/manage_jp/common/Result.java

@@ -0,0 +1,108 @@
+package com.fdkankan.manage_jp.common;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 通用返回类
+ *
+ * @author
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class Result<T> implements Serializable {
+    private static final long serialVersionUID = -1491499610244557029L;
+    public static final String SUCCESS_MSG = "操作成功";
+    public static int CODE_SUCCESS = 0;
+    public static int CODE_FAILURE = -1;
+    public static String[] NOOP = new String[]{};
+
+    /**
+     * 处理状态:0: 成功, 1: 失败
+     */
+
+    private int code;
+    /**
+     * 消息
+     */
+
+    private String msg;
+    /**
+     * 返回数据
+     */
+
+    private T data;
+    /**
+     * 处理成功,并返回数据
+     *
+     * @param data 数据对象
+     * @return data
+     */
+    public static Result success(Object data) {
+        return new Result(CODE_SUCCESS, SUCCESS_MSG, data);
+    }
+    /**
+     * 处理成功
+     *
+     * @return data
+     */
+    public static Result success() {
+        return new Result(CODE_SUCCESS, SUCCESS_MSG, NOOP);
+    }
+    /**
+     * 处理成功
+     *
+     * @param msg 消息
+     * @return data
+     */
+    public static Result success(String msg) {
+        return new Result(CODE_SUCCESS, msg, NOOP);
+    }
+    /**
+     * 处理成功
+     *
+     * @param msg  消息
+     * @param data 数据对象
+     * @return data
+     */
+    public static Result success(String msg, Object data) {
+        return new Result(CODE_SUCCESS, msg, data);
+    }
+    /**
+     * 处理失败,并返回数据(一般为错误信息)
+     *
+     * @param code 错误代码
+     * @param msg  消息
+     * @return data
+     */
+    public static Result failure(int code, String msg) {
+        return new Result(code, msg, NOOP);
+    }
+    /**
+     * 处理失败
+     *
+     * @param msg 消息
+     * @return data
+     */
+    public static Result failure(String msg) {
+        return failure(CODE_FAILURE, msg);
+    }
+    /**
+     * 处理失败
+     *
+     */
+    public static Result failure(ResultCode resultCode) {
+        return failure(resultCode.code(), resultCode.message());
+    }
+
+    @Override
+    public String toString() {
+        return "JsonResult [code=" + code + ", msg=" + msg + ", data="
+                + data + "]";
+    }
+}

+ 13 - 53
src/main/java/com/fdkankan/manage_jp/common/ResultCode.java

@@ -6,62 +6,22 @@ public enum ResultCode  {
 
     NOT_ROLE(4001, "无此角色"),
     NOT_PERMISSION(4002, "无此权限"),
-    USER_NOT_EXIST(4003, "用户不存在"),
-    USER_EXIST(4004, "用户已存在"),
-    PASSWORD_ERROR(4005, "账号密码错误,请重新登录!"),
-    USERNAME_ERROR(4006, "该账号已停止使用"),
-    MISSING_REQUIRED_PARAMETERS(4007, "必填项不能为空"),
+    USER_EXIST(4003, "手机号已经被注册"),
+    PARAM_ERROR(4004, "参数缺失"),
     USER_NOT_LOGIN(4008, "用户未登录"),
+    USER_NOT_EXIST(4007, "用户不存在"),
+    PASSWORD_ERROR(4010, "账号或密码不正确"),
+    COMPANY_NOT_EXIST(4007, "用户名不存在"),
 
-    VISION_EXIST(50001, "版本号不能重复!"),
-    LOGIN_NUM_MUCH(50003, "频繁登录失败,请五分钟后再次尝试登录!"),
-    UPLOAD_ERROR(50004, "上传失败"),
-    SDK_DEL_ERROR(50005, "删除失败,请先下架在删除"),
-    MAIL_TEMPLATE_ERROR(50006, "邮件发送模板不存在"),
-    COMPANY_DEL_ERROR(50007, "删除失败,请先解绑设备"),
-    UPLOAD_FILE_ERROR(50008, "文件不存在"),
-    V3_SCENE_REBUILD(50009, "V3场景请先升级在重算"),
-    SCENE_NOT_EXIST(50010, "场景不存在"),
-    FILE_NAME_EMPTY(50011, "文件名称为空,请输入文件名称!"),
-    APP_FILE_EMPTY(50012, "应用包文件未上传,请先上传文件!"),
-    VERSION_EMPTY(50013, "version.json 文件未上传,请先上传文件!"),
-    WIFI_NAME_ERROR(50014, "wifi名称格式错误"),
-    WIFI_NAME_REPEAT(50015, "设备wifi名称重复"),
-    WIFI_PRE_NAME_ERROR(50016, "wifi名称前缀错误!"),
-    COMPANY_NAME_NOT_EXIST(50017, "客户名称不存在!"),
-    CAMERA_NOT_EXIST(50018, "相机不存在!"),
-    CAMERA_NOT_IN(50019, "该相机未入库!"),
-    CAMERA_DEL_ERROR(50020, "相机已绑定,请先解绑后删除!"),
-    CAMERA_VERSION_NOT_EXIST(50021, "相机版本不存在"),
-    CAMERA_VERSION_STATUS_ERROR(50022, "相机版本已禁用"),
-    SHIP_NUM_EMPTY(50023, "快递单号为空"),
-    IN_TEMPLATE_EMPTY(50024, "入库模板数据为空"),
-    OUT_TEMPLATE_EMPTY(50025, "出库模板数据为空"),
-    COMPANY_TEMPLATE_EMPTY(50026, "客户关联数据为空"),
-    FILE_TYPE_ERROR(50027, "文件格式校验,需为xlsx文件"),
-    TEMPLATE_TYPE_ERROR(50028, "模板格式错误"),
-    EXCEL_MSG_ERROR(50029, "模板格式错误"),
-    CAMERA_TYPE_ERROR(50030, "相机类型错误"),
-    CAMERA_SPACE_ERROR(50031, "相机容量不足,不能迁移"),
-    CAMERA_TYPE_NOT_ERROR(50032, "必须迁移至相同的类型的相机下面!"),
-    MAIL_SEND_ERROR(50033, "邮件发送失败!"),
-    CAMERA_SN_NOT_EXIST(50034, "sn码不存在!"),
-    DEL_ROLE_ERROR(50035, "该角色已关联用户,不可删除。请先修改相关用户的角色!"),
-    ORDER_SN_ERROR(50036, "订单号不存在"),
-    OLD_PASSWORD_ERROR(50037, "原密码错误"),
-    UPLOAD_YUN_TYPE_ERROR(50038, "上传服务器类型错误,请确认环境上传"),
-    UPDATE_MYSELF_PASSWORD(50039, "只能修改自己的密码!"),
-    INCREMENT_TYPE_EMPTY(50040, "权益类型不存在!"),
-    AGENT_NEW_EMPTY(50041, "代理商不存在!"),
-    SS_NO_COPY(50042, "深时场景暂不支持复制!"),
-    AGENT_NOT_EMPTY(50043, "经销商名称已存在!"),
-    CAMERA_NOT_MOVE(50044, "场景在改相机中,无需迁移!"),
-    SCENE_REBUILD_ERROR(50045, "场景重算失败。。。"),
-    PASSWORD_ERROR_G(50046, "密码格式错误!"),
-    AGENT_U_NOT_EMPTY(50047, "经销商账号已存在!"),
-    INCREMENT_TYPE_ERROR(50048, "权益类型错误!"),
-    DEL_UCENTER_ERROR(50049, "该用户已绑定相机,请先解绑再删除用户。"),
     DATA_TOO_LONG(50050, "长度超出限制!"),
+    NOT_RECORD(50051, "记录找不到!"),
+    POINT_GT_ZERO(50052, "点数设置结果小于0,设置失败!"),
+    CAMERA_NOT_EXIST(50053, "该设备不存在或已被激活!"),
+    PASSWORD_TYPE_ERROR(3011, "密码需要包含英文大小写、数字,长度8-16字符"),
+    OLD_PASSWORD_ERROR(3027, "原密码错误"),
+    SS_SCENE_DOWN_ERROR(50051, "获取深时下载状态失败!"),
+    MAIL_TEMPLATE_ERROR(50006, "邮件发送模板不存在"),
+    MAIL_SEND_ERROR(50007, "邮件发送失败"),
 
     ;
 

+ 0 - 72
src/main/java/com/fdkankan/manage_jp/common/ResultData.java

@@ -1,72 +0,0 @@
-package com.fdkankan.manage_jp.common;
-
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.constant.ServerCode;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.Calendar;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class ResultData<T> implements Serializable {
-    /**
-     * 状态码
-     */
-    private int code;
-    /**
-     * 响应信息
-     */
-    private String message;
-    /**
-     * 后端返回结果
-     */
-    private T data;
-    /**
-     * 后端返回结果
-     */
-    private Boolean success;
-    /**
-     * 响应时间戳
-     */
-    private long timestamp = Calendar.getInstance().getTimeInMillis();
-
-    public static ResultData ok() {
-        return ok(null);
-    }
-    public static ResultData ok(Object data) {
-        return ok("成功", data);
-    }
-    public static ResultData ok(String msg, Object data) {
-        return base(ServerCode.SUCCESS.code(), msg, data,true);
-    }
-
-    public static ResultData error(int code, String msg) {
-        return error(code, msg, null); }
-    public static ResultData error(int code, String msg, Object data) {
-        return base(code, msg, data,false);
-    }
-    public static ResultData error(ErrorCode errorCode, Object data) {
-        return base(errorCode.code(), errorCode.message(), data,false);
-    }
-
-    public static ResultData error(ErrorCode errorCode) {
-        return error(errorCode.code(), errorCode.message());
-    }
-    public static ResultData error(ResultCode errorCode) {
-        return error(errorCode.code(), errorCode.message());
-    }
-
-    private static ResultData  base(int code, String msg, Object data,Boolean success) {
-        ResultData rd = new ResultData();
-        rd.setCode(code);
-        rd.setMessage(msg);
-        rd.setData(data);
-        rd.setSuccess(success);
-        return rd;
-    }
-
-}

+ 0 - 133
src/main/java/com/fdkankan/manage_jp/config/SaTokenConfigure.java

@@ -1,133 +0,0 @@
-package com.fdkankan.manage_jp.config;
-
-import cn.dev33.satoken.context.SaHolder;
-import cn.dev33.satoken.exception.NotLoginException;
-import cn.dev33.satoken.exception.NotPermissionException;
-import cn.dev33.satoken.exception.NotRoleException;
-import cn.dev33.satoken.filter.SaServletFilter;
-import cn.dev33.satoken.jwt.StpLogicJwtForMixin;
-import cn.dev33.satoken.router.SaRouter;
-import cn.dev33.satoken.stp.StpLogic;
-import cn.dev33.satoken.stp.StpUtil;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.alibaba.nacos.common.utils.HttpMethod;
-import com.fdkankan.manage_jp.common.RedisKeyUtil;
-import com.fdkankan.manage_jp.common.ResultCode;
-import com.fdkankan.manage_jp.common.ResultData;
-import com.fdkankan.manage_jp.exception.BusinessException;
-import com.fdkankan.redis.constant.RedisKey;
-import com.fdkankan.redis.util.RedisUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.HashMap;
-
-@Configuration
-@Slf4j
-public class SaTokenConfigure {
-
-    public static HashMap<String, JSONObject> manageMenuUrl = new HashMap<>();
-    public static HashMap<String, JSONObject> manageMenuId = new HashMap<>();
-
-    @Autowired
-    RedisUtil redisUtil;
-    // 注册Sa-Token的拦截器
-    @Bean
-    public SaServletFilter getSaServletFilter() {
-        return new SaServletFilter()
-                // 指定 拦截路由 与 放行路由
-                .addInclude("/**").addExclude("/**/reMyselfPassword","/test/**")
-                // 认证函数: 每次请求执行
-                .setAuth(obj -> {
-                    log.info("---------- 进入Sa-Token全局认证 -----------");
-                    // 登录认证 -- 拦截所有路由,并排除/user/doLogin 用于开放登录
-                    SaRouter.match("/**", "/service/manage/login", r ->checkLogin() );
-                    String menu = redisUtil.get(RedisKey.MANAGE_MENU);
-                    if(StringUtils.isBlank(menu)){
-                        SaRouter.match("/**", r -> StpUtil.checkRole("super-admin"));
-                        return;
-                    }
-                    JSONArray menuArray = JSONObject.parseArray(menu);
-                    for (Object o : menuArray) {
-                        JSONObject jsonObject = (JSONObject)  o;
-                        String url = jsonObject.getString("url");
-                        String perm = jsonObject.getString("perms");
-                        if(StringUtils.isEmpty(url) || StringUtils.isEmpty(perm)){
-                            continue;
-                        }
-                        manageMenuId.put(jsonObject.getString("id"),jsonObject);
-                        manageMenuUrl.put(jsonObject.getString("url"),jsonObject);
-                        if(StpUtil.hasRole("super-admin")){
-                            continue;
-                        }
-                        SaRouter.match(url, r -> StpUtil.checkPermission(perm));
-                    }
-                })
-
-                // 异常处理函数:每次认证函数发生异常时执行此函数
-                .setError(e -> {
-                    System.out.println("---------- 进入Sa-Token异常处理 -----------");
-                    SaHolder.getResponse().setHeader("Content-Type", "application/json;charset=UTF-8");
-                    ResultData aj ;
-                    if (e instanceof NotLoginException) {	// 如果是未登录异常
-                        NotLoginException ee = (NotLoginException) e;
-                        aj = ResultData.error(ResultCode.USER_NOT_LOGIN.code(),ResultCode.USER_NOT_LOGIN.message());
-                    }
-                    else if(e instanceof NotRoleException) {		// 如果是角色异常
-                        NotRoleException ee = (NotRoleException) e;
-                        aj =  ResultData.error(ResultCode.NOT_ROLE.code(),ResultCode.NOT_ROLE.message());
-                    }
-                    else if(e instanceof NotPermissionException) {	// 如果是权限异常
-                        NotPermissionException ee = (NotPermissionException) e;
-                        aj =  ResultData.error(ResultCode.NOT_PERMISSION.code(),ResultCode.NOT_PERMISSION.message());
-                    }
-                    else if(e instanceof BusinessException) {	// 如果是权限异常
-                        BusinessException ee = (BusinessException) e;
-                        aj = ResultData.error(ee.getCode(),ee.getMessage());
-                    }
-                    else {	// 普通异常, 输出:500 + 异常信息
-                        aj = ResultData.error(ResultCode.SYSTEM_ERROR.code(),ResultCode.SYSTEM_ERROR.message());
-                    }
-                    return JSONObject.toJSONString(aj);
-                })
-                // 前置函数:在每次认证函数之前执行
-                .setBeforeAuth(r -> {
-                    // ---------- 设置一些安全响应头 ----------
-                    SaHolder.getResponse()
-                            .setHeader("Access-Control-Allow-Origin", "*")
-                            .setHeader("Access-Control-Allow-Methods", "*")
-                            .setHeader("Access-Control-Max-Age", "3600")
-                            .setHeader("Access-Control-Allow-Headers", "*")
-                            .setServer("4dkk");
-
-                    // 跳过对 OPTIONS 请求的检查,否则这里会鉴权失败,导致 springboot 配置的 addCorsMappings 跨域不执行
-                    if (SaHolder.getRequest().getMethod().equals(HttpMethod.OPTIONS.toString())) {
-                        SaRouter.back();
-                    }
-                });
-
-    }
-
-    private void checkLogin(){
-        if(!redisUtil.hasKey(String.format(RedisKeyUtil.loginToken,StpUtil.getTokenValue()))){
-            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
-        }
-        redisUtil.expire(String.format(RedisKeyUtil.loginToken,StpUtil.getTokenValue()),21600);
-        StpUtil.checkLogin();
-    }
-
-
-    //Sa-Token    整合 jwt
-    //Stateless   无状态模式 纯jwt
-    //Mixin       混入模式 jwt 与 Redis 逻辑混合
-    //Simple      简单模式   Token风格替换
-    @Bean
-    public StpLogic getStpLogicJwt() {
-        return new StpLogicJwtForMixin();
-    }
-}
-

+ 0 - 50
src/main/java/com/fdkankan/manage_jp/config/StpInterfaceImpl.java

@@ -1,50 +0,0 @@
-package com.fdkankan.manage_jp.config;
-
-import cn.dev33.satoken.stp.StpInterface;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.manage_jp.common.ResultCode;
-import com.fdkankan.manage_jp.exception.BusinessException;
-import com.fdkankan.redis.constant.RedisKey;
-import com.fdkankan.redis.util.RedisUtil;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-@Component
-public class StpInterfaceImpl implements StpInterface {
-
-    @Autowired
-    RedisUtil redisUtil;
-
-    @Override
-    public List<String> getPermissionList(Object loginId, String loginType) {
-        String redisKey = String.format(RedisKey.MANAGE_PERM_USER, loginId);
-        String permString = redisUtil.get(redisKey);
-        if(StringUtils.isBlank(permString)){
-            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
-        }
-        JSONArray jsonArray = JSONObject.parseArray(permString);
-        List<String> permList = jsonArray.toJavaList(String.class)
-                .parallelStream().filter(StringUtils::isNotBlank).collect(Collectors.toList());
-        //从redis 中获取登录用户权限
-        return permList;
-    }
-
-    @Override
-    public List<String> getRoleList(Object loginId, String loginType) {
-        //从redis 中获取登录用户角色
-        String redisKey = String.format(RedisKey.MANAGE_ROLE_USER, loginId);
-        String roleString = redisUtil.get(redisKey);
-        if(StringUtils.isBlank(roleString)){
-            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
-        }
-        JSONArray jsonArray = JSONObject.parseArray(roleString);
-        List<String> roleList = jsonArray.toJavaList(String.class)
-                .parallelStream().filter(StringUtils::isNotBlank).collect(Collectors.toList());
-        return roleList;
-    }
-}

+ 34 - 0
src/main/java/com/fdkankan/manage_jp/config/WebAppConfig.java

@@ -0,0 +1,34 @@
+package com.fdkankan.manage_jp.config;
+
+import com.fdkankan.manage_jp.interceptor.UcenterInterceptor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+
+@Configuration
+public class WebAppConfig implements WebMvcConfigurer {
+
+	@Autowired
+	UcenterInterceptor ucenterInterceptor;
+
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+
+		registry.addInterceptor(ucenterInterceptor).addPathPatterns("/**")
+				.excludePathPatterns(
+						"/**/manage_jp/user/login/**"
+				);
+
+		WebMvcConfigurer.super.addInterceptors(registry);
+	}
+
+	@Override
+	public void addResourceHandlers(ResourceHandlerRegistry registry) {
+		WebMvcConfigurer.super.addResourceHandlers(registry);
+	}
+
+}
+

+ 86 - 0
src/main/java/com/fdkankan/manage_jp/controller/BaseController.java

@@ -0,0 +1,86 @@
+package com.fdkankan.manage_jp.controller;
+
+import com.fdkankan.common.util.DateEditor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.propertyeditors.StringTrimmerEditor;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+import java.util.Date;
+
+public class BaseController {
+
+    @Autowired
+    protected HttpServletRequest request;
+
+    @Autowired
+    protected HttpServletResponse response;
+
+    @InitBinder
+    protected void initBinder(WebDataBinder webDataBinder) {
+        webDataBinder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
+        webDataBinder.registerCustomEditor(Date.class, new DateEditor(true));
+    }
+
+    /**
+     * 带参重定向
+     *
+     * @param path
+     * @return
+     */
+    protected String redirect(String path) {
+        return "redirect:" + path;
+    }
+
+    /**
+     * 不带参重定向
+     *
+     * @param response
+     * @param path
+     * @return
+     */
+    protected String redirect(HttpServletResponse response, String path) {
+        try {
+            response.sendRedirect(path);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+
+
+    public static void output(HttpServletResponse resp, File file) {
+        OutputStream os = null;
+        BufferedInputStream bis = null;
+        byte[] buff = new byte[1024];
+        try {
+            os = resp.getOutputStream();
+            bis = new BufferedInputStream(new FileInputStream(file));
+            int i = 0;
+            while ((i = bis.read(buff)) != -1) {
+                os.write(buff, 0, i);
+                os.flush();
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                bis.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    protected String getToken(){
+        return request.getHeader("token");
+    }
+    protected String getSign(){
+        return request.getHeader("sign");
+    }
+
+}

+ 59 - 0
src/main/java/com/fdkankan/manage_jp/controller/CameraController.java

@@ -0,0 +1,59 @@
+package com.fdkankan.manage_jp.controller;
+
+
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.service.ICameraService;
+import com.fdkankan.manage_jp.vo.request.CameraAddParam;
+import com.fdkankan.manage_jp.vo.request.CameraListParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 相机主表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@RestController
+@RequestMapping("/manage_jp/camera")
+public class CameraController {
+
+    @Autowired
+    ICameraService cameraService;
+
+    @PostMapping("/list")
+    public Result list(@RequestBody CameraListParam param){
+        return Result.success(cameraService.pageList(param));
+    }
+
+    @PostMapping("/add")
+    public Result add(@RequestBody CameraAddParam param){
+        cameraService.add(param);
+        return Result.success();
+    }
+
+    @PostMapping("/update")
+    public Result update(@RequestBody CameraAddParam param){
+        cameraService.updateByParam(param);
+        return Result.success();
+    }
+
+    @PostMapping("/unbind")
+    public Result unbind(@RequestBody CameraAddParam param){
+        cameraService.unbind(param);
+        return Result.success();
+    }
+
+    @PostMapping("/bind")
+    public Result bind(@RequestBody CameraAddParam param){
+        cameraService.bind(param);
+        return Result.success();
+    }
+}
+

+ 204 - 3
src/main/java/com/fdkankan/manage_jp/controller/CompanyController.java

@@ -1,11 +1,36 @@
 package com.fdkankan.manage_jp.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.common.constant.Constant;
+import com.fdkankan.common.util.DateUtil;
+import com.fdkankan.common.util.SecurityUtil;
+import com.fdkankan.manage_jp.common.PageInfo;
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.Company;
+import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.exception.BusinessException;
+import com.fdkankan.manage_jp.service.ICameraDetailService;
 import com.fdkankan.manage_jp.service.ICompanyService;
+import com.fdkankan.manage_jp.service.IUserService;
+import com.fdkankan.manage_jp.vo.request.RequestCamera;
+import com.fdkankan.manage_jp.vo.request.RequestCompany;
+import com.fdkankan.manage_jp.vo.request.RequestUser;
+import com.fdkankan.manage_jp.vo.response.ResponseCompany;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -13,7 +38,7 @@ import org.springframework.web.bind.annotation.RestController;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @RestController
 @RequestMapping("/manage_jp/company")
@@ -21,6 +46,182 @@ public class CompanyController {
 
     @Autowired
     ICompanyService companyService;
+    @Autowired
+    IUserService userService;
+    @Autowired
+    ICameraDetailService cameraDetailService;
+
+    @PostMapping(value = "/insertOrUpdate")
+    public Result insertOrUpdate(@RequestBody RequestCompany param){
+        companyService.insertOrUpdate(param);
+        return Result.success();
+    }
+
+    /**
+     * 修改企业信息(如审核状态)
+     * @param bo
+     * @return
+     */
+    @RequestMapping("/auditCompany")
+    public Result auditCompany(@RequestBody Company bo){
+        companyService.auditCompany(bo);
+        return Result.success("修改企业数据成功");
+    }
+
+    /**
+     * 新增或修改企业信息
+     */
+    @PostMapping(value = "/addPoint")
+    public Result addPoint(@RequestBody RequestCompany param){
+        if(ObjectUtils.isEmpty(param.getId()) || ObjectUtils.isEmpty(param.getPoint())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        companyService.addPoint(param.getId(),param.getPoint());
+        return Result.success();
+    }
+
+    /**
+     * 校验设备是否可增加
+     * @param requestCamera
+     * @return
+     */
+    @RequestMapping("/checkDevice")
+    public Result checkDevice(@RequestBody RequestCamera requestCamera){
+        if (StringUtils.isEmpty(requestCamera.getChildName())) {
+            return Result.failure("参数不能为空!");
+        }
+        companyService.checkDevice(requestCamera.getChildName());
+        return Result.success("可增加该设备");
+    }
+
+    /**
+     * 获取企业下的子账号
+     * @param bo
+     * @return
+     */
+    @PostMapping("/selectUserList")
+    public Result selectUserList( @RequestBody RequestCompany bo){
+        if(ObjectUtils.isEmpty(bo.getId())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        return Result.success(userService.getPageByCompany(bo));
+    }
+
+    /**
+     * 检查用户是否存在
+     * @param bo
+     * @return
+     */
+    @PostMapping("/checkUserAddAble")
+    public Result checkUserAddAble(@RequestBody RequestUser bo){
+        if(bo == null || bo.getPhoneNum() == null){
+            return Result.failure("手机号不能为空");
+        }
+        User tbUser = userService.findByUserName(bo.getPhoneNum());
+        if (ObjectUtils.isEmpty(tbUser) || ObjectUtils.isEmpty(tbUser.getCompanyId()) || tbUser.getCompanyId() == 0) {
+            // 记录不存在,允许添加
+            return Result.success("可以添加用户",false);
+        }
+        // 记录已存在不可添加
+        return Result.success("用户已存在",true);
+    }
+
+    /**
+     * 根据id查询企业信息
+     */
+
+    @PostMapping(value = "/findById")
+    public Result findById(@RequestBody RequestCompany param){
+        if(StringUtils.isEmpty(param.getId())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        Company companyEntity = companyService.getById(param.getId());
+        ResponseCompany responseCompany = new ResponseCompany();
+        BeanUtils.copyProperties(companyEntity,responseCompany);
+        if(!ObjectUtils.isEmpty(companyEntity.getManagerId())){
+            User userEntity = userService.getById(companyEntity.getManagerId());
+            responseCompany.setManagerName(userEntity.getUserName());
+            responseCompany.setManagerPhone(userEntity.getUserName());
+        }
+
+        return Result.success(responseCompany);
+    }
+
+    /**
+     * 删除企业信息
+     */
+
+    @PostMapping(value = "/deleteById")
+    public Result deleteById(@RequestBody RequestCompany param){
+        if(StringUtils.isEmpty(param.getId())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        companyService.removeById(param.getId());
+
+        cameraDetailService.updateCompanyId(param.getId());
+        return Result.success();
+    }
+
+    /**
+     * 企业列表
+     */
+
+    @PostMapping(value = "/list")
+    public Result list(@RequestBody RequestCompany param){
+        PageInfo<ResponseCompany> result = companyService.companyList(param);
+        return Result.success(result);
+    }
+
+    /**
+     * 所有企业
+     */
+
+    @PostMapping(value = "/listAll")
+    public Result listAll(){
+        List<Company> list =  companyService.list();
+        return Result.success(list);
+    }
+
+
+    /**
+     * 根据获取企业列表
+     * @return
+     */
+    @RequestMapping("/selectCompanyByType")
+    @ResponseBody
+    public Result selectCompanyByType(@RequestBody RequestCompany param){
+        JSONObject result = companyService.selectCompanyByType(param);
+        return Result.success(result);
+    }
+
+    /**
+     * 批量新增企业子账号
+     * @param bo
+     * @return
+     */
+    @RequestMapping("/saveSubUsers")
+    public Result saveSubUsers(@RequestBody RequestCompany bo){
+        try {
+            companyService.saveSubUsers(bo);
+        }catch (Exception e){
+            e.printStackTrace();
+            return Result.failure(e.getMessage());
+        }
+        return Result.success("添加成功");
+    }
+
+    /**
+     * 获取企业的所有设备
+     * @return
+     */
+    @RequestMapping("/selectCompanyDevice")
+    public Result selectCompanyDevice(@RequestBody RequestCompany bo){
+        if(bo.getId() == null){
+            return Result.failure("参数不能为空");
+        }
+        return Result.success(cameraDetailService.selectCompanyDevice(bo.getId()));
+    }
+
 
 }
 

+ 21 - 0
src/main/java/com/fdkankan/manage_jp/controller/RoleController.java

@@ -0,0 +1,21 @@
+package com.fdkankan.manage_jp.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 角色表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-04
+ */
+@RestController
+@RequestMapping("/manage_jp/role")
+public class RoleController {
+
+}
+

+ 99 - 0
src/main/java/com/fdkankan/manage_jp/controller/SceneProController.java

@@ -0,0 +1,99 @@
+package com.fdkankan.manage_jp.controller;
+
+
+import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.entity.UserRole;
+import com.fdkankan.manage_jp.service.IDownService;
+import com.fdkankan.manage_jp.service.ISceneProService;
+import com.fdkankan.manage_jp.service.IUserRoleService;
+import com.fdkankan.manage_jp.service.IUserService;
+import com.fdkankan.manage_jp.vo.request.SceneParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * pro场景表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@RestController
+@RequestMapping("/manage_jp/scene")
+public class SceneProController extends BaseController{
+
+    @Autowired
+    ISceneProService sceneProService;
+    @Autowired
+    IUserService userService;
+    @Autowired
+    IUserRoleService userRoleService;
+    @Autowired
+    IDownService downService;
+
+    @PostMapping("/list")
+    public Result list(@RequestBody SceneParam param){
+        String username = JwtUtil.getUsername(getToken());
+        User user = userService.getByUserName(username);
+
+        Set<Long> roleIds = userRoleService.getByUser(user);
+        if(!roleIds.contains(5L)){      //平台管理员
+            param.setCompanyId(user.getCompanyId());
+            if(roleIds.contains(6L)){
+                param.setUserId(user.getId());
+            }
+        }
+
+        return Result.success(sceneProService.pageList(param));
+    }
+
+
+    /**
+     * 检查下载
+     * num      场景码
+     */
+    @GetMapping("/checkDownLoad")
+    public Result checkDownLoad(@RequestParam(required = false) String num,
+                                    @RequestParam(required = false,defaultValue = "0") Integer isObj){
+        return Result.success(downService.checkDownLoad(num,isObj));
+    }
+
+    /**
+     * 下载场景
+     * num      场景码
+     */
+    @GetMapping("/downScene")
+    public Result downScene(@RequestParam(required = false) String num,
+                                @RequestParam(required = false,defaultValue = "0") Integer isObj){
+        return Result.success(downService.down(num,isObj));
+    }
+
+    /**
+     * 下载场景进度条
+     * num      场景码
+     */
+    @GetMapping("/downloadProcess")
+    public Result downloadProcess(@RequestParam(required = false) String num,
+                                      @RequestParam(required = false,defaultValue = "0") Integer isObj){
+        return Result.success(downService.downloadProcess(num,isObj));
+    }
+
+    /**
+     * 增加场景下载次数
+     */
+    @RequestMapping(value = "/addDownloadNum", method = RequestMethod.GET)
+    public Result addDownloadNum(@RequestParam(required = false) String sceneNum) throws Exception{
+        //sceneProService.addDownloadNum(sceneNum);
+        return Result.success();
+    }
+
+}
+

+ 42 - 6
src/main/java/com/fdkankan/manage_jp/controller/UserController.java

@@ -1,12 +1,14 @@
 package com.fdkankan.manage_jp.controller;
 
 
+import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.manage_jp.common.Result;
 import com.fdkankan.manage_jp.service.IUserService;
+import com.fdkankan.manage_jp.vo.request.LoginParam;
+import com.fdkankan.manage_jp.vo.request.UserListParam;
+import com.fdkankan.manage_jp.vo.request.UserParam;
 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 org.springframework.web.bind.annotation.*;
 
 /**
  * <p>
@@ -14,14 +16,48 @@ import org.springframework.web.bind.annotation.RestController;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @RestController
 @RequestMapping("/manage_jp/user")
-public class UserController {
+public class UserController extends BaseController {
 
     @Autowired
     IUserService userService;
 
+    /**
+     * 登录
+     * phoneNum 用户名
+     * password 密码
+     */
+    @PostMapping("/login")
+    public Result login(@RequestBody LoginParam param){
+        return Result.success(userService.login(param));
+    }
+
+    /**
+     * 获取用户信息
+     */
+    @RequestMapping(value = "/getUserInfo", method = RequestMethod.POST)
+    public Result getUserInfo() {
+        String username = JwtUtil.getUsername(getToken());
+        return Result.success(userService.getUserInfo(username));
+    }
+
+    /**
+     * 查询用户列表
+     */
+    @PostMapping("/list")
+    public Result list(@RequestBody UserListParam param){
+
+        return Result.success(userService.pageList(param));
+    }
+
+    @PostMapping("/updatePassword")
+    public Result updatePassword(@RequestBody UserParam param){
+        userService.updatePassword(param);
+        return Result.success();
+    }
+
 }
 

+ 87 - 0
src/main/java/com/fdkankan/manage_jp/entity/Camera.java

@@ -0,0 +1,87 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 相机主表
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Getter
+@Setter
+@TableName("t_camera")
+public class Camera implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 相机的Mac地址
+     */
+    @TableField("child_name")
+    private String childName;
+
+    /**
+     * 激活时间
+     */
+    @TableField("activated_time")
+    private String activatedTime;
+
+    /**
+     * 相机密码
+     */
+    @TableField("child_password")
+    private String childPassword;
+
+    /**
+     * sn码
+     */
+    @TableField("sn_code")
+    private String snCode;
+
+    /**
+     * wifi名称
+     */
+    @TableField("wifi_name")
+    private String wifiName;
+
+    /**
+     * wifi密码
+     */
+    @TableField("wifi_password")
+    private String wifiPassword;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private String createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private String updateTime;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 159 - 0
src/main/java/com/fdkankan/manage_jp/entity/CameraDetail.java

@@ -0,0 +1,159 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 相机子表
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Getter
+@Setter
+@TableName("t_camera_detail")
+public class CameraDetail implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 余额
+     */
+    @TableField("balance")
+    private String balance;
+
+    /**
+     * 用户表t_user的id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 0表示客户,1表示员工,2表示赠送,3表示其他,4经销商销售
+     */
+    @TableField("own")
+    private Integer own;
+
+    /**
+     * 订单号
+     */
+    @TableField("order_sn")
+    private String orderSn;
+
+    /**
+     * 0表示本国,1表示国外
+     */
+    @TableField("country")
+    private Integer country;
+
+    /**
+     * 经销商
+     */
+    @TableField("agency")
+    private String agency;
+
+    /**
+     * 相机类型,0表示双目,1四维看看pro,2 四维看看lite,9 双目转台,10 激光转台
+     */
+    @TableField("type")
+    private Integer type;
+
+    /**
+     * 总容量
+     */
+    @TableField("total_space")
+    private Long totalSpace;
+
+    /**
+     * 已使用容量
+     */
+    @TableField("used_space")
+    private Long usedSpace;
+
+    /**
+     * 相机主表t_camera的id
+     */
+    @TableField("camera_id")
+    private Long cameraId;
+
+    /**
+     * 商品表t_goods的id
+     */
+    @TableField("goods_id")
+    private Long goodsId;
+
+    /**
+     * 企业表t_company的id
+     */
+    @TableField("company_id")
+    private Long companyId;
+
+    /**
+     * 代理商架构管理t_agent_framework的id
+     */
+    @TableField("agent_framework_id")
+    private Long agentFrameworkId;
+
+    /**
+     * 相机协作用户id
+     */
+    @TableField("cooperation_user")
+    private Long cooperationUser;
+
+    /**
+     * 设备地址(追溯管理后台)
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("user_camera_version")
+    private String userCameraVersion;
+
+    @TableField("app_version")
+    private String appVersion;
+
+    @TableField("last_request_time")
+    private Date lastRequestTime;
+
+    @TableField("out_time")
+    private Date outTime;
+
+    /**
+     * 代理商id
+     */
+    @TableField("agent_id")
+    private Integer agentId;
+
+
+}

+ 55 - 25
src/main/java/com/fdkankan/manage_jp/entity/Company.java

@@ -16,7 +16,7 @@ import lombok.Setter;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @Getter
 @Setter
@@ -41,16 +41,16 @@ public class Company implements Serializable {
     private String topLogo;
 
     /**
-     * 地面logo
+     * 地面点位标志Logo
      */
-    @TableField("floor_logo")
-    private String floorLogo;
+    @TableField("marker_logo")
+    private String markerLogo;
 
     /**
-     * 地面点位logo
+     * 地面logo
      */
-    @TableField("marker_logo")
-    private String markerLogo;
+    @TableField("floor_logo")
+    private String floorLogo;
 
     /**
      * 二维码logo
@@ -67,11 +67,11 @@ public class Company implements Serializable {
     /**
      * t_manager表的id
      */
-    @TableField("sys_user_id")
-    private Long sysUserId;
+    @TableField("manager_id")
+    private Long managerId;
 
     /**
-     * 新增的相机是否注册,0否,1删
+     * 新增的相机是否删除,0否,1删
      */
     @TableField("camera_delete")
     private Integer cameraDelete;
@@ -92,29 +92,59 @@ public class Company implements Serializable {
      * 记录的状态,A: 生效,I: 禁用
      */
     @TableField("rec_status")
-    @TableLogic
+    @TableLogic(value = "A",delval = "I")
     private String recStatus;
 
-    @TableField("calculate_flexibility")
-    private Boolean calculateFlexibility;
+    @TableField("area")
+    private String area;
 
-    /**
-     * 数据同步类型
-     */
-    @TableField("data_sync")
-    private String dataSync;
+    @TableField("address")
+    private String address;
 
-    @TableField("company_desc")
-    private String companyDesc;
+    @TableField("website")
+    private String website;
 
-    @TableField("manager_id")
-    private Integer managerId;
+    @TableField("logo")
+    private String logo;
+
+    @TableField("scene_logo")
+    private String sceneLogo;
+
+    @TableField("bg_music")
+    private String bgMusic;
+
+    @TableField("qualification")
+    private String qualification;
+
+    @TableField("code")
+    private String code;
+
+    @TableField("introduce")
+    private String introduce;
+
+    @TableField("point")
+    private Integer point;
+
+    @TableField("sub_num")
+    private Integer subNum;
+
+    @TableField("state")
+    private Integer state;
+
+    @TableField("type")
+    private Integer type;
+
+    @TableField("audit_time")
+    private Date auditTime;
+
+    @TableField("expiration_time")
+    private Date expirationTime;
 
     /**
-     * V3:计算为V3场景,V4:计算为V4场景,默认V4场景
+     * 数据同步类型
      */
-    @TableField("scene_version")
-    private String sceneVersion;
+    @TableField("data_sync")
+    private String dataSync;
 
 
 }

+ 72 - 0
src/main/java/com/fdkankan/manage_jp/entity/MailTemplate.java

@@ -0,0 +1,72 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Getter
+@Setter
+@TableName("t_mail_template")
+public class MailTemplate implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 发件人邮箱
+     */
+    @TableField("send_mail")
+    private String sendMail;
+
+    /**
+     * 发件人邮箱密码
+     */
+    @TableField("send_password")
+    private String sendPassword;
+
+    /**
+     * 发件人主机
+     */
+    @TableField("send_host")
+    private String sendHost;
+
+    /**
+     * 收件主题
+     */
+    @TableField("subject")
+    private String subject;
+
+    /**
+     * 邮件内容
+     */
+    @TableField("msg")
+    private String msg;
+
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 72 - 0
src/main/java/com/fdkankan/manage_jp/entity/Role.java

@@ -0,0 +1,72 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 角色表
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-04
+ */
+@Getter
+@Setter
+@TableName("t_role")
+public class Role implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 角色描述
+     */
+    @TableField("role_desc")
+    private String roleDesc;
+
+    /**
+     * 角色名
+     */
+    @TableField("role_name")
+    private String roleName;
+
+    /**
+     * 角色key
+     */
+    @TableField("role_key")
+    private String roleKey;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 78 - 0
src/main/java/com/fdkankan/manage_jp/entity/SceneDownloadLog.java

@@ -0,0 +1,78 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Getter
+@Setter
+@TableName("t_scene_download_log")
+public class SceneDownloadLog implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 场景码
+     */
+    @TableField("scene_num")
+    private String sceneNum;
+
+    /**
+     * 场景版本
+     */
+    @TableField("scene_version")
+    private Integer sceneVersion;
+
+    /**
+     * 场景打包之后的连接
+     */
+    @TableField("download_url")
+    private String downloadUrl;
+
+    /**
+     * 0下载中,1下载成功,2下载失败
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 下载版本v3,v4
+     */
+    @TableField("sys_version")
+    private String sysVersion;
+
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("create_time")
+    private Date createTime;
+
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 204 - 0
src/main/java/com/fdkankan/manage_jp/entity/SceneEditInfo.java

@@ -0,0 +1,204 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Getter
+@Setter
+@TableName("t_scene_edit_info")
+public class SceneEditInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    @TableField("scene_pro_id")
+    private Long sceneProId;
+
+    @TableField("scene_plus_id")
+    private Long scenePlusId;
+
+    /**
+     * 地面logo名称
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 地面logo大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 地面logo文件名称
+     */
+    @TableField("floor_logo_file")
+    private String floorLogoFile;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("music")
+    private String music;
+
+    /**
+     * 背景音乐文件名称
+     */
+    @TableField("music_file")
+    private String musicFile;
+
+    /**
+     * 浏览密码
+     */
+    @TableField("scene_password")
+    private String scenePassword;
+
+    /**
+     * 场景标题
+     */
+    @TableField("title")
+    private String title;
+
+    /**
+     * 场景描述
+     */
+    @TableField("description")
+    private String description;
+
+    /**
+     * 用户是否上传户型图(0-否,1-是)
+     */
+    @TableField("floor_plan_user")
+    private Integer floorPlanUser;
+
+    /**
+     * 是否有热点数据(0-否,1-是)
+     */
+    @TableField("tags")
+    private Integer tags;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 图片版本
+     */
+    @TableField("img_version")
+    private Integer imgVersion;
+
+    /**
+     * 场景关联版本
+     */
+    @TableField("link_version")
+    private Integer linkVersion;
+
+    /**
+     * 是否上传模型
+     */
+    @TableField("is_upload_obj")
+    private Integer isUploadObj;
+
+    /**
+     * 重新建模的版本
+     */
+    @TableField("floor_edit_ver")
+    private Integer floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    @TableField("floor_publish_ver")
+    private Integer floorPublishVer;
+
+    /**
+     * 空间视频数据
+     */
+    @TableField("box_videos")
+    private String boxVideos;
+
+    /**
+     * 空间贴图数据
+     */
+    @TableField("box_photos")
+    private String boxPhotos;
+
+    /**
+     * 空间模型数据
+     */
+    @TableField("box_models")
+    private String boxModels;
+
+    /**
+     * 是否需要处理球幕视频
+     */
+    @TableField("build_video_status")
+    private Integer buildVideoStatus;
+
+    /**
+     * 初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 加载logo名
+     */
+    @TableField("loading_logo")
+    private String loadingLogo;
+
+    /**
+     * 加载logo文件名
+     */
+    @TableField("loading_logo_file")
+    private String loadingLogoFile;
+
+    /**
+     * 用户上传自定义平面图数据
+     */
+    @TableField("floor_plan_upload")
+    private String floorPlanUpload;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 修改时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 123 - 0
src/main/java/com/fdkankan/manage_jp/entity/ScenePlus.java

@@ -0,0 +1,123 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 场景主表
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Getter
+@Setter
+@TableName("t_scene_plus")
+public class ScenePlus implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景码
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 相机id
+     */
+    @TableField("camera_id")
+    private Long cameraId;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 场景名称
+     */
+    @TableField("title")
+    private String title;
+
+    /**
+     * 场景描述
+     */
+    @TableField("description")
+    private String description;
+
+    /**
+     * 场景状态:0-未建好,1--已建好,-1-计算出错,-2--不在官网显示
+     */
+    @TableField("scene_status")
+    private Integer sceneStatus;
+
+    /**
+     * 场景来源:相机拍摄10以内表示,1表示八目,2双目,3转台,4 激光  其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景
+     */
+    @TableField("scene_source")
+    private Integer sceneSource;
+
+    /**
+     * 支付状态:0表示未付款,1表示付款了,-1表示欠费,-2表示容量不足
+     */
+    @TableField("pay_status")
+    private Integer payStatus;
+
+    /**
+     * 场景类型  0-其他,1-文博,2-地产,3-电商,4-餐饮,5-家居,99-一件换装虚拟房源
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 是否推荐:0-否,1-是
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 是否有housetype文件(0-否,1-是)
+     */
+    @TableField("house_type")
+    private Integer houseType;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+
+}

+ 180 - 0
src/main/java/com/fdkankan/manage_jp/entity/ScenePlusExt.java

@@ -0,0 +1,180 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Getter
+@Setter
+@TableName("t_scene_plus_ext")
+public class ScenePlusExt implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * t_scene_plus主键
+     */
+    @TableField("plus_id")
+    private Long plusId;
+
+    /**
+     * 场景数据目录
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    /**
+     * 场景链接
+     */
+    @TableField("web_site")
+    private String webSite;
+
+    /**
+     * 缩略图链接
+     */
+    @TableField("thumb")
+    private String thumb;
+
+    /**
+     * 方案:1-双目,2-转台,3-六目,4-八目,10-获取4k图,11-获取2k,12-获取1k
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 使用用量
+     */
+    @TableField("space")
+    private Long space;
+
+    /**
+     * 云服务器类型
+     */
+    @TableField("ecs")
+    private String ecs;
+
+    /**
+     * 点位数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 算法类型(slam、sfm)
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+    /**
+     * 固件版本
+     */
+    @TableField("firmware_version")
+    private String firmwareVersion;
+
+    /**
+     * 算法类型(V2,V3)
+     */
+    @TableField("build_type")
+    private String buildType;
+
+    /**
+     * 分辨率(2k,4k)
+     */
+    @TableField("scene_resolution")
+    private String sceneResolution;
+
+    /**
+     * 场景来源,lite:双目lite相机,pro:八目相机,minion:双面转台相机,laser:激光相机,virtual:虚拟场景,sketch:图片建模场景
+     */
+    @TableField("scene_from")
+    private String sceneFrom;
+
+    /**
+     * 切图方式(tiles:瓦片图,face:切片图,pan:全景图 ,local:本地切片,cube:立体图)
+     */
+    @TableField("scene_kind")
+    private String sceneKind;
+
+    /**
+     * 算法生成模型类型(dam,3dtiles)
+     */
+    @TableField("model_kind")
+    private String modelKind;
+
+    /**
+     * 点位视频
+     */
+    @TableField("videos")
+    private String videos;
+
+    /**
+     * oss桶名
+     */
+    @TableField("yun_file_bucket")
+    private String yunFileBucket;
+
+    /**
+     * 算法计算完成时间
+     */
+    @TableField("algorithm_time")
+    private Date algorithmTime;
+
+    /**
+     * 计算耗时
+     */
+    @TableField("compute_time")
+    private Long computeTime;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * A-有效,I-无效
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    @TableField("is_obj")
+    private Integer isObj;
+
+
+}

+ 237 - 0
src/main/java/com/fdkankan/manage_jp/entity/ScenePro.java

@@ -0,0 +1,237 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * pro场景表
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Getter
+@Setter
+@TableName("t_scene_pro")
+public class ScenePro implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 场景名称
+     */
+    @TableField("scene_name")
+    private String sceneName;
+
+    /**
+     * 场景描述
+     */
+    @TableField("scene_dec")
+    private String sceneDec;
+
+    /**
+     * 场景的链接地址
+     */
+    @TableField("web_site")
+    private String webSite;
+
+    /**
+     * 场景缩略图
+     */
+    @TableField("thumb")
+    private String thumb;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 0表示未建好,1表示建好,-1表示出错,-2表示不要在官网上显示
+     */
+    @TableField("status")
+    private Integer status;
+
+    /**
+     * 原始的大场景数据(七牛)
+     */
+    @TableField("data_source")
+    private String dataSource;
+
+    /**
+     * 用户表t_user的id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 0表示未付款,1表示付款了,-1表示欠费,-2表示容量不足
+     */
+    @TableField("pay_status")
+    private Integer payStatus;
+
+    /**
+     * 相机主表t_camera的id
+     */
+    @TableField("camera_id")
+    private Long cameraId;
+
+    /**
+     * 手机id
+     */
+    @TableField("phone_id")
+    private String phoneId;
+
+    /**
+     * 场景logo
+     */
+    @TableField("scene_logo")
+    private String sceneLogo;
+
+    /**
+     * 大场景序号
+     */
+    @TableField("num")
+    private String num;
+
+    /**
+     * 0表示其他,1表示文博,2表示地产,3表示电商,4表示餐饮,5表示家居,99一件换装虚拟房源
+     */
+    @TableField("scene_type")
+    private Integer sceneType;
+
+    /**
+     * 1表示推荐,0表示正常
+     */
+    @TableField("recommend")
+    private Integer recommend;
+
+    /**
+     * 浏览次数
+     */
+    @TableField("view_count")
+    private Integer viewCount;
+
+    /**
+     * 拍摄数量 ps:点位数量
+     */
+    @TableField("shoot_count")
+    private Integer shootCount;
+
+    /**
+     * 所有资源文件名
+     */
+    @TableField("files_name")
+    private String filesName;
+
+    /**
+     * 点位视频
+     */
+    @TableField("videos")
+    private String videos;
+
+    /**
+     * 要gps定位
+     */
+    @TableField("gps")
+    private String gps;
+
+    /**
+     * 方案:1是双目,2是转台,3是六目,4是八目,10获取4k图,11获取2k,12获取1k
+     */
+    @TableField("scene_scheme")
+    private Integer sceneScheme;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 算法类型
+     */
+    @TableField("algorithm")
+    private String algorithm;
+
+    /**
+     * 服务器的服务商
+     */
+    @TableField("ecs")
+    private String ecs;
+
+    /**
+     * 使用容量
+     */
+    @TableField("space")
+    private Long space;
+
+    /**
+     * 固件版本
+     */
+    @TableField("firmware_version")
+    private String firmwareVersion;
+
+    /**
+     * 调用V2还是V3的算法
+     */
+    @TableField("build_type")
+    private String buildType;
+
+    /**
+     * 计算时间(秒为单位)
+     */
+    @TableField("compute_time")
+    private Long computeTime;
+
+    /**
+     * 场景来源,相机拍摄10以内表示,1表示八目,2双目,3转台,4 激光  其他来源10以上,11:一键换装,12:123看房,13文通虚拟场景,14上传的matterport场景
+     */
+    @TableField("scene_source")
+    private Integer sceneSource;
+
+    /**
+     * 大场景序号(随心装场景码)
+     */
+    @TableField("vrnum")
+    private String vrnum;
+
+    @TableField("unicode")
+    private String unicode;
+
+    @TableField("mosaics")
+    private String mosaics;
+
+    /**
+     * 是否已升级v4(0-否,1-是)
+     */
+    @TableField("is_upgrade")
+    private Integer isUpgrade;
+
+    /**
+     * 是否是obj场景
+     */
+    @TableField("is_obj")
+    private Integer isObj;
+
+
+}

+ 285 - 0
src/main/java/com/fdkankan/manage_jp/entity/SceneProEdit.java

@@ -0,0 +1,285 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * pro场景编辑数据表
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Getter
+@Setter
+@TableName("t_scene_pro_edit")
+public class SceneProEdit implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * pro场景id
+     */
+    @TableField("pro_id")
+    private Long proId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 大场景的密钥
+     */
+    @TableField("scene_key")
+    private String sceneKey;
+
+    /**
+     * 展示页面密码,0不需要,1需要
+     */
+    @TableField("need_key")
+    private Integer needKey;
+
+    /**
+     * 版本
+     */
+    @TableField("version")
+    private Integer version;
+
+    /**
+     * 表示缩略图是否存在
+     */
+    @TableField("thumb_status")
+    private Integer thumbStatus;
+
+    /**
+     * 地面点位标志
+     */
+    @TableField("marker_logo")
+    private String markerLogo;
+
+    /**
+     * 0表示默认,1表示自己上传
+     */
+    @TableField("floor_logo")
+    private String floorLogo;
+
+    /**
+     * 标记大小
+     */
+    @TableField("floor_logo_size")
+    private Integer floorLogoSize;
+
+    /**
+     * 要上传的热点的id集合,用逗号隔开
+     */
+    @TableField("hots_ids")
+    private String hotsIds;
+
+    /**
+     * 表示初始点信息
+     */
+    @TableField("entry")
+    private String entry;
+
+    /**
+     * 背景音乐名称
+     */
+    @TableField("bg_music")
+    private String bgMusic;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+    /**
+     * 普通录屏文件地址
+     */
+    @TableField("screencap_voice_src")
+    private String screencapVoiceSrc;
+
+    /**
+     * 录音文件地址
+     */
+    @TableField("screencap_voice_sound")
+    private String screencapVoiceSound;
+
+    /**
+     * 同步录音地址
+     */
+    @TableField("screencap_voice_soundsync")
+    private String screencapVoiceSoundsync;
+
+    /**
+     * 选择的类型,sound为screencapVoiceSound,file为screencapVoiceSrc,soundsync为screencap_voice_soundsync
+     */
+    @TableField("screencap_voice_type")
+    private String screencapVoiceType;
+
+    /**
+     * 录屏文件地址
+     */
+    @TableField("play_data")
+    private String playData;
+
+    /**
+     * 重新建模的版本
+     */
+    @TableField("floor_edit_ver")
+    private Integer floorEditVer;
+
+    /**
+     * 正式发布重新建模的版本
+     */
+    @TableField("floor_publish_ver")
+    private Integer floorPublishVer;
+
+    /**
+     * 录屏图片存放文件
+     */
+    @TableField("screencap_thumb")
+    private String screencapThumb;
+
+    /**
+     * 分享的logo和生成二维码的logo
+     */
+    @TableField("share_logo")
+    private String shareLogo;
+
+    /**
+     * 小地图浏览
+     */
+    @TableField("map_visi")
+    private Integer mapVisi;
+
+    /**
+     * 自动导览
+     */
+    @TableField("tour_visi")
+    private Integer tourVisi;
+
+    /**
+     * vr模式
+     */
+    @TableField("vr_visi")
+    private Integer vrVisi;
+
+    /**
+     * 展示页面是否显示标尺
+     */
+    @TableField("ruler_visi")
+    private Integer rulerVisi;
+
+    /**
+     * 展示页面cad图在平面图是否显示
+     */
+    @TableField("cad_img_visi")
+    private Integer cadImgVisi;
+
+    /**
+     * cad平面图
+     */
+    @TableField("floor_plan_png")
+    private String floorPlanPng;
+
+    /**
+     * cad平面图参数
+     */
+    @TableField("cad_info")
+    private String cadInfo;
+
+    @TableField("pano_visi")
+    private Integer panoVisi;
+
+    @TableField("m2d_visi")
+    private Integer m2dVisi;
+
+    @TableField("m3d_visi")
+    private Integer m3dVisi;
+
+    @TableField("measure_visi")
+    private Integer measureVisi;
+
+    /**
+     * 肖安需求,场景于场景之间的关联
+     */
+    @TableField("link_scene")
+    private String linkScene;
+
+    @TableField("overlay")
+    private String overlay;
+
+    /**
+     * 是否显示底部logo,1显示,0不显示
+     */
+    @TableField("show_logo_bottom")
+    private Boolean showLogoBottom;
+
+    /**
+     * 全景图版本号
+     */
+    @TableField("images_version")
+    private Integer imagesVersion;
+
+    /**
+     * 上传的背景音乐
+     */
+    @TableField("bg_music_name")
+    private String bgMusicName;
+
+    @TableField("jump_scene")
+    private Boolean jumpScene;
+
+    /**
+     * 旋转角度
+     */
+    @TableField("floor_plan_angle")
+    private String floorPlanAngle;
+
+    /**
+     * 场景下载次数
+     */
+    @TableField("download_num")
+    private Integer downloadNum;
+
+    /**
+     * 绿幕抠图json数据
+     */
+    @TableField("videos_user")
+    private String videosUser;
+
+    /**
+     * 大场景序号(随心装场景码)
+     */
+    @TableField("vr_num")
+    private String vrNum;
+
+    /**
+     * 随心装封面图
+     */
+    @TableField("vr_thumb")
+    private String vrThumb;
+
+
+}

+ 3 - 3
src/main/java/com/fdkankan/manage_jp/entity/User.java

@@ -16,7 +16,7 @@ import lombok.Setter;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @Getter
 @Setter
@@ -128,7 +128,7 @@ public class User implements Serializable {
      * 记录的状态,A: 生效,I: 禁用
      */
     @TableField("rec_status")
-    @TableLogic
+    @TableLogic(value = "A",delval = "I")
     private String recStatus;
 
     /**
@@ -138,7 +138,7 @@ public class User implements Serializable {
     private Date updateTime;
 
     @TableField("company_id")
-    private Integer companyId;
+    private Long companyId;
 
     /**
      * 深时场景下载总次数

+ 63 - 0
src/main/java/com/fdkankan/manage_jp/entity/UserRole.java

@@ -0,0 +1,63 @@
+package com.fdkankan.manage_jp.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 用户角色关系表
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-23
+ */
+@Getter
+@Setter
+@TableName("t_user_role")
+public class UserRole implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 用户表id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 角色表id
+     */
+    @TableField("role_id")
+    private Long roleId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+    /**
+     * 记录的状态,A: 生效,I: 禁用
+     */
+    @TableField("rec_status")
+    @TableLogic(value = "A",delval = "I")
+    private String recStatus;
+
+    /**
+     * 更新时间
+     */
+    @TableField("update_time")
+    private Date updateTime;
+
+
+}

+ 4 - 0
src/main/java/com/fdkankan/manage_jp/exception/BusinessException.java

@@ -15,6 +15,10 @@ public class BusinessException extends RuntimeException {
         this.code = code;
         this.message = msg;
     }
+    public BusinessException(String msg){
+        this.code = -1;
+        this.message = msg;
+    }
 
     public BusinessException(ResultCode errorCode) {
         this.code = errorCode.code();

+ 8 - 8
src/main/java/com/fdkankan/manage_jp/exception/GlobalExceptionHandler.java

@@ -1,7 +1,7 @@
 package com.fdkankan.manage_jp.exception;
 
+import com.fdkankan.manage_jp.common.Result;
 import com.fdkankan.manage_jp.common.ResultCode;
-import com.fdkankan.manage_jp.common.ResultData;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -20,9 +20,9 @@ public class GlobalExceptionHandler {
      */
     @ResponseBody
     @ExceptionHandler(value = Exception.class)
-    public ResultData exceptionHandler(Exception e) throws Exception {
+    public Result exceptionHandler(Exception e) throws Exception {
         log.error("服务错误:", e);
-        return ResultData.error( 500, e.getCause().getMessage());
+        return Result.failure( 500, e.getCause().getMessage());
     }
 
     /**
@@ -30,20 +30,20 @@ public class GlobalExceptionHandler {
      */
     @ResponseBody
     @ExceptionHandler(value = BusinessException.class)
-    public ResultData businessExceptionHandler(BusinessException e) {
+    public Result businessExceptionHandler(BusinessException e) {
         log.info("业务异常code:{},message:{}", e.getCode(), e.getMessage());
-        return ResultData.error(e.getCode(), e.getMessage());
+        return Result.failure(e.getCode(), e.getMessage());
     }
     /**
      * 处理业务异常
      */
     @ResponseBody
     @ExceptionHandler(value = DataIntegrityViolationException.class)
-    public ResultData DataIntegrityViolationExceptionHandler(DataIntegrityViolationException e) {
+    public Result DataIntegrityViolationExceptionHandler(DataIntegrityViolationException e) {
         log.error("mysql服务错误:", e);
         if(e.getCause().getMessage().contains("Data too long")){
-            return ResultData.error(ResultCode.DATA_TOO_LONG);
+            return Result.failure(ResultCode.DATA_TOO_LONG);
         }
-        return ResultData.error( 500, e.getCause().getMessage());
+        return Result.failure( 500, e.getCause().getMessage());
     }
 }

+ 1 - 1
src/main/java/com/fdkankan/manage_jp/generate/AutoGenerate.java

@@ -18,7 +18,7 @@ public class AutoGenerate {
         String path =System.getProperty("user.dir");
 
         generate(path,"manage_jp", getTables(new String[]{
-                "t_company","t_user",
+              "t_mail_template"
         }));
 
 //        generate(path,"goods", getTables(new String[]{

+ 20 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/address/LaserAddressSource.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage_jp.httpClient.address;
+
+import com.dtflys.forest.callback.AddressSource;
+import com.dtflys.forest.http.ForestAddress;
+import com.dtflys.forest.http.ForestRequest;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+@Component
+public class LaserAddressSource implements AddressSource {
+
+    @Value("${4dkk.laserService.basePath}")
+    private String basePath;
+
+
+    @Override
+    public ForestAddress getAddress(ForestRequest forestRequest) {
+        return new ForestAddress("","",null,basePath);
+    }
+}

+ 72 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/client/LaserClient.java

@@ -0,0 +1,72 @@
+package com.fdkankan.manage_jp.httpClient.client;
+
+import com.dtflys.forest.annotation.*;
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.httpClient.address.LaserAddressSource;
+import com.fdkankan.manage_jp.httpClient.param.LaserSceneMoveParam;
+import com.fdkankan.manage_jp.httpClient.param.LaserSceneParam;
+import com.fdkankan.manage_jp.httpClient.param.SSDownSceneParam;
+import com.fdkankan.manage_jp.httpClient.vo.FdkkResponse;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 获取,调用4dkk服务
+ */
+@Address(source = LaserAddressSource.class)
+public interface LaserClient {
+
+    /**
+     * 获取深时场景数据
+     */
+    @Post("/laser/4dage/managerSceneList")
+    FdkkResponse sceneList(@JSONBody LaserSceneParam param);
+    /**
+     * 相机迁移
+     */
+    @Post("/laser/4dage/scene/migrate")
+    FdkkResponse migrate(@JSONBody LaserSceneMoveParam param);
+    /**
+     * 修改场景状态
+     */
+    @Get("/indoor/{sceneNum}/scene/useStatus/{status}")
+    Result updateSceneStatus(@Var("sceneNum") String sceneNum, @Var("status")Integer status);
+    /**
+     * 获取相机场景数
+     * @param param
+     */
+    @Post("/laser/4dage/scene/getSceneNumByCamera")
+    Result getSceneNumByCamera(@JSONBody Map<String, String> param);
+    /**
+     * 取消相机协作
+     * @param param
+     */
+    @Post("/laser/4dage/scene/cooperation/disable")
+    Result cooperationDisable(@JSONBody List<Map<String, String>> param);
+    /**
+     * 添加相机协作
+     * @param param
+     */
+    @Post("/laser/4dage/scene/cooperation/cameraSave")
+    Result cooperationCameraSave(@JSONBody List<Map<String, String> >param);
+    /**
+     * 添加相机协作
+     */
+    @Post("/laser/init/{sceneNum}/saveOrEdit")
+    Result saveOrEdit(@Var("sceneNum") String sceneNum, @JSONBody  Map<String,Object> params);
+
+    /**
+     * 下载深时场景
+     * status :0:正在生成 1,初次生成  2,已经生成直接下载 3,重新生成
+     */
+    @Post("/laser/4dage/downOfflineScene")
+    Result downOfflineScene(@JSONBody SSDownSceneParam param) ;
+    /**
+     * 检测深时场景是否需要重新生成
+     *
+     * status :离线包状态是否需要重新生成 0未生成,1 不需要 2需要
+     */
+    @Post("/laser/4dage/downOfflineSceneStatus")
+    Result downOfflineSceneStatus(@JSONBody SSDownSceneParam param) ;
+}

+ 13 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/param/LaserSceneMoveParam.java

@@ -0,0 +1,13 @@
+package com.fdkankan.manage_jp.httpClient.param;
+
+import lombok.Data;
+
+@Data
+public class LaserSceneMoveParam {
+
+    private String phone;
+    private String sceneCode;
+    private String snCode;
+    private String toSnCode;
+    private Long userId;
+}

+ 20 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/param/LaserSceneParam.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage_jp.httpClient.param;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class LaserSceneParam {
+    private Integer pageNum;
+    private Integer pageSize;
+    private String title;
+    private String phone;
+    private String snCode;
+    private List<String> snCodes = new ArrayList<>();
+
+    private String sceneCode;
+    private String startTime;
+    private String endTime;
+}

+ 8 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/param/SSDownSceneParam.java

@@ -0,0 +1,8 @@
+package com.fdkankan.manage_jp.httpClient.param;
+
+import lombok.Data;
+
+@Data
+public class SSDownSceneParam {
+    private String sceneCode;
+}

+ 191 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/service/LaserService.java

@@ -0,0 +1,191 @@
+package com.fdkankan.manage_jp.httpClient.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.manage_jp.common.PageInfo;
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.entity.Camera;
+import com.fdkankan.manage_jp.entity.CameraDetail;
+import com.fdkankan.manage_jp.httpClient.client.LaserClient;
+import com.fdkankan.manage_jp.httpClient.param.LaserSceneParam;
+import com.fdkankan.manage_jp.httpClient.param.SSDownSceneParam;
+import com.fdkankan.manage_jp.httpClient.vo.FdkkResponse;
+import com.fdkankan.manage_jp.httpClient.vo.SSDownSceneVo;
+import com.fdkankan.manage_jp.service.ICameraDetailService;
+import com.fdkankan.manage_jp.service.ICameraService;
+import com.fdkankan.manage_jp.service.IUserService;
+import com.fdkankan.manage_jp.vo.request.SceneParam;
+import com.fdkankan.manage_jp.vo.response.SceneVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class LaserService {
+
+   @Autowired
+   LaserClient laserClient;
+    @Value("${4dkk.laserService.basePath}")
+    private String basePath;
+    @Autowired
+    IUserService userService;
+    @Autowired
+    ICameraDetailService cameraDetailService;
+    @Autowired
+    ICameraService cameraService;
+
+
+    public PageInfo pageList(SceneParam param) {
+        LaserSceneParam laserSceneParam = getLaserSceneParam(param);
+        if(laserSceneParam == null ){
+            return PageInfo.PageInfoEmpty(param.getPage(),param.getLimit());
+        }
+        FdkkResponse response = laserClient.sceneList(laserSceneParam);
+        JSONObject jsonObject =response.getData();
+        if(jsonObject == null){
+            return PageInfo.PageInfoEmpty(param.getPage(),param.getLimit());
+        }
+        JSONArray list = jsonObject.getJSONArray("list");
+        long total =jsonObject.getLong("total");
+
+        List<SceneVo> sceneVoList = new ArrayList<>();
+        String newBasePath = basePath;
+        newBasePath = newBasePath.contains("dev")? newBasePath + "/dev" : newBasePath;
+        newBasePath = newBasePath.contains("uat")? newBasePath + "/uat" : newBasePath;
+        newBasePath =  newBasePath.replace("/backend","");
+        for (Object o : list) {
+            String res = JSONObject.toJSONString(o);
+            SceneVo vo = JSONObject.parseObject(res,SceneVo.class);
+            //深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
+            JSONObject obj = (JSONObject) o;
+            vo.setStatusString(getLaserStatus(vo.getStatus()));
+            vo.setStatus(toFdStatus(vo.getStatus()));
+            if(vo.getStatus() == -3){
+                vo.setPayStatus(-1);
+            }else {
+                vo.setPayStatus(1);
+            }
+            vo.setSceneName(obj.getString("title"));
+            vo.setUserName(obj.getString("phone"));
+            vo.setThumb(newBasePath +"/index.html?m="+vo.getNum() );
+            vo.setPayStatus(1);
+            sceneVoList.add(vo);
+        }
+
+        Page<SceneVo> voPage = new Page<>(param.getPage(),param.getLimit());
+        voPage.setRecords(sceneVoList);
+        voPage.setTotal(total);
+        return PageInfo.PageInfo(voPage);
+    }
+
+    private LaserSceneParam getLaserSceneParam(SceneParam param) {
+        LaserSceneParam newParam = new LaserSceneParam();
+        if(param.getCompanyId()!= null){ //客户场景
+            List<CameraDetail> cameraDetails = cameraDetailService.getListByCompanyId(param.getCompanyId());
+            param.setSnCodes(this.setSnCodes(cameraDetails));
+            if(param.getSnCodes() == null || param.getSnCodes().size() <=0){
+                return null;
+            }
+        }
+        if(StringUtils.isNotBlank(param.getUserName())){
+            List<CameraDetail> cameraDetails = cameraDetailService.getByUserName(param.getUserName());
+            param.setSnCodes(this.setSnCodes(cameraDetails));
+        }
+        if(StringUtils.isNotBlank(param.getSceneName()) && StringUtils.isBlank(param.getChildName()) &&
+                (param.getSnCodes() == null || param.getSnCodes().size() <=0)){
+            param.setSnCode("phoneEmptySelect");
+        }
+        BeanUtils.copyProperties(param,newParam);
+        newParam.setTitle(param.getSceneName());
+        return newParam;
+    }
+
+    private List<String> setSnCodes(List<CameraDetail> cameraDetails) {
+        if(cameraDetails != null && cameraDetails.size() >0){
+            Set<Long> cameraIds = cameraDetails.stream()
+                    .filter(entity -> entity.getGoodsId() == 10).map(CameraDetail::getCameraId).collect(Collectors.toSet());
+            if(cameraIds.size() >0){
+                List<Camera> cameraList = cameraService.listByIds(cameraIds);
+                return cameraList.stream().map(Camera::getSnCode).collect(Collectors.toList());
+            }
+        }
+        return null;
+    }
+
+    private Integer toFdStatus(Integer status) {
+        //深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
+        switch (status){
+            case 0 :
+            case 4 :
+                return 0;
+            case 2 : return -2;
+            case 3 : return -3;
+            default: return -1;
+        }
+    }
+
+    public static String getLaserStatus(Integer status){
+        //深时状态,-1:场景被删 0:计算中 1计算失败 2计算成功 3封存 4生成OBJ中
+        switch (status){
+            case -1 : return "场景已删除";
+            case 0 : return "计算中";
+            case 1 : return "计算失败";
+            case 2 : return "计算成功";
+            case 3 : return "封存";
+            case 4 : return "生成OBJ中";
+            default: return "";
+        }
+    }
+
+
+
+
+
+
+    public SSDownSceneVo downOfflineSceneStatus(String num) {
+        try {
+            SSDownSceneVo vo ;
+            SSDownSceneParam param = new SSDownSceneParam();
+            param.setSceneCode(num);
+            Result responseEntity = laserClient.downOfflineSceneStatus(param);
+            if( responseEntity.getCode() != HttpStatus.OK.value()){
+                log.error("downOfflineSceneStatus-根据场景码获取激光转台下载状态失败:{}",responseEntity);
+                return null;
+            }
+            vo = JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), SSDownSceneVo.class);
+            return vo;
+
+        }catch (Exception e){
+            log.error("downOfflineSceneStatus-根据场景码获取激光转台下载状态失败!",e);
+        }
+        return null ;
+    }
+
+    public SSDownSceneVo downOfflineScene(String num) {
+        try {
+            SSDownSceneVo vo ;
+            SSDownSceneParam param = new SSDownSceneParam();
+            param.setSceneCode(num);
+            Result responseEntity = laserClient.downOfflineScene(param);
+            if( responseEntity.getCode() != HttpStatus.OK.value()){
+                log.error("downOfflineScene-根据场景码获取激光转台下载失败:{}",responseEntity);
+                return null;
+            }
+            vo = JSONObject.parseObject(JSONObject.toJSONString(responseEntity.getData()), SSDownSceneVo.class);
+            return vo ;
+        }catch (Exception e){
+            log.error("downOfflineScene-根据场景码获取激光转台下载状态失败!",e);
+        }
+        return null ;
+    }
+
+}

+ 11 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/vo/FdkkResponse.java

@@ -0,0 +1,11 @@
+package com.fdkankan.manage_jp.httpClient.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
+
+@Data
+public class FdkkResponse<T> {
+    private Integer code;
+    private String msg;
+    private JSONObject data;
+}

+ 31 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/vo/OverallParam.java

@@ -0,0 +1,31 @@
+package com.fdkankan.manage_jp.httpClient.vo;
+
+import lombok.Data;
+import org.apache.commons.lang3.StringUtils;
+
+@Data
+public class OverallParam {
+    private String id;
+    private Long pageNum = 1L;
+    private Long pageSize = 10L;
+    private String searchKey;
+    private String userId;
+
+
+    private String sceneName;
+    private String userName;
+
+    public String getSearchKey() {
+        if(StringUtils.isNotBlank(sceneName)){
+            return sceneName;
+        }
+        return searchKey;
+    }
+    public String getUserId() {
+        if(StringUtils.isNotBlank(userName)){
+            return userName;
+        }
+        return userId;
+    }
+
+}

+ 10 - 0
src/main/java/com/fdkankan/manage_jp/httpClient/vo/SSDownSceneVo.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage_jp.httpClient.vo;
+
+import lombok.Data;
+
+@Data
+public class SSDownSceneVo {
+                                //离线包状态是否需要重新生成 1 不需要 2需要
+    private Integer status;     //0:正在生成 1,初次生成  2,已经生成直接下载 3,重新生成
+    private String url;         //下载地址
+}

+ 63 - 0
src/main/java/com/fdkankan/manage_jp/interceptor/UcenterInterceptor.java

@@ -0,0 +1,63 @@
+package com.fdkankan.manage_jp.interceptor;
+
+
+import cn.hutool.http.ContentType;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.redis.constant.RedisKey;
+import com.fdkankan.redis.util.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpHeaders;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+
+@Component
+@Slf4j
+public class UcenterInterceptor implements HandlerInterceptor {
+
+	@Autowired
+	private RedisUtil redisUtil;
+
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+		response.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.JSON.getValue());
+		response.setCharacterEncoding(StandardCharsets.UTF_8.name());
+		String token = request.getHeader("token");
+		if(StringUtils.isEmpty(token)){
+			this.needLogin(request,response);
+			return false;
+		}
+		try {
+			String redisKey = String.format(RedisKey.TOKEN_V3,token);
+			if(redisUtil.hasKey(redisKey)){
+				redisUtil.expire(redisKey,2 * 60 * 60);
+				return true;
+			}
+		}catch (Exception e){
+			e.printStackTrace();
+		}
+		this.needLogin(request,response);
+		return false;
+	}
+
+	private void needLogin(HttpServletRequest request, HttpServletResponse response) {
+		try {
+			String result = JSONObject.toJSONString(Result.failure(ResultCode.USER_NOT_LOGIN));
+			response.getWriter().append(result);
+		} catch (IOException e) {
+			log.info("LoginInterceptor|needLogin|IOException|" + e);
+			e.printStackTrace();
+		}
+	}
+
+}
+

+ 19 - 0
src/main/java/com/fdkankan/manage_jp/mapper/ICameraDetailMapper.java

@@ -0,0 +1,19 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.CameraDetail;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 相机子表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Mapper
+public interface ICameraDetailMapper extends MPJBaseMapper<CameraDetail> {
+
+}

+ 23 - 0
src/main/java/com/fdkankan/manage_jp/mapper/ICameraMapper.java

@@ -0,0 +1,23 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.manage_jp.entity.Camera;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.manage_jp.vo.request.CameraListParam;
+import com.fdkankan.manage_jp.vo.request.RequestCamera;
+import com.github.yulichang.base.MPJBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 相机主表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Mapper
+public interface ICameraMapper extends MPJBaseMapper<Camera> {
+
+    Page<RequestCamera> pageList(Page<Object> page, CameraListParam param);
+}

+ 1 - 1
src/main/java/com/fdkankan/manage_jp/mapper/ICompanyMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @Mapper
 public interface ICompanyMapper extends BaseMapper<Company> {

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/IMailTemplateMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.MailTemplate;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Mapper
+public interface IMailTemplateMapper extends BaseMapper<MailTemplate> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/IRoleMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.Role;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 角色表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-04
+ */
+@Mapper
+public interface IRoleMapper extends BaseMapper<Role> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/ISceneDownloadLogMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.SceneDownloadLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Mapper
+public interface ISceneDownloadLogMapper extends BaseMapper<SceneDownloadLog> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/ISceneEditInfoMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.SceneEditInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Mapper
+public interface ISceneEditInfoMapper extends BaseMapper<SceneEditInfo> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/IScenePlusExtMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.ScenePlusExt;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Mapper
+public interface IScenePlusExtMapper extends BaseMapper<ScenePlusExt> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/IScenePlusMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.ScenePlus;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 场景主表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Mapper
+public interface IScenePlusMapper extends BaseMapper<ScenePlus> {
+
+}

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/ISceneProEditMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.SceneProEdit;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * pro场景编辑数据表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Mapper
+public interface ISceneProEditMapper extends BaseMapper<SceneProEdit> {
+
+}

+ 22 - 0
src/main/java/com/fdkankan/manage_jp/mapper/ISceneProMapper.java

@@ -0,0 +1,22 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.manage_jp.entity.ScenePro;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fdkankan.manage_jp.vo.request.SceneParam;
+import com.fdkankan.manage_jp.vo.response.SceneVo;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * pro场景表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Mapper
+public interface ISceneProMapper extends BaseMapper<ScenePro> {
+
+    Page<SceneVo> pageList(Page<Object> page, SceneParam param);
+}

+ 1 - 1
src/main/java/com/fdkankan/manage_jp/mapper/IUserMapper.java

@@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @Mapper
 public interface IUserMapper extends BaseMapper<User> {

+ 18 - 0
src/main/java/com/fdkankan/manage_jp/mapper/IUserRoleMapper.java

@@ -0,0 +1,18 @@
+package com.fdkankan.manage_jp.mapper;
+
+import com.fdkankan.manage_jp.entity.UserRole;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 用户角色关系表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-23
+ */
+@Mapper
+public interface IUserRoleMapper extends BaseMapper<UserRole> {
+
+}

+ 35 - 0
src/main/java/com/fdkankan/manage_jp/service/ICameraDetailService.java

@@ -0,0 +1,35 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.CameraDetail;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage_jp.vo.response.ResponseCamera;
+import com.github.yulichang.base.MPJBaseService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 相机子表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+public interface ICameraDetailService extends MPJBaseService<CameraDetail> {
+
+    void updateCompanyId(Long id);
+
+    int findCountByCompanyId(Long id);
+
+    List<ResponseCamera> selectCompanyDevice(Long id);
+
+    void updateOwnByCameraId(Integer cameraId, Integer own);
+
+    void unbind(Long cameraId);
+
+    void bind(List<Long> cameraIds, Integer companyId);
+
+    List<CameraDetail> getListByCompanyId(Long companyId);
+
+    List<CameraDetail> getByUserName(String userName);
+}

+ 34 - 0
src/main/java/com/fdkankan/manage_jp/service/ICameraService.java

@@ -0,0 +1,34 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.Camera;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage_jp.vo.request.CameraAddParam;
+import com.fdkankan.manage_jp.vo.request.CameraListParam;
+import com.github.yulichang.base.MPJBaseService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 相机主表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+public interface ICameraService extends MPJBaseService<Camera> {
+
+    Camera findByChildName(String childName);
+
+    Object pageList(CameraListParam param);
+
+    void add(CameraAddParam param);
+
+    void updateByParam(CameraAddParam param);
+
+    void unbind(CameraAddParam param);
+
+    void bind(CameraAddParam param);
+
+    List<Camera> getByChildNames(List<String> childNames);
+}

+ 18 - 1
src/main/java/com/fdkankan/manage_jp/service/ICompanyService.java

@@ -1,7 +1,11 @@
 package com.fdkankan.manage_jp.service;
 
+import com.alibaba.fastjson.JSONObject;
+import com.fdkankan.manage_jp.common.PageInfo;
 import com.fdkankan.manage_jp.entity.Company;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage_jp.vo.request.RequestCompany;
+import com.fdkankan.manage_jp.vo.response.ResponseCompany;
 
 /**
  * <p>
@@ -9,8 +13,21 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 public interface ICompanyService extends IService<Company> {
 
+    void insertOrUpdate(RequestCompany param);
+
+    void auditCompany(Company bo);
+
+    void addPoint(Long id, Integer point);
+
+    void checkDevice(String childName);
+
+    PageInfo<ResponseCompany> companyList(RequestCompany param);
+
+    JSONObject selectCompanyByType(RequestCompany param);
+
+    void saveSubUsers(RequestCompany bo);
 }

+ 13 - 0
src/main/java/com/fdkankan/manage_jp/service/IDownService.java

@@ -0,0 +1,13 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.vo.response.DownVo;
+import com.fdkankan.manage_jp.vo.response.DownloadProcessVo;
+
+public interface IDownService {
+
+    DownVo checkDownLoad(String sceneNum, Integer isObj);
+
+    DownVo down(String sceneNum,Integer isObj);
+
+    DownloadProcessVo downloadProcess(String num, Integer isObj);
+}

+ 17 - 0
src/main/java/com/fdkankan/manage_jp/service/IMailTemplateService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.MailTemplate;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+public interface IMailTemplateService extends IService<MailTemplate> {
+
+    Boolean sendMail(String email, MailTemplate emailTemplate, String file);
+}

+ 16 - 0
src/main/java/com/fdkankan/manage_jp/service/IRoleService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.Role;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 角色表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-04
+ */
+public interface IRoleService extends IService<Role> {
+
+}

+ 17 - 0
src/main/java/com/fdkankan/manage_jp/service/ISceneDownloadLogService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.SceneDownloadLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+public interface ISceneDownloadLogService extends IService<SceneDownloadLog> {
+
+    SceneDownloadLog getByStatusAndNum(String sceneNum, Integer status,Integer isUp);
+}

+ 17 - 0
src/main/java/com/fdkankan/manage_jp/service/ISceneEditInfoService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.SceneEditInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+public interface ISceneEditInfoService extends IService<SceneEditInfo> {
+
+    SceneEditInfo getByScenePlusId(Long plusId);
+}

+ 16 - 0
src/main/java/com/fdkankan/manage_jp/service/IScenePlusExtService.java

@@ -0,0 +1,16 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.ScenePlusExt;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+public interface IScenePlusExtService extends IService<ScenePlusExt> {
+
+}

+ 17 - 0
src/main/java/com/fdkankan/manage_jp/service/IScenePlusService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.ScenePlus;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 场景主表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+public interface IScenePlusService extends IService<ScenePlus> {
+
+    ScenePlus getByNum(String sceneNum);
+}

+ 17 - 0
src/main/java/com/fdkankan/manage_jp/service/ISceneProEditService.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.SceneProEdit;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * pro场景编辑数据表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+public interface ISceneProEditService extends IService<SceneProEdit> {
+
+    SceneProEdit getByProId(Long proId);
+}

+ 28 - 0
src/main/java/com/fdkankan/manage_jp/service/ISceneProService.java

@@ -0,0 +1,28 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.ScenePro;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage_jp.vo.request.SceneParam;
+
+import java.util.List;
+
+/**
+ * <p>
+ * pro场景表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+public interface ISceneProService extends IService<ScenePro> {
+
+    Long getCountByUserIds(List<Long> userIds);
+
+    void rebindUser(Long id, Long managerId);
+
+    Object pageList(SceneParam param);
+
+    ScenePro getByNum(String sceneNum);
+
+    void addDownloadNum(String sceneNum);
+}

+ 23 - 0
src/main/java/com/fdkankan/manage_jp/service/IUserRoleService.java

@@ -0,0 +1,23 @@
+package com.fdkankan.manage_jp.service;
+
+import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.entity.UserRole;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * <p>
+ * 用户角色关系表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-23
+ */
+public interface IUserRoleService extends IService<UserRole> {
+
+    List<UserRole> getByUserId(Long userId);
+
+    Set<Long> getByUser(User user);
+}

+ 25 - 1
src/main/java/com/fdkankan/manage_jp/service/IUserService.java

@@ -1,7 +1,14 @@
 package com.fdkankan.manage_jp.service;
 
+import com.fdkankan.manage_jp.common.PageInfo;
 import com.fdkankan.manage_jp.entity.User;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fdkankan.manage_jp.vo.request.LoginParam;
+import com.fdkankan.manage_jp.vo.request.RequestCompany;
+import com.fdkankan.manage_jp.vo.request.UserListParam;
+import com.fdkankan.manage_jp.vo.request.UserParam;
+
+import java.util.List;
 
 /**
  * <p>
@@ -9,8 +16,25 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 public interface IUserService extends IService<User> {
 
+    User getByUserName(String managerPhone);
+
+    PageInfo getPageByCompany(RequestCompany bo);
+
+    User findByUserName(String phoneNum);
+
+    List<User> findByCompanyId(Long id);
+
+    List<User> findByUserNameList(String userName);
+
+    Object login(LoginParam param);
+
+    Object getUserInfo(String username);
+
+    Object pageList(UserListParam param);
+
+    void updatePassword(UserParam param);
 }

+ 112 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/CameraDetailServiceImpl.java

@@ -0,0 +1,112 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.manage_jp.entity.Camera;
+import com.fdkankan.manage_jp.entity.CameraDetail;
+import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.mapper.ICameraDetailMapper;
+import com.fdkankan.manage_jp.mapper.ICameraMapper;
+import com.fdkankan.manage_jp.service.ICameraDetailService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.service.ICameraService;
+import com.fdkankan.manage_jp.service.IUserService;
+import com.fdkankan.manage_jp.vo.response.ResponseCamera;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 相机子表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Service
+public class CameraDetailServiceImpl extends MPJBaseServiceImpl<ICameraDetailMapper, CameraDetail> implements ICameraDetailService {
+
+    @Autowired
+    ICameraService cameraService;
+    @Autowired
+    IUserService userService;
+
+    @Override
+    public void updateCompanyId(Long id) {
+        LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CameraDetail::getCompanyId,id);
+        wrapper.set(CameraDetail::getCompanyId,null);
+        this.update(wrapper);
+    }
+
+    @Override
+    public int findCountByCompanyId(Long id) {
+        LambdaQueryWrapper<CameraDetail> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CameraDetail::getCompanyId,id);
+        return Math.toIntExact(this.count(wrapper));
+    }
+
+    @Override
+    public List<ResponseCamera> selectCompanyDevice(Long id) {
+        MPJLambdaWrapper<Camera> wrapper = new MPJLambdaWrapper<>();
+        wrapper.selectAll(Camera.class);
+        wrapper.selectAll(CameraDetail.class);
+        wrapper.leftJoin(CameraDetail.class,CameraDetail::getCameraId,Camera :: getId);
+        wrapper.eq(CameraDetail :: getCompanyId,id);
+
+        return cameraService.selectJoinList(ResponseCamera.class,wrapper);
+    }
+
+    @Override
+    public void updateOwnByCameraId(Integer cameraId, Integer own) {
+        LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CameraDetail::getCameraId,cameraId);
+        wrapper.set(CameraDetail::getOwn,own);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void unbind(Long cameraId) {
+        LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(CameraDetail::getCameraId,cameraId);
+        wrapper.set(CameraDetail::getCompanyId,null);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void bind(List<Long> cameraIds, Integer companyId) {
+        LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.in(CameraDetail::getCameraId,cameraIds);
+        wrapper.set(CameraDetail::getCompanyId,companyId);
+        this.update(wrapper);
+    }
+
+    @Override
+    public List<CameraDetail> getListByCompanyId(Long companyId) {
+        LambdaQueryWrapper<CameraDetail> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(CameraDetail::getCompanyId,companyId);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public List<CameraDetail> getByUserName(String userName) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.like(User::getUserName,userName);
+        List<User> list = userService.list(wrapper);
+        if(list.size() >0){
+            List<Long> userIds = list.stream().map(User::getId).collect(Collectors.toList());
+            if(userIds.size() >0){
+                LambdaQueryWrapper<CameraDetail> dtW = new LambdaQueryWrapper<>();
+                dtW.in(CameraDetail::getUserId,userIds);
+                return this.list(dtW);
+            }
+        }
+        return null;
+    }
+}

+ 150 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/CameraServiceImpl.java

@@ -0,0 +1,150 @@
+package com.fdkankan.manage_jp.service.impl;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.common.util.DateUtil;
+import com.fdkankan.manage_jp.common.Constant;
+import com.fdkankan.manage_jp.common.PageInfo;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.Camera;
+import com.fdkankan.manage_jp.entity.CameraDetail;
+import com.fdkankan.manage_jp.entity.Company;
+import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.exception.BusinessException;
+import com.fdkankan.manage_jp.mapper.ICameraMapper;
+import com.fdkankan.manage_jp.service.ICameraDetailService;
+import com.fdkankan.manage_jp.service.ICameraService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.service.ICompanyService;
+import com.fdkankan.manage_jp.service.IUserService;
+import com.fdkankan.manage_jp.vo.request.CameraAddParam;
+import com.fdkankan.manage_jp.vo.request.CameraListParam;
+import com.fdkankan.manage_jp.vo.request.RequestCamera;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 相机主表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Service
+public class CameraServiceImpl extends MPJBaseServiceImpl<ICameraMapper, Camera> implements ICameraService {
+
+    @Autowired
+    ICameraDetailService cameraDetailService;
+    @Autowired
+    ICompanyService companyService;
+    @Autowired
+    IUserService userService;
+
+    @Override
+    public Camera findByChildName(String childName) {
+        LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Camera::getChildName,childName);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public Object pageList(CameraListParam param) {
+        Page<RequestCamera> page = this.getBaseMapper().pageList(new Page<>(param.getPage(),param.getLimit()),param);
+
+        return PageInfo.PageInfo(page);
+    }
+
+    @Override
+    public void add(CameraAddParam param) {
+        Camera camera = new Camera();
+        camera.setChildName(param.getChildName());
+        camera.setChildPassword(Constant.CHILD_PASSWORD_VALUE);
+        camera.setSnCode(param.getSnCode());
+        camera.setWifiName(param.getWifiName());
+        camera.setWifiPassword(Constant.WIFI_PASSWORD_VALUE);
+        this.save(camera);
+
+        CameraDetail detail = new CameraDetail();
+        detail.setOwn(param.getOwn());
+        detail.setTotalSpace(Long.valueOf(Constant.CAMERA_BASE_SPACE_VALUE));
+        detail.setUsedSpace(0L);
+        detail.setCameraId(camera.getId());
+        detail.setType(param.getCameraType());
+        if(param.getCameraType() == 9){
+            detail.setGoodsId(9L);
+        }else if(param.getCameraType() == 10){
+            detail.setGoodsId(10L);
+        }else{
+            detail.setGoodsId(param.getCameraType() == 0 ? 1L : 4L);
+        }
+        detail.setOutTime(new Date());
+        detail.setAgency(Constant.DEFAULT_AGENT);
+        cameraDetailService.save(detail);
+    }
+
+    @Override
+    public void updateByParam(CameraAddParam param) {
+        if(param.getCameraId() == null || param.getOwn() == null ){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+
+        cameraDetailService.updateOwnByCameraId(param.getCameraId(),param.getOwn());
+    }
+
+    @Override
+    public void unbind(CameraAddParam param) {
+        if(StringUtils.isBlank(param.getChildName())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        Camera camera = this.findByChildName(param.getChildName());
+        if(camera == null){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        LambdaUpdateWrapper<Camera> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(Camera::getId,camera.getId());
+        wrapper.set(Camera::getActivatedTime,null);
+        this.update(wrapper);
+
+        cameraDetailService.unbind(camera.getId());
+    }
+
+    @Override
+    public void bind(CameraAddParam param) {
+        if(param.getChildNames() == null  || param.getChildNames().size() <=0 || param.getCompanyId() == null){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        Company company = companyService.getById(param.getCameraId());
+        if(company ==  null){
+            throw new BusinessException(ResultCode.COMPANY_NOT_EXIST);
+        }
+        User user = userService.getById(company.getManagerId());
+        if(user == null){
+            throw new BusinessException(ResultCode.USER_NOT_EXIST);
+        }
+
+        LambdaUpdateWrapper<Camera> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.in(Camera::getChildName,param.getChildNames());
+        wrapper.set(Camera::getActivatedTime, DateUtil.date2String(new Date(),"yyyy-MM-dd HH:mm:ss"));
+        this.update(wrapper);
+        List<Camera> byChildNames = this.getByChildNames(param.getChildNames());
+
+        List<Long> cameraIds = byChildNames.stream().map(Camera::getId).collect(Collectors.toList());
+        cameraDetailService.bind(cameraIds,param.getCompanyId());
+
+    }
+
+    @Override
+    public List<Camera> getByChildNames(List<String> childNames) {
+        LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(Camera::getChildName,childNames);
+        return this.list(wrapper);
+    }
+}

+ 295 - 3
src/main/java/com/fdkankan/manage_jp/service/impl/CompanyServiceImpl.java

@@ -1,10 +1,36 @@
 package com.fdkankan.manage_jp.service.impl;
 
-import com.fdkankan.manage_jp.entity.Company;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.common.util.DateUtil;
+import com.fdkankan.common.util.SecurityUtil;
+import com.fdkankan.manage_jp.common.Constant;
+import com.fdkankan.manage_jp.common.PageInfo;
+import com.fdkankan.manage_jp.common.Result;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.*;
+import com.fdkankan.manage_jp.exception.BusinessException;
 import com.fdkankan.manage_jp.mapper.ICompanyMapper;
-import com.fdkankan.manage_jp.service.ICompanyService;
+import com.fdkankan.manage_jp.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.util.SendMailUtils;
+import com.fdkankan.manage_jp.vo.request.RequestCompany;
+import com.fdkankan.manage_jp.vo.response.ResponseCompany;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
+import org.springframework.util.StringUtils;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -12,9 +38,275 @@ import org.springframework.stereotype.Service;
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @Service
+@Slf4j
 public class CompanyServiceImpl extends ServiceImpl<ICompanyMapper, Company> implements ICompanyService {
 
+    @Autowired
+    IUserService userService;
+    @Autowired
+    IUserRoleService userRoleService;
+    @Autowired
+    ICameraService cameraService;
+    @Autowired
+    ICameraDetailService cameraDetailService;
+    @Autowired
+    ISceneProService sceneProService;
+    @Autowired
+    IMailTemplateService mailTemplateService;
+
+    @Override
+    public void insertOrUpdate(RequestCompany param) {
+        Company entity = new Company();
+        if(param.getId() != null){
+            entity = this.getById(param.getId());
+            BeanUtils.copyProperties(param, entity);
+            entity.setUpdateTime(null);
+            this.updateById(entity);
+            return;
+        }
+
+        // 判断邮箱是否注册过
+        User userEntity = userService.getByUserName(param.getManagerPhone());
+        if(!ObjectUtils.isEmpty(userEntity)){
+            throw new BusinessException(ResultCode.USER_EXIST);
+        }
+        entity.setState(1);
+        BeanUtils.copyProperties(param, entity);
+        entity.setAuditTime(new Date());
+        this.save(entity);
+
+        userEntity = new User();
+        userEntity.setPassword(SecurityUtil.MD5("Geosign123"));
+        userEntity.setUserName(param.getManagerPhone());
+        userEntity.setCompanyId(entity.getId());
+        userEntity.setNickName(param.getManagerName());
+        userEntity.setCreateTime(new Date());
+        userEntity.setUpdateTime(new Date());
+        userEntity.setRegisterTime(new Date());
+        userService.save(userEntity);
+
+        UserRole userRoleEntity = new UserRole();
+        userRoleEntity.setUserId(userEntity.getId());
+        userRoleEntity.setRoleId(6L);
+        userRoleService.save(userRoleEntity);
+
+        entity.setManagerId(userEntity.getId());
+        entity.setUpdateTime(null);
+        this.updateById(entity);
+    }
+
+    @Override
+    public void auditCompany(Company bo) {
+        if(bo == null || bo.getId() == null){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        Company companyEntity = this.getById(bo.getId());
+        if(ObjectUtils.isEmpty(companyEntity)){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        bo.setAuditTime(new Date());
+        String expirationDate = DateUtil.date2String(new Date(), DateUtil.YYYY_MM_DD_DATE_FORMAT);
+        bo.setExpirationTime(DateUtil.string2Date(expirationDate + " 23:59:59", null));
+        bo.setUpdateTime(null);
+        bo.setCreateTime(null);
+        this.updateById(bo);
+        // 等于审核通过
+        if(bo.getState() == 1){
+            // 发送企业认证通过邮件
+            User userEntity = userService.getById(companyEntity.getManagerId());
+            if(!ObjectUtils.isEmpty(userEntity)){
+                log.info("发送审核通过邮件:{}",userEntity.getUserName());
+                MailTemplate mailTemplate = mailTemplateService.getById(1);
+                Boolean mail = mailTemplateService.sendMail(userEntity.getUserName(), mailTemplate,null);
+                if(!mail){
+                    throw new BusinessException(ResultCode.MAIL_SEND_ERROR);
+                }
+            }
+        }
+
+    }
+
+    @Override
+    public void addPoint(Long id, Integer point) {
+        Company company = getById(id);
+        if(company == null){
+            throw new BusinessException(ResultCode.NOT_RECORD);
+        }
+        point = company.getPoint() + point;
+        if (point < 0) {
+            throw new BusinessException(ResultCode.POINT_GT_ZERO);
+        }
+        LambdaUpdateWrapper<Company> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(Company::getId,id);
+        wrapper.set(Company::getPoint,point);
+        this.update(wrapper);
+    }
+
+    @Override
+    public void checkDevice(String childName) {
+        Camera instance = cameraService.findByChildName(childName);
+        if(ObjectUtils.isEmpty(instance) || !ObjectUtils.isEmpty(instance.getActivatedTime())){
+            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
+        }
+    }
+
+    @Override
+    public PageInfo<ResponseCompany> companyList(RequestCompany param) {
+        MPJLambdaWrapper<Company> wrapper = new MPJLambdaWrapper<Company>()
+                .selectAll(Company.class)
+                .leftJoin(User.class,User::getId,Company::getManagerId);
+        if(!StringUtils.isEmpty(param.getManagerName())){
+            wrapper.like(User::getUserName,param.getUserName());
+        }
+        Page<Company> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+
+        List<ResponseCompany> list = page.getRecords().stream().map(entity->{
+            ResponseCompany company = new ResponseCompany();
+            BeanUtils.copyProperties(entity,company);
+            if(entity.getManagerId() != null){
+                User userEntity = userService.getById(entity.getManagerId());
+                if(userEntity != null){
+                    company.setManagerName(userEntity.getUserName());
+                    company.setManagerPhone(userEntity.getUserName());
+                }
+            }
+            company.setSceneNum(0);
+            List<User> users = userService.findByCompanyId(company.getId());
+            company.setTotalSubNum(company.getSubNum());
+            // 去除企业账号
+            company.setSubNum(users.size());
+            if (users.size() > 0) {
+                company.setSubNum(users.size() - 1);
+            }
+            List<Long> userIds = users.stream().map(User::getId).collect(Collectors.toList());
+            if(!CollectionUtils.isEmpty(userIds)){
+                Long sceneNum = sceneProService.getCountByUserIds(userIds);
+                company.setSceneNum(Math.toIntExact(sceneNum));
+            }
+            int cameraNum = cameraDetailService.findCountByCompanyId(company.getId());
+            company.setCameraNum(cameraNum);
+
+            return company;
+        }).collect(Collectors.toList());
+
+        Page<ResponseCompany> pageVo = new Page<>(param.getPageNum(),param.getPageSize());
+        pageVo.setRecords(list);
+        pageVo.setTotal(page.getTotal());
+        return PageInfo.PageInfo(pageVo);
+    }
+
+    @Override
+    public JSONObject selectCompanyByType(RequestCompany param) {
+        LambdaQueryWrapper<Company> wrapper = new LambdaQueryWrapper<>();
+        if(!StringUtils.isEmpty(param.getCompanyName())){
+            wrapper.eq(Company::getCompanyName,param.getCompanyName());
+        }
+        if(!StringUtils.isEmpty(param.getState())){
+            wrapper.eq(Company::getState,param.getState());
+        }
+        if(!ObjectUtils.isEmpty(param.getStartTime())){
+            String startTime = param.getStartTime().split(" ")[0]+" 00:00:00";
+            wrapper.ge(Company::getCreateTime,startTime);
+        }
+        if(!ObjectUtils.isEmpty(param.getUserName())){
+            List<User> nameList = userService.findByUserNameList(param.getUserName());
+            if(CollectionUtils.isEmpty(nameList)){
+                return new JSONObject();
+            }
+            List<Long> companyIds = nameList.stream().map(User::getCompanyId).collect(Collectors.toList());
+            wrapper.in(Company::getId,companyIds);
+        }
+        if(!ObjectUtils.isEmpty(param.getEndTime())){
+            String endTime = param.getEndTime().split(" ")[0]+" 23:59:59";
+            wrapper.le(Company::getCreateTime,endTime);
+        }
+        wrapper.orderByDesc(Company::getId);
+        Page<Company> page = this.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
+
+        List<ResponseCompany> list = page.getRecords().stream().map(entity->{
+            ResponseCompany company = new ResponseCompany();
+            BeanUtils.copyProperties(entity,company);
+            if(entity.getManagerId() != null){
+                User userEntity = userService.getById(entity.getManagerId());
+                if(userEntity != null){
+                    company.setManagerName(userEntity.getUserName());
+                    company.setManagerPhone(userEntity.getUserName());
+                }
+            }
+            company.setSceneNum(0);
+            return company;
+        }).collect(Collectors.toList());
+        JSONObject result = JSONObject.parseObject(JSONObject.toJSONString(param));
+        result.put("list",list);
+        return result;
+    }
+
+    @Override
+    public void saveSubUsers(RequestCompany bo) {
+        Company tbCompany = getById(bo.getId());
+        if(ObjectUtils.isEmpty(tbCompany)){
+            throw new BusinessException("企业数据查询失败");
+        }
+        // 更新子账号数量
+        tbCompany.setSubNum(bo.getSubNum());
+        tbCompany.setUpdateTime(null);
+        this.updateById(tbCompany);
+
+        Date currentDate = new Date();
+        List<User> oldUsers = userService.findByCompanyId(tbCompany.getId());
+        oldUsers = oldUsers.stream().filter(param -> param.getId() - tbCompany.getManagerId() != 0).collect(Collectors.toList());
+        // 获取编辑的子账号
+        oldUsers.stream().forEach(user -> {
+            bo.getSubUsers().stream().filter(param -> user.getId().equals(param.getId()))
+                    .filter(param -> !org.apache.commons.lang3.StringUtils.equals(param.getNickName(), user.getNickName()))
+                    .forEach(upUser -> {
+                                user.setNickName(upUser.getNickName());
+                                user.setUpdateTime(currentDate);
+                                userService.updateById(user);
+                            }
+                    );
+        });
+
+        // 获取解绑的子账号
+        oldUsers.stream().forEach(user -> {
+            if (bo.getSubUsers().stream().noneMatch(param -> user.getId().equals(param.getId()))) {
+                // 将场景重新绑定到企业账号下面
+                sceneProService.rebindUser(user.getId(),tbCompany.getManagerId());
+                userService.removeById(user.getId());
+            }
+        });
+        // 获取新增的子账号
+        bo.getSubUsers().stream().filter(user -> ObjectUtils.isEmpty(user.getId())).forEach(user -> {
+            // 获取用户是否存在
+            User userEntity = userService.findByUserName(user.getUserName());
+            if (!ObjectUtils.isEmpty(userEntity)) {
+                if (!ObjectUtils.isEmpty(userEntity.getCompanyId())) {
+                    throw new BusinessException(user.getUserName() + "已经被绑定,请确认!");
+                }
+            }else{
+                userEntity = new User();
+                userEntity.setRegisterTime(new Date());
+            }
+            userEntity.setPassword(SecurityUtil.MD5("Geosign123"));
+            userEntity.setUserName(user.getUserName());
+            userEntity.setCompanyId(tbCompany.getId());
+            userEntity.setNickName(user.getNickName());
+            userEntity.setCreateTime(currentDate);
+            userEntity.setUpdateTime(currentDate);
+            if (ObjectUtils.isEmpty(userEntity.getId())) {
+                userService.save(userEntity);
+            } else {
+                userService.updateById(userEntity);
+            }
+            // 保存用户员工角色
+            UserRole userRole = new UserRole();
+            userRole.setUserId(userEntity.getId());
+            userRole.setRoleId(8L);
+            userRoleService.save(userRole);
+
+        });
+    }
 }

+ 287 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/DownService.java

@@ -0,0 +1,287 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fdkankan.common.constant.SceneConstant;
+import com.fdkankan.manage_jp.common.DownloadStatusEnum;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.*;
+import com.fdkankan.manage_jp.exception.BusinessException;
+import com.fdkankan.manage_jp.httpClient.service.LaserService;
+import com.fdkankan.manage_jp.httpClient.vo.SSDownSceneVo;
+import com.fdkankan.manage_jp.service.*;
+import com.fdkankan.manage_jp.vo.response.DownVo;
+import com.fdkankan.manage_jp.vo.response.DownloadProcessVo;
+import com.fdkankan.redis.constant.RedisKey;
+import com.fdkankan.redis.util.RedisUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+@Slf4j
+public class DownService implements IDownService {
+
+    @Autowired
+    ISceneProService sceneProService;
+    @Autowired
+    ISceneProEditService sceneProEditService;
+    @Autowired
+    ISceneDownloadLogService sceneDownloadLogService;
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    ISceneEditInfoService sceneEditInfoService;
+    @Autowired
+    RedisUtil redisUtil;
+    @Autowired
+    LaserService laserService;
+
+
+    @Override
+    public DownVo checkDownLoad(String sceneNum, Integer isObj) {
+        if(StringUtils.isEmpty(sceneNum)){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        ScenePro scenePro = sceneProService.getByNum(sceneNum);
+        ScenePlus plus = scenePlusService.getByNum(sceneNum);
+        if(scenePro == null && plus == null){
+            throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
+        }
+        Integer sceneType = scenePro !=null ? scenePro.getSceneSource() : plus.getSceneSource();
+        log.info("checkDownLoad--sceneType:{},isObj:{}",sceneType,isObj);
+        if(sceneType == 4 && isObj !=1){ //深时场景
+            return SSCheckDownload(sceneNum);
+        }
+        SceneDownloadLog sceneDownloadLog;
+        int isUp = 0;
+        if(scenePro == null){
+            isUp = 1;
+        }
+        Integer sceneVersion = getSceneVersion(scenePro, plus);
+
+        sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,0,isUp);
+        DownVo downVo = new DownVo();
+        if(sceneDownloadLog != null){
+            downVo.setDownloadStatus(1);
+            return downVo;
+        }
+        sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,1,isUp);
+        //3下载过,并且没有修改过
+        if(sceneDownloadLog != null && sceneDownloadLog.getSceneVersion().intValue() == sceneVersion){
+            downVo.setDownloadStatus(3);
+            downVo.setDownloadUrl(sceneDownloadLog.getDownloadUrl());
+            return downVo;
+        }
+        //下载过,有更改
+        if(sceneDownloadLog != null){
+            String redisKey = RedisKey.PREFIX_DOWNLOAD_PROGRESS;
+            if(isUp == 1){
+                redisKey = RedisKey.PREFIX_DOWNLOAD_PROGRESS_V4;
+            }
+            downVo.setDownloadStatus(2);
+            redisUtil.del(String.format(redisKey,sceneNum));  // 清除旧的下载信息
+            return downVo;
+        }
+        return downVo;
+    }
+
+    private Integer getSceneVersion(ScenePro scenePro, ScenePlus scenePlus) {
+        Integer version = 0;
+        if(scenePro != null){
+            SceneProEdit proEdit = sceneProEditService.getByProId(scenePro.getId());
+            if(proEdit == null){
+                throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
+            }
+            version = proEdit.getVersion();
+        }
+        if(scenePro == null && scenePlus !=null){
+            SceneEditInfo sceneEditInfo = sceneEditInfoService.getByScenePlusId(scenePlus.getId());
+            if(sceneEditInfo == null){
+                throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
+            }
+            version = sceneEditInfo.getVersion();
+        }
+        return version;
+    }
+
+    @Override
+    public DownVo down(String sceneNum,Integer isObj) {
+        if(StringUtils.isEmpty(sceneNum) ){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        ScenePro scenePro = sceneProService.getByNum(sceneNum);
+        ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);
+        if(scenePro == null && scenePlus == null){
+            throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
+        }
+        Long userId = scenePro == null ? scenePlus.getUserId() : scenePro.getUserId();
+
+        Integer sceneType = scenePro !=null ? scenePro.getSceneSource() : scenePlus.getSceneSource();
+        log.info("down--sceneType:{},isObj:{}",sceneType,isObj);
+        if(sceneType == 4 && isObj !=1){ //深时场景
+            return SSDownload(sceneNum,userId);
+        }
+
+        DownVo downVo = new DownVo();
+        Integer sceneVersion = getSceneVersion(scenePro, scenePlus);
+
+        Map<String,String> params = new HashMap<>(2);
+        params.put("type","local");
+        params.put("sceneNum",sceneNum);
+        String redisKey = RedisKey.DOWNLOAD_TASK;
+        String sysVersion = "v3";
+        if(scenePro == null){
+            params.put("num",sceneNum);
+            redisKey = RedisKey.SCENE_DOWNLOADS_TASK_V4;
+            sysVersion = "v4";
+        }
+        redisUtil.lRightPush(redisKey, JSONObject.toJSONString(params));
+        SceneDownloadLog sceneDownloadLogEntity = new SceneDownloadLog();
+        sceneDownloadLogEntity.setUserId(userId);
+        sceneDownloadLogEntity.setSceneNum(sceneNum);
+        sceneDownloadLogEntity.setSceneVersion(sceneVersion);
+        sceneDownloadLogEntity.setStatus(0);
+        sceneDownloadLogEntity.setSysVersion(sysVersion);
+        sceneDownloadLogService.save(sceneDownloadLogEntity);
+        downVo.setDownloadStatus(1);
+        return downVo;
+    }
+
+    @Override
+    public DownloadProcessVo downloadProcess(String sceneNum, Integer isObj) {
+        if (StringUtils.isEmpty(sceneNum)) {
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        ScenePro scenePro = sceneProService.getByNum(sceneNum);
+        ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);
+        if(scenePro == null && scenePlus == null){
+            throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
+        }
+        Integer sceneType = scenePro !=null ? scenePro.getSceneSource() : scenePlus.getSceneSource();
+        log.info("downloadProcess--sceneType:{},isObj:{}",sceneType,isObj);
+        if(sceneType == 4 && isObj !=1){ //深时场景
+            return SSDownloadProcess(sceneNum);
+        }
+        String redisKey = RedisKey.PREFIX_DOWNLOAD_PROGRESS;
+        if(scenePro == null){
+            redisKey = RedisKey.PREFIX_DOWNLOAD_PROGRESS_V4;
+        }
+        // 获取下载进度
+        String result = redisUtil.get(String.format(redisKey,sceneNum));
+        if(StringUtils.isEmpty(result)){
+            return new DownloadProcessVo();
+        }
+        int isUp = 0;
+        if(scenePro == null){
+            isUp = 1;
+        }
+        SceneDownloadLog sceneDownloadLog = sceneDownloadLogService.getByStatusAndNum(sceneNum,0,isUp);
+
+        DownloadProcessVo downloadProcessVo = JSONObject.parseObject(result, DownloadProcessVo.class);
+
+        if(sceneDownloadLog != null){
+            switch (downloadProcessVo.getStatus()) {
+                case DownloadStatusEnum.DOWNLOAD_SUCCESS_CODE:
+                    String url = downloadProcessVo.getUrl();
+                    if (!StringUtils.isEmpty(url)) {
+                        sceneDownloadLog.setDownloadUrl(url);
+                        sceneDownloadLog.setStatus(1);
+                        break;
+                    }
+                case DownloadStatusEnum.DOWNLOAD_FAILED_CODE:
+                    sceneDownloadLog.setStatus(-1);
+                    break;
+            }
+            sceneDownloadLogService.updateById(sceneDownloadLog);
+        }
+        return downloadProcessVo;
+    }
+
+    /**
+     * status :离线包状态是否需要重新生成  0 未生成:1 不需要  2需要   3 生成中
+     */
+    private DownVo SSCheckDownload(String sceneNum) {
+        DownVo downVo = new DownVo();
+        SSDownSceneVo vo = laserService.downOfflineSceneStatus(sceneNum);
+        if(vo == null){
+            throw new BusinessException(ResultCode.SS_SCENE_DOWN_ERROR);
+        }
+        downVo.setDownloadStatus(0);
+        if(vo.getStatus() == 1){
+            downVo.setDownloadStatus(3);
+            downVo.setDownloadUrl(vo.getUrl());
+        }
+        if(vo.getStatus() == 2){
+            downVo.setDownloadStatus(2);
+        }
+        if(vo.getStatus() == 3){
+            downVo.setDownloadStatus(1);
+        }
+        return downVo;
+    }
+
+    /**
+     * downloadStatus -1下载失败  1下载成功
+     */
+    private DownVo SSDownload(String sceneNum,Long userId) {
+        DownVo downVo = new DownVo();
+
+        //status :0:正在生成 1,初次生成  2,已经生成直接下载 3,重新生成
+        SSDownSceneVo vo = laserService.downOfflineScene(sceneNum);
+        if(vo == null){
+            throw new BusinessException(ResultCode.SS_SCENE_DOWN_ERROR);
+        }
+
+        SceneDownloadLog sceneDownloadLogEntity = new SceneDownloadLog();
+        sceneDownloadLogEntity.setUserId(userId);
+        sceneDownloadLogEntity.setSceneNum(sceneNum);
+        sceneDownloadLogEntity.setSceneVersion(0);
+        sceneDownloadLogEntity.setStatus(0);
+        sceneDownloadLogEntity.setSysVersion("ss");
+        sceneDownloadLogService.save(sceneDownloadLogEntity);
+        downVo.setDownloadStatus(1);
+        return downVo;
+    }
+
+    public static HashMap<String,Integer> ssNumProcessNumMap = new HashMap<>();
+
+    private DownloadProcessVo SSDownloadProcess(String sceneNum) {
+        DownloadProcessVo downVo = new DownloadProcessVo();
+        SSDownSceneVo vo = laserService.downOfflineSceneStatus(sceneNum);
+        if(vo == null){
+            throw new BusinessException(ResultCode.SS_SCENE_DOWN_ERROR);
+        }
+        downVo.setStatus(1003);
+
+        if(vo.getStatus() == 0 || vo.getStatus() == 2 || vo.getStatus() == 3){    //下载中
+            ssNumProcessNumMap.merge(sceneNum, 1, Integer::sum);
+            Integer percent = ssNumProcessNumMap.get(sceneNum);
+            percent = percent /2;
+            if(percent >50){
+                percent = 50;
+            }
+            downVo.setStatus(1001);
+            downVo.setPercent(percent);
+        }
+        if(vo.getStatus() == 1){    //下载完成
+            ssNumProcessNumMap.remove(sceneNum);
+            downVo.setPercent(100);
+            downVo.setUrl(vo.getUrl());
+            downVo.setStatus(1002);
+
+            LambdaUpdateWrapper<SceneDownloadLog> wrapper = new LambdaUpdateWrapper<>();
+            wrapper.eq(SceneDownloadLog::getSceneNum,sceneNum);
+            wrapper.eq(SceneDownloadLog::getStatus,0);
+            wrapper.set(SceneDownloadLog::getDownloadUrl,vo.getUrl());
+            wrapper.set(SceneDownloadLog::getStatus,1);
+            sceneDownloadLogService.update(wrapper);
+        }
+        return downVo;
+    }
+
+}

+ 31 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/MailTemplateServiceImpl.java

@@ -0,0 +1,31 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.MailTemplate;
+import com.fdkankan.manage_jp.exception.BusinessException;
+import com.fdkankan.manage_jp.mapper.IMailTemplateMapper;
+import com.fdkankan.manage_jp.service.IMailTemplateService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.util.SendMailUtils;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Service
+public class MailTemplateServiceImpl extends ServiceImpl<IMailTemplateMapper, MailTemplate> implements IMailTemplateService {
+
+    @Override
+    public Boolean sendMail(String email , MailTemplate mailTemplate, String file) {
+        if(mailTemplate == null){
+            throw new BusinessException(ResultCode.MAIL_TEMPLATE_ERROR);
+        }
+        return SendMailUtils.sendMail(mailTemplate.getSendMail(), mailTemplate.getSendPassword(), mailTemplate.getSendHost(),
+                email, mailTemplate.getSubject(), mailTemplate.getMsg(), file);
+    }
+}

+ 20 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/RoleServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.fdkankan.manage_jp.entity.Role;
+import com.fdkankan.manage_jp.mapper.IRoleMapper;
+import com.fdkankan.manage_jp.service.IRoleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 角色表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-04
+ */
+@Service
+public class RoleServiceImpl extends ServiceImpl<IRoleMapper, Role> implements IRoleService {
+
+}

+ 40 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/SceneDownloadLogServiceImpl.java

@@ -0,0 +1,40 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.manage_jp.entity.SceneDownloadLog;
+import com.fdkankan.manage_jp.mapper.ISceneDownloadLogMapper;
+import com.fdkankan.manage_jp.service.ISceneDownloadLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Service
+public class SceneDownloadLogServiceImpl extends ServiceImpl<ISceneDownloadLogMapper, SceneDownloadLog> implements ISceneDownloadLogService {
+
+    @Override
+    public SceneDownloadLog getByStatusAndNum(String sceneNum, Integer status,Integer isUp) {
+        LambdaQueryWrapper<SceneDownloadLog> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneDownloadLog::getSceneNum,sceneNum);
+        wrapper.eq(SceneDownloadLog::getStatus,status);
+        String sysVersion = "v3";
+        if(isUp == 1){
+            sysVersion = "v4";
+        }
+        wrapper.eq(SceneDownloadLog::getSysVersion,sysVersion);
+        wrapper.orderByDesc(SceneDownloadLog::getCreateTime);
+        List<SceneDownloadLog> list = this.list(wrapper);
+        if(list != null && list.size() >0){
+            return list.get(0);
+        }
+        return null;
+    }
+}

+ 25 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/SceneEditInfoServiceImpl.java

@@ -0,0 +1,25 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.manage_jp.entity.SceneEditInfo;
+import com.fdkankan.manage_jp.mapper.ISceneEditInfoMapper;
+import com.fdkankan.manage_jp.service.ISceneEditInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Service
+public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper, SceneEditInfo> implements ISceneEditInfoService {
+    @Override
+    public SceneEditInfo getByScenePlusId(Long plusId) {
+        return this.getOne(new LambdaQueryWrapper<SceneEditInfo>()
+                .eq(SceneEditInfo::getScenePlusId, plusId));
+    }
+}

+ 20 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/ScenePlusExtServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.fdkankan.manage_jp.entity.ScenePlusExt;
+import com.fdkankan.manage_jp.mapper.IScenePlusExtMapper;
+import com.fdkankan.manage_jp.service.IScenePlusExtService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Service
+public class ScenePlusExtServiceImpl extends ServiceImpl<IScenePlusExtMapper, ScenePlusExt> implements IScenePlusExtService {
+
+}

+ 33 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/ScenePlusServiceImpl.java

@@ -0,0 +1,33 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.manage_jp.entity.ScenePlus;
+import com.fdkankan.manage_jp.mapper.IScenePlusMapper;
+import com.fdkankan.manage_jp.service.IScenePlusService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 场景主表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Service
+public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlus> implements IScenePlusService {
+
+    @Override
+    public ScenePlus getByNum(String sceneNum) {
+        LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ScenePlus::getNum,sceneNum);
+        List<ScenePlus> list = this.list(wrapper);
+        if(list!=null && list.size() >0){
+            return list.get(0);
+        }
+        return null;
+    }
+}

+ 33 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/SceneProEditServiceImpl.java

@@ -0,0 +1,33 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.manage_jp.entity.SceneProEdit;
+import com.fdkankan.manage_jp.mapper.ISceneProEditMapper;
+import com.fdkankan.manage_jp.service.ISceneProEditService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * pro场景编辑数据表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-01-05
+ */
+@Service
+public class SceneProEditServiceImpl extends ServiceImpl<ISceneProEditMapper, SceneProEdit> implements ISceneProEditService {
+
+    @Override
+    public SceneProEdit getByProId(Long proId) {
+        LambdaQueryWrapper<SceneProEdit> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SceneProEdit::getProId,proId);
+        List<SceneProEdit> list = this.list(wrapper);
+        if(list != null && list.size() >0){
+            return list.get(0);
+        }
+        return null;
+    }
+}

+ 112 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/SceneProServiceImpl.java

@@ -0,0 +1,112 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.manage_jp.common.PageInfo;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.ScenePlus;
+import com.fdkankan.manage_jp.entity.ScenePro;
+import com.fdkankan.manage_jp.entity.SceneProEdit;
+import com.fdkankan.manage_jp.exception.BusinessException;
+import com.fdkankan.manage_jp.httpClient.service.LaserService;
+import com.fdkankan.manage_jp.mapper.ISceneProMapper;
+import com.fdkankan.manage_jp.service.IScenePlusService;
+import com.fdkankan.manage_jp.service.ISceneProEditService;
+import com.fdkankan.manage_jp.service.ISceneProService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.vo.request.SceneParam;
+import com.fdkankan.manage_jp.vo.response.SceneVo;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * pro场景表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-30
+ */
+@Service
+public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro> implements ISceneProService {
+
+    @Autowired
+    IScenePlusService scenePlusService;
+    @Autowired
+    LaserService laserService;
+    @Autowired
+    ISceneProEditService sceneProEditService;
+
+
+    @Override
+    public Long getCountByUserIds(List<Long> userIds) {
+        LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(ScenePro::getUserId,userIds);
+        wrapper.eq(ScenePro::getIsUpgrade,0);
+        long count = this.count(wrapper);
+
+        LambdaQueryWrapper<ScenePlus> wrapper2 = new LambdaQueryWrapper<>();
+        wrapper2.in(ScenePlus::getUserId,userIds);
+        long count2 = scenePlusService.count(wrapper2);
+        return count + count2;
+    }
+
+    @Override
+    public void rebindUser(Long fromUserId, Long toUserId) {
+        LambdaUpdateWrapper<ScenePro> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(ScenePro::getUserId,fromUserId);
+        wrapper.set(ScenePro::getUserId,toUserId);
+        this.update(wrapper);
+
+        LambdaUpdateWrapper<ScenePlus> wrapper2 = new LambdaUpdateWrapper<>();
+        wrapper2.eq(ScenePlus::getUserId,fromUserId);
+        wrapper2.set(ScenePlus::getUserId,toUserId);
+        scenePlusService.update(wrapper2);
+    }
+
+    @Override
+    public Object pageList(SceneParam param) {
+        if(param.getType() == 2){  //深时
+            return laserService.pageList(param);
+        }
+        Page<SceneVo> page = this.getBaseMapper().pageList(new Page<>(param.getPage(),param.getLimit()),param);
+        return PageInfo.PageInfo(page);
+    }
+
+    @Override
+    public ScenePro getByNum(String num) {
+        LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ScenePro::getNum,num);
+        wrapper.eq(ScenePro::getIsUpgrade,0);
+        List<ScenePro> list = this.list(wrapper);
+        if(list == null || list.size() <=0){
+            return null;
+        }
+        return list.get(0);
+    }
+
+    @Override
+    public void addDownloadNum(String sceneNum) {
+        if(StringUtils.isBlank(sceneNum)){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        ScenePro scenePro = this.getByNum(sceneNum);
+        if(scenePro != null){
+            SceneProEdit sceneProEditEntity = sceneProEditService.getByProId(scenePro.getId());
+            if(sceneProEditEntity.getDownloadNum() == null){
+                sceneProEditEntity.setDownloadNum(1);
+            }else{
+                sceneProEditEntity.setDownloadNum(sceneProEditEntity.getDownloadNum() + 1);
+            }
+            sceneProEditService.updateById(sceneProEditEntity);
+        }
+
+    }
+}

+ 45 - 0
src/main/java/com/fdkankan/manage_jp/service/impl/UserRoleServiceImpl.java

@@ -0,0 +1,45 @@
+package com.fdkankan.manage_jp.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.entity.UserRole;
+import com.fdkankan.manage_jp.mapper.IUserRoleMapper;
+import com.fdkankan.manage_jp.service.IUserRoleService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.service.IUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 用户角色关系表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2022-12-23
+ */
+@Service
+public class UserRoleServiceImpl extends ServiceImpl<IUserRoleMapper, UserRole> implements IUserRoleService {
+
+    @Autowired
+    IUserService userService;
+
+    @Override
+    public List<UserRole> getByUserId(Long userId) {
+        LambdaQueryWrapper<UserRole> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(UserRole::getUserId,userId);
+        return this.list(wrapper);
+    }
+
+
+    @Override
+    public Set<Long> getByUser(User user) {
+        List<UserRole> userRoles = this.getByUserId(user.getId());
+        return userRoles.stream().map(UserRole::getRoleId).collect(Collectors.toSet());
+    }
+}

+ 184 - 1
src/main/java/com/fdkankan/manage_jp/service/impl/UserServiceImpl.java

@@ -1,20 +1,203 @@
 package com.fdkankan.manage_jp.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fdkankan.common.util.Base64Converter;
+import com.fdkankan.common.util.JwtUtil;
+import com.fdkankan.common.util.PasswordUtils;
+import com.fdkankan.common.util.SecurityUtil;
+import com.fdkankan.manage_jp.common.PageInfo;
+import com.fdkankan.manage_jp.common.ResultCode;
+import com.fdkankan.manage_jp.entity.Company;
+import com.fdkankan.manage_jp.entity.Role;
 import com.fdkankan.manage_jp.entity.User;
+import com.fdkankan.manage_jp.entity.UserRole;
+import com.fdkankan.manage_jp.exception.BusinessException;
 import com.fdkankan.manage_jp.mapper.IUserMapper;
+import com.fdkankan.manage_jp.service.ICompanyService;
+import com.fdkankan.manage_jp.service.IRoleService;
+import com.fdkankan.manage_jp.service.IUserRoleService;
 import com.fdkankan.manage_jp.service.IUserService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fdkankan.manage_jp.util.PasswordUtil;
+import com.fdkankan.manage_jp.vo.request.LoginParam;
+import com.fdkankan.manage_jp.vo.request.RequestCompany;
+import com.fdkankan.manage_jp.vo.request.UserListParam;
+import com.fdkankan.manage_jp.vo.request.UserParam;
+import com.fdkankan.manage_jp.vo.response.LoginVo;
+import com.fdkankan.manage_jp.vo.response.UserVo;
+import com.fdkankan.redis.constant.RedisKey;
+import com.fdkankan.redis.util.RedisUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
 /**
  * <p>
  * 用户信息表 服务实现类
  * </p>
  *
  * @author 
- * @since 2022-12-22
+ * @since 2022-12-23
  */
 @Service
 public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements IUserService {
 
+    @Autowired
+    ICompanyService companyService;
+    @Autowired
+    private RedisUtil redisUtil;
+    @Autowired
+    IUserRoleService userRoleService;
+    @Autowired
+    IRoleService roleService;
+
+    @Override
+    public User getByUserName(String managerPhone) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(User::getUserName,managerPhone);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public PageInfo getPageByCompany(RequestCompany bo) {
+        Company company = companyService.getById(bo.getId());
+        if(company == null){
+            throw new BusinessException(ResultCode.NOT_RECORD);
+        }
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(User::getCompanyId,bo.getId());
+        wrapper.ne(User::getId,company.getManagerId());
+        if(StringUtils.isNotBlank(bo.getUserName())){
+            wrapper.like(User::getUserName,bo.getUserName());
+        }
+        Page<User> page = this.page(new Page<>(bo.getPageNum(), bo.getPageSize()), wrapper);
+        for (User record : page.getRecords()) {
+            record.setPassword(null);
+        }
+
+        return PageInfo.PageInfo(page);
+    }
+
+    @Override
+    public User findByUserName(String phoneNum) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(User::getUserName,phoneNum);
+        return this.getOne(wrapper);
+    }
+
+    @Override
+    public List<User> findByCompanyId(Long id) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(User::getCompanyId,id);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public List<User> findByUserNameList(String userName) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        wrapper.like(User::getUserName,userName);
+        return this.list(wrapper);
+    }
+
+    public LoginVo login(LoginParam param) {
+        if (StringUtils.isEmpty(param.getPassword()) || StringUtils.isEmpty(param.getPhoneNum())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        String password = Base64Converter.decode(Base64Converter.subText(param.getPassword()));
+        String passwordCode = SecurityUtil.MD5(password);
+        User user = this.getByUserName(param.getPhoneNum());
+        if(user == null){
+            throw new BusinessException(ResultCode.USER_NOT_EXIST);
+        }
+        if(!user.getPassword().equals(passwordCode)){
+            throw new BusinessException(ResultCode.PASSWORD_ERROR);
+        }
+        String token = this.redisLogin(user.getUserName(), JSONObject.toJSONString(user),"user");
+        UserVo userVo = getUserVo(user);
+        LoginVo vo = new LoginVo();
+        vo.setToken(token);
+        vo.setUser(userVo);
+        return vo;
+    }
+
+    public String redisLogin(String userName,String value,String loginType){
+        String token = JwtUtil.createJWT(-1,userName,loginType);
+        String redisKey = String.format(RedisKey.TOKEN_V3,token);
+        redisUtil.set(redisKey, value,2 * 60 * 60);
+        return token;
+    }
+
+    @Override
+    public Object getUserInfo(String username) {
+        User user = this.getByUserName(username);
+        return getUserVo(user);
+    }
+    private UserVo getUserVo(User user){
+        UserVo userVo = new UserVo();
+        BeanUtils.copyProperties(user,userVo);
+        List<UserRole> userRoles = userRoleService.getByUserId(userVo.getId());
+        Set<Long> roleIds = userRoles.stream().map(UserRole::getRoleId).collect(Collectors.toSet());
+        userVo.setRoleIds(roleIds);
+        return userVo;
+    }
+
+    @Override
+    public Object pageList(UserListParam param) {
+        LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>();
+        if(StringUtils.isNotBlank(param.getPhoneNum())){
+            wrapper.like(User::getUserName,param.getPhoneNum());
+        }
+        wrapper.orderByDesc(User::getCreateTime);
+        Page<User> page = this.page(new Page<>(param.getPage(), param.getLimit()), wrapper);
+        List<UserVo> userVos = new ArrayList<>();
+        for (User record : page.getRecords()) {
+            UserVo vo = new UserVo();
+            BeanUtils.copyProperties(record,vo);
+            List<UserRole> userRoleList = userRoleService.getByUserId(record.getId());
+            if(userRoleList.size() >0){
+                Role role = roleService.getById(userRoleList.get(0).getRoleId());
+                vo.setRoleName(role.getRoleName());
+            }
+            userVos.add(vo);
+        }
+        Page<UserVo> pageVo = new Page<>(param.getPage(),param.getLimit());
+        pageVo.setTotal(page.getTotal());
+        pageVo.setRecords(userVos);
+        return PageInfo.PageInfo(pageVo);
+    }
+
+    @Override
+    public void updatePassword(UserParam param) {
+        if(param.getId() == null || StringUtils.isBlank(param.getNewPassword())){
+            throw new BusinessException(ResultCode.PARAM_ERROR);
+        }
+        if(StringUtils.isNotBlank(param.getPassword())){
+            String oldPassword = Base64Converter.decode(Base64Converter.subText(param.getNewPassword()));
+            String passwordOldCode = SecurityUtil.MD5(oldPassword);
+            User user = this.getById(param.getId());
+            if(!user.getPassword().equals(passwordOldCode)){
+                throw new BusinessException(ResultCode.OLD_PASSWORD_ERROR);
+            }
+        }
+        String password = Base64Converter.decode(Base64Converter.subText(param.getNewPassword()));
+        if(!PasswordUtil.checkPasswordFormal(password)){
+            throw new BusinessException(ResultCode.PASSWORD_TYPE_ERROR);
+        }
+        String passwordCode = SecurityUtil.MD5(password);
+
+        LambdaUpdateWrapper<User> wrapper = new LambdaUpdateWrapper<>();
+        wrapper.eq(User::getId,param.getId());
+        wrapper.set(User::getPassword,passwordCode);
+        this.update(wrapper);
+
+    }
 }

+ 17 - 0
src/main/java/com/fdkankan/manage_jp/util/PasswordUtil.java

@@ -0,0 +1,17 @@
+package com.fdkankan.manage_jp.util;
+
+public class PasswordUtil {
+
+    /**
+     * 校验密码格式 8-16个字符,不包含空格,必须包含数字,字母或字符至少两种
+     *
+     * @param value
+     * @return
+     * @author Super WD
+     */
+    public static boolean checkPasswordFormal(String value) {
+        String regex = "^(?=.*\\d)(?!^[0-9]+$)(?!^[A-z]+$)(?!^[^A-z0-9]+$)^[^\\s\\u4e00-\\u9fa5]{8,16}";
+        return value.matches(regex);
+    }
+
+}

+ 95 - 0
src/main/java/com/fdkankan/manage_jp/util/SendMailUtils.java

@@ -0,0 +1,95 @@
+package com.fdkankan.manage_jp.util;
+
+import com.sun.mail.util.MailSSLSocketFactory;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.activation.DataHandler;
+import javax.activation.DataSource;
+import javax.activation.FileDataSource;
+import javax.mail.*;
+import javax.mail.internet.*;
+import java.util.Properties;
+
+/**
+ * Created by Hb_zzZ on 2020/3/16.
+ */
+public class SendMailUtils {
+
+
+    /**
+     * 发送带附件的邮件
+     * @param  from      发件人
+     * @param  pass      发件人密码
+     * @param  host      发件人主机
+     * @param receive    收件人
+     * @param subject    邮件主题
+     * @param msg        邮件内容
+     * @param filename   附件地址
+     *
+     */
+    public static boolean sendMail(String from,String pass,String host,
+                                   String receive, String subject, String msg, String filename) {
+        if (StringUtils.isEmpty(receive)) {
+            return false;
+        }
+        try {
+            // 获取系统属性
+            Properties properties = System.getProperties();
+            // 设置邮件服务器
+            properties.setProperty("mail.smtp.host", host);
+            properties.setProperty("mail.debug", "true");
+            properties.put("mail.smtp.auth", "true");
+            MailSSLSocketFactory sf = new MailSSLSocketFactory();
+            sf.setTrustAllHosts(true);
+            properties.put("mail.smtp.ssl.enable", "true");
+            properties.put("mail.smtp.ssl.socketFactory", sf);
+            // 获取默认session对象
+            Session session = Session.getDefaultInstance(properties, new Authenticator() {
+                public PasswordAuthentication getPasswordAuthentication() { // qq邮箱服务器账户、第三方登录授权码
+                    return new PasswordAuthentication(from, pass); // 发件人邮件用户名、密码
+                }
+            });
+            // 创建默认的 MimeMessage 对象
+            MimeMessage message = new MimeMessage(session);
+            // Set From: 头部头字段
+            message.setFrom(new InternetAddress(from));
+            // Set To: 头部头字段
+            message.addRecipient(Message.RecipientType.TO, new InternetAddress(receive));
+            // Set Subject: 主题文字
+            message.setSubject(subject);
+            // 创建消息部分
+            BodyPart messageBodyPart = new MimeBodyPart();
+            // 消息
+            messageBodyPart.setText(msg);
+            // 创建多重消息
+            MimeMultipart multipart = new MimeMultipart("mixed");
+
+            if(StringUtils.isNotEmpty(filename)){
+                // 附件部分
+                messageBodyPart = new MimeBodyPart();
+                // 设置要发送附件的文件路径
+                DataSource source = new FileDataSource(filename);
+                messageBodyPart.setDataHandler(new DataHandler(source));
+                // messageBodyPart.setFileName(filename);
+                // 处理附件名称中文(附带文件路径)乱码问题
+                messageBodyPart.setFileName(MimeUtility.encodeText(filename));
+                multipart.addBodyPart(messageBodyPart);
+            }
+            //html代码部分
+            MimeBodyPart htmlPart = new MimeBodyPart();
+            multipart.addBodyPart(htmlPart);
+            //html代码
+            htmlPart.setContent(msg, "text/html;charset=utf-8");
+            // 发送完整消息
+            message.setContent(multipart);
+            // 发送消息
+            Transport.send(message, new  Address[]{new InternetAddress(receive)});
+            // System.out.println("Sent message successfully....");
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+}

+ 20 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/CameraAddParam.java

@@ -0,0 +1,20 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CameraAddParam {
+    private String address;
+    private Integer cameraType;
+    private String childName;
+    private Integer own;
+    private String snCode;
+    private String wifiName;
+
+    private Integer cameraId;
+    private List<String> childNames;
+    private Integer companyId;
+
+}

+ 10 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/CameraListParam.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import lombok.Data;
+
+@Data
+public class CameraListParam {
+    private Integer page = 1;
+    private Integer limit = 20;
+    private String searchKey;
+}

+ 10 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/LoginParam.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import lombok.Data;
+
+@Data
+public class LoginParam {
+    private String phoneNum;        //用户名
+    private String password;        //密码
+    private Boolean rememberMe;
+}

+ 94 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/RequestCamera.java

@@ -0,0 +1,94 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import com.fdkankan.manage_jp.common.RequestBase;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class RequestCamera extends RequestBase implements Serializable {
+
+    private static final long serialVersionUID = 5251625920621810844L;
+
+    private Long cameraId;
+
+    private String userName;
+
+    private String childName;
+
+    private List<String> childNames;
+
+    private String childPassword;
+
+    private String snCode;
+
+    private String wifiName;
+
+    private String balance;
+
+    private String own;
+
+    private String orderSn;
+
+    private String startDate;
+
+    private String endDate;
+    // 0-充值记录,1-消费记录
+    private Integer type;
+
+    private String searchKey;
+    //充值类型
+    private int body;
+
+    private int points;
+    // 支付类型,0表示微信,1表示支付宝,2表示paypal
+    private int payType;
+
+    private Integer cameraType;
+
+    private Long userId;
+    // 0表示国内订单,1表示国外订单
+    private Integer abroad;
+
+    private Integer dateType;
+
+    private String ids;
+
+    //月份
+    private Integer month;
+
+    //容量G位单位
+    private Integer space;
+
+    /**
+     * 企业表t_company的id
+     */
+    private Long companyId;
+
+    private String recStatus;
+
+    private String address;
+
+    private String resourceIds;
+
+    private Long agentFrameworkId;
+
+    private Long userIncrementId;
+
+    /**
+     * 权益类型Id
+     */
+    private Long incrementTypeId;
+
+    private String sceneType;
+
+    private String startTime;
+
+    private String endTime;
+
+    private String selecttype;
+
+    private Integer subNum;
+
+}

+ 63 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/RequestCompany.java

@@ -0,0 +1,63 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import com.fdkankan.manage_jp.common.RequestBase;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class RequestCompany extends RequestBase {
+
+    private Long id;
+
+    private String companyName;
+
+    private String managerName;
+
+    private String managerPhone;
+
+    private String password;
+
+    private String topLogo;
+
+    private String logo;
+
+    private String introduce;
+
+    private String address;
+
+    private String markerLogo;
+
+    private String floorLogo;
+
+    private String qrLogo;
+
+    private Integer showLogo;
+
+    private String sceneLogo;
+
+    private Long managerId;
+
+    private Integer cameraDelete;
+
+    private Integer state;
+
+    private Integer point;
+
+    private String userName;
+
+    private String bgMusic;
+
+    private Integer subNum;
+
+    private String endTime;
+
+    private String startTime;
+
+    private String authCode;
+
+    /**
+     * 子账号
+     */
+    private List<RequestUser> subUsers;
+}

+ 94 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/RequestUser.java

@@ -0,0 +1,94 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import com.fdkankan.manage_jp.common.RequestBase;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+
+public class RequestUser extends RequestBase implements Serializable {
+    private static final long serialVersionUID = 4835988280504608525L;
+
+
+    private Long userId;
+
+    private int status;
+
+    private String password;
+
+    private String confirmPwd;
+
+    private String randomcode;
+
+    private String phoneNum;
+
+    private String userName;
+
+    private String msgAuthCode;
+
+    private String imgdata;
+
+    private String areaNum;
+
+    private String nickName;
+
+    private String country;
+
+    private boolean rememberMe = false;
+    //扫码登录凭证
+    private String uuid;
+
+    private String appUserName;
+
+    private String appPassword;
+
+    private String province;
+
+    private String city;
+    //收货地址
+    private String shipAddress;
+    //收货地址
+    private String shipAreaPath;
+    //收货人手机号
+    private String shipMobile;
+    //收货姓名
+    private String shipName;
+
+    private String email;
+
+    private String startDate;
+
+    private String endDate;
+
+    private String searchKey;
+
+    private String sceneNum;
+
+    private String unicode;
+
+    private String head;
+
+    private Integer cameraType;
+
+    private Long cameraId;
+
+    private Integer isNotice;
+
+    private Long id;
+
+    private Long companyId;
+
+    private Integer setDefault;
+
+    private String orderBy;
+
+    private Integer sceneType;
+
+    private String sceneName;
+
+    private String downloadUrl;
+
+    private Boolean isTiles;
+
+}

+ 23 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/SceneParam.java

@@ -0,0 +1,23 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class SceneParam {
+    private Integer page = 1;
+    private Integer limit = 20;
+    private String childName;
+    private String companyName;
+    private String sceneName;
+
+    private Long companyId;
+
+    private Long userId;
+
+    private Integer type = 0;
+    private List<String> snCodes;
+    private String snCode;
+    private String userName;
+}

+ 10 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/UserListParam.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import lombok.Data;
+
+@Data
+public class UserListParam {
+    private Integer page = 1;
+    private Integer limit = 20;
+    private String phoneNum;
+}

+ 10 - 0
src/main/java/com/fdkankan/manage_jp/vo/request/UserParam.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage_jp.vo.request;
+
+import lombok.Data;
+
+@Data
+public class UserParam {
+    private Integer id;
+    private String newPassword;
+    private String password;
+}

+ 9 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/DownVo.java

@@ -0,0 +1,9 @@
+package com.fdkankan.manage_jp.vo.response;
+
+import lombok.Data;
+
+@Data
+public class DownVo {
+    private Integer downloadStatus = 0;     //0未下载过,1打包资源下载,2已下载过,3下载过,并且没有修改过,无需打包直接返回下载地址,-1没下载次数不足
+    private String downloadUrl;         //下载连击
+}

+ 10 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/DownloadProcessVo.java

@@ -0,0 +1,10 @@
+package com.fdkankan.manage_jp.vo.response;
+
+import lombok.Data;
+
+@Data
+public class DownloadProcessVo {
+    private Integer status = 1000;
+    private String url;
+    private Integer percent = 0;
+}

+ 9 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/LoginVo.java

@@ -0,0 +1,9 @@
+package com.fdkankan.manage_jp.vo.response;
+
+import lombok.Data;
+
+@Data
+public class LoginVo {
+    private String token;
+    private UserVo user;
+}

+ 133 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/ResponseCamera.java

@@ -0,0 +1,133 @@
+package com.fdkankan.manage_jp.vo.response;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class ResponseCamera implements Serializable {
+
+    private static final long serialVersionUID = -8445289048065283322L;
+
+    private Long id;
+
+
+    private String userName;
+
+
+    private Date activatedTime;
+
+
+    private String childName;
+
+
+    private String balance;
+
+
+    private String goodsName;
+
+
+    private String imageUrl;
+
+
+    private String pic;
+
+
+    private int own;
+
+
+    private String usedSpaceStr;
+
+
+    private String totalSpaceStr;
+
+
+    private double usedSpace;
+
+
+    private double totalSpace;
+
+
+    private Integer type;
+
+
+    private String wifiName;
+
+
+    private String cameraType;
+
+
+    private String spaceEndTime;
+
+    private String spaceContent;
+
+
+    private int country;
+
+
+    private String snCode;
+
+
+    private Long goodsId;
+
+
+    private String spaceEndStr;
+
+
+    private Long space;
+
+
+    private String spaceStr;
+
+
+    private Boolean isExpire;
+
+
+    private String nickName;
+
+
+    private Long spaceId;
+
+
+    private Long userId;
+
+
+    private String orderSn;
+
+
+    private String agentName;
+
+
+    private Date inTime;
+
+
+    private Date outTime;
+
+    private Long companyId;
+
+    private String companyName;
+
+    private String recStatus;
+
+    private String address;
+
+    private Date createTime;
+
+    private Long cooperationUser;
+
+    private String cooperationUserName;
+
+    private Integer sceneNum;
+
+    private Date lastTime;
+
+    private Long agentFrameworkId;
+
+    private String agentFrameworkName;
+
+    private Integer surplusDate;
+
+    private Long userIncrementId;
+
+}

+ 69 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/ResponseCompany.java

@@ -0,0 +1,69 @@
+package com.fdkankan.manage_jp.vo.response;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * Created by Hb_zzZ on 2020/9/25.
+ */
+@Data
+public class ResponseCompany {
+
+    private Long id;
+
+    private String companyName;
+
+    private String topLogo;
+
+    private String floorLogo;
+
+    private String qrLogo;
+
+    private Integer showLogo;
+
+    private String sceneLogo;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private String recStatus;
+
+    private String markerLogo;
+
+    private String managerName;
+
+    private String managerPhone;
+
+    private Integer cameraNum;
+
+    private Integer subNum;
+
+    private Integer totalSubNum;
+
+    private Integer sceneNum;
+
+    private Integer point;
+
+    private String expirationTime;
+
+    private String bgMusic;
+
+    private String area;
+
+    private String address;
+
+    private String website;
+
+    private String introduce;
+
+    private String logo;
+
+    private String qualification;
+
+    private String state;
+
+    private Date auditTime;
+
+}

+ 25 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/SceneVo.java

@@ -0,0 +1,25 @@
+package com.fdkankan.manage_jp.vo.response;
+
+import lombok.Data;
+
+@Data
+public class SceneVo {
+    private String sceneName;       //场景标题
+    private String num;             //场景码
+    private String createTime;      //拍摄时间
+    private String snCode;          //相机sn码
+    private String sceneSize;       //场景大小
+    private Boolean isCopy = false;          //是否复制
+    private String copyTime;        //复制时间
+    private String userName;        //绑定账号
+    private Integer viewCount;      //浏览量
+    private Integer status;         //状态
+    private String statusString;    //中文状态
+    private Integer payStatus;      //
+    private String sceneVersion;   //场景版本
+
+    private String thumb;           //场景链接
+
+    private String algorithmTime;  //v4场景计算完成时间
+
+}

+ 0 - 0
src/main/java/com/fdkankan/manage_jp/vo/response/UserVo.java


Some files were not shown because too many files changed in this diff