|
@@ -0,0 +1,98 @@
|
|
|
+package com.sooka.sponest.mobile.comprehensive.organizationAndInstitutioncontroller;
|
|
|
+
|
|
|
+import com.ruoyi.common.core.constant.HttpStatus;
|
|
|
+import com.ruoyi.common.core.domain.R;
|
|
|
+import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.web.page.PageDomain;
|
|
|
+import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.core.web.page.TableSupport;
|
|
|
+import com.ruoyi.common.security.utils.DictUtils;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.domain.ComprehensivePatrolPlan;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensivepatrol.service.RemotePatrolPlanService;
|
|
|
+import com.sooka.sponest.mobile.utils.DictUtil;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 巡查计划
|
|
|
+ *
|
|
|
+ * @author lidongyu
|
|
|
+ * @date 2023/9/14 10:16
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/AppPatrolPlanController")
|
|
|
+public class AppPatrolPlanController extends BaseController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ RemotePatrolPlanService remotePatrolPlanService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询巡查计划列表
|
|
|
+ */
|
|
|
+ @GetMapping("/comprehensivepatrolplan/list")
|
|
|
+ public AjaxResult list(ComprehensivePatrolPlan comprehensivepatrolplan) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ TableDataInfo tableDataInfo = remotePatrolPlanService.selectPatrolPlanList(pageNum, pageSize,comprehensivepatrolplan.getType(),comprehensivepatrolplan.getName());
|
|
|
+ if(HttpStatus.SUCCESS == tableDataInfo.getCode()){
|
|
|
+ return AjaxResult.success(tableDataInfo.getRows());
|
|
|
+ }else{
|
|
|
+ return AjaxResult.error(tableDataInfo.getCode(),tableDataInfo.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取巡查计划详细信息
|
|
|
+ */
|
|
|
+ @GetMapping("/comprehensivepatrolplan/edit")
|
|
|
+ public AjaxResult getInfo(String id) {
|
|
|
+ R<ComprehensivePatrolPlan> edit = remotePatrolPlanService.selectPatrolPlanById(id);
|
|
|
+ ComprehensivePatrolPlan data = edit.getData();
|
|
|
+ if (HttpStatus.SUCCESS == edit.getCode()){
|
|
|
+ data.setRankLabel(DictUtils.getDictDataByValue("forest_lin_level",data.getRank()));
|
|
|
+ data.setPeriodLabel(DictUtils.getDictDataByValue("centerdataplanning_cycle",data.getPeriod()));
|
|
|
+ data.setIsEdit(true);
|
|
|
+ }else if (HttpStatus.ERROR == edit.getCode() && null != edit.getData()) {
|
|
|
+ data.setIsEdit(false);
|
|
|
+ }else {
|
|
|
+ return AjaxResult.error(edit.getCode(), edit.getMsg());
|
|
|
+ }
|
|
|
+ return AjaxResult.success(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增巡查计划
|
|
|
+ */
|
|
|
+ @PostMapping("/comprehensivepatrolplan")
|
|
|
+ public AjaxResult add(@RequestBody String json) {
|
|
|
+ return remotePatrolPlanService.insertPatrolPlan(json);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 修改巡查计划
|
|
|
+ */
|
|
|
+ @PostMapping("/comprehensivepatrolplan/put")
|
|
|
+ public AjaxResult edit(@RequestBody String json) {
|
|
|
+ return remotePatrolPlanService.updatePatrolPlan(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除巡查计划
|
|
|
+ */
|
|
|
+ @GetMapping("/comprehensivepatrolplan/del")
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
+ return remotePatrolPlanService.deletePatrolPlanByIds(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询计划下拉选
|
|
|
+ */
|
|
|
+ @GetMapping("/comprehensivepatrolplan/getPatrolPlanAll")
|
|
|
+ public AjaxResult getPatrolPlanAll(String type) {
|
|
|
+
|
|
|
+ return remotePatrolPlanService.getPatrolPlanAll(type);
|
|
|
+ }
|
|
|
+}
|