|
@@ -1,43 +1,38 @@
|
|
|
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.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.qdtl.domain.TlInspectionPlan;
|
|
|
import com.ruoyi.qdtl.domain.TlInspectionPlanUser;
|
|
|
+import com.ruoyi.qdtl.service.ITlInspectionPlanService;
|
|
|
import com.ruoyi.qdtl.service.ITlInspectionPlanUserService;
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
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;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 巡检计划管理Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author ruoyi
|
|
|
* @date 2022-03-03
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/qdtl/plan")
|
|
|
-public class TlInspectionPlanController extends BaseController
|
|
|
-{
|
|
|
+public class TlInspectionPlanController extends BaseController {
|
|
|
@Autowired
|
|
|
private ITlInspectionPlanService tlInspectionPlanService;
|
|
|
@Autowired
|
|
@@ -48,8 +43,7 @@ public class TlInspectionPlanController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('qdtl:plan:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(TlInspectionPlan tlInspectionPlan)
|
|
|
- {
|
|
|
+ public TableDataInfo list(TlInspectionPlan tlInspectionPlan) {
|
|
|
startPage();
|
|
|
List<TlInspectionPlan> list = tlInspectionPlanService.selectTlInspectionPlanList(tlInspectionPlan);
|
|
|
if (list.size() > 0) {
|
|
@@ -59,8 +53,10 @@ public class TlInspectionPlanController extends BaseController
|
|
|
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);
|
|
|
+ if (inspectionPlan.getPlanUsers() != null) {
|
|
|
+ String planUser = inspectionPlan.getPlanUsers().stream().map(TlInspectionPlanUser::getNickName).collect(Collectors.joining("、"));
|
|
|
+ inspectionPlan.setPlanUser(planUser);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return getDataTable(list);
|
|
@@ -84,8 +80,7 @@ public class TlInspectionPlanController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('qdtl:plan:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return AjaxResult.success(tlInspectionPlanService.selectTlInspectionPlanById(id));
|
|
|
}
|
|
|
|
|
@@ -95,8 +90,7 @@ public class TlInspectionPlanController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('qdtl:plan:add')")
|
|
|
@Log(title = "巡检计划管理", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody TlInspectionPlan tlInspectionPlan)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody TlInspectionPlan tlInspectionPlan) {
|
|
|
return toAjax(tlInspectionPlanService.insertTlInspectionPlan(tlInspectionPlan));
|
|
|
}
|
|
|
|
|
@@ -106,8 +100,7 @@ public class TlInspectionPlanController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('qdtl:plan:edit')")
|
|
|
@Log(title = "巡检计划管理", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody TlInspectionPlan tlInspectionPlan)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody TlInspectionPlan tlInspectionPlan) {
|
|
|
return toAjax(tlInspectionPlanService.updateTlInspectionPlan(tlInspectionPlan));
|
|
|
}
|
|
|
|
|
@@ -116,9 +109,8 @@ public class TlInspectionPlanController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('qdtl:plan:remove')")
|
|
|
@Log(title = "巡检计划管理", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(tlInspectionPlanService.deleteTlInspectionPlanByIds(ids));
|
|
|
}
|
|
|
}
|