From 2d1470f505772d3f0c0b18e74c3ff8b44ef9f9fa Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Sat, 8 May 2021 11:38:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2/IndustryCheckItemAppController.java | 108 ++++++++++++++++++ src/main/resources/application-test.yml | 12 +- .../v2/checkitemoption-mapper.xml | 2 +- .../enterpriseofgridoperator-mapper.xml | 8 ++ .../taskcheck/v2/taskcheck-v2-mapper.xml | 8 +- 5 files changed, 127 insertions(+), 11 deletions(-) create mode 100644 src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/v2/IndustryCheckItemAppController.java diff --git a/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/v2/IndustryCheckItemAppController.java b/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/v2/IndustryCheckItemAppController.java new file mode 100644 index 0000000..d4844a9 --- /dev/null +++ b/src/main/java/com/cm/inspection/controller/app/apis/industrycheckitem/v2/IndustryCheckItemAppController.java @@ -0,0 +1,108 @@ +package com.cm.inspection.controller.app.apis.industrycheckitem.v2; + +import com.cm.common.annotation.CheckRequestBodyAnnotation; +import com.cm.common.base.AbstractController; +import com.cm.common.component.SecurityComponent; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.exception.SearchException; +import com.cm.common.pojo.ListPage; +import com.cm.common.pojo.dtos.CurrentUserIdInfoDTO; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResult; +import com.cm.common.result.SuccessResultList; +import com.cm.inspection.pojo.dtos.industrycheckitem.v2.IndustryCheckItemDTO; +import com.cm.inspection.pojo.vos.industrycheckitem.v2.IndustryCheckItemBindVO; +import com.cm.inspection.service.industrycheckitem.v2.IIndustryCheckItemService; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IndustryCheckItemController + * @Description: 行业检查项 + * @Author: WenG + * @Date: 2020-03-27 22:12 + * @Version: 1.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "行业检查项接口") +@RestController("IndustryCheckItemV2AppController") +@RequestMapping(ISystemConstant.APP_PREFIX + "/industrycheckitem/v2") +public class IndustryCheckItemAppController extends AbstractController { + + @Autowired + private IIndustryCheckItemService industryCheckItemService; + @Autowired + private SecurityComponent securityComponent; + + @ApiOperation(value = "新增行业检查项", notes = "新增行业检查项接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @PostMapping("saveindustrycheckitembyindustryid/{industryId}") + @CheckRequestBodyAnnotation + public SuccessResult saveIndustryCheckItemByNatureId(@PathVariable("industryId") String industryId, @RequestBody IndustryCheckItemBindVO industryCheckItemBindVO) throws Exception { + return industryCheckItemService.saveIndustryCheckItemByNatureId(industryId, industryCheckItemBindVO); + } + + @ApiOperation(value = "行业检查项详情(通过ID)", notes = "行业检查项详情(通过ID)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "industryCheckItemId", value = "行业检查项ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getindustrycheckitembyid/{industryCheckItemId}") + public IndustryCheckItemDTO getIndustryCheckItemById(@PathVariable("industryCheckItemId") String industryCheckItemId) throws SearchException { + return industryCheckItemService.getIndustryCheckItemById(industryCheckItemId); + } + + @ApiOperation(value = "行业检查项列表", notes = "行业检查项列表接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listindustrycheckitem") + public List listIndustryCheckItem() throws SearchException { + Map params = requestParams(); + return industryCheckItemService.listIndustryCheckItem(params); + } + + @ApiOperation(value = "行业检查项列表(通过场所性质)", notes = "行业检查项列表(通过行业类型)接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listindustrycheckitembyindustryid/{industryId}") + public List listIndustryCheckItemByNatureId(@PathVariable("industryId") String industryId) throws SearchException { + Map params = requestParams(); + params.put("industryId", industryId); + return industryCheckItemService.listIndustryCheckItem(params); + } + + @ApiOperation(value = "行业检查项列表(通过行业)", notes = "行业检查项列表(通过行业)接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "industryId", value = "行业ID", paramType = "path") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listbyindustryid/{industryId}") + public List listByIndustryId(@PathVariable("industryId") String industryId) { + return industryCheckItemService.listByIndustryId(industryId); + } + + @ApiOperation(value = "行业检查项分页列表", notes = "行业检查项分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpageindustrycheckitem") + public SuccessResultList> listPageIndustryCheckItem(ListPage page) throws SearchException { + Map params = requestParams(); + page.setParams(params); + return industryCheckItemService.listPageIndustryCheckItem(page); + } + + @ApiOperation(value = "当前用户id信息", notes = "当前用户id信息接口") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("getcurrentuseridinfo") + public CurrentUserIdInfoDTO getCurrentUserIdInfo() { + return securityComponent.getCurrentUserIdInfo(); + } + +} \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 8048b06..4bce60c 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -20,14 +20,14 @@ spring: max-request-size: 1GB datasource: druid: -# url: jdbc:mysql://49.233.36.36:6688/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false - url: jdbc:mysql://127.0.0.1:3306/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false + url: jdbc:mysql://49.233.36.36:6688/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false +# url: jdbc:mysql://127.0.0.1:3306/db_cloud_inspection?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false db-type: mysql driver-class-name: com.mysql.jdbc.Driver -# username: wanggeng - username: root -# password: WenG>2132997 - password: root + username: wanggeng +# username: root + password: WenG>2132997 +# password: root initial-size: 2 min-idle: 2 max-active: 5 diff --git a/src/main/resources/mybatis/mapper/enterprise/checkitemoption/v2/checkitemoption-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/checkitemoption/v2/checkitemoption-mapper.xml index 6aa2950..b20ec8a 100644 --- a/src/main/resources/mybatis/mapper/enterprise/checkitemoption/v2/checkitemoption-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/checkitemoption/v2/checkitemoption-mapper.xml @@ -160,7 +160,7 @@ t1.check_item_id, t1.check_item_option_id FROM - gen_check_item_option t1 + gen_enterprise_check_item_option_v2 t1 WHERE t1.is_delete = 0 diff --git a/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml b/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml index 1cb5e9a..56cb16e 100644 --- a/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterpriseofgridoperator/enterpriseofgridoperator-mapper.xml @@ -181,6 +181,8 @@ jt1.nature_dictionary_name, jt1.is_log_off is_log_off_by_enterprise_id, jt1.legal_person, + jt1.industry_type industry_type_join_by_enterprise_id, + jt2.dictionary_name industry_type_dictionary_name, t1.enterprise_of_grid_operator_id FROM gen_enterprise_of_grid_operator t1 @@ -190,6 +192,12 @@ t1.enterprise_id = jt1.enterprise_id AND jt1.is_delete = 0 + LEFT JOIN + data_dictionary jt2 + ON + jt1.industry_type = jt2.dictionary_id + AND + jt2.is_delete = 0 WHERE t1.is_delete = 0 diff --git a/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml b/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml index fca3fc2..4009016 100644 --- a/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml +++ b/src/main/resources/mybatis/mapper/taskcheck/v2/taskcheck-v2-mapper.xml @@ -393,10 +393,10 @@ gen_check_item jt1 ON t1.check_item_id = jt1.check_item_id - INNER JOIN - gen_industry_check_item_v2 jt2 - ON - t1.check_item_id = jt2.check_item_id +-- INNER JOIN +-- gen_industry_check_item_v2 jt2 +-- ON +-- t1.check_item_id = jt2.check_item_id WHERE jt1.is_delete = 0