From bc906065cf3ab03d92b3cf815fb8c03bef9941ea Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期四, 03 七月 2025 09:13:27 +0800 Subject: [PATCH] 质量管理-抽样规则、缺陷维护功能 --- src/main/java/org/jeecg/modules/qms/entity/InspectionPlanItem.java | 71 ++ src/main/java/org/jeecg/modules/qms/entity/Defect.java | 82 +++ src/main/java/org/jeecg/modules/qms/service/impl/SamplingRulesServiceImpl.java | 19 src/main/java/org/jeecg/modules/qms/mapper/SamplingRulesMapper.java | 17 src/main/java/org/jeecg/modules/qms/service/impl/InspectionItemServiceImpl.java | 35 + src/main/java/org/jeecg/modules/qms/controller/DefectController.java | 194 +++++++ src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanItemMapper.java | 17 src/main/java/org/jeecg/modules/qms/service/IInspectionItemService.java | 4 src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanItemServiceImpl.java | 19 src/main/java/org/jeecg/modules/qms/mapper/InspectionItemMapper.java | 5 src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanServiceImpl.java | 19 src/main/java/org/jeecg/modules/qms/service/IInspectionPlanService.java | 14 src/main/java/org/jeecg/modules/qms/service/impl/DefectServiceImpl.java | 19 src/main/java/org/jeecg/modules/qms/mapper/xml/DefectMapper.xml | 5 src/main/java/org/jeecg/modules/qms/controller/SamplingRulesController.java | 194 +++++++ src/main/java/org/jeecg/modules/qms/service/IInspectionPlanItemService.java | 14 src/main/java/org/jeecg/modules/qms/controller/InspectionPlanItemController.java | 177 +++++++ src/main/java/org/jeecg/modules/qms/entity/InspectionPlan.java | 94 +++ src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionItemMapper.xml | 20 src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanMapper.xml | 5 src/main/java/org/jeecg/modules/qms/service/ISamplingRulesService.java | 14 src/main/java/org/jeecg/modules/qms/mapper/DefectMapper.java | 17 src/main/java/org/jeecg/modules/qms/entity/SamplingRules.java | 98 +++ src/main/java/org/jeecg/modules/qms/controller/InspectionPlanController.java | 194 +++++++ src/main/java/org/jeecg/modules/qms/controller/InspectionItemController.java | 61 ++ src/main/java/org/jeecg/modules/qms/service/IDefectService.java | 14 src/main/java/org/jeecg/modules/qms/mapper/xml/SamplingRulesMapper.xml | 5 src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanMapper.java | 17 src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanItemMapper.xml | 5 29 files changed, 1,449 insertions(+), 0 deletions(-) diff --git a/src/main/java/org/jeecg/modules/qms/controller/DefectController.java b/src/main/java/org/jeecg/modules/qms/controller/DefectController.java new file mode 100644 index 0000000..2b97121 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/controller/DefectController.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.InspectionItem; +import org.jeecg.modules.qms.service.IDefectService; + +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/defect") +@Slf4j +public class DefectController extends JeecgController<Defect, IDefectService> { + @Autowired + private IDefectService defectService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param defect + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "缂洪櫡缁存姢-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value="缂洪櫡缁存姢-鍒嗛〉鍒楄〃鏌ヨ", notes="缂洪櫡缁存姢-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<IPage<Defect>> queryPageList(Defect defect, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<Defect> queryWrapper = QueryGenerator.initQueryWrapper(defect, req.getParameterMap()); + Page<Defect> page = new Page<Defect>(pageNo, pageSize); + IPage<Defect> pageList = defectService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param defect + * @return + */ + @AutoLog(value = "缂洪櫡缁存姢-娣诲姞") + @ApiOperation(value="缂洪櫡缁存姢-娣诲姞", notes="缂洪櫡缁存姢-娣诲姞") + //@RequiresPermissions("org.jeecg.modules:qms_defect:add") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody Defect defect) { + defect.setDefectStatus(CommonConstant.STATUS_1); + defectService.save(defect); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param defect + * @return + */ + @AutoLog(value = "缂洪櫡缁存姢-缂栬緫") + @ApiOperation(value="缂洪櫡缁存姢-缂栬緫", notes="缂洪櫡缁存姢-缂栬緫") + //@RequiresPermissions("org.jeecg.modules:qms_defect:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result<String> edit(@RequestBody Defect defect) { + defectService.updateById(defect); + return Result.OK("缂栬緫鎴愬姛!"); + } + + /** + * 閫氳繃id鍒犻櫎 + * + * @param id + * @return + */ + @AutoLog(value = "缂洪櫡缁存姢-閫氳繃id鍒犻櫎") + @ApiOperation(value="缂洪櫡缁存姢-閫氳繃id鍒犻櫎", notes="缂洪櫡缁存姢-閫氳繃id鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:qms_defect:delete") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name="id",required=true) String id) { + defectService.removeById(id); + return Result.OK("鍒犻櫎鎴愬姛!"); + } + + /** + * 鎵归噺鍒犻櫎 + * + * @param ids + * @return + */ + @AutoLog(value = "缂洪櫡缁存姢-鎵归噺鍒犻櫎") + @ApiOperation(value="缂洪櫡缁存姢-鎵归噺鍒犻櫎", notes="缂洪櫡缁存姢-鎵归噺鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:qms_defect:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.defectService.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<Defect> queryById(@RequestParam(name="id",required=true) String id) { + Defect defect = defectService.getById(id); + if(defect==null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + return Result.OK(defect); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param defect + */ + //@RequiresPermissions("org.jeecg.modules:qms_defect:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Defect defect) { + return super.exportXls(request, defect, Defect.class, "缂洪櫡缁存姢"); + } + + /** + * 閫氳繃excel瀵煎叆鏁版嵁 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("qms_defect:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, Defect.class); + } + + @AutoLog(value = "缂洪櫡缁存姢-鍚敤&绂佺敤") + @ApiOperation(value = "缂洪櫡缁存姢-鍚敤&绂佺敤", notes = "缂洪櫡缁存姢-鍚敤&绂佺敤") + @PutMapping(value = "/active") + public Result<?> active(@RequestParam(name = "id", required = true) String id) { + Defect defect = defectService.getById(id); + if (CommonConstant.STATUS_1.equals(defect.getDefectStatus())) { + defect.setDefectStatus(CommonConstant.STATUS_0); + } else { + defect.setDefectStatus(CommonConstant.STATUS_1); + } + defectService.updateById(defect); + return Result.ok("鎿嶄綔鎴愬姛锛�"); + } + +} diff --git a/src/main/java/org/jeecg/modules/qms/controller/InspectionItemController.java b/src/main/java/org/jeecg/modules/qms/controller/InspectionItemController.java index 22d7c03..1c38dc3 100644 --- a/src/main/java/org/jeecg/modules/qms/controller/InspectionItemController.java +++ b/src/main/java/org/jeecg/modules/qms/controller/InspectionItemController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.qms.controller; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -9,11 +10,14 @@ import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; 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.InspectionItem; +import org.jeecg.modules.qms.entity.InspectionTools; import org.jeecg.modules.qms.service.IInspectionItemService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -21,6 +25,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.qms.service.IInspectionToolsService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -50,6 +55,9 @@ public class InspectionItemController extends JeecgController<InspectionItem, IInspectionItemService> { @Autowired private IInspectionItemService inspectionItemService; + + @Autowired + private IInspectionToolsService inspectionToolsService; /** * 鍒嗛〉鍒楄〃鏌ヨ @@ -176,4 +184,57 @@ return super.importExcel(request, response, InspectionItem.class); } + @AutoLog(value = "妫�楠岄」鐩�-鍚敤&绂佺敤") + @ApiOperation(value = "妫�楠岄」鐩�-鍚敤&绂佺敤", notes = "妫�楠岄」鐩�-鍚敤&绂佺敤") + @PutMapping(value = "/active") + public Result<?> active(@RequestParam(name = "id", required = true) String id) { + InspectionItem inspectionItem = inspectionItemService.getById(id); + if (CommonConstant.STATUS_1.equals(inspectionItem.getItemStatus())) { + inspectionItem.setItemStatus(CommonConstant.STATUS_0); + } else { + inspectionItem.setItemStatus(CommonConstant.STATUS_1); + } + inspectionItemService.updateById(inspectionItem); + return Result.ok("鎿嶄綔鎴愬姛锛�"); + } + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param inspectionItem + * @param pageNo + * @param pageSize + * @param query + * @return + */ + @ApiOperation(value="妫�楠岄」鐩�-鍒嗛〉鍒楄〃鏌ヨ", notes="妫�楠岄」鐩�-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/queryList") + public Result<?> queryList(InspectionItem inspectionItem, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam Map<String, String> query) { + IPage<Map<String, Object>> pageList = inspectionItemService.queryList(pageNo,pageSize, query); + for(Map<String, Object> r : pageList.getRecords()){ + String inspectionTools = (String) r.get("inspectionTools"); + if(StringUtils.isNotBlank(inspectionTools)){ + List<String> inspectionToolsList = Arrays.asList(inspectionTools.split(",")); + List<String> inspectionToolsNameList = new ArrayList<>(); + String inspectionToolsNames = ""; + for(String inspectionTool : inspectionToolsList){ + InspectionTools inspectionTools1 = inspectionToolsService.getById(inspectionTool); + if(inspectionTools1 != null){ + inspectionToolsNameList.add(inspectionTools1.getToolName()); + } + } + inspectionToolsNames = inspectionToolsNameList.stream() + .collect(Collectors.joining(",")); + r.put("inspectionToolsNames",inspectionToolsNames); + + } + + } + + return Result.OK(pageList); + } + } 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("鎿嶄綔鎴愬姛锛�"); + } + +} diff --git a/src/main/java/org/jeecg/modules/qms/controller/InspectionPlanItemController.java b/src/main/java/org/jeecg/modules/qms/controller/InspectionPlanItemController.java new file mode 100644 index 0000000..82780ce --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/controller/InspectionPlanItemController.java @@ -0,0 +1,177 @@ +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.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.qms.entity.InspectionPlanItem; +import org.jeecg.modules.qms.service.IInspectionPlanItemService; + +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/inspectionPlanItem") +@Slf4j +public class InspectionPlanItemController extends JeecgController<InspectionPlanItem, IInspectionPlanItemService> { + @Autowired + private IInspectionPlanItemService inspectionPlanItemService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param inspectionPlanItem + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "妫�楠屾柟妗堟楠岄」-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value="妫�楠屾柟妗堟楠岄」-鍒嗛〉鍒楄〃鏌ヨ", notes="妫�楠屾柟妗堟楠岄」-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<IPage<InspectionPlanItem>> queryPageList(InspectionPlanItem inspectionPlanItem, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<InspectionPlanItem> queryWrapper = QueryGenerator.initQueryWrapper(inspectionPlanItem, req.getParameterMap()); + Page<InspectionPlanItem> page = new Page<InspectionPlanItem>(pageNo, pageSize); + IPage<InspectionPlanItem> pageList = inspectionPlanItemService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param inspectionPlanItem + * @return + */ + @AutoLog(value = "妫�楠屾柟妗堟楠岄」-娣诲姞") + @ApiOperation(value="妫�楠屾柟妗堟楠岄」-娣诲姞", notes="妫�楠屾柟妗堟楠岄」-娣诲姞") + //@RequiresPermissions("org.jeecg.modules:qms_inspection_plan_item:add") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody InspectionPlanItem inspectionPlanItem) { + inspectionPlanItemService.save(inspectionPlanItem); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param inspectionPlanItem + * @return + */ + @AutoLog(value = "妫�楠屾柟妗堟楠岄」-缂栬緫") + @ApiOperation(value="妫�楠屾柟妗堟楠岄」-缂栬緫", notes="妫�楠屾柟妗堟楠岄」-缂栬緫") + //@RequiresPermissions("org.jeecg.modules:qms_inspection_plan_item:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result<String> edit(@RequestBody InspectionPlanItem inspectionPlanItem) { + inspectionPlanItemService.updateById(inspectionPlanItem); + return Result.OK("缂栬緫鎴愬姛!"); + } + + /** + * 閫氳繃id鍒犻櫎 + * + * @param id + * @return + */ + @AutoLog(value = "妫�楠屾柟妗堟楠岄」-閫氳繃id鍒犻櫎") + @ApiOperation(value="妫�楠屾柟妗堟楠岄」-閫氳繃id鍒犻櫎", notes="妫�楠屾柟妗堟楠岄」-閫氳繃id鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:qms_inspection_plan_item:delete") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name="id",required=true) String id) { + inspectionPlanItemService.removeById(id); + return Result.OK("鍒犻櫎鎴愬姛!"); + } + + /** + * 鎵归噺鍒犻櫎 + * + * @param ids + * @return + */ + @AutoLog(value = "妫�楠屾柟妗堟楠岄」-鎵归噺鍒犻櫎") + @ApiOperation(value="妫�楠屾柟妗堟楠岄」-鎵归噺鍒犻櫎", notes="妫�楠屾柟妗堟楠岄」-鎵归噺鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:qms_inspection_plan_item:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.inspectionPlanItemService.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<InspectionPlanItem> queryById(@RequestParam(name="id",required=true) String id) { + InspectionPlanItem inspectionPlanItem = inspectionPlanItemService.getById(id); + if(inspectionPlanItem==null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + return Result.OK(inspectionPlanItem); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param inspectionPlanItem + */ + //@RequiresPermissions("org.jeecg.modules:qms_inspection_plan_item:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, InspectionPlanItem inspectionPlanItem) { + return super.exportXls(request, inspectionPlanItem, InspectionPlanItem.class, "妫�楠屾柟妗堟楠岄」"); + } + + /** + * 閫氳繃excel瀵煎叆鏁版嵁 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("qms_inspection_plan_item:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, InspectionPlanItem.class); + } + +} diff --git a/src/main/java/org/jeecg/modules/qms/controller/SamplingRulesController.java b/src/main/java/org/jeecg/modules/qms/controller/SamplingRulesController.java new file mode 100644 index 0000000..35a1780 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/controller/SamplingRulesController.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.InspectionItem; +import org.jeecg.modules.qms.entity.SamplingRules; +import org.jeecg.modules.qms.service.ISamplingRulesService; + +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/samplingRules") +@Slf4j +public class SamplingRulesController extends JeecgController<SamplingRules, ISamplingRulesService> { + @Autowired + private ISamplingRulesService samplingRulesService; + + /** + * 鍒嗛〉鍒楄〃鏌ヨ + * + * @param samplingRules + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "鎶芥牱瑙勫垯-鍒嗛〉鍒楄〃鏌ヨ") + @ApiOperation(value="鎶芥牱瑙勫垯-鍒嗛〉鍒楄〃鏌ヨ", notes="鎶芥牱瑙勫垯-鍒嗛〉鍒楄〃鏌ヨ") + @GetMapping(value = "/list") + public Result<IPage<SamplingRules>> queryPageList(SamplingRules samplingRules, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper<SamplingRules> queryWrapper = QueryGenerator.initQueryWrapper(samplingRules, req.getParameterMap()); + Page<SamplingRules> page = new Page<SamplingRules>(pageNo, pageSize); + IPage<SamplingRules> pageList = samplingRulesService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 娣诲姞 + * + * @param samplingRules + * @return + */ + @AutoLog(value = "鎶芥牱瑙勫垯-娣诲姞") + @ApiOperation(value="鎶芥牱瑙勫垯-娣诲姞", notes="鎶芥牱瑙勫垯-娣诲姞") + //@RequiresPermissions("org.jeecg.modules:qms_sampling_rules:add") + @PostMapping(value = "/add") + public Result<String> add(@RequestBody SamplingRules samplingRules) { + samplingRules.setRuleStatus(CommonConstant.STATUS_1); + samplingRulesService.save(samplingRules); + return Result.OK("娣诲姞鎴愬姛锛�"); + } + + /** + * 缂栬緫 + * + * @param samplingRules + * @return + */ + @AutoLog(value = "鎶芥牱瑙勫垯-缂栬緫") + @ApiOperation(value="鎶芥牱瑙勫垯-缂栬緫", notes="鎶芥牱瑙勫垯-缂栬緫") + //@RequiresPermissions("org.jeecg.modules:qms_sampling_rules:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result<String> edit(@RequestBody SamplingRules samplingRules) { + samplingRulesService.updateById(samplingRules); + return Result.OK("缂栬緫鎴愬姛!"); + } + + /** + * 閫氳繃id鍒犻櫎 + * + * @param id + * @return + */ + @AutoLog(value = "鎶芥牱瑙勫垯-閫氳繃id鍒犻櫎") + @ApiOperation(value="鎶芥牱瑙勫垯-閫氳繃id鍒犻櫎", notes="鎶芥牱瑙勫垯-閫氳繃id鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:qms_sampling_rules:delete") + @DeleteMapping(value = "/delete") + public Result<String> delete(@RequestParam(name="id",required=true) String id) { + samplingRulesService.removeById(id); + return Result.OK("鍒犻櫎鎴愬姛!"); + } + + /** + * 鎵归噺鍒犻櫎 + * + * @param ids + * @return + */ + @AutoLog(value = "鎶芥牱瑙勫垯-鎵归噺鍒犻櫎") + @ApiOperation(value="鎶芥牱瑙勫垯-鎵归噺鍒犻櫎", notes="鎶芥牱瑙勫垯-鎵归噺鍒犻櫎") + //@RequiresPermissions("org.jeecg.modules:qms_sampling_rules:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.samplingRulesService.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<SamplingRules> queryById(@RequestParam(name="id",required=true) String id) { + SamplingRules samplingRules = samplingRulesService.getById(id); + if(samplingRules==null) { + return Result.error("鏈壘鍒板搴旀暟鎹�"); + } + return Result.OK(samplingRules); + } + + /** + * 瀵煎嚭excel + * + * @param request + * @param samplingRules + */ + //@RequiresPermissions("org.jeecg.modules:qms_sampling_rules:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, SamplingRules samplingRules) { + return super.exportXls(request, samplingRules, SamplingRules.class, "鎶芥牱瑙勫垯"); + } + + /** + * 閫氳繃excel瀵煎叆鏁版嵁 + * + * @param request + * @param response + * @return + */ + //@RequiresPermissions("qms_sampling_rules:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, SamplingRules.class); + } + + @AutoLog(value = "鎶芥牱瑙勫垯-鍚敤&绂佺敤") + @ApiOperation(value = "鎶芥牱瑙勫垯-鍚敤&绂佺敤", notes = "鎶芥牱瑙勫垯-鍚敤&绂佺敤") + @PutMapping(value = "/active") + public Result<?> active(@RequestParam(name = "id", required = true) String id) { + SamplingRules samplingRules = samplingRulesService.getById(id); + if (CommonConstant.STATUS_1.equals(samplingRules.getRuleStatus())) { + samplingRules.setRuleStatus(CommonConstant.STATUS_0); + } else { + samplingRules.setRuleStatus(CommonConstant.STATUS_1); + } + samplingRulesService.updateById(samplingRules); + return Result.ok("鎿嶄綔鎴愬姛锛�"); + } + +} diff --git a/src/main/java/org/jeecg/modules/qms/entity/Defect.java b/src/main/java/org/jeecg/modules/qms/entity/Defect.java new file mode 100644 index 0000000..b6ffba0 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/entity/Defect.java @@ -0,0 +1,82 @@ +package org.jeecg.modules.qms.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.common.constant.CommonConstant; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 缂洪櫡缁存姢 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Data +@TableName("qms_defect") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="qms_defect瀵硅薄", description="缂洪櫡缁存姢") +public class Defect implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + private Date createTime; + /**鏇存柊浜�*/ + @ApiModelProperty(value = "鏇存柊浜�") + private String updateBy; + /**鏇存柊鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鏇存柊鏃堕棿") + private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag = CommonConstant.DEL_FLAG_0; + /**缂洪櫡缂栫爜*/ + @Excel(name = "缂洪櫡缂栫爜", width = 15) + @ApiModelProperty(value = "缂洪櫡缂栫爜") + private String defectCode; + /**缂洪櫡鍚嶇О*/ + @Excel(name = "缂洪櫡鍚嶇О", width = 15) + @ApiModelProperty(value = "缂洪櫡鍚嶇О") + private String defectName; + /**缂洪櫡鍒嗙被*/ + @Excel(name = "缂洪櫡鍒嗙被", width = 15) + @ApiModelProperty(value = "缂洪櫡鍒嗙被") + @Dict(dicCode = "defect_category") + private String defectCategory; + /**缂洪櫡鐘舵��*/ + @Excel(name = "缂洪櫡鐘舵��", width = 15) + @ApiModelProperty(value = "缂洪櫡鐘舵��") + private String defectStatus; + /**缂洪櫡鎻忚堪*/ + @Excel(name = "缂洪櫡鎻忚堪", width = 15) + @ApiModelProperty(value = "缂洪櫡鎻忚堪") + private String descreption; +} diff --git a/src/main/java/org/jeecg/modules/qms/entity/InspectionPlan.java b/src/main/java/org/jeecg/modules/qms/entity/InspectionPlan.java new file mode 100644 index 0000000..e98d3f6 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/entity/InspectionPlan.java @@ -0,0 +1,94 @@ +package org.jeecg.modules.qms.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.common.constant.CommonConstant; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 妫�楠屾柟妗� + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Data +@TableName("qms_inspection_plan") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="qms_inspection_plan瀵硅薄", description="妫�楠屾柟妗�") +public class InspectionPlan implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + private Date createTime; + /**鏇存柊浜�*/ + @ApiModelProperty(value = "鏇存柊浜�") + private String updateBy; + /**鏇存柊鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鏇存柊鏃堕棿") + private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag = CommonConstant.DEL_FLAG_0; + /**鏂规缂栫爜*/ + @Excel(name = "鏂规缂栫爜", width = 15) + @ApiModelProperty(value = "鏂规缂栫爜") + private String planCode; + /**鏂规鍚嶇О*/ + @Excel(name = "鏂规鍚嶇О", width = 15) + @ApiModelProperty(value = "鏂规鍚嶇О") + private String planName; + /**鐗╂枡缂栫爜*/ + @Excel(name = "鐗╂枡缂栫爜", width = 15) + @ApiModelProperty(value = "鐗╂枡缂栫爜") + private String materialNumber; + /**鐗╂枡鍚嶇О*/ + @Excel(name = "鐗╂枡鍚嶇О", width = 15) + @ApiModelProperty(value = "鐗╂枡鍚嶇О") + private String materialName; + /**鏂规鐘舵��*/ + @Excel(name = "鏂规鐘舵��", width = 15) + @ApiModelProperty(value = "鏂规鐘舵��") + private String planStatus; + /**鏂规鍒嗙被;棣栨銆佸贰妫�銆佸畬宸ユ*/ + @Excel(name = "鏂规鍒嗙被;棣栨銆佸贰妫�銆佸畬宸ユ", width = 15) + @ApiModelProperty(value = "鏂规鍒嗙被;棣栨銆佸贰妫�銆佸畬宸ユ") + @Dict(dicCode = "plan_category") + private String planCategory; + /**鎶芥牱瑙勫垯ID*/ + @Excel(name = "鎶芥牱瑙勫垯ID", width = 15) + @ApiModelProperty(value = "鎶芥牱瑙勫垯ID") + private String ruleId; + /**鏂规鎻忚堪*/ + @Excel(name = "鏂规鎻忚堪", width = 15) + @ApiModelProperty(value = "鏂规鎻忚堪") + private String descreption; +} diff --git a/src/main/java/org/jeecg/modules/qms/entity/InspectionPlanItem.java b/src/main/java/org/jeecg/modules/qms/entity/InspectionPlanItem.java new file mode 100644 index 0000000..e6b6ee5 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/entity/InspectionPlanItem.java @@ -0,0 +1,71 @@ +package org.jeecg.modules.qms.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 妫�楠屾柟妗堟楠岄」 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Data +@TableName("qms_inspection_plan_item") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="qms_inspection_plan_item瀵硅薄", description="妫�楠屾柟妗堟楠岄」") +public class InspectionPlanItem implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + private Date createTime; + /**鏂规ID*/ + @Excel(name = "鏂规ID", width = 15) + @ApiModelProperty(value = "鏂规ID") + private String planId; + /**妫�楠岄」ID*/ + @Excel(name = "妫�楠岄」ID", width = 15) + @ApiModelProperty(value = "妫�楠岄」ID") + private String itemId; + /**鎺掑簭*/ + @Excel(name = "鎺掑簭", width = 15) + @ApiModelProperty(value = "鎺掑簭") + private Integer sorter; + /**鏍囧噯鍊�*/ + @Excel(name = "鏍囧噯鍊�", width = 15) + @ApiModelProperty(value = "鏍囧噯鍊�") + private BigDecimal standardValue; + /**涓婂叕宸�(鏈�澶у��)*/ + @Excel(name = "涓婂叕宸�(鏈�澶у��)", width = 15) + @ApiModelProperty(value = "涓婂叕宸�(鏈�澶у��)") + private BigDecimal maxValue; + /**涓嬪叕宸�(鏈�灏忓��)*/ + @Excel(name = "涓嬪叕宸�(鏈�灏忓��)", width = 15) + @ApiModelProperty(value = "涓嬪叕宸�(鏈�灏忓��)") + private BigDecimal minValue; +} diff --git a/src/main/java/org/jeecg/modules/qms/entity/SamplingRules.java b/src/main/java/org/jeecg/modules/qms/entity/SamplingRules.java new file mode 100644 index 0000000..da47902 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/entity/SamplingRules.java @@ -0,0 +1,98 @@ +package org.jeecg.modules.qms.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.common.constant.CommonConstant; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 鎶芥牱瑙勫垯 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Data +@TableName("qms_sampling_rules") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="qms_sampling_rules瀵硅薄", description="鎶芥牱瑙勫垯") +public class SamplingRules implements Serializable { + private static final long serialVersionUID = 1L; + + /**涓婚敭*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "涓婚敭") + private String id; + /**鍒涘缓浜�*/ + @ApiModelProperty(value = "鍒涘缓浜�") + private String createBy; + /**鍒涘缓鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鍒涘缓鏃堕棿") + private Date createTime; + /**鏇存柊浜�*/ + @ApiModelProperty(value = "鏇存柊浜�") + private String updateBy; + /**鏇存柊鏃堕棿*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "鏇存柊鏃堕棿") + private Date updateTime; + /**鍒犻櫎鏍囪*/ + @Excel(name = "鍒犻櫎鏍囪", width = 15) + @ApiModelProperty(value = "鍒犻櫎鏍囪") + @TableLogic + private Integer delFlag = CommonConstant.DEL_FLAG_0; + /**瑙勫垯缂栫爜*/ + @Excel(name = "瑙勫垯缂栫爜", width = 15) + @ApiModelProperty(value = "瑙勫垯缂栫爜") + private String ruleCode; + /**瑙勫垯鍚嶇О*/ + @Excel(name = "瑙勫垯鍚嶇О", width = 15) + @ApiModelProperty(value = "瑙勫垯鍚嶇О") + private String ruleName; + /**鎶芥牱鍒嗙被*/ + @Excel(name = "鎶芥牱鍒嗙被", width = 15) + @ApiModelProperty(value = "鎶芥牱鍒嗙被") + @Dict(dicCode = "rule_category") + private String ruleCategory; + /**瑙勫垯鐘舵��*/ + @Excel(name = "瑙勫垯鐘舵��", width = 15) + @ApiModelProperty(value = "瑙勫垯鐘舵��") + private String ruleStatus; + /**鏈�澶т笉鍚堟牸鏁�*/ + @Excel(name = "鏈�澶т笉鍚堟牸鏁�", width = 15) + @ApiModelProperty(value = "鏈�澶т笉鍚堟牸鏁�") + private BigDecimal maxUnqualifiedQuantity; + /**鎶芥牱鏁伴噺*/ + @Excel(name = "鎶芥牱鏁伴噺", width = 15) + @ApiModelProperty(value = "鎶芥牱鏁伴噺") + private BigDecimal samplingQuantity; + /**鎵归噺涓嬮檺鍊�*/ + @Excel(name = "鎵归噺涓嬮檺鍊�", width = 15) + @ApiModelProperty(value = "鎵归噺涓嬮檺鍊�") + private BigDecimal batchLowerLimit; + /**鎵归噺涓婇檺鍊�*/ + @Excel(name = "鎵归噺涓婇檺鍊�", width = 15) + @ApiModelProperty(value = "鎵归噺涓婇檺鍊�") + private BigDecimal batchUpperLimit; + /**澶囨敞*/ + @Excel(name = "澶囨敞", width = 15) + @ApiModelProperty(value = "澶囨敞") + private String remark; +} diff --git a/src/main/java/org/jeecg/modules/qms/mapper/DefectMapper.java b/src/main/java/org/jeecg/modules/qms/mapper/DefectMapper.java new file mode 100644 index 0000000..b7aa9a8 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/DefectMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.qms.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.qms.entity.Defect; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 缂洪櫡缁存姢 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface DefectMapper extends BaseMapper<Defect> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/mapper/InspectionItemMapper.java b/src/main/java/org/jeecg/modules/qms/mapper/InspectionItemMapper.java index 45a1711..7530ed4 100644 --- a/src/main/java/org/jeecg/modules/qms/mapper/InspectionItemMapper.java +++ b/src/main/java/org/jeecg/modules/qms/mapper/InspectionItemMapper.java @@ -1,7 +1,11 @@ package org.jeecg.modules.qms.mapper; import java.util.List; +import java.util.Map; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; import org.apache.ibatis.annotations.Param; import org.jeecg.modules.qms.entity.InspectionItem; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -14,4 +18,5 @@ */ public interface InspectionItemMapper extends BaseMapper<InspectionItem> { + public IPage<Map<String, Object>> queryList(IPage<Map> pageData, @Param(Constants.WRAPPER) Wrapper<Map> wrapper); } diff --git a/src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanItemMapper.java b/src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanItemMapper.java new file mode 100644 index 0000000..3b6c1e9 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanItemMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.qms.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.qms.entity.InspectionPlanItem; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 妫�楠屾柟妗堟楠岄」 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface InspectionPlanItemMapper extends BaseMapper<InspectionPlanItem> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanMapper.java b/src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanMapper.java new file mode 100644 index 0000000..e126859 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/InspectionPlanMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.qms.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.qms.entity.InspectionPlan; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 妫�楠屾柟妗� + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface InspectionPlanMapper extends BaseMapper<InspectionPlan> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/mapper/SamplingRulesMapper.java b/src/main/java/org/jeecg/modules/qms/mapper/SamplingRulesMapper.java new file mode 100644 index 0000000..a5333eb --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/SamplingRulesMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.qms.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.qms.entity.SamplingRules; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 鎶芥牱瑙勫垯 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface SamplingRulesMapper extends BaseMapper<SamplingRules> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/mapper/xml/DefectMapper.xml b/src/main/java/org/jeecg/modules/qms/mapper/xml/DefectMapper.xml new file mode 100644 index 0000000..bd17e8e --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/xml/DefectMapper.xml @@ -0,0 +1,5 @@ +<?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="org.jeecg.modules.qms.mapper.DefectMapper"> + +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionItemMapper.xml b/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionItemMapper.xml index 3d0f356..bf9049b 100644 --- a/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionItemMapper.xml +++ b/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionItemMapper.xml @@ -2,4 +2,24 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.jeecg.modules.qms.mapper.InspectionItemMapper"> + + <select id="queryList" resultType="map" parameterType="String"> + SELECT + t1.id, + t1.item_code itemCode, + t1.item_name itemName, + t1.item_category itemCategory, + t1.qualitative_or_quantitative qualitativeOrQuantitative, + t1.inspection_tools inspectionTools, + t1.item_status itemStatus, + t1.create_time createTime, + t2.item_text itemCategoryName, + t3.item_text qualitativeOrQuantitativeName, + t1.remark + FROM + qms_inspection_item t1 + LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'item_category' ) t2 ON t2.item_value = t1.item_category + left join ( SELECT * FROM v_sys_dict WHERE dict_code = 'qualitative_or_quantitative' ) t3 on t3.item_value = t1.qualitative_or_quantitative + ${ew.customSqlSegment} + </select> </mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanItemMapper.xml b/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanItemMapper.xml new file mode 100644 index 0000000..90fe8e3 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanItemMapper.xml @@ -0,0 +1,5 @@ +<?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="org.jeecg.modules.qms.mapper.InspectionPlanItemMapper"> + +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanMapper.xml b/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanMapper.xml new file mode 100644 index 0000000..1662cf1 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/xml/InspectionPlanMapper.xml @@ -0,0 +1,5 @@ +<?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="org.jeecg.modules.qms.mapper.InspectionPlanMapper"> + +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/qms/mapper/xml/SamplingRulesMapper.xml b/src/main/java/org/jeecg/modules/qms/mapper/xml/SamplingRulesMapper.xml new file mode 100644 index 0000000..abf690f --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/mapper/xml/SamplingRulesMapper.xml @@ -0,0 +1,5 @@ +<?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="org.jeecg.modules.qms.mapper.SamplingRulesMapper"> + +</mapper> \ No newline at end of file diff --git a/src/main/java/org/jeecg/modules/qms/service/IDefectService.java b/src/main/java/org/jeecg/modules/qms/service/IDefectService.java new file mode 100644 index 0000000..a978849 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/IDefectService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.qms.service; + +import org.jeecg.modules.qms.entity.Defect; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 缂洪櫡缁存姢 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface IDefectService extends IService<Defect> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/IInspectionItemService.java b/src/main/java/org/jeecg/modules/qms/service/IInspectionItemService.java index d68aa84..3d0d3e4 100644 --- a/src/main/java/org/jeecg/modules/qms/service/IInspectionItemService.java +++ b/src/main/java/org/jeecg/modules/qms/service/IInspectionItemService.java @@ -1,7 +1,10 @@ package org.jeecg.modules.qms.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import org.jeecg.modules.qms.entity.InspectionItem; import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.Map; /** * @Description: 妫�楠岄」鐩� @@ -11,4 +14,5 @@ */ public interface IInspectionItemService extends IService<InspectionItem> { + IPage<Map<String, Object>> queryList(Integer pageNo, Integer pageSize, Map<String, String> query); } diff --git a/src/main/java/org/jeecg/modules/qms/service/IInspectionPlanItemService.java b/src/main/java/org/jeecg/modules/qms/service/IInspectionPlanItemService.java new file mode 100644 index 0000000..b17c646 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/IInspectionPlanItemService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.qms.service; + +import org.jeecg.modules.qms.entity.InspectionPlanItem; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 妫�楠屾柟妗堟楠岄」 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface IInspectionPlanItemService extends IService<InspectionPlanItem> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/IInspectionPlanService.java b/src/main/java/org/jeecg/modules/qms/service/IInspectionPlanService.java new file mode 100644 index 0000000..afcb5bb --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/IInspectionPlanService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.qms.service; + +import org.jeecg.modules.qms.entity.InspectionPlan; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 妫�楠屾柟妗� + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface IInspectionPlanService extends IService<InspectionPlan> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/ISamplingRulesService.java b/src/main/java/org/jeecg/modules/qms/service/ISamplingRulesService.java new file mode 100644 index 0000000..8e878f2 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/ISamplingRulesService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.qms.service; + +import org.jeecg.modules.qms.entity.SamplingRules; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 鎶芥牱瑙勫垯 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +public interface ISamplingRulesService extends IService<SamplingRules> { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/impl/DefectServiceImpl.java b/src/main/java/org/jeecg/modules/qms/service/impl/DefectServiceImpl.java new file mode 100644 index 0000000..693e0df --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/impl/DefectServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.qms.service.impl; + +import org.jeecg.modules.qms.entity.Defect; +import org.jeecg.modules.qms.mapper.DefectMapper; +import org.jeecg.modules.qms.service.IDefectService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 缂洪櫡缁存姢 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Service +public class DefectServiceImpl extends ServiceImpl<DefectMapper, Defect> implements IDefectService { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/impl/InspectionItemServiceImpl.java b/src/main/java/org/jeecg/modules/qms/service/impl/InspectionItemServiceImpl.java index 101beb0..b851290 100644 --- a/src/main/java/org/jeecg/modules/qms/service/impl/InspectionItemServiceImpl.java +++ b/src/main/java/org/jeecg/modules/qms/service/impl/InspectionItemServiceImpl.java @@ -1,11 +1,22 @@ package org.jeecg.modules.qms.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.metadata.OrderItem; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.commons.lang.StringUtils; +import org.jeecg.common.exception.ExceptionCast; import org.jeecg.modules.qms.entity.InspectionItem; import org.jeecg.modules.qms.mapper.InspectionItemMapper; import org.jeecg.modules.qms.service.IInspectionItemService; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * @Description: 妫�楠岄」鐩� @@ -16,4 +27,28 @@ @Service public class InspectionItemServiceImpl extends ServiceImpl<InspectionItemMapper, InspectionItem> implements IInspectionItemService { + @Override + public IPage<Map<String, Object>> queryList(Integer pageNo, Integer pageSize, Map<String, String> query) { + if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) { + ExceptionCast.cast("鍙傛暟閿欒"); + } + IPage<Map> pageData = new Page<Map>(pageNo, pageSize); + QueryWrapper<Map> queryWrapper = Wrappers.query(); + if (null != query) { + String itemCode = query.get("itemCode"); + if (StringUtils.isNotBlank(itemCode)) { + queryWrapper.like("t1.item_code", itemCode); + } + String itemName = query.get("itemName"); + if (StringUtils.isNotBlank(itemName)) { + queryWrapper.like("t2.item_name", itemName); + } + + // 鎺掑簭鍐欐硶 + List<OrderItem> orderItems = new ArrayList<>(); + orderItems.add(OrderItem.desc("t1.create_time")); + ((Page<Map>) pageData).setOrders(orderItems); + } + return super.getBaseMapper().queryList(pageData,queryWrapper); + } } diff --git a/src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanItemServiceImpl.java b/src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanItemServiceImpl.java new file mode 100644 index 0000000..cd703b2 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanItemServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.qms.service.impl; + +import org.jeecg.modules.qms.entity.InspectionPlanItem; +import org.jeecg.modules.qms.mapper.InspectionPlanItemMapper; +import org.jeecg.modules.qms.service.IInspectionPlanItemService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 妫�楠屾柟妗堟楠岄」 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Service +public class InspectionPlanItemServiceImpl extends ServiceImpl<InspectionPlanItemMapper, InspectionPlanItem> implements IInspectionPlanItemService { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanServiceImpl.java b/src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanServiceImpl.java new file mode 100644 index 0000000..85ba77c --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/impl/InspectionPlanServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.qms.service.impl; + +import org.jeecg.modules.qms.entity.InspectionPlan; +import org.jeecg.modules.qms.mapper.InspectionPlanMapper; +import org.jeecg.modules.qms.service.IInspectionPlanService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 妫�楠屾柟妗� + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Service +public class InspectionPlanServiceImpl extends ServiceImpl<InspectionPlanMapper, InspectionPlan> implements IInspectionPlanService { + +} diff --git a/src/main/java/org/jeecg/modules/qms/service/impl/SamplingRulesServiceImpl.java b/src/main/java/org/jeecg/modules/qms/service/impl/SamplingRulesServiceImpl.java new file mode 100644 index 0000000..7120045 --- /dev/null +++ b/src/main/java/org/jeecg/modules/qms/service/impl/SamplingRulesServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.qms.service.impl; + +import org.jeecg.modules.qms.entity.SamplingRules; +import org.jeecg.modules.qms.mapper.SamplingRulesMapper; +import org.jeecg.modules.qms.service.ISamplingRulesService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 鎶芥牱瑙勫垯 + * @Author: jeecg-boot + * @Date: 2025-07-02 + * @Version: V1.0 + */ +@Service +public class SamplingRulesServiceImpl extends ServiceImpl<SamplingRulesMapper, SamplingRules> implements ISamplingRulesService { + +} -- Gitblit v1.9.3