Commit f618b7be authored by tianyiming's avatar tianyiming

监管-部分公共接口提交

parent 2d508643
......@@ -18,6 +18,11 @@
</dependency>
<dependency>
<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>
<version>${amos-biz-boot.version}</version>
</dependency>
......
package com.yeejoin.amos.boot.module.jg.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import java.util.List;
import java.util.Map;
/**
* 装备分类 Mapper 接口
*
* @author system_generator
* @date 2021-10-20
*/
public interface EquipmentCategoryMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getUnitListByType(String type);
}
<?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="com.yeejoin.amos.boot.module.jg.api.mapper.EquipmentCategoryMapper">
<select id="getUnitListByType" resultType="java.util.Map">
SELECT
*
FROM
tz_base_enterprise_info
WHERE
unit_type LIKE CONCAT('%',#{type},'%') AND is_delete = '0';
</select>
</mapper>
......@@ -17,6 +17,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* 装备分类
......@@ -58,4 +59,16 @@ public class EquipmentCategoryController extends BaseController {
public ResponseModel<Object> creatTree() {
return ResponseHelper.buildResponse(equipmentCategoryService.getTree());
}
/**
* 获取管辖分局树
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUnitList")
@ApiOperation(httpMethod = "GET", value = "通过单位类型获取单位列表", notes = "通过单位类型获取单位列表")
public ResponseModel<List<Map<String,Object>>> getUnitList(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(equipmentCategoryService.getUnitListByType(type));
}
}
......@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* 装备分类接口类
......@@ -21,4 +22,6 @@ public interface IEquipmentCategoryService {
List<LinkedHashMap> getTree();
List<LinkedHashMap> creatTree();
List<Map<String,Object>> getUnitListByType(String type);
}
......@@ -7,7 +7,7 @@ import com.yeejoin.amos.boot.module.jg.biz.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.ymt.flc.api.feign.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.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import lombok.extern.slf4j.Slf4j;
......@@ -18,10 +18,7 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -150,6 +147,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
return resultTree;
}
@Override
public List<Map<String, Object>> getUnitListByType(String type) {
return equipmentCategoryMapper.getUnitListByType(type);
}
/**
* 将管辖机构树中children为[]的修改为null
*
......
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