From 8c945d42c6610abd9ef17bc153114024175bec2a Mon Sep 17 00:00:00 2001
From: houshuai <17802598606@163.com>
Date: 星期四, 03 七月 2025 19:43:12 +0800
Subject: [PATCH] 线边库和订单 基本搭建

---
 src/main/java/org/jeecg/modules/qms/controller/InspectionPlanController.java |  194 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 194 insertions(+), 0 deletions(-)

diff --git a/src/main/java/org/jeecg/modules/qms/controller/InspectionPlanController.java b/src/main/java/org/jeecg/modules/qms/controller/InspectionPlanController.java
new file mode 100644
index 0000000..764eac7
--- /dev/null
+++ b/src/main/java/org/jeecg/modules/qms/controller/InspectionPlanController.java
@@ -0,0 +1,194 @@
+package org.jeecg.modules.qms.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.qms.entity.Defect;
+import org.jeecg.modules.qms.entity.InspectionPlan;
+import org.jeecg.modules.qms.service.IInspectionPlanService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 妫�楠屾柟妗�
+ * @Author: jeecg-boot
+ * @Date:   2025-07-02
+ * @Version: V1.0
+ */
+@Api(tags="妫�楠屾柟妗�")
+@RestController
+@RequestMapping("/qms/inspectionPlan")
+@Slf4j
+public class InspectionPlanController extends JeecgController<InspectionPlan, IInspectionPlanService> {
+	@Autowired
+	private IInspectionPlanService inspectionPlanService;
+	
+	/**
+	 * 鍒嗛〉鍒楄〃鏌ヨ
+	 *
+	 * @param inspectionPlan
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "妫�楠屾柟妗�-鍒嗛〉鍒楄〃鏌ヨ")
+	@ApiOperation(value="妫�楠屾柟妗�-鍒嗛〉鍒楄〃鏌ヨ", notes="妫�楠屾柟妗�-鍒嗛〉鍒楄〃鏌ヨ")
+	@GetMapping(value = "/list")
+	public Result<IPage<InspectionPlan>> queryPageList(InspectionPlan inspectionPlan,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<InspectionPlan> queryWrapper = QueryGenerator.initQueryWrapper(inspectionPlan, req.getParameterMap());
+		Page<InspectionPlan> page = new Page<InspectionPlan>(pageNo, pageSize);
+		IPage<InspectionPlan> pageList = inspectionPlanService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   娣诲姞
+	 *
+	 * @param inspectionPlan
+	 * @return
+	 */
+	@AutoLog(value = "妫�楠屾柟妗�-娣诲姞")
+	@ApiOperation(value="妫�楠屾柟妗�-娣诲姞", notes="妫�楠屾柟妗�-娣诲姞")
+	//@RequiresPermissions("org.jeecg.modules:qms_inspection_plan:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody InspectionPlan inspectionPlan) {
+		inspectionPlan.setPlanStatus(CommonConstant.STATUS_1);
+		inspectionPlanService.save(inspectionPlan);
+		return Result.OK("娣诲姞鎴愬姛锛�");
+	}
+	
+	/**
+	 *  缂栬緫
+	 *
+	 * @param inspectionPlan
+	 * @return
+	 */
+	@AutoLog(value = "妫�楠屾柟妗�-缂栬緫")
+	@ApiOperation(value="妫�楠屾柟妗�-缂栬緫", notes="妫�楠屾柟妗�-缂栬緫")
+	//@RequiresPermissions("org.jeecg.modules:qms_inspection_plan:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody InspectionPlan inspectionPlan) {
+		inspectionPlanService.updateById(inspectionPlan);
+		return Result.OK("缂栬緫鎴愬姛!");
+	}
+	
+	/**
+	 *   閫氳繃id鍒犻櫎
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "妫�楠屾柟妗�-閫氳繃id鍒犻櫎")
+	@ApiOperation(value="妫�楠屾柟妗�-閫氳繃id鍒犻櫎", notes="妫�楠屾柟妗�-閫氳繃id鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:qms_inspection_plan:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		inspectionPlanService.removeById(id);
+		return Result.OK("鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 *  鎵归噺鍒犻櫎
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "妫�楠屾柟妗�-鎵归噺鍒犻櫎")
+	@ApiOperation(value="妫�楠屾柟妗�-鎵归噺鍒犻櫎", notes="妫�楠屾柟妗�-鎵归噺鍒犻櫎")
+	//@RequiresPermissions("org.jeecg.modules:qms_inspection_plan:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.inspectionPlanService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("鎵归噺鍒犻櫎鎴愬姛!");
+	}
+	
+	/**
+	 * 閫氳繃id鏌ヨ
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "妫�楠屾柟妗�-閫氳繃id鏌ヨ")
+	@ApiOperation(value="妫�楠屾柟妗�-閫氳繃id鏌ヨ", notes="妫�楠屾柟妗�-閫氳繃id鏌ヨ")
+	@GetMapping(value = "/queryById")
+	public Result<InspectionPlan> queryById(@RequestParam(name="id",required=true) String id) {
+		InspectionPlan inspectionPlan = inspectionPlanService.getById(id);
+		if(inspectionPlan==null) {
+			return Result.error("鏈壘鍒板搴旀暟鎹�");
+		}
+		return Result.OK(inspectionPlan);
+	}
+
+    /**
+    * 瀵煎嚭excel
+    *
+    * @param request
+    * @param inspectionPlan
+    */
+    //@RequiresPermissions("org.jeecg.modules:qms_inspection_plan:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, InspectionPlan inspectionPlan) {
+        return super.exportXls(request, inspectionPlan, InspectionPlan.class, "妫�楠屾柟妗�");
+    }
+
+    /**
+      * 閫氳繃excel瀵煎叆鏁版嵁
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("qms_inspection_plan:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, InspectionPlan.class);
+    }
+
+	 @AutoLog(value = "妫�楠屾柟妗�-鍚敤&绂佺敤")
+	 @ApiOperation(value = "妫�楠屾柟妗�-鍚敤&绂佺敤", notes = "妫�楠屾柟妗�-鍚敤&绂佺敤")
+	 @PutMapping(value = "/active")
+	 public Result<?> active(@RequestParam(name = "id", required = true) String id) {
+		 InspectionPlan inspectionPlan = inspectionPlanService.getById(id);
+		 if (CommonConstant.STATUS_1.equals(inspectionPlan.getPlanStatus())) {
+			 inspectionPlan.setPlanStatus(CommonConstant.STATUS_0);
+		 } else {
+			 inspectionPlan.setPlanStatus(CommonConstant.STATUS_1);
+		 }
+		 inspectionPlanService.updateById(inspectionPlan);
+		 return Result.ok("鎿嶄綔鎴愬姛锛�");
+	 }
+
+}

--
Gitblit v1.9.3