Browse Source

巡检人员状态查询(operateType:0,签到;1,签退)

fuyuhchuan 1 year ago
parent
commit
4e11de7abb

+ 8 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionPersonnelController.java

@@ -102,5 +102,13 @@ public class PatrolInspectionPersonnelController {
     public ApiResult<List<PatrolInspectionPersonnelVo>> patrolInspectionPersonnelSelect(@RequestParam(value = "areaId", required = false) Integer areaId) {
         return ApiResult.success(patrolInspectionPersonnelService.patrolInspectionPersonnelSelect(areaId));
     }
+
+    /**
+     * 人员状态查询(0:签到,1:签退)
+     */
+    @GetMapping("getStatus")
+    public ApiResult<PatrolInspectionPersonnel> getStatus(){
+        return ApiResult.success(patrolInspectionPersonnelService.getStatus());
+    }
 }
 

+ 1 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPersonnelService.java

@@ -32,5 +32,6 @@ public interface PatrolInspectionPersonnelService extends CrudService<PatrolInsp
 
     void updateSignStatus(Integer status);
 
+    PatrolInspectionPersonnel getStatus();
 
 }

+ 12 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPersonnelServiceImpl.java

@@ -216,6 +216,9 @@ public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<Pa
         return patrolInspectionAreaVoListOne;
     }
 
+    /**
+     * 签到状态更新
+     */
     public void updateSignStatus(Integer status) {
         LambdaUpdateWrapper<PatrolInspectionPersonnel> updateWrapper = Wrappers.lambdaUpdate();
         updateWrapper.eq(PatrolInspectionPersonnel::getUserId, SecurityUtils.getUserId())
@@ -224,6 +227,15 @@ public class PatrolInspectionPersonnelServiceImpl extends AbstractCrudService<Pa
         baseMapper.update(null, updateWrapper);
     }
 
+    /**
+     * 签到状态查询
+     */
+    public PatrolInspectionPersonnel getStatus(){
+        LambdaQueryWrapper<PatrolInspectionPersonnel> wrapper = Wrappers.lambdaQuery();
+        wrapper.eq(PatrolInspectionPersonnel::getUserId,SecurityUtils.getUserId());
+        return baseMapper.selectOne(wrapper);
+    }
+
 
     @Override
     public List<PatrolInspectionPersonnelVo> patrolInspectionPersonnelSelect(Integer areaId) {