Browse Source

设备,账号添加禁用状态

lyhzzz 1 năm trước cách đây
mục cha
commit
7d62cc2768

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

@@ -45,5 +45,11 @@ public class RtkAccountController {
         rtkAccountService.del(param);
         return ResultData.ok();
     }
+
+    @PostMapping("/uploadExcel")
+    public ResultData uploadExcel(@RequestBody RtkAccount param){
+        rtkAccountService.del(param);
+        return ResultData.ok();
+    }
 }
 

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/RtkAccount.java

@@ -63,6 +63,9 @@ public class RtkAccount implements Serializable {
     @TableField("status")
     private Integer status;
 
+    @TableField("use_status")
+    private Integer useStatus;
+
     @TableField("failure_time")
     private Date failureTime;
 

+ 3 - 0
src/main/java/com/fdkankan/manage/entity/RtkDevice.java

@@ -40,6 +40,9 @@ public class RtkDevice implements Serializable {
     @TableField("rtk_type")
     private Integer rtkType;
 
+    @TableField("use_status")
+    private Integer useStatus;
+
     @TableField("rec_status")
     @TableLogic(value = "A",delval = "I")
     private String recStatus;

+ 1 - 1
src/main/java/com/fdkankan/manage/inner/controller/InnerController.java

@@ -94,7 +94,7 @@ public class InnerController extends BaseController {
             throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
         }
         RtkDevice rtkDevice = rtkDeviceService.getByRtkSnCode(rtkSnCode);
-        if(rtkDevice == null){
+        if(rtkDevice == null || rtkDevice.getUseStatus() !=0){
             throw new BusinessException(ResultCode.RTK_SN_CODE_NOT_EXIT);
         }
         RtkInfo rtkInfo = new RtkInfo();

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

@@ -88,6 +88,7 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
 
         LambdaQueryWrapper<RtkAccount> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(RtkAccount::getStatus,0,1);
+        wrapper.eq(RtkAccount::getUseStatus,0);
         wrapper.orderByAsc(RtkAccount::getUpdateTime);
         wrapper.orderByAsc(RtkAccount::getId);
         List<RtkAccount> list = this.list(wrapper);
@@ -117,7 +118,7 @@ public class RtkAccountServiceImpl extends ServiceImpl<IRtkAccountMapper, RtkAcc
 
     private Boolean checkAccountFailureTime(Integer accountId) {
         RtkAccount dbRtkAccount = this.getById(accountId);
-        if(dbRtkAccount == null || dbRtkAccount.getStatus() == 3){
+        if(dbRtkAccount == null || dbRtkAccount.getStatus() == 3 || dbRtkAccount.getUseStatus() == 1){
             return false;
         }
         if(dbRtkAccount.getFailureTime() != null &&  dbRtkAccount.getFailureTime().getTime() <= new Date().getTime() ){