Commit 4fcb5119 authored by tianyiming's avatar tianyiming

监管-部分公共接口修改

parent 262d63ac
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-ymt-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-api</artifactId> <artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
......
...@@ -13,7 +13,7 @@ import java.util.Map; ...@@ -13,7 +13,7 @@ import java.util.Map;
* @author system_generator * @author system_generator
* @date 2021-10-20 * @date 2021-10-20
*/ */
public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> { public interface CommonMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getUnitListByType(String type); List<Map<String, Object>> getUnitListByType(String type);
} }
......
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.EquipmentCategoryMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper">
<select id="getUnitListByType" resultType="java.util.Map"> <select id="getUnitListByType" resultType="java.util.Map">
SELECT SELECT
* sequence_nbr sequenceNbr,
use_code useCode,
use_unit useUnit,
use_contact useContact,
contact_phone contactPhone
FROM FROM
tz_base_enterprise_info tz_base_enterprise_info
WHERE WHERE
......
...@@ -2,7 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller; ...@@ -2,7 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jg.biz.service.IEquipmentCategoryService; import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -27,17 +27,17 @@ import java.util.Map; ...@@ -27,17 +27,17 @@ import java.util.Map;
*/ */
@RestController @RestController
@Api(tags = "装备分类Api") @Api(tags = "装备分类Api")
@RequestMapping(value = "/equipment-category") @RequestMapping(value = "/common")
public class EquipmentCategoryController extends BaseController { public class CommonController extends BaseController {
@Autowired @Autowired
IEquipmentCategoryService equipmentCategoryService; ICommonService commonService;
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getChildren") @GetMapping(value = "/getChildren")
@ApiOperation(httpMethod = "GET", value = "通过设备种类code获取设备类别", notes = "通过设备种类code获取设备类别") @ApiOperation(httpMethod = "GET", value = "通过设备种类code获取设备类别", notes = "通过设备种类code获取设备类别")
public ResponseModel<List<EquipmentCategory>> getChildren(@RequestParam(value = "code") String code, public ResponseModel<List<EquipmentCategory>> getChildren(@RequestParam(value = "code") String code,
@RequestParam(value = "type", required = false) String type) { @RequestParam(value = "type", required = false) String type) {
return ResponseHelper.buildResponse(equipmentCategoryService.getEquipmentCategoryList(code, type)); return ResponseHelper.buildResponse(commonService.getEquipmentCategoryList(code, type));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -45,7 +45,7 @@ public class EquipmentCategoryController extends BaseController { ...@@ -45,7 +45,7 @@ public class EquipmentCategoryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取行政区划", notes = "获取行政区划") @ApiOperation(httpMethod = "GET", value = "获取行政区划", notes = "获取行政区划")
public ResponseModel<Object> getRegion(@RequestParam(value = "level", required = false) String level, public ResponseModel<Object> getRegion(@RequestParam(value = "level", required = false) String level,
@RequestParam(value = "parentId", required = false) String parentId) { @RequestParam(value = "parentId", required = false) String parentId) {
return ResponseHelper.buildResponse(equipmentCategoryService.getRegion(level, parentId)); return ResponseHelper.buildResponse(commonService.getRegion(level, parentId));
} }
/** /**
...@@ -57,11 +57,11 @@ public class EquipmentCategoryController extends BaseController { ...@@ -57,11 +57,11 @@ public class EquipmentCategoryController extends BaseController {
@GetMapping(value = "/creatTree") @GetMapping(value = "/creatTree")
@ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树") @ApiOperation(httpMethod = "GET", value = "获取管辖分局树", notes = "获取管辖分局树")
public ResponseModel<Object> creatTree() { public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(equipmentCategoryService.getTree()); return ResponseHelper.buildResponse(commonService.getTree());
} }
/** /**
* 获取管辖分局树 * 通过单位类型获取单位列表
* *
* @return * @return
*/ */
...@@ -69,6 +69,6 @@ public class EquipmentCategoryController extends BaseController { ...@@ -69,6 +69,6 @@ public class EquipmentCategoryController extends BaseController {
@GetMapping(value = "/getUnitList") @GetMapping(value = "/getUnitList")
@ApiOperation(httpMethod = "GET", value = "通过单位类型获取单位列表", notes = "通过单位类型获取单位列表") @ApiOperation(httpMethod = "GET", value = "通过单位类型获取单位列表", notes = "通过单位类型获取单位列表")
public ResponseModel<List<Map<String,Object>>> getUnitList(@RequestParam(value = "type") String type) { public ResponseModel<List<Map<String,Object>>> getUnitList(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(equipmentCategoryService.getUnitListByType(type)); return ResponseHelper.buildResponse(commonService.getUnitListByType(type));
} }
} }
...@@ -13,7 +13,7 @@ import java.util.Map; ...@@ -13,7 +13,7 @@ import java.util.Map;
* @author system_generator * @author system_generator
* @date 2021-10-20 * @date 2021-10-20
*/ */
public interface IEquipmentCategoryService { public interface ICommonService {
List<EquipmentCategory> getEquipmentCategoryList(String code, String type); List<EquipmentCategory> getEquipmentCategoryList(String code, String type);
......
...@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl; ...@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.biz.service.IEquipmentCategoryService; import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService; import com.yeejoin.amos.boot.module.jg.flc.api.fegin.PrivilegeFeginService;
import com.yeejoin.amos.boot.module.ymt.api.dto.EquipmentCategoryDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.jg.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -26,13 +26,16 @@ import java.util.stream.Collectors; ...@@ -26,13 +26,16 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
@Slf4j @Slf4j
public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryDto, EquipmentCategory, EquipmentCategoryMapper> implements IEquipmentCategoryService { public class CommonServiceImpl implements ICommonService {
@Autowired @Autowired
EquipmentCategoryMapper equipmentCategoryMapper; EquipmentCategoryMapper equipmentCategoryMapper;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired
CommonMapper commonMapper;
//行政区划redis缓存key //行政区划redis缓存key
private static final String PROVINCE = "PROVINCE"; private static final String PROVINCE = "PROVINCE";
private static final String CITY = "CITY"; private static final String CITY = "CITY";
...@@ -153,7 +156,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -153,7 +156,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
type = "维保单位"; type = "维保单位";
} }
return equipmentCategoryMapper.getUnitListByType(type); return commonMapper.getUnitListByType(type);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment