459242451@qq.com 3 жил өмнө
parent
commit
7426677dd2
35 өөрчлөгдсөн 2332 нэмэгдсэн , 39 устгасан
  1. 0 12
      bin/clean.bat
  2. 0 12
      bin/package.bat
  3. 0 14
      bin/run.bat
  4. 115 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionLineController.java
  5. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionLineLocationController.java
  6. 124 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionPlanController.java
  7. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionPlanUserController.java
  8. 1 1
      ruoyi-admin/src/main/resources/application.yml
  9. 188 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLine.java
  10. 79 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLineLocation.java
  11. 20 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLocation.java
  12. 161 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionPlan.java
  13. 79 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionPlanUser.java
  14. 66 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLineLocationMapper.java
  15. 61 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLineMapper.java
  16. 2 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLocationMapper.java
  17. 61 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionPlanMapper.java
  18. 69 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionPlanUserMapper.java
  19. 65 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLineLocationService.java
  20. 61 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLineService.java
  21. 2 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLocationService.java
  22. 61 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionPlanService.java
  23. 67 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionPlanUserService.java
  24. 103 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLineLocationServiceImpl.java
  25. 118 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLineServiceImpl.java
  26. 5 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLocationServiceImpl.java
  27. 116 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionPlanServiceImpl.java
  28. 109 0
      ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionPlanUserServiceImpl.java
  29. 1 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlAreaMapper.xml
  30. 1 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionDeviceMapper.xml
  31. 77 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLineLocationMapper.xml
  32. 106 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLineMapper.xml
  33. 22 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLocationMapper.xml
  34. 99 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionPlanMapper.xml
  35. 85 0
      ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionPlanUserMapper.xml

+ 0 - 12
bin/clean.bat

@@ -1,12 +0,0 @@
-@echo off
-echo.
-echo [信息] 清理工程target生成路径。
-echo.
-
-%~d0
-cd %~dp0
-
-cd ..
-call mvn clean
-
-pause

+ 0 - 12
bin/package.bat

@@ -1,12 +0,0 @@
-@echo off
-echo.
-echo [信息] 打包Web工程,生成war/jar包文件。
-echo.
-
-%~d0
-cd %~dp0
-
-cd ..
-call mvn clean package -Dmaven.test.skip=true
-
-pause

+ 0 - 14
bin/run.bat

@@ -1,14 +0,0 @@
-@echo off
-echo.
-echo [信息] 使用Jar命令运行Web工程。
-echo.
-
-cd %~dp0
-cd ../ruoyi-admin/target
-
-set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
-
-java -jar %JAVA_OPTS% ruoyi-admin.jar
-
-cd bin
-pause

+ 115 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionLineController.java

@@ -0,0 +1,115 @@
+package com.ruoyi.web.controller.qdtl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.qdtl.domain.TlInspectionLocation;
+import com.ruoyi.qdtl.service.ITlInspectionLocationService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.qdtl.domain.TlInspectionLine;
+import com.ruoyi.qdtl.service.ITlInspectionLineService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 巡检线路管理Controller
+ *
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@RestController
+@RequestMapping("/qdtl/line")
+public class TlInspectionLineController extends BaseController {
+    @Autowired
+    private ITlInspectionLineService tlInspectionLineService;
+    @Autowired
+    private ITlInspectionLocationService tlInspectionLocationService;
+
+    /**
+     * 查询巡检线路管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:line:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TlInspectionLine tlInspectionLine) {
+        startPage();
+        List<TlInspectionLine> list = tlInspectionLineService.selectTlInspectionLineList(tlInspectionLine);
+        if (list.size() > 0) {
+            List<Long> idCollect = list.stream().map(TlInspectionLine::getId).collect(Collectors.toList());
+            // 查询所有的点位
+            List<TlInspectionLocation> locations = tlInspectionLocationService.queryLocationByLineIds(idCollect);
+            Map<Long, List<TlInspectionLocation>> collect = locations.stream().collect(Collectors.groupingBy(TlInspectionLocation::getLineId, Collectors.toList()));
+            for (TlInspectionLine inspectionLine : list) {
+                inspectionLine.setLocations(collect.get(inspectionLine.getId()));
+                inspectionLine.setLineLocationNum(inspectionLine.getLocations() == null ? 0 : inspectionLine.getLocations().size());
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检线路管理列表
+     */
+    /*@PreAuthorize("@ss.hasPermi('qdtl:line:export')")
+    @Log(title = "巡检线路管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TlInspectionLine tlInspectionLine)
+    {
+        List<TlInspectionLine> list = tlInspectionLineService.selectTlInspectionLineList(tlInspectionLine);
+        ExcelUtil<TlInspectionLine> util = new ExcelUtil<TlInspectionLine>(TlInspectionLine.class);
+        util.exportExcel(response, list, "巡检线路管理数据");
+    }*/
+
+    /**
+     * 获取巡检线路管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:line:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tlInspectionLineService.selectTlInspectionLineById(id));
+    }
+
+    /**
+     * 新增巡检线路管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:line:add')")
+    @Log(title = "巡检线路管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TlInspectionLine tlInspectionLine) {
+        return toAjax(tlInspectionLineService.insertTlInspectionLine(tlInspectionLine));
+    }
+
+    /**
+     * 修改巡检线路管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:line:edit')")
+    @Log(title = "巡检线路管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TlInspectionLine tlInspectionLine) {
+        return toAjax(tlInspectionLineService.updateTlInspectionLine(tlInspectionLine));
+    }
+
+    /**
+     * 删除巡检线路管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:line:remove')")
+    @Log(title = "巡检线路管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tlInspectionLineService.deleteTlInspectionLineByIds(ids));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionLineLocationController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.qdtl;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.qdtl.domain.TlInspectionLineLocation;
+import com.ruoyi.qdtl.service.ITlInspectionLineLocationService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 巡检线路点位Controller
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@RestController
+@RequestMapping("/qdtl/lineLocation")
+public class TlInspectionLineLocationController extends BaseController
+{
+    @Autowired
+    private ITlInspectionLineLocationService tlInspectionLineLocationService;
+
+    /**
+     * 查询巡检线路点位列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:location:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        startPage();
+        List<TlInspectionLineLocation> list = tlInspectionLineLocationService.selectTlInspectionLineLocationList(tlInspectionLineLocation);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检线路点位列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:location:export')")
+    @Log(title = "巡检线路点位", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        List<TlInspectionLineLocation> list = tlInspectionLineLocationService.selectTlInspectionLineLocationList(tlInspectionLineLocation);
+        ExcelUtil<TlInspectionLineLocation> util = new ExcelUtil<TlInspectionLineLocation>(TlInspectionLineLocation.class);
+        util.exportExcel(response, list, "巡检线路点位数据");
+    }
+
+    /**
+     * 获取巡检线路点位详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:location:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tlInspectionLineLocationService.selectTlInspectionLineLocationById(id));
+    }
+
+    /**
+     * 新增巡检线路点位
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:location:add')")
+    @Log(title = "巡检线路点位", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        return toAjax(tlInspectionLineLocationService.insertTlInspectionLineLocation(tlInspectionLineLocation));
+    }
+
+    /**
+     * 修改巡检线路点位
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:location:edit')")
+    @Log(title = "巡检线路点位", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        return toAjax(tlInspectionLineLocationService.updateTlInspectionLineLocation(tlInspectionLineLocation));
+    }
+
+    /**
+     * 删除巡检线路点位
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:location:remove')")
+    @Log(title = "巡检线路点位", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tlInspectionLineLocationService.deleteTlInspectionLineLocationByIds(ids));
+    }
+}

+ 124 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionPlanController.java

@@ -0,0 +1,124 @@
+package com.ruoyi.web.controller.qdtl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.qdtl.domain.TlInspectionLine;
+import com.ruoyi.qdtl.domain.TlInspectionLocation;
+import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
+import com.ruoyi.qdtl.service.ITlInspectionPlanUserService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.qdtl.domain.TlInspectionPlan;
+import com.ruoyi.qdtl.service.ITlInspectionPlanService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 巡检计划管理Controller
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@RestController
+@RequestMapping("/qdtl/plan")
+public class TlInspectionPlanController extends BaseController
+{
+    @Autowired
+    private ITlInspectionPlanService tlInspectionPlanService;
+    @Autowired
+    private ITlInspectionPlanUserService tlInspectionPlanUserService;
+
+    /**
+     * 查询巡检计划管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:plan:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TlInspectionPlan tlInspectionPlan)
+    {
+        startPage();
+        List<TlInspectionPlan> list = tlInspectionPlanService.selectTlInspectionPlanList(tlInspectionPlan);
+        if (list.size() > 0) {
+            // 查询计划执行的人员
+            List<Long> idCollect = list.stream().map(TlInspectionPlan::getId).collect(Collectors.toList());
+            List<TlInspectionPlanUser> users = tlInspectionPlanUserService.queryUserByPlanIds(idCollect);
+            Map<Long, List<TlInspectionPlanUser>> collect = users.stream().collect(Collectors.groupingBy(TlInspectionPlanUser::getPlanId, Collectors.toList()));
+            for (TlInspectionPlan inspectionPlan : list) {
+                inspectionPlan.setPlanUsers(collect.get(inspectionPlan.getId()));
+                String planUser = inspectionPlan.getPlanUsers().stream().map(TlInspectionPlanUser::getNickName).collect(Collectors.joining("、"));
+                inspectionPlan.setPlanUser(planUser);
+            }
+        }
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检计划管理列表
+     */
+    /*@PreAuthorize("@ss.hasPermi('qdtl:plan:export')")
+    @Log(title = "巡检计划管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TlInspectionPlan tlInspectionPlan)
+    {
+        List<TlInspectionPlan> list = tlInspectionPlanService.selectTlInspectionPlanList(tlInspectionPlan);
+        ExcelUtil<TlInspectionPlan> util = new ExcelUtil<TlInspectionPlan>(TlInspectionPlan.class);
+        util.exportExcel(response, list, "巡检计划管理数据");
+    }*/
+
+    /**
+     * 获取巡检计划管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:plan:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tlInspectionPlanService.selectTlInspectionPlanById(id));
+    }
+
+    /**
+     * 新增巡检计划管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:plan:add')")
+    @Log(title = "巡检计划管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TlInspectionPlan tlInspectionPlan)
+    {
+        return toAjax(tlInspectionPlanService.insertTlInspectionPlan(tlInspectionPlan));
+    }
+
+    /**
+     * 修改巡检计划管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:plan:edit')")
+    @Log(title = "巡检计划管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TlInspectionPlan tlInspectionPlan)
+    {
+        return toAjax(tlInspectionPlanService.updateTlInspectionPlan(tlInspectionPlan));
+    }
+
+    /**
+     * 删除巡检计划管理
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:plan:remove')")
+    @Log(title = "巡检计划管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tlInspectionPlanService.deleteTlInspectionPlanByIds(ids));
+    }
+}

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/qdtl/TlInspectionPlanUserController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.qdtl;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
+import com.ruoyi.qdtl.service.ITlInspectionPlanUserService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 巡检计划人员关系Controller
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@RestController
+@RequestMapping("/qdtl/planUser")
+public class TlInspectionPlanUserController extends BaseController
+{
+    @Autowired
+    private ITlInspectionPlanUserService tlInspectionPlanUserService;
+
+    /**
+     * 查询巡检计划人员关系列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:user:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        startPage();
+        List<TlInspectionPlanUser> list = tlInspectionPlanUserService.selectTlInspectionPlanUserList(tlInspectionPlanUser);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出巡检计划人员关系列表
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:user:export')")
+    @Log(title = "巡检计划人员关系", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        List<TlInspectionPlanUser> list = tlInspectionPlanUserService.selectTlInspectionPlanUserList(tlInspectionPlanUser);
+        ExcelUtil<TlInspectionPlanUser> util = new ExcelUtil<TlInspectionPlanUser>(TlInspectionPlanUser.class);
+        util.exportExcel(response, list, "巡检计划人员关系数据");
+    }
+
+    /**
+     * 获取巡检计划人员关系详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:user:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(tlInspectionPlanUserService.selectTlInspectionPlanUserById(id));
+    }
+
+    /**
+     * 新增巡检计划人员关系
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:user:add')")
+    @Log(title = "巡检计划人员关系", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        return toAjax(tlInspectionPlanUserService.insertTlInspectionPlanUser(tlInspectionPlanUser));
+    }
+
+    /**
+     * 修改巡检计划人员关系
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:user:edit')")
+    @Log(title = "巡检计划人员关系", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        return toAjax(tlInspectionPlanUserService.updateTlInspectionPlanUser(tlInspectionPlanUser));
+    }
+
+    /**
+     * 删除巡检计划人员关系
+     */
+    @PreAuthorize("@ss.hasPermi('qdtl:user:remove')")
+    @Log(title = "巡检计划人员关系", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tlInspectionPlanUserService.deleteTlInspectionPlanUserByIds(ids));
+    }
+}

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -89,7 +89,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 30
+    expireTime: 10080
   
 # MyBatis配置
 mybatis:

+ 188 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLine.java

@@ -0,0 +1,188 @@
+package com.ruoyi.qdtl.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 巡检线路管理对象 tl_inspection_line
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public class TlInspectionLine extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 编号 */
+    @Excel(name = "编号")
+    private String lineCode;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String lineName;
+
+    /** 描述 */
+    @Excel(name = "描述")
+    private String detail;
+
+    /** 所属区域 */
+    @Excel(name = "所属区域")
+    private Long areaId;
+
+    /** 是否需要拍照 */
+    @Excel(name = "是否需要拍照")
+    private String photo;
+
+    /** 是否需要录音 */
+    @Excel(name = "是否需要录音")
+    private String voice;
+
+    /** 是否需要视频 */
+    @Excel(name = "是否需要视频")
+    private String video;
+
+    /** 是否需要附件文本 */
+    @Excel(name = "是否需要附件文本")
+    private String annex;
+
+    @Excel(name = "巡检点数")
+    private Integer lineLocationNum = 0;
+
+    private List<TlInspectionLineLocation> lineLocations;
+
+    private List<TlInspectionLocation> locations = new ArrayList<>();
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setLineCode(String lineCode) 
+    {
+        this.lineCode = lineCode;
+    }
+
+    public String getLineCode() 
+    {
+        return lineCode;
+    }
+    public void setLineName(String lineName) 
+    {
+        this.lineName = lineName;
+    }
+
+    public String getLineName() 
+    {
+        return lineName;
+    }
+    public void setDetail(String detail) 
+    {
+        this.detail = detail;
+    }
+
+    public String getDetail() 
+    {
+        return detail;
+    }
+    public void setAreaId(Long areaId) 
+    {
+        this.areaId = areaId;
+    }
+
+    public Long getAreaId() 
+    {
+        return areaId;
+    }
+    public void setPhoto(String photo) 
+    {
+        this.photo = photo;
+    }
+
+    public String getPhoto() 
+    {
+        return photo;
+    }
+    public void setVoice(String voice) 
+    {
+        this.voice = voice;
+    }
+
+    public String getVoice() 
+    {
+        return voice;
+    }
+    public void setVideo(String video) 
+    {
+        this.video = video;
+    }
+
+    public String getVideo() 
+    {
+        return video;
+    }
+    public void setAnnex(String annex) 
+    {
+        this.annex = annex;
+    }
+
+    public String getAnnex() 
+    {
+        return annex;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("lineCode", getLineCode())
+            .append("lineName", getLineName())
+            .append("detail", getDetail())
+            .append("areaId", getAreaId())
+            .append("remark", getRemark())
+            .append("photo", getPhoto())
+            .append("voice", getVoice())
+            .append("video", getVideo())
+            .append("annex", getAnnex())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+
+    public Integer getLineLocationNum() {
+        return lineLocationNum;
+    }
+
+    public void setLineLocationNum(Integer lineLocationNum) {
+        this.lineLocationNum = lineLocationNum;
+    }
+
+    public List<TlInspectionLineLocation> getLineLocations() {
+        return lineLocations;
+    }
+
+    public void setLineLocations(List<TlInspectionLineLocation> lineLocations) {
+        this.lineLocations = lineLocations;
+    }
+
+    public List<TlInspectionLocation> getLocations() {
+        return locations;
+    }
+
+    public void setLocations(List<TlInspectionLocation> locations) {
+        this.locations = locations;
+    }
+}

+ 79 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLineLocation.java

@@ -0,0 +1,79 @@
+package com.ruoyi.qdtl.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 巡检线路点位对象 tl_inspection_line_location
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public class TlInspectionLineLocation extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 线路id */
+    @Excel(name = "线路id")
+    private Long lineId;
+
+    /** 巡检点id */
+    @Excel(name = "巡检点id")
+    private Long locationId;
+
+    /** 顺序编号 */
+    @Excel(name = "顺序编号")
+    private Long sortNo;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setLineId(Long lineId) 
+    {
+        this.lineId = lineId;
+    }
+
+    public Long getLineId() 
+    {
+        return lineId;
+    }
+    public void setLocationId(Long locationId) 
+    {
+        this.locationId = locationId;
+    }
+
+    public Long getLocationId() 
+    {
+        return locationId;
+    }
+    public void setSortNo(Long sortNo) 
+    {
+        this.sortNo = sortNo;
+    }
+
+    public Long getSortNo() 
+    {
+        return sortNo;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("lineId", getLineId())
+            .append("locationId", getLocationId())
+            .append("sortNo", getSortNo())
+            .toString();
+    }
+}

+ 20 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionLocation.java

@@ -48,6 +48,10 @@ public class TlInspectionLocation extends BaseEntity
     /** 删除标志(0代表存在 2代表删除) */
     private String delFlag;
 
+    private Integer sortNo;
+
+    private Long lineId;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -147,4 +151,20 @@ public class TlInspectionLocation extends BaseEntity
     public void setDeviceNames(List<TlInspectionDevice> deviceNames) {
         this.deviceNames = deviceNames;
     }
+
+    public Integer getSortNo() {
+        return sortNo;
+    }
+
+    public void setSortNo(Integer sortNo) {
+        this.sortNo = sortNo;
+    }
+
+    public Long getLineId() {
+        return lineId;
+    }
+
+    public void setLineId(Long lineId) {
+        this.lineId = lineId;
+    }
 }

+ 161 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionPlan.java

@@ -0,0 +1,161 @@
+package com.ruoyi.qdtl.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+import java.util.List;
+
+/**
+ * 巡检计划管理对象 tl_inspection_plan
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public class TlInspectionPlan extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 编号 */
+    @Excel(name = "编号")
+    private String planCode;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String planName;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private String planType;
+
+    /** 开始时间 */
+    @Excel(name = "开始时间")
+    private String startDate;
+
+    /** 结束时间 */
+    @Excel(name = "结束时间")
+    private String endDate;
+
+    /** 线路id */
+    @Excel(name = "线路id")
+    private Long lineId;
+
+    /** 计划分数 */
+    @Excel(name = "计划分数")
+    private String score;
+
+    private List<TlInspectionPlanUser> planUsers;
+
+    private String planUser;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPlanCode(String planCode) 
+    {
+        this.planCode = planCode;
+    }
+
+    public String getPlanCode() 
+    {
+        return planCode;
+    }
+    public void setPlanName(String planName) 
+    {
+        this.planName = planName;
+    }
+
+    public String getPlanName() 
+    {
+        return planName;
+    }
+    public void setPlanType(String planType) 
+    {
+        this.planType = planType;
+    }
+
+    public String getPlanType() 
+    {
+        return planType;
+    }
+    public void setStartDate(String startDate) 
+    {
+        this.startDate = startDate;
+    }
+
+    public String getStartDate() 
+    {
+        return startDate;
+    }
+    public void setEndDate(String endDate) 
+    {
+        this.endDate = endDate;
+    }
+
+    public String getEndDate() 
+    {
+        return endDate;
+    }
+    public void setLineId(Long lineId) 
+    {
+        this.lineId = lineId;
+    }
+
+    public Long getLineId() 
+    {
+        return lineId;
+    }
+    public void setScore(String score) 
+    {
+        this.score = score;
+    }
+
+    public String getScore() 
+    {
+        return score;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("planCode", getPlanCode())
+            .append("planName", getPlanName())
+            .append("planType", getPlanType())
+            .append("startDate", getStartDate())
+            .append("endDate", getEndDate())
+            .append("lineId", getLineId())
+            .append("score", getScore())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+
+    public List<TlInspectionPlanUser> getPlanUsers() {
+        return planUsers;
+    }
+
+    public void setPlanUsers(List<TlInspectionPlanUser> planUsers) {
+        this.planUsers = planUsers;
+    }
+
+    public String getPlanUser() {
+        return planUser;
+    }
+
+    public void setPlanUser(String planUser) {
+        this.planUser = planUser;
+    }
+}

+ 79 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/domain/TlInspectionPlanUser.java

@@ -0,0 +1,79 @@
+package com.ruoyi.qdtl.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 巡检计划人员关系对象 tl_inspection_plan_user
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public class TlInspectionPlanUser extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 计划id */
+    @Excel(name = "计划id")
+    private Long planId;
+
+    /** 人员id */
+    @Excel(name = "人员id")
+    private Long userId;
+
+    /** 人员姓名 */
+    @Excel(name = "人员姓名")
+    private String nickName;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setPlanId(Long planId) 
+    {
+        this.planId = planId;
+    }
+
+    public Long getPlanId() 
+    {
+        return planId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setNickName(String nickName) 
+    {
+        this.nickName = nickName;
+    }
+
+    public String getNickName() 
+    {
+        return nickName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("planId", getPlanId())
+            .append("userId", getUserId())
+            .append("nickName", getNickName())
+            .toString();
+    }
+}

+ 66 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLineLocationMapper.java

@@ -0,0 +1,66 @@
+package com.ruoyi.qdtl.mapper;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionLineLocation;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 巡检线路点位Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface TlInspectionLineLocationMapper 
+{
+    /**
+     * 查询巡检线路点位
+     * 
+     * @param id 巡检线路点位主键
+     * @return 巡检线路点位
+     */
+    public TlInspectionLineLocation selectTlInspectionLineLocationById(Long id);
+
+    /**
+     * 查询巡检线路点位列表
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 巡检线路点位集合
+     */
+    public List<TlInspectionLineLocation> selectTlInspectionLineLocationList(TlInspectionLineLocation tlInspectionLineLocation);
+
+    /**
+     * 新增巡检线路点位
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 结果
+     */
+    public int insertTlInspectionLineLocation(TlInspectionLineLocation tlInspectionLineLocation);
+
+    /**
+     * 修改巡检线路点位
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 结果
+     */
+    public int updateTlInspectionLineLocation(TlInspectionLineLocation tlInspectionLineLocation);
+
+    /**
+     * 删除巡检线路点位
+     * 
+     * @param id 巡检线路点位主键
+     * @return 结果
+     */
+    public int deleteTlInspectionLineLocationById(Long id);
+
+    /**
+     * 批量删除巡检线路点位
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionLineLocationByIds(Long[] ids);
+
+    void batchInsert(List<TlInspectionLineLocation> lineLocations);
+
+    void deleteLineLocation(@Param("lineId") Long lineId);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLineMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.mapper;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionLine;
+
+/**
+ * 巡检线路管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface TlInspectionLineMapper 
+{
+    /**
+     * 查询巡检线路管理
+     * 
+     * @param id 巡检线路管理主键
+     * @return 巡检线路管理
+     */
+    public TlInspectionLine selectTlInspectionLineById(Long id);
+
+    /**
+     * 查询巡检线路管理列表
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 巡检线路管理集合
+     */
+    public List<TlInspectionLine> selectTlInspectionLineList(TlInspectionLine tlInspectionLine);
+
+    /**
+     * 新增巡检线路管理
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 结果
+     */
+    public int insertTlInspectionLine(TlInspectionLine tlInspectionLine);
+
+    /**
+     * 修改巡检线路管理
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 结果
+     */
+    public int updateTlInspectionLine(TlInspectionLine tlInspectionLine);
+
+    /**
+     * 删除巡检线路管理
+     * 
+     * @param id 巡检线路管理主键
+     * @return 结果
+     */
+    public int deleteTlInspectionLineById(Long id);
+
+    /**
+     * 批量删除巡检线路管理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionLineByIds(Long[] ids);
+}

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionLocationMapper.java

@@ -64,4 +64,6 @@ public interface TlInspectionLocationMapper
     int selectExist(TlInspectionLocation tlInspectionLocation);
 
     List<JSONObject> queryLocationByArea();
+
+    List<TlInspectionLocation> queryLocationByLineIds(List<Long> idCollect);
 }

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionPlanMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.mapper;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionPlan;
+
+/**
+ * 巡检计划管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface TlInspectionPlanMapper 
+{
+    /**
+     * 查询巡检计划管理
+     * 
+     * @param id 巡检计划管理主键
+     * @return 巡检计划管理
+     */
+    public TlInspectionPlan selectTlInspectionPlanById(Long id);
+
+    /**
+     * 查询巡检计划管理列表
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 巡检计划管理集合
+     */
+    public List<TlInspectionPlan> selectTlInspectionPlanList(TlInspectionPlan tlInspectionPlan);
+
+    /**
+     * 新增巡检计划管理
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 结果
+     */
+    public int insertTlInspectionPlan(TlInspectionPlan tlInspectionPlan);
+
+    /**
+     * 修改巡检计划管理
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 结果
+     */
+    public int updateTlInspectionPlan(TlInspectionPlan tlInspectionPlan);
+
+    /**
+     * 删除巡检计划管理
+     * 
+     * @param id 巡检计划管理主键
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanById(Long id);
+
+    /**
+     * 批量删除巡检计划管理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanByIds(Long[] ids);
+}

+ 69 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/mapper/TlInspectionPlanUserMapper.java

@@ -0,0 +1,69 @@
+package com.ruoyi.qdtl.mapper;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 巡检计划人员关系Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface TlInspectionPlanUserMapper 
+{
+    /**
+     * 查询巡检计划人员关系
+     * 
+     * @param id 巡检计划人员关系主键
+     * @return 巡检计划人员关系
+     */
+    public TlInspectionPlanUser selectTlInspectionPlanUserById(Long id);
+
+    /**
+     * 查询巡检计划人员关系列表
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 巡检计划人员关系集合
+     */
+    public List<TlInspectionPlanUser> selectTlInspectionPlanUserList(TlInspectionPlanUser tlInspectionPlanUser);
+
+    /**
+     * 新增巡检计划人员关系
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 结果
+     */
+    public int insertTlInspectionPlanUser(TlInspectionPlanUser tlInspectionPlanUser);
+
+    /**
+     * 修改巡检计划人员关系
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 结果
+     */
+    public int updateTlInspectionPlanUser(TlInspectionPlanUser tlInspectionPlanUser);
+
+    /**
+     * 删除巡检计划人员关系
+     * 
+     * @param id 巡检计划人员关系主键
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanUserById(Long id);
+
+    /**
+     * 批量删除巡检计划人员关系
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanUserByIds(Long[] ids);
+
+    void batchInsert(List<TlInspectionPlanUser> planUsers);
+
+    void deletePlanUser(@Param("id") Long id);
+
+    List<TlInspectionPlanUser> queryUserByPlanIds(List<Long> idCollect);
+
+}

+ 65 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLineLocationService.java

@@ -0,0 +1,65 @@
+package com.ruoyi.qdtl.service;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionLineLocation;
+
+/**
+ * 巡检线路点位Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface ITlInspectionLineLocationService 
+{
+    /**
+     * 查询巡检线路点位
+     * 
+     * @param id 巡检线路点位主键
+     * @return 巡检线路点位
+     */
+    public TlInspectionLineLocation selectTlInspectionLineLocationById(Long id);
+
+    /**
+     * 查询巡检线路点位列表
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 巡检线路点位集合
+     */
+    public List<TlInspectionLineLocation> selectTlInspectionLineLocationList(TlInspectionLineLocation tlInspectionLineLocation);
+
+    /**
+     * 新增巡检线路点位
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 结果
+     */
+    public int insertTlInspectionLineLocation(TlInspectionLineLocation tlInspectionLineLocation);
+
+    /**
+     * 修改巡检线路点位
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 结果
+     */
+    public int updateTlInspectionLineLocation(TlInspectionLineLocation tlInspectionLineLocation);
+
+    /**
+     * 批量删除巡检线路点位
+     * 
+     * @param ids 需要删除的巡检线路点位主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionLineLocationByIds(Long[] ids);
+
+    /**
+     * 删除巡检线路点位信息
+     * 
+     * @param id 巡检线路点位主键
+     * @return 结果
+     */
+    public int deleteTlInspectionLineLocationById(Long id);
+
+    void batchInsert(List<TlInspectionLineLocation> lineLocations);
+
+    void deleteLineLocation(Long lineId);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLineService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.service;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionLine;
+
+/**
+ * 巡检线路管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface ITlInspectionLineService 
+{
+    /**
+     * 查询巡检线路管理
+     * 
+     * @param id 巡检线路管理主键
+     * @return 巡检线路管理
+     */
+    public TlInspectionLine selectTlInspectionLineById(Long id);
+
+    /**
+     * 查询巡检线路管理列表
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 巡检线路管理集合
+     */
+    public List<TlInspectionLine> selectTlInspectionLineList(TlInspectionLine tlInspectionLine);
+
+    /**
+     * 新增巡检线路管理
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 结果
+     */
+    public int insertTlInspectionLine(TlInspectionLine tlInspectionLine);
+
+    /**
+     * 修改巡检线路管理
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 结果
+     */
+    public int updateTlInspectionLine(TlInspectionLine tlInspectionLine);
+
+    /**
+     * 批量删除巡检线路管理
+     * 
+     * @param ids 需要删除的巡检线路管理主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionLineByIds(Long[] ids);
+
+    /**
+     * 删除巡检线路管理信息
+     * 
+     * @param id 巡检线路管理主键
+     * @return 结果
+     */
+    public int deleteTlInspectionLineById(Long id);
+}

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionLocationService.java

@@ -62,4 +62,6 @@ public interface ITlInspectionLocationService
     public int deleteTlInspectionLocationById(Long id);
 
     Map<String, Integer> queryLocationByArea();
+
+    List<TlInspectionLocation> queryLocationByLineIds(List<Long> idCollect);
 }

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionPlanService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.qdtl.service;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionPlan;
+
+/**
+ * 巡检计划管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface ITlInspectionPlanService 
+{
+    /**
+     * 查询巡检计划管理
+     * 
+     * @param id 巡检计划管理主键
+     * @return 巡检计划管理
+     */
+    public TlInspectionPlan selectTlInspectionPlanById(Long id);
+
+    /**
+     * 查询巡检计划管理列表
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 巡检计划管理集合
+     */
+    public List<TlInspectionPlan> selectTlInspectionPlanList(TlInspectionPlan tlInspectionPlan);
+
+    /**
+     * 新增巡检计划管理
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 结果
+     */
+    public int insertTlInspectionPlan(TlInspectionPlan tlInspectionPlan);
+
+    /**
+     * 修改巡检计划管理
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 结果
+     */
+    public int updateTlInspectionPlan(TlInspectionPlan tlInspectionPlan);
+
+    /**
+     * 批量删除巡检计划管理
+     * 
+     * @param ids 需要删除的巡检计划管理主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanByIds(Long[] ids);
+
+    /**
+     * 删除巡检计划管理信息
+     * 
+     * @param id 巡检计划管理主键
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanById(Long id);
+}

+ 67 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/ITlInspectionPlanUserService.java

@@ -0,0 +1,67 @@
+package com.ruoyi.qdtl.service;
+
+import java.util.List;
+import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
+
+/**
+ * 巡检计划人员关系Service接口
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+public interface ITlInspectionPlanUserService 
+{
+    /**
+     * 查询巡检计划人员关系
+     * 
+     * @param id 巡检计划人员关系主键
+     * @return 巡检计划人员关系
+     */
+    public TlInspectionPlanUser selectTlInspectionPlanUserById(Long id);
+
+    /**
+     * 查询巡检计划人员关系列表
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 巡检计划人员关系集合
+     */
+    public List<TlInspectionPlanUser> selectTlInspectionPlanUserList(TlInspectionPlanUser tlInspectionPlanUser);
+
+    /**
+     * 新增巡检计划人员关系
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 结果
+     */
+    public int insertTlInspectionPlanUser(TlInspectionPlanUser tlInspectionPlanUser);
+
+    /**
+     * 修改巡检计划人员关系
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 结果
+     */
+    public int updateTlInspectionPlanUser(TlInspectionPlanUser tlInspectionPlanUser);
+
+    /**
+     * 批量删除巡检计划人员关系
+     * 
+     * @param ids 需要删除的巡检计划人员关系主键集合
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanUserByIds(Long[] ids);
+
+    /**
+     * 删除巡检计划人员关系信息
+     * 
+     * @param id 巡检计划人员关系主键
+     * @return 结果
+     */
+    public int deleteTlInspectionPlanUserById(Long id);
+
+    void batchInsert(List<TlInspectionPlanUser> planUsers);
+
+    void deletePlanUser(Long id);
+
+    List<TlInspectionPlanUser> queryUserByPlanIds(List<Long> idCollect);
+}

+ 103 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLineLocationServiceImpl.java

@@ -0,0 +1,103 @@
+package com.ruoyi.qdtl.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.qdtl.mapper.TlInspectionLineLocationMapper;
+import com.ruoyi.qdtl.domain.TlInspectionLineLocation;
+import com.ruoyi.qdtl.service.ITlInspectionLineLocationService;
+
+/**
+ * 巡检线路点位Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@Service
+public class TlInspectionLineLocationServiceImpl implements ITlInspectionLineLocationService 
+{
+    @Autowired
+    private TlInspectionLineLocationMapper tlInspectionLineLocationMapper;
+
+    /**
+     * 查询巡检线路点位
+     * 
+     * @param id 巡检线路点位主键
+     * @return 巡检线路点位
+     */
+    @Override
+    public TlInspectionLineLocation selectTlInspectionLineLocationById(Long id)
+    {
+        return tlInspectionLineLocationMapper.selectTlInspectionLineLocationById(id);
+    }
+
+    /**
+     * 查询巡检线路点位列表
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 巡检线路点位
+     */
+    @Override
+    public List<TlInspectionLineLocation> selectTlInspectionLineLocationList(TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        return tlInspectionLineLocationMapper.selectTlInspectionLineLocationList(tlInspectionLineLocation);
+    }
+
+    /**
+     * 新增巡检线路点位
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 结果
+     */
+    @Override
+    public int insertTlInspectionLineLocation(TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        return tlInspectionLineLocationMapper.insertTlInspectionLineLocation(tlInspectionLineLocation);
+    }
+
+    /**
+     * 修改巡检线路点位
+     * 
+     * @param tlInspectionLineLocation 巡检线路点位
+     * @return 结果
+     */
+    @Override
+    public int updateTlInspectionLineLocation(TlInspectionLineLocation tlInspectionLineLocation)
+    {
+        return tlInspectionLineLocationMapper.updateTlInspectionLineLocation(tlInspectionLineLocation);
+    }
+
+    /**
+     * 批量删除巡检线路点位
+     * 
+     * @param ids 需要删除的巡检线路点位主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionLineLocationByIds(Long[] ids)
+    {
+        return tlInspectionLineLocationMapper.deleteTlInspectionLineLocationByIds(ids);
+    }
+
+    /**
+     * 删除巡检线路点位信息
+     * 
+     * @param id 巡检线路点位主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionLineLocationById(Long id)
+    {
+        return tlInspectionLineLocationMapper.deleteTlInspectionLineLocationById(id);
+    }
+
+    @Override
+    public void batchInsert(List<TlInspectionLineLocation> lineLocations) {
+        tlInspectionLineLocationMapper.batchInsert(lineLocations);
+    }
+
+    @Override
+    public void deleteLineLocation(Long lineId) {
+        tlInspectionLineLocationMapper.deleteLineLocation(lineId);
+    }
+}

+ 118 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLineServiceImpl.java

@@ -0,0 +1,118 @@
+package com.ruoyi.qdtl.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.qdtl.domain.TlInspectionLineLocation;
+import com.ruoyi.qdtl.service.ITlInspectionLineLocationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.qdtl.mapper.TlInspectionLineMapper;
+import com.ruoyi.qdtl.domain.TlInspectionLine;
+import com.ruoyi.qdtl.service.ITlInspectionLineService;
+
+/**
+ * 巡检线路管理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@Service
+public class TlInspectionLineServiceImpl implements ITlInspectionLineService 
+{
+    @Autowired
+    private TlInspectionLineMapper tlInspectionLineMapper;
+    @Autowired
+    private ITlInspectionLineLocationService tlInspectionLineLocationService;
+
+    /**
+     * 查询巡检线路管理
+     * 
+     * @param id 巡检线路管理主键
+     * @return 巡检线路管理
+     */
+    @Override
+    public TlInspectionLine selectTlInspectionLineById(Long id)
+    {
+        return tlInspectionLineMapper.selectTlInspectionLineById(id);
+    }
+
+    /**
+     * 查询巡检线路管理列表
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 巡检线路管理
+     */
+    @Override
+    public List<TlInspectionLine> selectTlInspectionLineList(TlInspectionLine tlInspectionLine)
+    {
+        return tlInspectionLineMapper.selectTlInspectionLineList(tlInspectionLine);
+    }
+
+    /**
+     * 新增巡检线路管理
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 结果
+     */
+    @Override
+    public int insertTlInspectionLine(TlInspectionLine tlInspectionLine)
+    {
+        tlInspectionLine.setCreateTime(DateUtils.getNowDate());
+        int row = tlInspectionLineMapper.insertTlInspectionLine(tlInspectionLine);
+        for (TlInspectionLineLocation lineLocation : tlInspectionLine.getLineLocations()) {
+            lineLocation.setLineId(tlInspectionLine.getId());
+        }
+        // 新增路线中检测点位数据
+        if (tlInspectionLine.getLineLocations().size() > 0) {
+            tlInspectionLineLocationService.batchInsert(tlInspectionLine.getLineLocations());
+        }
+        return row;
+    }
+
+    /**
+     * 修改巡检线路管理
+     * 
+     * @param tlInspectionLine 巡检线路管理
+     * @return 结果
+     */
+    @Override
+    public int updateTlInspectionLine(TlInspectionLine tlInspectionLine)
+    {
+        tlInspectionLine.setUpdateTime(DateUtils.getNowDate());
+        int row = tlInspectionLineMapper.updateTlInspectionLine(tlInspectionLine);
+        // 删除关系后再新增
+        tlInspectionLineLocationService.deleteLineLocation(tlInspectionLine.getId());
+        for (TlInspectionLineLocation lineLocation : tlInspectionLine.getLineLocations()) {
+            lineLocation.setLineId(tlInspectionLine.getId());
+        }
+        // 新增路线中检测点位数据
+        if (tlInspectionLine.getLineLocations().size() > 0) {
+            tlInspectionLineLocationService.batchInsert(tlInspectionLine.getLineLocations());
+        }
+        return row;
+    }
+
+    /**
+     * 批量删除巡检线路管理
+     * 
+     * @param ids 需要删除的巡检线路管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionLineByIds(Long[] ids)
+    {
+        return tlInspectionLineMapper.deleteTlInspectionLineByIds(ids);
+    }
+
+    /**
+     * 删除巡检线路管理信息
+     * 
+     * @param id 巡检线路管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionLineById(Long id)
+    {
+        return tlInspectionLineMapper.deleteTlInspectionLineById(id);
+    }
+}

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionLocationServiceImpl.java

@@ -131,4 +131,9 @@ public class TlInspectionLocationServiceImpl implements ITlInspectionLocationSer
         List<JSONObject> jsonObjects = tlInspectionLocationMapper.queryLocationByArea();
         return jsonObjects.stream().collect(Collectors.toMap(a -> a.getString("areaId"), b -> b.getInteger("cnt")));
     }
+
+    @Override
+    public List<TlInspectionLocation> queryLocationByLineIds(List<Long> idCollect) {
+        return tlInspectionLocationMapper.queryLocationByLineIds(idCollect);
+    }
 }

+ 116 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionPlanServiceImpl.java

@@ -0,0 +1,116 @@
+package com.ruoyi.qdtl.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
+import com.ruoyi.qdtl.service.ITlInspectionPlanUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.qdtl.mapper.TlInspectionPlanMapper;
+import com.ruoyi.qdtl.domain.TlInspectionPlan;
+import com.ruoyi.qdtl.service.ITlInspectionPlanService;
+
+/**
+ * 巡检计划管理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@Service
+public class TlInspectionPlanServiceImpl implements ITlInspectionPlanService 
+{
+    @Autowired
+    private TlInspectionPlanMapper tlInspectionPlanMapper;
+    @Autowired
+    private ITlInspectionPlanUserService tlInspectionPlanUserService;
+
+    /**
+     * 查询巡检计划管理
+     * 
+     * @param id 巡检计划管理主键
+     * @return 巡检计划管理
+     */
+    @Override
+    public TlInspectionPlan selectTlInspectionPlanById(Long id)
+    {
+        return tlInspectionPlanMapper.selectTlInspectionPlanById(id);
+    }
+
+    /**
+     * 查询巡检计划管理列表
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 巡检计划管理
+     */
+    @Override
+    public List<TlInspectionPlan> selectTlInspectionPlanList(TlInspectionPlan tlInspectionPlan)
+    {
+        return tlInspectionPlanMapper.selectTlInspectionPlanList(tlInspectionPlan);
+    }
+
+    /**
+     * 新增巡检计划管理
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 结果
+     */
+    @Override
+    public int insertTlInspectionPlan(TlInspectionPlan tlInspectionPlan)
+    {
+        tlInspectionPlan.setCreateTime(DateUtils.getNowDate());
+        int row = tlInspectionPlanMapper.insertTlInspectionPlan(tlInspectionPlan);
+        for (TlInspectionPlanUser planUser : tlInspectionPlan.getPlanUsers()) {
+            planUser.setPlanId(tlInspectionPlan.getId());
+        }
+        if (tlInspectionPlan.getPlanUsers().size() > 0) {
+            tlInspectionPlanUserService.batchInsert(tlInspectionPlan.getPlanUsers());
+        }
+        return row;
+    }
+
+    /**
+     * 修改巡检计划管理
+     * 
+     * @param tlInspectionPlan 巡检计划管理
+     * @return 结果
+     */
+    @Override
+    public int updateTlInspectionPlan(TlInspectionPlan tlInspectionPlan)
+    {
+        tlInspectionPlan.setUpdateTime(DateUtils.getNowDate());
+        int row = tlInspectionPlanMapper.updateTlInspectionPlan(tlInspectionPlan);
+        // 删除关系后再新增
+        tlInspectionPlanUserService.deletePlanUser(tlInspectionPlan.getId());
+        for (TlInspectionPlanUser planUser : tlInspectionPlan.getPlanUsers()) {
+            planUser.setPlanId(tlInspectionPlan.getId());
+        }
+        if (tlInspectionPlan.getPlanUsers().size() > 0) {
+            tlInspectionPlanUserService.batchInsert(tlInspectionPlan.getPlanUsers());
+        }
+        return row;
+    }
+
+    /**
+     * 批量删除巡检计划管理
+     * 
+     * @param ids 需要删除的巡检计划管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionPlanByIds(Long[] ids)
+    {
+        return tlInspectionPlanMapper.deleteTlInspectionPlanByIds(ids);
+    }
+
+    /**
+     * 删除巡检计划管理信息
+     * 
+     * @param id 巡检计划管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionPlanById(Long id)
+    {
+        return tlInspectionPlanMapper.deleteTlInspectionPlanById(id);
+    }
+}

+ 109 - 0
ruoyi-system/src/main/java/com/ruoyi/qdtl/service/impl/TlInspectionPlanUserServiceImpl.java

@@ -0,0 +1,109 @@
+package com.ruoyi.qdtl.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.qdtl.mapper.TlInspectionPlanUserMapper;
+import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
+import com.ruoyi.qdtl.service.ITlInspectionPlanUserService;
+
+/**
+ * 巡检计划人员关系Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2022-03-03
+ */
+@Service
+public class TlInspectionPlanUserServiceImpl implements ITlInspectionPlanUserService 
+{
+    @Autowired
+    private TlInspectionPlanUserMapper tlInspectionPlanUserMapper;
+
+    /**
+     * 查询巡检计划人员关系
+     * 
+     * @param id 巡检计划人员关系主键
+     * @return 巡检计划人员关系
+     */
+    @Override
+    public TlInspectionPlanUser selectTlInspectionPlanUserById(Long id)
+    {
+        return tlInspectionPlanUserMapper.selectTlInspectionPlanUserById(id);
+    }
+
+    /**
+     * 查询巡检计划人员关系列表
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 巡检计划人员关系
+     */
+    @Override
+    public List<TlInspectionPlanUser> selectTlInspectionPlanUserList(TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        return tlInspectionPlanUserMapper.selectTlInspectionPlanUserList(tlInspectionPlanUser);
+    }
+
+    /**
+     * 新增巡检计划人员关系
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 结果
+     */
+    @Override
+    public int insertTlInspectionPlanUser(TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        return tlInspectionPlanUserMapper.insertTlInspectionPlanUser(tlInspectionPlanUser);
+    }
+
+    /**
+     * 修改巡检计划人员关系
+     * 
+     * @param tlInspectionPlanUser 巡检计划人员关系
+     * @return 结果
+     */
+    @Override
+    public int updateTlInspectionPlanUser(TlInspectionPlanUser tlInspectionPlanUser)
+    {
+        return tlInspectionPlanUserMapper.updateTlInspectionPlanUser(tlInspectionPlanUser);
+    }
+
+    /**
+     * 批量删除巡检计划人员关系
+     * 
+     * @param ids 需要删除的巡检计划人员关系主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionPlanUserByIds(Long[] ids)
+    {
+        return tlInspectionPlanUserMapper.deleteTlInspectionPlanUserByIds(ids);
+    }
+
+    /**
+     * 删除巡检计划人员关系信息
+     * 
+     * @param id 巡检计划人员关系主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTlInspectionPlanUserById(Long id)
+    {
+        return tlInspectionPlanUserMapper.deleteTlInspectionPlanUserById(id);
+    }
+
+    @Override
+    public void batchInsert(List<TlInspectionPlanUser> planUsers) {
+        tlInspectionPlanUserMapper.batchInsert(planUsers);
+    }
+
+    @Override
+    public void deletePlanUser(Long id) {
+        tlInspectionPlanUserMapper.deletePlanUser(id);
+    }
+
+    @Override
+    public List<TlInspectionPlanUser> queryUserByPlanIds(List<Long> idCollect) {
+        return tlInspectionPlanUserMapper.queryUserByPlanIds(idCollect);
+    }
+
+}

+ 1 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlAreaMapper.xml

@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="areaType != null  and areaType != ''"> and area_type = #{areaType}</if>
              and del_flag = '0'
         </where>
+        order by create_time desc
     </select>
     
     <select id="selectTlAreaById" parameterType="Long" resultMap="TlAreaResult">

+ 1 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionDeviceMapper.xml

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="areaId != null "> and area_id = #{areaId}</if>
              and del_flag = '0'
         </where>
+        order by create_time desc
     </select>
     
     <select id="selectTlInspectionDeviceById" parameterType="Long" resultMap="TlInspectionDeviceResult">

+ 77 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLineLocationMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.qdtl.mapper.TlInspectionLineLocationMapper">
+    
+    <resultMap type="TlInspectionLineLocation" id="TlInspectionLineLocationResult">
+        <result property="id"    column="id"    />
+        <result property="lineId"    column="line_id"    />
+        <result property="locationId"    column="location_id"    />
+        <result property="sortNo"    column="sort_no"    />
+    </resultMap>
+
+    <sql id="selectTlInspectionLineLocationVo">
+        select id, line_id, location_id, sort_no from tl_inspection_line_location
+    </sql>
+
+    <select id="selectTlInspectionLineLocationList" parameterType="TlInspectionLineLocation" resultMap="TlInspectionLineLocationResult">
+        <include refid="selectTlInspectionLineLocationVo"/>
+        <where>  
+            <if test="lineId != null "> and line_id = #{lineId}</if>
+            <if test="locationId != null "> and location_id = #{locationId}</if>
+            <if test="sortNo != null "> and sort_no = #{sortNo}</if>
+        </where>
+    </select>
+    
+    <select id="selectTlInspectionLineLocationById" parameterType="Long" resultMap="TlInspectionLineLocationResult">
+        <include refid="selectTlInspectionLineLocationVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTlInspectionLineLocation" parameterType="TlInspectionLineLocation" useGeneratedKeys="true" keyProperty="id">
+        insert into tl_inspection_line_location
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="lineId != null">line_id,</if>
+            <if test="locationId != null">location_id,</if>
+            <if test="sortNo != null">sort_no,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="lineId != null">#{lineId},</if>
+            <if test="locationId != null">#{locationId},</if>
+            <if test="sortNo != null">#{sortNo},</if>
+         </trim>
+    </insert>
+
+    <insert id="batchInsert">
+        insert into tl_inspection_line_location(line_id, location_id, sort_no) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.lineId},#{item.locationId},#{item.sortNo})
+        </foreach>
+    </insert>
+
+    <update id="updateTlInspectionLineLocation" parameterType="TlInspectionLineLocation">
+        update tl_inspection_line_location
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="lineId != null">line_id = #{lineId},</if>
+            <if test="locationId != null">location_id = #{locationId},</if>
+            <if test="sortNo != null">sort_no = #{sortNo},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTlInspectionLineLocationById" parameterType="Long">
+        delete from tl_inspection_line_location where id = #{id}
+    </delete>
+
+    <delete id="deleteTlInspectionLineLocationByIds" parameterType="String">
+        delete from tl_inspection_line_location where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="deleteLineLocation">
+        delete from tl_inspection_line_location where line_id = #{lineId}
+    </delete>
+</mapper>

+ 106 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLineMapper.xml

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.qdtl.mapper.TlInspectionLineMapper">
+    
+    <resultMap type="TlInspectionLine" id="TlInspectionLineResult">
+        <result property="id"    column="id"    />
+        <result property="lineCode"    column="line_code"    />
+        <result property="lineName"    column="line_name"    />
+        <result property="detail"    column="detail"    />
+        <result property="areaId"    column="area_id"    />
+        <result property="remark"    column="remark"    />
+        <result property="photo"    column="photo"    />
+        <result property="voice"    column="voice"    />
+        <result property="video"    column="video"    />
+        <result property="annex"    column="annex"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTlInspectionLineVo">
+        select id, line_code, line_name, detail, area_id, remark, photo, voice, video, annex, create_by, create_time, update_by, update_time from tl_inspection_line
+    </sql>
+
+    <select id="selectTlInspectionLineList" parameterType="TlInspectionLine" resultMap="TlInspectionLineResult">
+        <include refid="selectTlInspectionLineVo"/>
+        <where>  
+            <if test="lineCode != null  and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
+            <if test="lineName != null  and lineName != ''"> and line_name like concat('%', #{lineName}, '%')</if>
+        </where>
+        order by create_time desc
+    </select>
+    
+    <select id="selectTlInspectionLineById" parameterType="Long" resultMap="TlInspectionLineResult">
+        <include refid="selectTlInspectionLineVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTlInspectionLine" parameterType="TlInspectionLine" useGeneratedKeys="true" keyProperty="id">
+        insert into tl_inspection_line
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="lineCode != null and lineCode != ''">line_code,</if>
+            <if test="lineName != null and lineName != ''">line_name,</if>
+            <if test="detail != null">detail,</if>
+            <if test="areaId != null">area_id,</if>
+            <if test="remark != null">remark,</if>
+            <if test="photo != null">photo,</if>
+            <if test="voice != null">voice,</if>
+            <if test="video != null">video,</if>
+            <if test="annex != null">annex,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="lineCode != null and lineCode != ''">#{lineCode},</if>
+            <if test="lineName != null and lineName != ''">#{lineName},</if>
+            <if test="detail != null">#{detail},</if>
+            <if test="areaId != null">#{areaId},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="photo != null">#{photo},</if>
+            <if test="voice != null">#{voice},</if>
+            <if test="video != null">#{video},</if>
+            <if test="annex != null">#{annex},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTlInspectionLine" parameterType="TlInspectionLine">
+        update tl_inspection_line
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if>
+            <if test="lineName != null and lineName != ''">line_name = #{lineName},</if>
+            <if test="detail != null">detail = #{detail},</if>
+            <if test="areaId != null">area_id = #{areaId},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="photo != null">photo = #{photo},</if>
+            <if test="voice != null">voice = #{voice},</if>
+            <if test="video != null">video = #{video},</if>
+            <if test="annex != null">annex = #{annex},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTlInspectionLineById" parameterType="Long">
+        delete from tl_inspection_line where id = #{id}
+    </delete>
+
+    <delete id="deleteTlInspectionLineByIds" parameterType="String">
+        delete from tl_inspection_line where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 22 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionLocationMapper.xml

@@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locationName != null  and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
             <if test="areaId != null "> and area_id = #{areaId}</if>
         </where>
+        order by create_time desc
     </select>
     
     <select id="selectTlInspectionLocationById" parameterType="Long" resultMap="TlInspectionLocationResult">
@@ -52,6 +53,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         group by area_id
     </select>
 
+    <select id="queryLocationByLineIds" resultType="com.ruoyi.qdtl.domain.TlInspectionLocation">
+        select t2.id,
+               location_code locationCode,
+               location_name locationName,
+               detail,
+               device_ids deviceIds,
+               area_id areaId,
+               lnglat,
+               remark,
+               t1.sort_no sortNo,
+               t1.line_id lineId
+        from tl_inspection_line_location t1
+                 left join tl_inspection_location t2 on t1.location_id = t2.id
+        where del_flag = 0
+          and t1.line_id in
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        order by t1.sort_no
+    </select>
+
     <insert id="insertTlInspectionLocation" parameterType="TlInspectionLocation" useGeneratedKeys="true" keyProperty="id">
         insert into tl_inspection_location
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 99 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionPlanMapper.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.qdtl.mapper.TlInspectionPlanMapper">
+    
+    <resultMap type="TlInspectionPlan" id="TlInspectionPlanResult">
+        <result property="id"    column="id"    />
+        <result property="planCode"    column="plan_code"    />
+        <result property="planName"    column="plan_name"    />
+        <result property="planType"    column="plan_type"    />
+        <result property="startDate"    column="start_date"    />
+        <result property="endDate"    column="end_date"    />
+        <result property="lineId"    column="line_id"    />
+        <result property="score"    column="score"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTlInspectionPlanVo">
+        select id, plan_code, plan_name, plan_type, start_date, end_date, line_id, score, create_by, create_time, update_by, update_time from tl_inspection_plan
+    </sql>
+
+    <select id="selectTlInspectionPlanList" parameterType="TlInspectionPlan" resultMap="TlInspectionPlanResult">
+        <include refid="selectTlInspectionPlanVo"/>
+        <where>  
+            <if test="planCode != null  and planCode != ''"> and plan_code like concat('%', #{planCode}, '%')</if>
+            <if test="planName != null  and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
+            <if test="planType != null  and planType != ''"> and plan_type = #{planType}</if>
+        </where>
+        order by create_time desc
+    </select>
+    
+    <select id="selectTlInspectionPlanById" parameterType="Long" resultMap="TlInspectionPlanResult">
+        <include refid="selectTlInspectionPlanVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTlInspectionPlan" parameterType="TlInspectionPlan" useGeneratedKeys="true" keyProperty="id">
+        insert into tl_inspection_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="planCode != null">plan_code,</if>
+            <if test="planName != null">plan_name,</if>
+            <if test="planType != null">plan_type,</if>
+            <if test="startDate != null">start_date,</if>
+            <if test="endDate != null">end_date,</if>
+            <if test="lineId != null">line_id,</if>
+            <if test="score != null">score,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="planCode != null">#{planCode},</if>
+            <if test="planName != null">#{planName},</if>
+            <if test="planType != null">#{planType},</if>
+            <if test="startDate != null">#{startDate},</if>
+            <if test="endDate != null">#{endDate},</if>
+            <if test="lineId != null">#{lineId},</if>
+            <if test="score != null">#{score},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTlInspectionPlan" parameterType="TlInspectionPlan">
+        update tl_inspection_plan
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="planCode != null">plan_code = #{planCode},</if>
+            <if test="planName != null">plan_name = #{planName},</if>
+            <if test="planType != null">plan_type = #{planType},</if>
+            <if test="startDate != null">start_date = #{startDate},</if>
+            <if test="endDate != null">end_date = #{endDate},</if>
+            <if test="lineId != null">line_id = #{lineId},</if>
+            <if test="score != null">score = #{score},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTlInspectionPlanById" parameterType="Long">
+        delete from tl_inspection_plan where id = #{id}
+    </delete>
+
+    <delete id="deleteTlInspectionPlanByIds" parameterType="String">
+        delete from tl_inspection_plan where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 85 - 0
ruoyi-system/src/main/resources/mapper/qdtl/TlInspectionPlanUserMapper.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.qdtl.mapper.TlInspectionPlanUserMapper">
+    
+    <resultMap type="TlInspectionPlanUser" id="TlInspectionPlanUserResult">
+        <result property="id"    column="id"    />
+        <result property="planId"    column="plan_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="nickName"    column="nick_name"    />
+    </resultMap>
+
+    <sql id="selectTlInspectionPlanUserVo">
+        select id, plan_id, user_id, nick_name from tl_inspection_plan_user
+    </sql>
+
+    <select id="selectTlInspectionPlanUserList" parameterType="TlInspectionPlanUser" resultMap="TlInspectionPlanUserResult">
+        <include refid="selectTlInspectionPlanUserVo"/>
+        <where>  
+            <if test="planId != null "> and plan_id = #{planId}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="nickName != null  and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
+        </where>
+    </select>
+    
+    <select id="selectTlInspectionPlanUserById" parameterType="Long" resultMap="TlInspectionPlanUserResult">
+        <include refid="selectTlInspectionPlanUserVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="queryUserByPlanIds" resultMap="TlInspectionPlanUserResult">
+        <include refid="selectTlInspectionPlanUserVo"/>
+        where plan_id in
+        <foreach collection="list" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+    </select>
+
+    <insert id="insertTlInspectionPlanUser" parameterType="TlInspectionPlanUser" useGeneratedKeys="true" keyProperty="id">
+        insert into tl_inspection_plan_user
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="planId != null">plan_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="nickName != null">nick_name,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="planId != null">#{planId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="nickName != null">#{nickName},</if>
+         </trim>
+    </insert>
+
+    <insert id="batchInsert">
+        insert into tl_inspection_plan_user(plan_id, user_id, nick_name) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.planId},#{item.userId},#{item.nickName})
+        </foreach>
+    </insert>
+
+    <update id="updateTlInspectionPlanUser" parameterType="TlInspectionPlanUser">
+        update tl_inspection_plan_user
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="planId != null">plan_id = #{planId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="nickName != null">nick_name = #{nickName},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTlInspectionPlanUserById" parameterType="Long">
+        delete from tl_inspection_plan_user where id = #{id}
+    </delete>
+
+    <delete id="deleteTlInspectionPlanUserByIds" parameterType="String">
+        delete from tl_inspection_plan_user where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <delete id="deletePlanUser">
+        delete from tl_inspection_plan_user where plan_id = #{id}
+    </delete>
+</mapper>