package com.gkhy.exam.admin.controller.web; import com.gkhy.exam.common.api.CommonResult; import com.gkhy.exam.system.domain.*; import com.gkhy.exam.system.service.QualitySystemPlanService; import com.gkhy.exam.system.service.StandardizedTemplateService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @Api(tags = "标准化体系模板") @RestController @RequestMapping("/template") public class TemplateController { @Autowired private StandardizedTemplateService standardizedTemplateService; @Autowired private QualitySystemPlanService qualitySystemPlanService; /** * 行业模版 * @param companyId * @return */ @ApiOperation(value = "标准化模版(分页)") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = false, value = "公司iD"), @ApiImplicitParam(paramType = "query", name = "templateType", dataType = "int", required = true, value = "类型1体系标准2技术标准3应用标准4程序文件5作业指导书6记录及表单7技术类8生产类9其他知识产权"), @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = true, value = "页码"), @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = true, value = "每页数量") }) @GetMapping("/standardizedTemplate/list") public CommonResult selectStandardizedTemplateList(Integer companyId, @RequestParam("templateType") Integer templateType){ return CommonResult.success(standardizedTemplateService.selectStandardizedTemplateList(companyId, templateType)); } /** * 行业模版新增 * @param standardizedTemplate * @return */ @ApiOperation(value = "标准化模版新增") @PostMapping("/standardizedTemplate/insert") public CommonResult insertStandardizedTemplate(@Validated @RequestBody StandardizedTemplate standardizedTemplate){ return standardizedTemplateService.insertStandardizedTemplate(standardizedTemplate); } /** * 企业花名册修改 * @param standardizedTemplate * @return */ @ApiOperation(value = "标准化模版修改") @PostMapping("/standardizedTemplate/update") public CommonResult updateCompanyIndustryTemplate(@Validated @RequestBody StandardizedTemplate standardizedTemplate){ return standardizedTemplateService.updateStandardizedTemplate(standardizedTemplate); } /** * 行业模版删除 * @param standardizedTemplateId * @return */ @ApiOperation(value = "标准化模版删除") @GetMapping("/standardizedTemplate/deleted") public CommonResult deletedStandardizedTemplate(@RequestParam("standardizedTemplateId") Integer standardizedTemplateId){ return standardizedTemplateService.deletedStandardizedTemplate(standardizedTemplateId); } /** * 行业模版 * @param companyId * @return */ @ApiOperation(value = "获取质量手册") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "int", required = true, value = "公司iD"), }) @GetMapping("/standardizedQuality/info") public CommonResult selectStandardizedQuality(Integer companyId){ return CommonResult.success(standardizedTemplateService.selectStandardizedQuality(companyId)); } /** * 行业模版新增 * @param standardizedQuality * @return */ @ApiOperation(value = "质量手册新增") @PostMapping("/standardizedQuality/insert") public CommonResult insertStandardizedQuality(@Validated @RequestBody StandardizedQuality standardizedQuality){ return standardizedTemplateService.insertStandardizedQuality(standardizedQuality); } /** * 企业花名册修改 * @param standardizedQuality * @return */ @ApiOperation(value = "质量手册修改") @PostMapping("/standardizedQuality/update") public CommonResult updateStandardizedQuality(@Validated @RequestBody StandardizedQuality standardizedQuality){ return standardizedTemplateService.updateStandardizedQuality(standardizedQuality); } /** * 行业模版删除 * @param standardizedQualityId * @return */ @ApiOperation(value = "质量手册删除") @GetMapping("/standardizedQuality/deleted") public CommonResult deletedStandardizedQuality(@RequestParam("standardizedQualityId") Integer standardizedQualityId){ return standardizedTemplateService.deletedStandardizedQuality(standardizedQualityId); } /** * 获取质量手册数据 * @param companyId * @return */ @ApiOperation(value = "获取质量手册数据") @GetMapping("/standardizedQuality/dataInfo") public CommonResult standardizedQualityDataInfo(@RequestParam("companyId") Integer companyId){ return standardizedTemplateService.getStandardizedQualityByCompanyId(companyId); } /** * 质量体系策划 * @param qualitySystemPlan * @return */ @ApiOperation(value = "质量体系策划列表(分页)") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"), @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"), }) @GetMapping("/list") public CommonResult listQualitySystemPlan(QualitySystemPlan qualitySystemPlan){ return CommonResult.success(qualitySystemPlanService.selectQualitySystemPlanList(qualitySystemPlan)); } /** * 质量体系策划新增 * @param qualitySystemPlan * @return */ @ApiOperation(value = "质量体系策划新增") @PostMapping("/insert") public CommonResult insertQualitySystemPlan(@RequestBody QualitySystemPlan qualitySystemPlan){ return qualitySystemPlanService.insertQualitySystemPlan(qualitySystemPlan); } /** * 质量体系策划修改 * @param qualitySystemPlan * @return */ @ApiOperation(value = "质量体系策划修改") @PostMapping("/update") public CommonResult updateQualitySystemPlan(@RequestBody QualitySystemPlan qualitySystemPlan){ return qualitySystemPlanService.updateQualitySystemPlan(qualitySystemPlan); } /** * 质量体系策划删除 * @param planId * @return */ @ApiOperation(value = "质量体系策划删除") @GetMapping("/deleted") public CommonResult deletedQualitySystemPlan(@RequestParam("planId") Integer planId){ return qualitySystemPlanService.deletedQualitySystemPlan(planId); } }