|
@@ -60,25 +60,28 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
patrolInspectionScheme.setExecutions(0);
|
|
|
this.save(patrolInspectionScheme);
|
|
|
Integer inspectionSchemeId = patrolInspectionScheme.getId();
|
|
|
- PatrolInspectionRoute patrolInspectionRoute = new PatrolInspectionRoute();
|
|
|
-
|
|
|
- patrolInspectionRoute.setInspectionRouteName(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getInspectionRouteName());
|
|
|
- patrolInspectionRoute.setInspectionSchemeId(inspectionSchemeId);
|
|
|
- patrolInspectionRoute.setSiteId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getSiteId());
|
|
|
- patrolInspectionRoute.setCreator(user.getUserName());
|
|
|
- patrolInspectionRoute.setCreateTime(new Date());
|
|
|
- patrolInspectionRoute.setStatus(1);
|
|
|
- patrolInspectionRouteService.save(patrolInspectionRoute);
|
|
|
- Integer inspectionRouteId = patrolInspectionRoute.getId();
|
|
|
- if (patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getPatrolRouteContentVo().size() > 0) {
|
|
|
- for (int j = 0; j < patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getPatrolRouteContentVo().size(); j++) {
|
|
|
- PatrolRouteContent patrolRouteContent = new PatrolRouteContent();
|
|
|
- patrolRouteContent.setInspectionContentId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getPatrolRouteContentVo().get(j).getInspectionContentId());
|
|
|
- patrolRouteContent.setInspectionRouteId(inspectionRouteId);
|
|
|
- patrolRouteContent.setCreator(user.getUserName());
|
|
|
- patrolRouteContent.setCreateTime(new Date());
|
|
|
- patrolRouteContent.setStatus(1);
|
|
|
- patrolRouteContentService.save(patrolRouteContent);
|
|
|
+ if (patrolInspectionSchemeVo.getPatrolInspectionRouteVo().size()>0){
|
|
|
+ for (int i=0;i<patrolInspectionSchemeVo.getPatrolInspectionRouteVo().size();i++){
|
|
|
+ PatrolInspectionRoute patrolInspectionRoute = new PatrolInspectionRoute();
|
|
|
+ patrolInspectionRoute.setInspectionRouteName(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getInspectionRouteName());
|
|
|
+ patrolInspectionRoute.setInspectionSchemeId(inspectionSchemeId);
|
|
|
+ patrolInspectionRoute.setSiteId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getSiteId());
|
|
|
+ patrolInspectionRoute.setCreator(user.getUserName());
|
|
|
+ patrolInspectionRoute.setCreateTime(new Date());
|
|
|
+ patrolInspectionRoute.setStatus(1);
|
|
|
+ patrolInspectionRouteService.save(patrolInspectionRoute);
|
|
|
+ Integer inspectionRouteId = patrolInspectionRoute.getId();
|
|
|
+ if (patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getPatrolRouteContentVo().size() > 0) {
|
|
|
+ for (int j = 0; j < patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getPatrolRouteContentVo().size(); j++) {
|
|
|
+ PatrolRouteContent patrolRouteContent = new PatrolRouteContent();
|
|
|
+ patrolRouteContent.setInspectionContentId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getPatrolRouteContentVo().get(j).getInspectionContentId());
|
|
|
+ patrolRouteContent.setInspectionRouteId(inspectionRouteId);
|
|
|
+ patrolRouteContent.setCreator(user.getUserName());
|
|
|
+ patrolRouteContent.setCreateTime(new Date());
|
|
|
+ patrolRouteContent.setStatus(1);
|
|
|
+ patrolRouteContentService.save(patrolRouteContent);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -128,24 +131,28 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
}
|
|
|
}
|
|
|
//重新添加新数据
|
|
|
- PatrolInspectionRoute patrolInspectionRoute = new PatrolInspectionRoute();
|
|
|
- patrolInspectionRoute.setInspectionRouteName(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getInspectionRouteName());
|
|
|
- patrolInspectionRoute.setInspectionSchemeId(inspectionSchemeId);
|
|
|
- patrolInspectionRoute.setSiteId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getSiteId());
|
|
|
- patrolInspectionRoute.setCreator(user.getUserName());
|
|
|
- patrolInspectionRoute.setCreateTime(new Date());
|
|
|
- patrolInspectionRoute.setStatus(1);
|
|
|
- patrolInspectionRouteService.save(patrolInspectionRoute);
|
|
|
- Integer inspectionRouteId = patrolInspectionRoute.getId();
|
|
|
- if (patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getPatrolRouteContentVo().size() > 0) {
|
|
|
- for (int j = 0; j < patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getPatrolRouteContentVo().size(); j++) {
|
|
|
- PatrolRouteContent patrolRouteContent = new PatrolRouteContent();
|
|
|
- patrolRouteContent.setInspectionContentId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().getPatrolRouteContentVo().get(j).getInspectionContentId());
|
|
|
- patrolRouteContent.setInspectionRouteId(inspectionRouteId);
|
|
|
- patrolRouteContent.setCreator(user.getUserName());
|
|
|
- patrolRouteContent.setCreateTime(new Date());
|
|
|
- patrolRouteContent.setStatus(1);
|
|
|
- patrolRouteContentService.save(patrolRouteContent);
|
|
|
+ if (patrolInspectionSchemeVo.getPatrolInspectionRouteVo().size()>0){
|
|
|
+ for (int i =0;i<patrolInspectionSchemeVo.getPatrolInspectionRouteVo().size();i++){
|
|
|
+ PatrolInspectionRoute patrolInspectionRoute = new PatrolInspectionRoute();
|
|
|
+ patrolInspectionRoute.setInspectionRouteName(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getInspectionRouteName());
|
|
|
+ patrolInspectionRoute.setInspectionSchemeId(inspectionSchemeId);
|
|
|
+ patrolInspectionRoute.setSiteId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getSiteId());
|
|
|
+ patrolInspectionRoute.setCreator(user.getUserName());
|
|
|
+ patrolInspectionRoute.setCreateTime(new Date());
|
|
|
+ patrolInspectionRoute.setStatus(1);
|
|
|
+ patrolInspectionRouteService.save(patrolInspectionRoute);
|
|
|
+ Integer inspectionRouteId = patrolInspectionRoute.getId();
|
|
|
+ if (patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getPatrolRouteContentVo().size() > 0) {
|
|
|
+ for (int j = 0; j < patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getPatrolRouteContentVo().size(); j++) {
|
|
|
+ PatrolRouteContent patrolRouteContent = new PatrolRouteContent();
|
|
|
+ patrolRouteContent.setInspectionContentId(patrolInspectionSchemeVo.getPatrolInspectionRouteVo().get(i).getPatrolRouteContentVo().get(j).getInspectionContentId());
|
|
|
+ patrolRouteContent.setInspectionRouteId(inspectionRouteId);
|
|
|
+ patrolRouteContent.setCreator(user.getUserName());
|
|
|
+ patrolRouteContent.setCreateTime(new Date());
|
|
|
+ patrolRouteContent.setStatus(1);
|
|
|
+ patrolRouteContentService.save(patrolRouteContent);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -176,7 +183,7 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
@Override
|
|
|
public List<PatrolInspectionSchemeOneVo> PatrolInspectionScheme(Integer id) {
|
|
|
// PatrolInspectionSchemeVo patrolInspectionSchemeVo = new PatrolInspectionSchemeVo();
|
|
|
- PatrolInspectionRouteVo patrolInspectionRouteVo = new PatrolInspectionRouteVo();
|
|
|
+ List<PatrolInspectionRouteVo> patrolInspectionRouteVoList = new ArrayList<>();
|
|
|
PatrolInspectionTeamVo patrolInspectionTeamVo = new PatrolInspectionTeamVo();
|
|
|
LambdaQueryWrapper<PatrolInspectionScheme> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(PatrolInspectionScheme::getId, id);
|
|
@@ -187,18 +194,19 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
queryWrapperOne.eq(PatrolInspectionRoute::getInspectionSchemeId, id).eq(PatrolInspectionRoute::getStatus, 1);
|
|
|
List<PatrolInspectionRoute> patrolInspectionRouteList = patrolInspectionRouteService.list(queryWrapperOne);
|
|
|
if (patrolInspectionRouteList.size() > 0) {
|
|
|
-// for (int i = 0; i < patrolInspectionRouteList.size(); i++) {
|
|
|
- List<PatrolRouteContentVo> patrolRouteContentList = baseMapper.patrolRouteContent(patrolInspectionRouteList.get(0).getId());
|
|
|
- Integer inspectionSchemeId = patrolInspectionRouteList.get(0).getInspectionSchemeId();
|
|
|
-
|
|
|
+ for (int i = 0; i < patrolInspectionRouteList.size(); i++) {
|
|
|
+ List<PatrolRouteContentVo> patrolRouteContentList = baseMapper.patrolRouteContent(patrolInspectionRouteList.get(i).getId());
|
|
|
+ Integer inspectionSchemeId = patrolInspectionRouteList.get(i).getInspectionSchemeId();
|
|
|
+ PatrolInspectionRouteVo patrolInspectionRouteVo = new PatrolInspectionRouteVo();
|
|
|
patrolInspectionRouteVo.setInspectionSchemeId(inspectionSchemeId);
|
|
|
- patrolInspectionRouteVo.setInspectionRouteName(patrolInspectionRouteList.get(0).getInspectionRouteName());
|
|
|
- patrolInspectionRouteVo.setCreator(patrolInspectionRouteList.get(0).getCreator());
|
|
|
- patrolInspectionRouteVo.setCreateTime(patrolInspectionRouteList.get(0).getCreateTime());
|
|
|
- patrolInspectionRouteVo.setId(patrolInspectionRouteList.get(0).getId());
|
|
|
- patrolInspectionRouteVo.setStatus(patrolInspectionRouteList.get(0).getStatus());
|
|
|
+ patrolInspectionRouteVo.setInspectionRouteName(patrolInspectionRouteList.get(i).getInspectionRouteName());
|
|
|
+ patrolInspectionRouteVo.setCreator(patrolInspectionRouteList.get(i).getCreator());
|
|
|
+ patrolInspectionRouteVo.setCreateTime(patrolInspectionRouteList.get(i).getCreateTime());
|
|
|
+ patrolInspectionRouteVo.setId(patrolInspectionRouteList.get(i).getId());
|
|
|
+ patrolInspectionRouteVo.setStatus(patrolInspectionRouteList.get(i).getStatus());
|
|
|
patrolInspectionRouteVo.setPatrolRouteContentVo(patrolRouteContentList);
|
|
|
-// }
|
|
|
+ patrolInspectionRouteVoList.add(patrolInspectionRouteVo);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//团队查询
|
|
@@ -206,7 +214,6 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
queryWrapperTwo.eq(PatrolInspectionTeam::getId, patrolInspectionSchemeList.get(0).getInspectionTeamId()).eq(PatrolInspectionTeam::getStatus, 1);
|
|
|
List<PatrolInspectionTeam> patrolInspectionTeamList = patrolInspectionTeamService.list(queryWrapperTwo);
|
|
|
if (patrolInspectionTeamList.size() > 0) {
|
|
|
-// for (int i = 0; i < patrolInspectionTeamList.size(); i++) {
|
|
|
List<PatrolInspectors> patrolInspectorsList = baseMapper.patrolInspectorsList(patrolInspectionTeamList.get(0).getId());
|
|
|
patrolInspectionTeamVo.setId(patrolInspectionTeamList.get(0).getId());
|
|
|
patrolInspectionTeamVo.setTeamName(patrolInspectionTeamList.get(0).getTeamName());
|
|
@@ -218,7 +225,6 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
patrolInspectionTeamVo.setCreateTime(patrolInspectionTeamList.get(0).getCreateTime());
|
|
|
patrolInspectionTeamVo.setStatus(patrolInspectionTeamList.get(0).getStatus());
|
|
|
patrolInspectionTeamVo.setPatrolInspectors(patrolInspectorsList);
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
List<PatrolInspectionSchemeOneVo> list = new ArrayList<>();
|
|
@@ -240,7 +246,7 @@ public class PatrolInspectionSchemeServiceImpl extends AbstractCrudService<Patro
|
|
|
.executions(patrolInspectionSchemeList.get(0).getExecutions())
|
|
|
.id(patrolInspectionSchemeList.get(0).getId())
|
|
|
.patrolInspectionTeamVo(patrolInspectionTeamVo)
|
|
|
- .patrolInspectionRouteVo(patrolInspectionRouteVo)
|
|
|
+ .patrolInspectionRouteVo(patrolInspectionRouteVoList)
|
|
|
.build()
|
|
|
);
|
|
|
return list;
|