jiawuxian il y a 2 ans
Parent
commit
b6918dc861

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/ProtectionController.java

@@ -75,7 +75,7 @@ class ProtectionController extends BaseController {
     @ApiOperation(value = "布撤防")
     @PostMapping("updatestatus/{protectionId}/{status}")
     @RequiresPermissions("device:protection:maintain")
-    public AjaxResult edit(@PathVariable Long protectionId,@PathVariable String status) {
+    public AjaxResult updateStatus(@PathVariable Long protectionId,@PathVariable String status) {
         return success(protectionService.updateStatus(protectionId,status));
     }
 }

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/IProtectionService.java

@@ -9,6 +9,7 @@ import com.xunmei.core.resumption.dto.protection.ProtectionLogPageDto;
 import com.xunmei.core.resumption.dto.protection.ProtectionPageDto;
 import com.xunmei.core.resumption.vo.protection.ProtectionLogPageVo;
 
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -33,7 +34,7 @@ public interface IProtectionService extends IService<Protection> {
 
     TableDataInfo history(ProtectionLogPageDto request);
 
-    boolean updateStatus(Long protectionId,String status);
+    Date updateStatus(Long protectionId, String status);
 
     List<Protection> findNotAllHour(Long orgId);
 //    MePage<pageSensorVo> pageSensorList(pageSensorDto request);

+ 3 - 3
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ProtectionServiceImpl.java

@@ -120,7 +120,7 @@ public class ProtectionServiceImpl extends ServiceImpl<ProtectionMapper, Protect
 
     @Override
     @Transactional
-    public boolean updateStatus(Long protectionId, String status) {
+    public Date updateStatus(Long protectionId, String status) {
         Date now = DateUtil.date();
         int count = baseMapper.update(null, new LambdaUpdateWrapper<Protection>()
                 .eq(Protection::getId, protectionId)
@@ -139,7 +139,7 @@ public class ProtectionServiceImpl extends ServiceImpl<ProtectionMapper, Protect
             protectionLogMapper.insert(log);
         }
 
-        return count > 0;
+        return count > 0 ? now : null;
     }
 
     @Override
@@ -147,7 +147,7 @@ public class ProtectionServiceImpl extends ServiceImpl<ProtectionMapper, Protect
         List<Protection> list = baseMapper.selectList(new LambdaQueryWrapper<Protection>()
                 .eq(Protection::getOrgId, orgId)
                 .eq(Protection::getDeleted, 0)
-                .eq(Protection::getAllHour,0));
+                .eq(Protection::getAllHour, 0));
         return list;
     }
 }