|
@@ -15,6 +15,7 @@ import com.usky.fire.service.vo.DataCountVo;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionAreaVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -41,7 +42,7 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
|
|
|
.eq(PatrolInspectionArea::getEnable, 1);
|
|
|
List<PatrolInspectionArea> patrolInspectionAreaList = patrolInspectionAreaService.list(queryWrapper);
|
|
|
LambdaQueryWrapper<PatrolInspectionSite> queryWrapperOne = Wrappers.lambdaQuery();
|
|
|
- queryWrapperOne.eq(PatrolInspectionSite::getEnable, 1);
|
|
|
+ queryWrapperOne.eq(PatrolInspectionSite::getEnable, 1).eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
|
|
|
List<PatrolInspectionSite> list = this.list(queryWrapperOne);
|
|
|
Map<Integer, List<PatrolInspectionSite>> grouypByAreaId = list.stream().collect(
|
|
|
Collectors.groupingBy(o -> o.getAreaId())
|
|
@@ -100,4 +101,31 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
|
|
|
return new CommonPage<>(list, patrolInspectionSiteList.size(), pageNum, pageSize);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void updatePatrolInspectionSiteList(List<PatrolInspectionSite> patrolInspectionSiteList){
|
|
|
+ for (int i=0;i<patrolInspectionSiteList.size();i++){
|
|
|
+ PatrolInspectionSite patrolInspectionSite = new PatrolInspectionSite();
|
|
|
+ patrolInspectionSite.setId(patrolInspectionSiteList.get(i).getId());
|
|
|
+ patrolInspectionSite.setAreaId(patrolInspectionSiteList.get(i).getAreaId());
|
|
|
+ patrolInspectionSite.setPictureUrl(patrolInspectionSiteList.get(i).getPictureUrl());
|
|
|
+ patrolInspectionSite.setDistanceRange(patrolInspectionSiteList.get(i).getDistanceRange());
|
|
|
+ this.updateById(patrolInspectionSite);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updatePatrolInspectionSite(PatrolInspectionSite patrolInspectionSite){
|
|
|
+ this.updateById(patrolInspectionSite);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delPatrolInspectionSite(Integer id){
|
|
|
+ PatrolInspectionSite patrolInspectionSite = new PatrolInspectionSite();
|
|
|
+ patrolInspectionSite.setId(id);
|
|
|
+ patrolInspectionSite.setEnable(0);
|
|
|
+ this.updateById(patrolInspectionSite);
|
|
|
+ }
|
|
|
+
|
|
|
}
|