lyhzzz 2 vuotta sitten
vanhempi
commit
0c1b599b07
49 muutettua tiedostoa jossa 316 lisäystä ja 249 poistoa
  1. 21 0
      src/main/java/com/fdkankan/manage/common/ExcelErrorUtil.java
  2. 42 2
      src/main/java/com/fdkankan/manage/common/ResultCode.java
  3. 7 7
      src/main/java/com/fdkankan/manage/config/SaTokenConfigure.java
  4. 4 4
      src/main/java/com/fdkankan/manage/config/StpInterfaceImpl.java
  5. 3 3
      src/main/java/com/fdkankan/manage/controller/AppFileController.java
  6. 3 3
      src/main/java/com/fdkankan/manage/controller/BuryPointController.java
  7. 3 3
      src/main/java/com/fdkankan/manage/controller/CameraController.java
  8. 3 3
      src/main/java/com/fdkankan/manage/controller/CameraOrderController.java
  9. 3 3
      src/main/java/com/fdkankan/manage/controller/CameraVersionController.java
  10. 3 3
      src/main/java/com/fdkankan/manage/controller/CaseClassController.java
  11. 3 3
      src/main/java/com/fdkankan/manage/controller/CaseController.java
  12. 3 3
      src/main/java/com/fdkankan/manage/controller/CaseIconController.java
  13. 5 5
      src/main/java/com/fdkankan/manage/controller/CompanyController.java
  14. 6 6
      src/main/java/com/fdkankan/manage/controller/EmailTemplateController.java
  15. 3 3
      src/main/java/com/fdkankan/manage/controller/EmployNoteController.java
  16. 3 3
      src/main/java/com/fdkankan/manage/controller/ExcelController.java
  17. 4 4
      src/main/java/com/fdkankan/manage/controller/LookSpaceController.java
  18. 3 3
      src/main/java/com/fdkankan/manage/controller/SceneApplyController.java
  19. 7 7
      src/main/java/com/fdkankan/manage/controller/SceneController.java
  20. 6 5
      src/main/java/com/fdkankan/manage/controller/SpaceSdkController.java
  21. 3 3
      src/main/java/com/fdkankan/manage/controller/SysMenuController.java
  22. 3 3
      src/main/java/com/fdkankan/manage/controller/SysRoleController.java
  23. 6 6
      src/main/java/com/fdkankan/manage/controller/SysUserController.java
  24. 6 6
      src/main/java/com/fdkankan/manage/controller/UserController.java
  25. 0 5
      src/main/java/com/fdkankan/manage/exception/BusinessException.java
  26. 2 2
      src/main/java/com/fdkankan/manage/exception/GlobalExceptionHandler.java
  27. 2 2
      src/main/java/com/fdkankan/manage/httpClient/service/LaserService.java
  28. 2 0
      src/main/java/com/fdkankan/manage/service/IExcelService.java
  29. 7 7
      src/main/java/com/fdkankan/manage/service/impl/AppFileServiceImpl.java
  30. 3 3
      src/main/java/com/fdkankan/manage/service/impl/BuryPointServiceImpl.java
  31. 4 4
      src/main/java/com/fdkankan/manage/service/impl/CameraDetailServiceImpl.java
  32. 42 55
      src/main/java/com/fdkankan/manage/service/impl/CameraServiceImpl.java
  33. 9 9
      src/main/java/com/fdkankan/manage/service/impl/CameraVersionServiceImpl.java
  34. 4 4
      src/main/java/com/fdkankan/manage/service/impl/DownService.java
  35. 3 3
      src/main/java/com/fdkankan/manage/service/impl/EmployNoteServiceImpl.java
  36. 28 9
      src/main/java/com/fdkankan/manage/service/impl/ExcelServiceImpl.java
  37. 3 3
      src/main/java/com/fdkankan/manage/service/impl/IntercomMessageServiceImpl.java
  38. 9 9
      src/main/java/com/fdkankan/manage/service/impl/InvoiceServiceImpl.java
  39. 4 4
      src/main/java/com/fdkankan/manage/service/impl/LookSpaceServiceImpl.java
  40. 3 2
      src/main/java/com/fdkankan/manage/service/impl/MailTemplateServiceImpl.java
  41. 2 2
      src/main/java/com/fdkankan/manage/service/impl/ManageService.java
  42. 1 1
      src/main/java/com/fdkankan/manage/service/impl/Scene3dNumServiceImpl.java
  43. 4 3
      src/main/java/com/fdkankan/manage/service/impl/SceneApplyServiceImpl.java
  44. 8 7
      src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java
  45. 8 10
      src/main/java/com/fdkankan/manage/service/impl/SpaceSdkServiceImpl.java
  46. 5 5
      src/main/java/com/fdkankan/manage/service/impl/SysRoleServiceImpl.java
  47. 3 2
      src/main/java/com/fdkankan/manage/service/impl/SysUserServiceImpl.java
  48. 4 4
      src/main/java/com/fdkankan/manage/service/impl/UserIncrementServiceImpl.java
  49. 3 3
      src/main/java/com/fdkankan/manage/service/impl/UserServiceImpl.java

+ 21 - 0
src/main/java/com/fdkankan/manage/common/ExcelErrorUtil.java

@@ -0,0 +1,21 @@
+package com.fdkankan.manage.common;
+
+import com.fdkankan.manage.exception.BusinessException;
+
+import java.util.List;
+
+public class ExcelErrorUtil {
+
+    public  static String getResultIn(List<Integer> errorList){
+        if(errorList.size() <=0){
+            return null;
+        }
+        StringBuilder res = new StringBuilder("第");
+        for (Integer index : errorList) {
+            res.append(index  +3).append(",");
+        }
+        res.deleteCharAt(res.lastIndexOf(","));
+        res.append("行存在错误");
+        return res.toString();
+    }
+}

+ 42 - 2
src/main/java/com/fdkankan/manage/common/ResultCode.java

@@ -1,18 +1,58 @@
 package com.fdkankan.manage.common;
 
-import org.apache.log4j.spi.ErrorCode;
 
 public enum ResultCode  {
+    SYSTEM_ERROR(500, "系统异常"),
+
+    NOT_ROLE(4001, "无此角色"),
+    NOT_PERMISSION(4002, "无此权限"),
+    USER_NOT_EXIST(4003, "用户不存在"),
+    USER_EXIST(4004, "用户已存在"),
+    MISSING_REQUIRED_PARAMETERS(4007, "缺少必要参数"),
+    USER_NOT_LOGIN(4008, "用户未登录"),
+
     VISION_EXIST(50001, "版本号已存在!"),
     PASSWORD_ERROR(50002, "账号密码错误,请重新登录!"),
     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, "该角色已关联用户,不可删除。请先修改相关用户的角色!"),
 
     ;
 
     private Integer code;
     private String message;
 
-    private ResultCode(Integer code, String message) {
+   private ResultCode(Integer code, String message) {
         this.code = code;
         this.message = message;
     }

+ 7 - 7
src/main/java/com/fdkankan/manage/config/SaTokenConfigure.java

@@ -12,8 +12,8 @@ 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.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
@@ -73,22 +73,22 @@ public class SaTokenConfigure {
                     ResultData aj ;
                     if (e instanceof NotLoginException) {	// 如果是未登录异常
                         NotLoginException ee = (NotLoginException) e;
-                        aj = ResultData.error(ErrorCode.USER_NOT_LOGIN);
+                        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(4010,"无此角色:" + ee.getRole());
+                        aj =  ResultData.error(ResultCode.NOT_ROLE.code(),ResultCode.NOT_ROLE.message());
                     }
                     else if(e instanceof NotPermissionException) {	// 如果是权限异常
                         NotPermissionException ee = (NotPermissionException) e;
-                        aj = ResultData.error(4011,"无此权限:" + ee.getPermission());
+                        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(500,e.getMessage());
+                        aj = ResultData.error(ResultCode.SYSTEM_ERROR.code(),ResultCode.SYSTEM_ERROR.message());
                     }
                     return JSONObject.toJSONString(aj);
                 })
@@ -112,7 +112,7 @@ public class SaTokenConfigure {
 
     private void checkLogin(){
         if(!redisUtil.hasKey(String.format(RedisKey.TOKEN_V3,StpUtil.getTokenValue()))){
-            throw new BusinessException(ErrorCode.USER_NOT_LOGIN);
+            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
         }
         redisUtil.expire(String.format(RedisKey.TOKEN_V3,StpUtil.getTokenValue()),21600);
         StpUtil.checkLogin();

+ 4 - 4
src/main/java/com/fdkankan/manage/config/StpInterfaceImpl.java

@@ -3,8 +3,8 @@ package com.fdkankan.manage.config;
 import cn.dev33.satoken.stp.StpInterface;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.redis.constant.RedisKey;
 import com.fdkankan.redis.util.RedisUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -25,7 +25,7 @@ public class StpInterfaceImpl implements StpInterface {
         String redisKey = String.format(RedisKey.MANAGE_PERM_USER, loginId);
         String permString = redisUtil.get(redisKey);
         if(StringUtils.isBlank(permString)){
-            throw new BusinessException(ErrorCode.USER_NOT_LOGIN);
+            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
         }
         JSONArray jsonArray = JSONObject.parseArray(permString);
         List<String> permList = jsonArray.toJavaList(String.class)
@@ -40,7 +40,7 @@ public class StpInterfaceImpl implements StpInterface {
         String redisKey = String.format(RedisKey.MANAGE_ROLE_USER, loginId);
         String roleString = redisUtil.get(redisKey);
         if(StringUtils.isBlank(roleString)){
-            throw new BusinessException(ErrorCode.USER_NOT_LOGIN);
+            throw new BusinessException(ResultCode.USER_NOT_LOGIN);
         }
         JSONArray jsonArray = JSONObject.parseArray(roleString);
         List<String> roleList = jsonArray.toJavaList(String.class)

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/AppFileController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.util.FileMd5Util;
 import com.fdkankan.manage.entity.AppFile;
@@ -52,7 +52,7 @@ public class AppFileController {
     @PostMapping(value = "/delete")
     private ResultData delete(@RequestBody AppFile param) {
         if(ObjectUtils.isEmpty(param.getId())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         appFileService.removeById(param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/BuryPointController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.BuryPoint;
 import com.fdkankan.manage.service.IBuryPointService;
@@ -44,7 +44,7 @@ public class BuryPointController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody BuryPoint buryPoint){
         if(buryPoint.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         buryPointService.removeById(buryPoint.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/CameraController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.service.ICameraService;
 import com.fdkankan.manage.service.ICompanyService;
@@ -57,7 +57,7 @@ public class CameraController {
             case 1:
                 return ResultData.ok(orderService.getOrderSn(orderSn));
             default:
-                throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+                throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
     }
 

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/CameraOrderController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.service.IOrderItemService;
 import com.fdkankan.manage.service.IOrderService;
@@ -33,7 +33,7 @@ public class CameraOrderController {
     @GetMapping("/item")
     public ResultData item(@RequestParam (required = false) Long id){
         if(id == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(orderItemService.getByOrderId(id));
     }

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/CameraVersionController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.CameraVersion;
 import com.fdkankan.manage.service.ICameraVersionService;
@@ -49,7 +49,7 @@ public class CameraVersionController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody CameraVersion param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         cameraVersionService.removeById(param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/CaseClassController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.Result;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.common.ResultCode;
@@ -49,7 +49,7 @@ public class CaseClassController {
     @PostMapping("/del")
     public ResultData del(@RequestBody CaseClass param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseClassService.removeById(param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/CaseController.java

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.Case;
 import com.fdkankan.manage.entity.CaseClass;
@@ -58,7 +58,7 @@ public class CaseController {
     @PostMapping("/del")
     public ResultData del(@RequestBody CaseClass param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseService.removeById(param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/CaseIconController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.CaseClass;
 import com.fdkankan.manage.entity.CaseIcon;
@@ -54,7 +54,7 @@ public class CaseIconController {
     @PostMapping("/del")
     public ResultData del(@RequestBody CaseClass param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         caseIconService.removeById(param.getId());
         return ResultData.ok();

+ 5 - 5
src/main/java/com/fdkankan/manage/controller/CompanyController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.manage.entity.Company;
@@ -45,7 +45,7 @@ public class CompanyController {
     @PostMapping("/update")
     public ResultData update(@RequestBody Company param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         param.setUpdateTime(DateUtil.date2String(new Date(),DateUtil.DEFAULT_DATE_FORMAT));
         companyService.updateById(param);
@@ -55,11 +55,11 @@ public class CompanyController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody Company param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         Long count = cameraDetailService.getCountByCompanyId(param.getId());
         if(count >0){
-            throw new BusinessException(-1,"删除失败,请先解绑设备");
+            throw new BusinessException(ResultCode.COMPANY_DEL_ERROR);
         }
         companyService.removeById(param.getId());
         return ResultData.ok();

+ 6 - 6
src/main/java/com/fdkankan/manage/controller/EmailTemplateController.java

@@ -1,7 +1,7 @@
 package com.fdkankan.manage.controller;
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.MailTemplate;
 import com.fdkankan.manage.service.IMailTemplateService;
@@ -23,7 +23,7 @@ public class EmailTemplateController {
     @GetMapping("/getInfo")
     public ResultData getInfo(@RequestParam(required = false) Integer mailTemplateId){
         if(mailTemplateId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(mailTemplateService.getById(mailTemplateId));
     }
@@ -37,7 +37,7 @@ public class EmailTemplateController {
     public ResultData save(@RequestBody MailTemplate mailTemplate){
         if(StringUtils.isBlank(mailTemplate.getSendMail()) || StringUtils.isBlank(mailTemplate.getSendPassword())
             || StringUtils.isBlank(mailTemplate.getSubject()) || StringUtils.isBlank(mailTemplate.getMsg())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         mailTemplate.setSendHost("smtp.exmail.qq.com");
         mailTemplateService.save(mailTemplate);
@@ -47,7 +47,7 @@ public class EmailTemplateController {
     @PostMapping("/update")
     public ResultData update(@RequestBody MailTemplate mailTemplate){
         if(mailTemplate.getId() == null ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         mailTemplateService.updateById(mailTemplate);
         return ResultData.ok();
@@ -56,7 +56,7 @@ public class EmailTemplateController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody MailTemplate mailTemplate){
         if(mailTemplate.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         mailTemplateService.removeById(mailTemplate.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/EmployNoteController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.manage.entity.EmployNote;
@@ -40,7 +40,7 @@ public class EmployNoteController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody EmployNote param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         employNoteService.removeById(param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/ExcelController.java

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 import cn.hutool.poi.word.WordUtil;
 import com.alibaba.nacos.common.codec.Base64;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.service.IExcelService;
 import org.apache.commons.io.FileUtils;
@@ -39,7 +39,7 @@ public class ExcelController {
             case 0 : fileName = "cameraIn.xlsx"; break;
             case 1 : fileName = "cameraOut.xlsx"; break;
             case 2 : fileName = "cameraCompany.xlsx"; break;
-            default: throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            default: throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("template/"+fileName);
         OutputStream os = res.getOutputStream();

+ 4 - 4
src/main/java/com/fdkankan/manage/controller/LookSpaceController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.LookSpace;
 import com.fdkankan.manage.service.ILookSpaceService;
@@ -40,7 +40,7 @@ public class LookSpaceController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody LookSpaceParam param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         lookSpaceService.removeById(param.getId());
         return ResultData.ok();
@@ -53,7 +53,7 @@ public class LookSpaceController {
     @PostMapping("/isPush")
     public ResultData isPush(@RequestBody LookSpace param){
         if(param.getId() == null || param.getIsPush() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         lookSpaceService.isPush(param.getIsPush(),param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/SceneApplyController.java

@@ -1,8 +1,8 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.SceneApply;
 import com.fdkankan.manage.service.ISceneApplyService;
@@ -37,7 +37,7 @@ public class SceneApplyController {
     @PostMapping("/sendEmail")
     public ResultData sendEmail(@RequestBody SceneApplySendEmailParam param){
         if(param.getSceneApplyId() == null || param.getMailTemplateId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sceneApplyService.sendEmail(param.getSceneApplyId(),param.getMailTemplateId());
         return ResultData.ok();

+ 7 - 7
src/main/java/com/fdkankan/manage/controller/SceneController.java

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.ScenePlus;
 import com.fdkankan.manage.entity.ScenePro;
@@ -49,7 +49,7 @@ public class SceneController {
     @PostMapping("/move")
     public ResultData move(@RequestBody SceneParam param){
         if(StringUtils.isEmpty(param.getNum()) || StringUtils.isEmpty(param.getSnCode())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sceneProService.move(param);
         return ResultData.ok();
@@ -62,7 +62,7 @@ public class SceneController {
     @PostMapping("/copy")
     public ResultData copy(@RequestBody SceneParam param) throws Exception {
         if(StringUtils.isEmpty(param.getNum())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sceneProService.copy(param.getNum());
         return ResultData.ok();
@@ -75,7 +75,7 @@ public class SceneController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody SceneParam param){
         if(StringUtils.isEmpty(param.getNum())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sceneProService.deleteByNum(param.getNum());
         return ResultData.ok();
@@ -116,11 +116,11 @@ public class SceneController {
     public ResultData rebuild(@RequestParam(required = false) String num){
         ScenePro scenePro = sceneProService.getByNum(num);
         if(scenePro!=null){
-            throw new BusinessException(-1,"V3场景请先升级在重算");
+            throw new BusinessException(ResultCode.V3_SCENE_REBUILD);
         }
         ScenePlus scenePlus = scenePlusService.getByNum(num);
         if(scenePlus == null){
-            throw new BusinessException(-1,"场景不存在");
+            throw new BusinessException(ResultCode.SCENE_NOT_EXIST);
         }
         HashMap<String,Object> paramMap = new HashMap<>();
         paramMap.put("num",num);

+ 6 - 5
src/main/java/com/fdkankan/manage/controller/SpaceSdkController.java

@@ -1,9 +1,10 @@
 package com.fdkankan.manage.controller;
 
 
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
+import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.manage.entity.SpaceSdk;
 import com.fdkankan.manage.service.ISpaceSdkService;
 import com.fdkankan.manage.vo.request.SpaceSdkParam;
@@ -42,7 +43,7 @@ public class SpaceSdkController {
         try {
             return ResultData.ok( spaceSdkService.upload(file, version,imprintCh,imprintEn,isTop,platformType));
         }catch (Exception e){
-            throw new BusinessException(-1,"上传失败!");
+            throw new BusinessException(ResultCode.UPLOAD_ERROR);
         }
     }
 
@@ -61,11 +62,11 @@ public class SpaceSdkController {
     @PostMapping("/delete")
     public ResultData delete(@RequestBody SpaceSdkParam param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         SpaceSdk spaceSdk = spaceSdkService.getById(param.getId());
         if(spaceSdk.getStatus() == 1){
-            throw new BusinessException(-1,"删除失败,请先下架在删除");
+            throw new BusinessException(ResultCode.SDK_DEL_ERROR);
         }
         spaceSdkService.removeById(param.getId());
         return ResultData.ok();

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/SysMenuController.java

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.request.RequestBase;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.common.util.DateUtil;
@@ -36,7 +36,7 @@ public class SysMenuController extends BaseController{
     @PostMapping("/update")
     public ResultData update(@RequestBody SysMenu param){
         if(StringUtils.isEmpty(param.getId())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         param.setUpdateTime(DateUtil.date2String(new Date(),DateUtil.DEFAULT_DATE_FORMAT));
         menuService.saveOrUpdate(param);

+ 3 - 3
src/main/java/com/fdkankan/manage/controller/SysRoleController.java

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.SysRole;
 import com.fdkankan.manage.service.ISysRoleService;
@@ -33,7 +33,7 @@ public class SysRoleController extends BaseController{
     @PostMapping("/update")
     public ResultData update(@RequestBody SysRoleParam param){
         if(StringUtils.isEmpty(param.getId())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         roleService.addOrUpdate(param);
         return ResultData.ok();

+ 6 - 6
src/main/java/com/fdkankan/manage/controller/SysUserController.java

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 
 import cn.dev33.satoken.stp.StpUtil;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.entity.SysRole;
 import com.fdkankan.manage.entity.SysUser;
@@ -46,7 +46,7 @@ public class SysUserController  extends BaseController{
     public ResultData add(@RequestBody SysUserParam param){
         if(StringUtils.isEmpty(param.getUserName()) || StringUtils.isEmpty(param.getPassword())
         || StringUtils.isEmpty(param.getNickName()) || param.getRoleId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         param.setCreateUserId(getUserId());
         sysUserService.addOrUpdate(param);
@@ -56,7 +56,7 @@ public class SysUserController  extends BaseController{
     @PostMapping("/update")
     public ResultData update(@RequestBody SysUserParam param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sysUserService.addOrUpdate(param);
         return ResultData.ok();
@@ -65,7 +65,7 @@ public class SysUserController  extends BaseController{
     @PostMapping("/delete")
     public ResultData delete(@RequestBody SysUserParam param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sysUserService.removeById(param.getId());
         return ResultData.ok();
@@ -73,7 +73,7 @@ public class SysUserController  extends BaseController{
     @PostMapping("/rePassword")
     public ResultData rePassword(@RequestBody SysUserParam param){
         if(param.getId() == null && StringUtils.isEmpty(param.getPassword())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         sysUserService.addOrUpdate(param);
         return ResultData.ok();

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

@@ -2,8 +2,8 @@ package com.fdkankan.manage.controller;
 
 
 import cn.hutool.core.io.FileUtil;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.service.ICameraService;
 import com.fdkankan.manage.service.IUserIncrementService;
@@ -60,7 +60,7 @@ public class UserController {
     @PostMapping("/incrementDelay")
     public ResultData IncrementDelay(@RequestBody UserIncrementParam param){
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         userIncrementService.delayById(param.getId(),param.getYear());
         return ResultData.ok();
@@ -74,7 +74,7 @@ public class UserController {
     @PostMapping("/addUserIncrement")
     public ResultData addUserIncrement(@RequestBody UserIncrementParam param){
         if(param.getUserId() == null || StringUtils.isEmpty(param.getIncrementEndTime())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         userIncrementService.add(param);
         return ResultData.ok();
@@ -88,7 +88,7 @@ public class UserController {
     @PostMapping("/addDownNum")
     public ResultData addDownNum(@RequestBody UserIncrementParam param){
         if(param.getUserId() == null || param.getCount() == null){
-            throw  new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw  new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         userService.addDownNum(param);
         return ResultData.ok();
@@ -101,7 +101,7 @@ public class UserController {
     @PostMapping("/getCameraDetail")
     public ResultData getCameraDetail(@RequestBody CameraParam cameraParam){
         if(cameraParam.getUserId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(cameraService.pageList(cameraParam));
     }

+ 0 - 5
src/main/java/com/fdkankan/manage/exception/BusinessException.java

@@ -1,6 +1,5 @@
 package com.fdkankan.manage.exception;
 
-import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.manage.common.ResultCode;
 import lombok.Data;
 
@@ -17,10 +16,6 @@ public class BusinessException extends RuntimeException {
         this.message = msg;
     }
 
-    public BusinessException(ErrorCode errorCode) {
-        this.code = errorCode.code();
-        this.message = errorCode.message();
-    }
     public BusinessException(ResultCode errorCode) {
         this.code = errorCode.code();
         this.message = errorCode.message();

+ 2 - 2
src/main/java/com/fdkankan/manage/exception/GlobalExceptionHandler.java

@@ -36,8 +36,8 @@ public class GlobalExceptionHandler {
      * 处理业务异常
      */
     @ResponseBody
-    @ExceptionHandler(value = com.fdkankan.common.exception.BusinessException.class)
-    public ResultData businessExceptionHandler2(com.fdkankan.common.exception.BusinessException e) {
+    @ExceptionHandler(value = com.fdkankan.manage.exception.BusinessException.class)
+    public ResultData businessExceptionHandler2(com.fdkankan.manage.exception.BusinessException e) {
         log.info("业务异常code:{},message:{}", e.getCode(), e.getMessage());
         return ResultData.error(e.getCode(), e.getMessage());
     }

+ 2 - 2
src/main/java/com/fdkankan/manage/httpClient/service/LaserService.java

@@ -3,9 +3,9 @@ package com.fdkankan.manage.httpClient.service;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.common.constant.HttpCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.response.Result;
 import com.fdkankan.common.util.DateUtil;

+ 2 - 0
src/main/java/com/fdkankan/manage/service/IExcelService.java

@@ -23,4 +23,6 @@ public interface IExcelService {
     void commonExport(HttpServletRequest request, HttpServletResponse response,String name,List<?> result,Class<?> clazz) throws Exception;
 
     Integer uploadExcel(MultipartFile file, Integer type) throws IOException;
+
+    void toExcelError(List<Integer> errorList);
 }

+ 7 - 7
src/main/java/com/fdkankan/manage/service/impl/AppFileServiceImpl.java

@@ -3,8 +3,8 @@ package com.fdkankan.manage.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.FileMd5Util;
 import com.fdkankan.common.util.FileUtils;
@@ -52,7 +52,7 @@ public class AppFileServiceImpl extends ServiceImpl<IAppFileMapper, AppFile> imp
     @Override
     public Map<String, String> upload(MultipartFile file) {
         if (ObjectUtils.isEmpty(file) || file.isEmpty() || file.getSize() <= 0) {
-            throw new BusinessException(ErrorCode.FAILURE_CODE_3017);
+            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         try {
             Map<String,String> result = new HashMap<>(2);
@@ -71,7 +71,7 @@ public class AppFileServiceImpl extends ServiceImpl<IAppFileMapper, AppFile> imp
             return result;
         }catch (Exception e){
             log.error("上传App出错{}",e);
-            throw new BusinessException(-1,"上传失败");
+            throw new BusinessException(ResultCode.UPLOAD_ERROR);
         }
     }
 
@@ -97,7 +97,7 @@ public class AppFileServiceImpl extends ServiceImpl<IAppFileMapper, AppFile> imp
     @Override
     public void saveByParam(AppFile param) {
         if(ObjectUtils.isEmpty(param.getName())){
-            throw new BusinessException(-1,"文件名称为空,请输入文件名称!");
+            throw new BusinessException(ResultCode.FILE_NAME_EMPTY);
         }
         AppFile managerAPPEntity = new AppFile();
         BeanUtils.copyProperties(param, managerAPPEntity);
@@ -106,12 +106,12 @@ public class AppFileServiceImpl extends ServiceImpl<IAppFileMapper, AppFile> imp
         String filePath = basePath.concat(param.getName());
         File file = new File(filePath);
         if (!file.exists()) {
-            throw new BusinessException(-1,"应用包文件未上传,请先上传文件!");
+            throw new BusinessException(ResultCode.APP_FILE_EMPTY);
         }
 
         String versionFilePath = basePath.concat("version.json");
         if (!new File(versionFilePath).exists()) {
-            throw new BusinessException(-1,"version.json 文件未上传,请先上传文件!");
+            throw new BusinessException(ResultCode.VERSION_EMPTY);
         }
 
         String fileType = param.getName().substring(param.getName().lastIndexOf(".")+1);

+ 3 - 3
src/main/java/com/fdkankan/manage/service/impl/BuryPointServiceImpl.java

@@ -3,8 +3,8 @@ package com.fdkankan.manage.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.extension.plugins.pagination.Page;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.manage.entity.BuryPoint;
 import com.fdkankan.manage.mapper.IBuryPointMapper;
@@ -42,7 +42,7 @@ public class BuryPointServiceImpl extends ServiceImpl<IBuryPointMapper, BuryPoin
     @Override
     public void add(BuryPoint buryPoint) {
         if(StringUtils.isBlank(buryPoint.getApplicationName())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         BuryPoint newBuryPoint = new BuryPoint();
         newBuryPoint.setApplicationName(buryPoint.getApplicationName());

+ 4 - 4
src/main/java/com/fdkankan/manage/service/impl/CameraDetailServiceImpl.java

@@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.common.CameraTypeEnum;
 import com.fdkankan.manage.entity.Camera;
 import com.fdkankan.manage.entity.CameraDetail;
@@ -52,11 +52,11 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
     public void unbindCamera(Long cameraId) {
         CameraDetail cameraDetail = this.getByCameraId(cameraId);
         if(cameraDetail == null){
-            throw new BusinessException(ErrorCode.CAMERA_BIND_NO_EXIST);
+            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
         }
         User user = userService.getById(cameraDetail.getUserId());
         if(user == null){
-            throw new BusinessException(ErrorCode.USER_NOT_EXIST);
+            throw new BusinessException(ResultCode.USER_NOT_EXIST);
         }
         String snCode = null;
         String cooperationUserName = null;

+ 42 - 55
src/main/java/com/fdkankan/manage/service/impl/CameraServiceImpl.java

@@ -5,8 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.common.constant.Constant;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ExcelErrorUtil;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.manage.common.CameraTypeEnum;
@@ -53,6 +54,8 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
     IScenePlusService scenePlusService;
     @Autowired
     ICompanyService companyService;
+    @Autowired
+    IExcelService excelService;
     @Value("${upload.type}")
     private String ossType;
 
@@ -99,16 +102,16 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
     @Override
     public void in(String wifiName) {
         if(StringUtils.isEmpty(wifiName) ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if( !wifiName.contains("_") || !wifiName.contains("4D")){
-            throw new BusinessException(-1,"wifi名称格式错误");
+            throw new BusinessException(ResultCode.WIFI_NAME_ERROR);
         }
         LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(Camera::getWifiName,wifiName);
         long count = this.count(wrapper);
         if(count > 0){
-            throw new BusinessException(-1,"设备wifi名称重复");
+            throw new BusinessException(ResultCode.WIFI_NAME_REPEAT);
         }
         saveBatchCamera(Collections.singletonList(wifiName));
     }
@@ -134,9 +137,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         for (Camera camera : cameraList) {
             String wifiName = camera.getWifiName();
             Integer type = CameraTypeEnum.getTypeByWifiNamePrefix(wifiName.substring(0,wifiName.lastIndexOf("_") +1));
-            if(type == null){
-                throw new BusinessException(-1,"wifi名称前缀错误!");
-            }
+
             CameraDetail cameraDetail = new CameraDetail();
             cameraDetail.setAgency(CameraConstant.DEFAULT_AGENT);
             cameraDetail.setCameraId(camera.getId());
@@ -161,35 +162,24 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
     @Override
     public Integer ins(List<String> wifiNameList){
         List<Integer> errorRow = getErrorRow(wifiNameList);
-        getResultIn(errorRow);
+        excelService.toExcelError(errorRow);
         LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(Camera::getWifiName,wifiNameList);
         List<Camera> list = this.list(wrapper);
         if(list.size() >0){
             List<String> newList = list.parallelStream().map(Camera::getWifiName).collect(Collectors.toList());
             List<Integer> errorRow2 = getErrorRow(wifiNameList, newList);
-            getResultIn(errorRow2);
+            excelService.toExcelError(errorRow2);
         }
         return saveBatchCamera(wifiNameList);
     }
 
-    private void getResultIn(List<Integer> errorList){
-        if(errorList.size() <=0){
-            return;
-        }
-        StringBuilder res = new StringBuilder("第");
-        for (Integer index : errorList) {
-            res.append(index ).append(",");
-        }
-        res.deleteCharAt(res.lastIndexOf(","));
-        res.append("行存在错误");
-        throw new BusinessException(-1, res.toString());
-    }
+
 
     private List<Integer> getErrorRow(List<String> wifiNameList){
         List<Integer> errorIndexList = new ArrayList<>();
         Set<String> wifiNameSet = new HashSet<>();
-        Integer index = 3;
+        Integer index = 0;
         for (String wifiName : wifiNameList) {
             index ++;
             if(StringUtils.isBlank(wifiName)){
@@ -214,7 +204,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         if(dbList.size() <=0){
             return errorIndexList;
         }
-        Integer index = 3;
+        Integer index = 0;
         for (String wifiName : wifiNameList) {
             index ++;
             if(dbList.contains(wifiName)){
@@ -227,20 +217,20 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
     @Override
     public void out(CameraInOutParam param) {
         if(param.getOutType() == null || param.getCompanyName() == null || param.getId() == null){
-            throw  new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw  new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         Company company = companyService.getCompanyByName(param.getCompanyName());
         if(company == null){
-            throw new BusinessException(-1,"客户名称不存在");
+            throw new BusinessException(ResultCode.COMPANY_NAME_NOT_EXIST);
         }
         param.setCompanyId(company.getId());
         Camera camera = this.getById(param.getId());
         if(camera == null){
-            throw new BusinessException(-1,"相机不存在");
+            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
         }
         CameraDetail detail = cameraDetailService.getByCameraId(camera.getId());
         if(detail ==null){
-            throw new BusinessException(-1,"该相机未入库");
+            throw new BusinessException(ResultCode.CAMERA_NOT_IN);
         }
 
         HashMap<Long,CameraDetail> detailMap = new HashMap<>();
@@ -268,7 +258,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         for (CameraInOutParam param : params) {
             CameraDetail cameraDetail = detailMap.get(param.getId());
             if(cameraDetail == null){
-                throw new BusinessException(-1,"相机未入库");
+                throw new BusinessException(ResultCode.CAMERA_NOT_IN);
             }
             cameraDetail.setOrderSn(param.getOrderSn());
             cameraDetail.setOwn(param.getOutType());
@@ -281,46 +271,42 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
 
     private void checkSnCode(List<String> snCodeList,List<String> dbSnCode) {
         HashMap<String,Integer> map = new HashMap<>();
+        List<Integer> errorList = new ArrayList<>();
+        Integer index = 0;
         for (String snCode : snCodeList) {
+            index ++;
             if(StringUtils.isBlank(snCode)){
-                map.put(snCode,2);
+                errorList.add(index);
             }
             if(map.get(snCode) == null){
                 map.put(snCode,1);
             }else {
                 map.put(snCode,2);
+                errorList.add(index);
             }
         }
-        List<String> errorSnCode = new ArrayList<>();
-        for (String snCode : map.keySet()) {
-            if(map.get(snCode) > 1){
-                errorSnCode.add(snCode);
-            }
-        }
-        if(errorSnCode.size() >0){
-            throw new BusinessException(-1,"存在重复的snCode:"+errorSnCode);
-        }
-        List<String> errorSnCode2 = new ArrayList<>();
+        excelService.toExcelError(errorList);
 
+        Integer index2 = 0;
         for (String snCode : snCodeList) {
+            index2 ++;
             if(!dbSnCode.contains(snCode)){
-                errorSnCode2.add(snCode);
+                errorList.add(index2);
             }
         }
-        if(errorSnCode2.size() >0){
-            throw new BusinessException(-1,"snCode:"+errorSnCode2+"不存在");
-        }
+        excelService.toExcelError(errorList);
+
     }
 
 
     @Override
     public void updateCamera(CameraInOutParam param) {
         if(param.getId() == null|| param.getOutType() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CameraDetail cameraDetail = cameraDetailService.getByCameraId(param.getId());
         if(cameraDetail == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(StringUtils.isNotBlank(param.getCompanyName())){
             Company company = companyService.getCompanyByName(param.getCompanyName());
@@ -336,11 +322,11 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
     @Override
     public void deleteCamera(Long id) {
         if(id == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CameraDetail cameraDetail = cameraDetailService.getByCameraId(id);
         if(cameraDetail !=null && cameraDetail.getUserId()!=null){
-            throw new BusinessException(-1,"相机已绑定,请先解绑后删除");
+            throw new BusinessException(ResultCode.CAMERA_DEL_ERROR);
         }
         this.removeById(id);
         cameraDetailService.deleteByCameraId(id);
@@ -370,22 +356,24 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         for (Company company : companyList) {
             companyNameMap.put(company.getCompanyName(),company.getId());
         }
+        List<Integer> errorList = new ArrayList<>();
+        Integer index = 0;
         for (CameraInOutParam companyParam : companyParams) {
+            index ++;
             if(StringUtils.isNotBlank(companyParam.getCompanyName())){
                 if(companyNameMap.get(companyParam.getCompanyName()) == null){
-                    throw new BusinessException(-1,"客户名称"+ companyParam.getCompanyName()+"-不存在");
+                    errorList.add(index);
                 }
                 companyParam.setCompanyId(companyNameMap.get(companyParam.getCompanyName()));
             }
         }
+        excelService.toExcelError(errorList);
     }
 
     private HashMap<String, Object> getResultMap(List<CameraInOutParam> params){
         HashMap<String,Object> resultMap = new HashMap<>();
         List<String> snCodeList = params.parallelStream().map(CameraInOutParam::getSnCode).collect(Collectors.toList());
-        if(snCodeList.size() <=0){
-            throw new BusinessException(-1,"snCode为空");
-        }
+
         List<Camera> cameraList = this.getBySnCodes(snCodeList);
         checkSnCode(snCodeList,cameraList.stream().map(Camera::getSnCode).collect(Collectors.toList()));
 
@@ -404,11 +392,10 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
         for (String snCode : snCodeList) {
             Camera camera = snCodeMap.get(snCode);
             if(camera == null || detailMap.get(camera.getId()) ==null){
-                errorList.add(snCodeList.indexOf(snCode) +3);
-                throw new BusinessException(-1,snCode +"不存在!");
+                errorList.add(snCodeList.indexOf(snCode) );
             }
         }
-        getResultIn(errorList);
+        excelService.toExcelError(errorList);
         resultMap.put("detailMap",detailMap);
         resultMap.put("snCodeMap",snCodeMap);
         return resultMap;

+ 9 - 9
src/main/java/com/fdkankan/manage/service/impl/CameraVersionServiceImpl.java

@@ -5,8 +5,8 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.common.util.FileMd5Util;
@@ -66,7 +66,7 @@ public class CameraVersionServiceImpl extends ServiceImpl<ICameraVersionMapper,
     public void addAndUpload(MultipartFile file, String version, String description, String minVersion, Integer type) throws IOException {
         log.info("run upload");
         if (!file.isEmpty()&& file.getSize() <= 0) {
-            throw new BusinessException(ErrorCode.FILE_NOT_EXIST);
+            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         // 文件名全名
         String fullFileName = file.getOriginalFilename();
@@ -98,7 +98,7 @@ public class CameraVersionServiceImpl extends ServiceImpl<ICameraVersionMapper,
             case 1: type = 1;break;
             case 2: type = 9;break;
             case 3: type = 10;break;
-            default: throw new BusinessException(-1,"相机类型错误");
+            default: throw new BusinessException(ResultCode.CAMERA_TYPE_ERROR);
         }
         List<CameraVersion> cameraVersions = this.getByVersion(version,type);
         if(cameraVersions != null && cameraVersions.size() >0){
@@ -134,7 +134,7 @@ public class CameraVersionServiceImpl extends ServiceImpl<ICameraVersionMapper,
             case 1: type = 1;break;
             case 2: type = 9;break;
             case 3: type = 10;break;
-            default: throw new BusinessException(-1,"相机类型错误");
+            default: throw new BusinessException(ResultCode.CAMERA_TYPE_ERROR);
         }
         LambdaQueryWrapper<CameraVersion> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(CameraVersion::getType,type);
@@ -167,18 +167,18 @@ public class CameraVersionServiceImpl extends ServiceImpl<ICameraVersionMapper,
     @Override
     public void updateByParam(CameraVersion param) {
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         CameraVersion cameraVersion = this.getById(param.getId());
         if(cameraVersion == null){
-            throw new BusinessException(ErrorCode.NOT_RECORD);
+            throw new BusinessException(ResultCode.CAMERA_VERSION_NOT_EXIST);
         }
         if(StringUtils.isNotBlank(param.getStatus()) && !param.getStatus().equals(cameraVersion.getStatus())){
             if(StringUtils.isBlank(param.getStatus()) || param.getType() == null){
-                throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+                throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
             }
             if (!ValidationUtils.validateRecStatus(param.getStatus())) {
-                throw new BusinessException(ErrorCode.ERROR_MSG);
+                throw new BusinessException(ResultCode.CAMERA_VERSION_STATUS_ERROR);
             }
             // 仅有有一台相机是活动状态
             // 查找所以活动状态相机

+ 4 - 4
src/main/java/com/fdkankan/manage/service/impl/DownService.java

@@ -1,7 +1,7 @@
 package com.fdkankan.manage.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.common.constant.SceneConstant;
 import com.fdkankan.manage.common.DownloadStatusEnum;
 import com.fdkankan.manage.exception.BusinessException;
@@ -40,7 +40,7 @@ public class DownService implements IDownService {
     @Override
     public DownVo checkDownLoad(String sceneNum) {
         if(StringUtils.isEmpty(sceneNum)){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS.code(),ErrorCode.MISSING_REQUIRED_PARAMETERS.message());
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS.code(),ResultCode.MISSING_REQUIRED_PARAMETERS.message());
         }
         ScenePro scenePro = sceneProService.getByNum(sceneNum);
         ScenePlus plus = scenePlusService.getByNum(sceneNum);
@@ -102,7 +102,7 @@ public class DownService implements IDownService {
     @Override
     public DownVo down(String sceneNum) {
         if(StringUtils.isEmpty(sceneNum) ){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS.code(),ErrorCode.MISSING_REQUIRED_PARAMETERS.message());
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS.code(),ResultCode.MISSING_REQUIRED_PARAMETERS.message());
         }
         ScenePro scenePro = sceneProService.getByNum(sceneNum);
         ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);
@@ -138,7 +138,7 @@ public class DownService implements IDownService {
     @Override
     public DownloadProcessVo downloadProcess(String sceneNum) {
         if (StringUtils.isEmpty(sceneNum)) {
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS.code(),ErrorCode.MISSING_REQUIRED_PARAMETERS.message());
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS.code(),ResultCode.MISSING_REQUIRED_PARAMETERS.message());
         }
         ScenePro scenePro = sceneProService.getByNum(sceneNum);
         ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);

+ 3 - 3
src/main/java/com/fdkankan/manage/service/impl/EmployNoteServiceImpl.java

@@ -3,8 +3,8 @@ package com.fdkankan.manage.service.impl;
 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.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.manage.entity.EmployNote;
 import com.fdkankan.manage.mapper.IEmployNoteMapper;
@@ -48,7 +48,7 @@ public class EmployNoteServiceImpl extends ServiceImpl<IEmployNoteMapper, Employ
 
     private void pushOrTop(Integer param, Long id,Integer type){
         if(id == null|| param == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<EmployNote> wrapper = new LambdaUpdateWrapper<>();
         wrapper.eq(EmployNote::getId,id);

+ 28 - 9
src/main/java/com/fdkankan/manage/service/impl/ExcelServiceImpl.java

@@ -3,7 +3,9 @@ package com.fdkankan.manage.service.impl;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.write.metadata.WriteSheet;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ExcelErrorUtil;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.constant.CameraOutTypeEnum;
 import com.fdkankan.manage.entity.Company;
 import com.fdkankan.manage.service.ICameraService;
@@ -76,30 +78,35 @@ public class ExcelServiceImpl implements IExcelService {
         assert originalFilename != null;
         String fileType=originalFilename.substring(originalFilename.lastIndexOf(".")+1);
         if (!fileType.equalsIgnoreCase("xlsx")) {
-            throw new BusinessException(50001,"文件格式校验,需为xlsx文件;");
+            throw new BusinessException(ResultCode.FILE_TYPE_ERROR);
         }
         List<HashMap<Integer, String>> excelRowList = new ArrayList<>();
         try {
             excelRowList = ExcelUtil.getExcelRowList(file);
         }catch (Exception e){
-            throw new BusinessException(50002,"模板错误");
+            throw new BusinessException(ResultCode.TEMPLATE_TYPE_ERROR);
         }
         List<String> wifiNameList = new ArrayList<>();
         List<CameraInOutParam> params = new ArrayList<>();
         List<CameraInOutParam> companyParams = new ArrayList<>();
+        List<Integer> errorIndex = new ArrayList<>();
+        Integer index = 0;
         for (HashMap<Integer, String> map : excelRowList) {
+            index ++;
             if(type == 0){      //入库
                 String wifiName = map.get(0);
+                if(StringUtils.isBlank(wifiName)){
+                    errorIndex.add(index);
+                }
                 wifiNameList.add(wifiName);
             }else if(type == 1){    //出库
                 String snCode = map.get(0);
                 String outTypeString = map.get(1);
                 String companyName = map.get(2);
                 String orderSn = map.get(3);
-
                 CameraOutTypeEnum outTypeEnum = CameraOutTypeEnum.getByMsg(outTypeString);
-                if(outTypeEnum == null){
-                    throw new BusinessException(50003,"出库类型错误:"+outTypeString);
+                if(outTypeEnum == null || StringUtils.isBlank(snCode)){
+                    errorIndex.add(index );
                 }
                 int outType = outTypeEnum.getCode();
                 CameraInOutParam param = new CameraInOutParam();
@@ -112,15 +119,20 @@ public class ExcelServiceImpl implements IExcelService {
                 CameraInOutParam param = new CameraInOutParam();
                 param.setCompanyName(map.get(0));
                 param.setSnCode(map.get(1));
+                if(StringUtils.isBlank(param.getSnCode()) || StringUtils.isBlank(param.getCompanyName())){
+                    errorIndex.add(index );
+                }
                 companyParams.add(param);
             }
         }
+         this.toExcelError(errorIndex);
+
         if(type == 0 && wifiNameList.size() <=0){
-            throw new BusinessException(50004,"入库模板数据为空");
+            throw new BusinessException(ResultCode.IN_TEMPLATE_EMPTY);
         }else if(type == 1 && params.size() <=0){
-            throw new BusinessException(50005,"出库模板数据为空");
+            throw new BusinessException(ResultCode.OUT_TEMPLATE_EMPTY);
         }else if(type == 2 && companyParams.size() <=0){
-            throw new BusinessException(50006,"客户关联数据为空");
+            throw new BusinessException(ResultCode.COMPANY_TEMPLATE_EMPTY);
         }
         if(wifiNameList.size() >0){
             return cameraService.ins(wifiNameList);
@@ -134,4 +146,11 @@ public class ExcelServiceImpl implements IExcelService {
         return 0;
     }
 
+    @Override
+    public void toExcelError(List<Integer> errorList) {
+        String resultIn = ExcelErrorUtil.getResultIn(errorList);
+        if(StringUtils.isNotBlank(resultIn)){
+            throw new BusinessException(-1,resultIn);
+        }
+    }
 }

+ 3 - 3
src/main/java/com/fdkankan/manage/service/impl/IntercomMessageServiceImpl.java

@@ -4,8 +4,8 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.manage.entity.IntercomMessage;
 import com.fdkankan.manage.mapper.IIntercomMessageMapper;
@@ -45,7 +45,7 @@ public class IntercomMessageServiceImpl extends ServiceImpl<IIntercomMessageMapp
     @Override
     public void handle(IntercomMessageParam param) {
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<IntercomMessage> wrapper = new LambdaUpdateWrapper<>();
         wrapper.set(IntercomMessage::getState,0);

+ 9 - 9
src/main/java/com/fdkankan/manage/service/impl/InvoiceServiceImpl.java

@@ -2,9 +2,9 @@ package com.fdkankan.manage.service.impl;
 
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.common.constant.InvoiceType;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.ResultData;
 import com.fdkankan.manage.common.OssPath;
 import com.fdkankan.manage.entity.*;
@@ -76,11 +76,11 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
 
         Invoice invoice = this.getById(id);
         if(Objects.isNull(invoice)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_9001);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         Integer type = invoice.getType();
         if(InvoiceType.NO_NEAD.code().equals(type)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_9002);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
 
         InvoiceRegister invoiceRegister = invoiceRegisterService.getByInvoiceId(id);
@@ -96,7 +96,7 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
         //普通发票
         if(InvoiceType.ORDINARY.code().equals(type)){
             if(Objects.isNull(file) || file.isEmpty()){
-                throw new BusinessException(ErrorCode.FAILURE_CODE_5048);
+                throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
             }
             String fileName = file.getOriginalFilename();
             String suffixName = fileName.substring(fileName.lastIndexOf("."));
@@ -128,11 +128,11 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
 
             Boolean mail = mailTemplateService.sendMail(invoice.getEmailAddress(), mailTemplate,localFile.getPath());
             if(!mail){
-                throw new BusinessException(-1,"邮件发送失败");
+                throw new BusinessException(ResultCode.MAIL_SEND_ERROR);
             }
         }else{//专用发票
             if(StrUtil.isEmpty(shipNum)){
-                throw new BusinessException(ErrorCode.FAILURE_CODE_9003);
+                throw new BusinessException(ResultCode.SHIP_NUM_EMPTY);
             }
             invoiceRegister.setShipNum(shipNum);
         }
@@ -171,11 +171,11 @@ public class InvoiceServiceImpl extends ServiceImpl<IInvoiceMapper, Invoice> imp
 
         Invoice invoice = this.getById(id);
         if(Objects.isNull(invoice)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_9001);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         InvoiceRegister invoiceRegister = invoiceRegisterService.getByInvoiceId(id);
         if(Objects.isNull(invoiceRegister)){
-            throw new BusinessException(ErrorCode.FAILURE_CODE_9004);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         return ResultData.ok(InvoiceRegisterDetailVO.builder()
             .type(invoice.getType())

+ 4 - 4
src/main/java/com/fdkankan/manage/service/impl/LookSpaceServiceImpl.java

@@ -5,8 +5,8 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.manage.entity.LookSpace;
@@ -44,7 +44,7 @@ public class LookSpaceServiceImpl extends ServiceImpl<ILookSpaceMapper, LookSpac
     @Override
     public void add(LookSpaceParam param) {
         if(StringUtils.isEmpty(param.getVideoTitle()) || StringUtils.isEmpty(param.getVideoFile())){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         Long loginId = Long.valueOf(StpUtil.getLoginId().toString());
         LookSpace lookSpace = new LookSpace();
@@ -58,7 +58,7 @@ public class LookSpaceServiceImpl extends ServiceImpl<ILookSpaceMapper, LookSpac
     @Override
     public void updateByParam(LookSpaceParam param) {
         if(param.getId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaUpdateWrapper<LookSpace> wrapper = new LambdaUpdateWrapper<>();
         if(StringUtils.isNotBlank(param.getVideoFile())){

+ 3 - 2
src/main/java/com/fdkankan/manage/service/impl/MailTemplateServiceImpl.java

@@ -1,6 +1,7 @@
 package com.fdkankan.manage.service.impl;
 
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.manage.entity.MailTemplate;
 import com.fdkankan.manage.mapper.IMailTemplateMapper;
 import com.fdkankan.manage.service.IMailTemplateService;
@@ -24,7 +25,7 @@ public class MailTemplateServiceImpl extends ServiceImpl<IMailTemplateMapper, Ma
     @Override
     public Boolean sendMail(String email , MailTemplate mailTemplate, String file) {
         if(mailTemplate == null){
-            throw new BusinessException(-1,"邮件发送模板不存在");
+            throw new BusinessException(ResultCode.MAIL_TEMPLATE_ERROR);
         }
        return SendMailUtils.sendMail(mailTemplate.getSendMail(), mailTemplate.getSendPassword(), mailTemplate.getSendHost(),
                email, mailTemplate.getSubject(), mailTemplate.getMsg(), file);

+ 2 - 2
src/main/java/com/fdkankan/manage/service/impl/ManageService.java

@@ -4,7 +4,7 @@ import cn.dev33.satoken.stp.SaLoginConfig;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.extra.servlet.ServletUtil;
 import com.alibaba.fastjson.JSONObject;
-import com.fdkankan.common.constant.ErrorCode;
+import com.fdkankan.manage.common.ResultCode;
 import com.fdkankan.common.util.Base64Converter;
 import com.fdkankan.common.util.SecurityUtil;
 import com.fdkankan.manage.common.RedisKeyUtil;
@@ -35,7 +35,7 @@ public class ManageService {
         this.checkLoginNum(ip,userName);
 
         if(StringUtils.isBlank(userName) || StringUtils.isBlank(password)){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         //对前端传的密码解密
         String passwordMd5 = SecurityUtil.MD52(Base64Converter.decode(Base64Converter.subText(password)));

+ 1 - 1
src/main/java/com/fdkankan/manage/service/impl/Scene3dNumServiceImpl.java

@@ -1,7 +1,7 @@
 package com.fdkankan.manage.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.util.RandomUtil;
 import com.fdkankan.manage.common.CameraTypeEnum;
 import com.fdkankan.manage.common.RedisKeyUtil;

+ 4 - 3
src/main/java/com/fdkankan/manage/service/impl/SceneApplyServiceImpl.java

@@ -5,7 +5,8 @@ import cn.hutool.extra.mail.MailAccount;
 import cn.hutool.extra.mail.MailUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.manage.entity.AgentAudit;
 import com.fdkankan.manage.entity.MailTemplate;
@@ -60,14 +61,14 @@ public class SceneApplyServiceImpl extends ServiceImpl<ISceneApplyMapper, SceneA
     public void sendEmail(Integer sceneApplyId, Integer emailTemplateId) {
         SceneApply sceneApply = this.getById(sceneApplyId);
         if(sceneApply == null){
-            throw new BusinessException(-1,"场景申请不存在");
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         MailTemplate mailTemplate = mailTemplateService.getById(emailTemplateId);
         String msg = mailTemplate.getMsg();
         mailTemplate.setMsg( msg.replace("${username}",sceneApply.getName()));
         Boolean flag = mailTemplateService.sendMail(sceneApply.getEmail(), mailTemplate,null);
         if(!flag){
-            throw new BusinessException(-1,"邮件发送失败");
+            throw new BusinessException(ResultCode.MAIL_SEND_ERROR);
         }
         sceneApply.setState(1);
         this.updateById(sceneApply);

+ 8 - 7
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -8,7 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fdkankan.common.constant.ConstantFilePath;
 import com.fdkankan.common.constant.SceneConstant;
 import com.fdkankan.common.constant.UploadFilePath;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.*;
 import com.fdkankan.manage.httpClient.client.FdKKClient;
@@ -235,11 +236,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
     public void move(SceneParam param) {
         Camera camera = cameraService.getBySnCode(param.getSnCode());
         if(camera == null){
-            throw new BusinessException(-1,"sn码不存在。");
+            throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
         }
         CameraDetail cameraDetail = cameraDetailService.getByCameraId(camera.getId());
         if(cameraDetail == null){
-            throw new BusinessException(-1,"sn码不存在。");
+            throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
         }
         ScenePro scenePro = this.getByNum(param.getNum());
         ScenePlus scenePlus = scenePlusService.getByNum(param.getNum());
@@ -256,18 +257,18 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         space = space == null ? 0 :space;
         Long newUseSpace = space + cameraDetail.getUsedSpace();
         if(newUseSpace  > cameraDetail.getTotalSpace()){
-            throw new BusinessException(-1,"相机容量不足,不能迁移");
+            throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
         }
         Camera oldCamera = cameraService.getById(cameraId);
         if(oldCamera == null){
-            throw new BusinessException(-1,"旧相机不存在");
+            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
         }
         CameraDetail oldCameraDetail = cameraDetailService.getByCameraId(oldCamera.getId());
         if(oldCameraDetail == null){
-            throw new BusinessException(-1,"旧相机不存在。");
+            throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
         }
         if(!oldCameraDetail.getType().equals(cameraDetail.getType())){
-            throw new BusinessException(-1,"必须迁移至相同的类型的相机下面!");
+            throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
         }
         Long oldUseSpace = oldCameraDetail.getUsedSpace() - space < 0 ? 0 : oldCameraDetail.getUsedSpace() - space;
         oldCameraDetail.setUsedSpace(oldUseSpace);

+ 8 - 10
src/main/java/com/fdkankan/manage/service/impl/SpaceSdkServiceImpl.java

@@ -6,8 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.common.util.FileUtils;
@@ -59,7 +59,7 @@ public class SpaceSdkServiceImpl extends ServiceImpl<ISpaceSdkMapper, SpaceSdk>
     @Override
     public String upload(MultipartFile file, String version, String imprintCh, String imprintEn, Integer isTop, Integer platformType) throws IOException {
         if (!file.isEmpty()&& file.getSize() <= 0) {
-            throw new BusinessException(ErrorCode.FILE_NOT_EXIST);
+            throw new BusinessException(ResultCode.UPLOAD_FILE_ERROR);
         }
         String fullFileName = "";
         if(platformType == 1){
@@ -124,24 +124,22 @@ public class SpaceSdkServiceImpl extends ServiceImpl<ISpaceSdkMapper, SpaceSdk>
     @Override
     public void updateByEntity(SpaceSdk param) {
         if(param.getId() == null || StringUtils.isEmpty(param.getPlatformType()) || param.getIsTop()==null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(param.getIsTop().equals(1)){
             this.updateTopFBySdkId(param.getId());//取消所有置顶
         }
-        if(!this.updateById(param)){
-            throw new BusinessException(ErrorCode.ERROR_MSG);
-        }
+        this.updateById(param);
     }
 
     @Override
     public void online(SpaceSdkParam param) {
         if(param.getId() == null || param.getStatus() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         SpaceSdk managerSdkEntity = this.getById(param.getId());
         if(managerSdkEntity == null ){
-            throw new BusinessException(-1,"获取记录为空");
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(managerSdkEntity.getPublishTime()!=null){
              this.updateBySdkId(param.getId(),param.getStatus());
@@ -153,7 +151,7 @@ public class SpaceSdkServiceImpl extends ServiceImpl<ISpaceSdkMapper, SpaceSdk>
     @Override
     public void top(SpaceSdkParam param) {
         if(param.getId() == null || param.getIsTop()==null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         if(param.getIsTop().equals(1)){
             this.updateTopFBySdkId(param.getId());//取消所有置顶

+ 5 - 5
src/main/java/com/fdkankan/manage/service/impl/SysRoleServiceImpl.java

@@ -3,8 +3,8 @@ package com.fdkankan.manage.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.manage.entity.SysRole;
@@ -61,13 +61,13 @@ public class SysRoleServiceImpl extends ServiceImpl<ISysRoleMapper, SysRole> imp
     @Override
     public void delete(Long id) {
         if(StringUtils.isEmpty(id)){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(SysUser::getRoleId,id);
         long count = sysUserService.count(wrapper);
         if(count >0){
-            throw new BusinessException(-1,"该角色已关联用户,不可删除。请先修改相关用户的角色。");
+            throw new BusinessException(ResultCode.DEL_ROLE_ERROR);
         }
         roleMenuService.deleteByRoleId(id);
         this.removeById(id);
@@ -76,7 +76,7 @@ public class SysRoleServiceImpl extends ServiceImpl<ISysRoleMapper, SysRole> imp
     @Override
     public void giveMenu(SysRoleMenuParam param) {
         if(param.getRoleId() == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         roleMenuService.deleteByRoleId(param.getRoleId());
         roleMenuService.saveBatchByRoleId(param.getRoleId(),param.getMenuIds());

+ 3 - 2
src/main/java/com/fdkankan/manage/service/impl/SysUserServiceImpl.java

@@ -4,7 +4,8 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.Base64Converter;
 import com.fdkankan.common.util.DateUtil;
@@ -95,7 +96,7 @@ public class SysUserServiceImpl extends ServiceImpl<ISysUserMapper, SysUser> imp
         if(param.getId() == null){
             SysUser user = this.getByUserName(param.getUserName());
             if(user !=null){
-                throw new BusinessException(-1,"用户已存在!");
+                throw new BusinessException(ResultCode.USER_EXIST);
             }
         }
         SysUser sysUser = new SysUser();

+ 4 - 4
src/main/java/com/fdkankan/manage/service/impl/UserIncrementServiceImpl.java

@@ -4,8 +4,8 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.common.util.DateUtil;
 import com.fdkankan.manage.entity.Camera;
@@ -56,7 +56,7 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
     @Override
     public PageInfo pageList(Long userId, Integer pageNum, Integer pageSize) {
         if(userId == null){
-            throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         LambdaQueryWrapper<UserIncrement> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(UserIncrement::getUserId,userId);
@@ -95,7 +95,7 @@ public class UserIncrementServiceImpl extends ServiceImpl<IUserIncrementMapper,
     public void delayById(Long id, Integer year) {
         UserIncrement userIncrement = this.getById(id);
         if(userIncrement == null){
-            throw new BusinessException(-1,"权益包不存在");
+            throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         userIncrement.setIsExpired(0);
         Date date = DateUtil.string2Date(userIncrement.getIncrementEndTime(), DateUtil.DEFAULT_DATE_FORMAT);

+ 3 - 3
src/main/java/com/fdkankan/manage/service/impl/UserServiceImpl.java

@@ -3,8 +3,8 @@ package com.fdkankan.manage.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fdkankan.common.constant.ErrorCode;
-import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.manage.common.ResultCode;
+import com.fdkankan.manage.exception.BusinessException;
 import com.fdkankan.common.response.PageInfo;
 import com.fdkankan.manage.entity.User;
 import com.fdkankan.manage.mapper.IUserMapper;
@@ -66,7 +66,7 @@ public class UserServiceImpl extends ServiceImpl<IUserMapper, User> implements I
     public void addDownNum(UserIncrementParam param) {
         User user = this.getById(param.getUserId());
         if(user == null){
-            throw new BusinessException(ErrorCode.USER_NOT_EXIST);
+            throw new BusinessException(ResultCode.USER_NOT_EXIST);
         }
         Integer totalNum = user.getDownloadNumTotal() == null ? 0 : user.getDownloadNumTotal() + param.getCount();
         user.setDownloadNumTotal(totalNum);