小程序企业筛选
This commit is contained in:
parent
1f016236dc
commit
b890d23e7f
|
|
@ -37,6 +37,9 @@ public interface BaseInClassMapper {
|
|||
|
||||
List<TreeModel>findAllTree(@Param("inType") Integer inType);
|
||||
|
||||
/*行业树形结构*/
|
||||
List<TreeModel>findInClass();
|
||||
|
||||
/*查询所有*/
|
||||
List<BaseInClass>findAll();
|
||||
|
||||
|
|
|
|||
|
|
@ -1272,7 +1272,7 @@
|
|||
SELECT so.OrgCode, so.OrgName,COUNT(be.BookEntCheckId) checkNum
|
||||
FROM SysOrg so
|
||||
LEFT JOIN SysEnterprise se
|
||||
ON (se.street_code = so.OrgCode or se.community_code = so.OrgCode )
|
||||
ON FIND_IN_SET(so.OrgCode,se.area_path)
|
||||
AND se.State = '启用'
|
||||
LEFT JOIN BookEntCheck be
|
||||
ON se.SysEnterpriseId = be.BaseEntId
|
||||
|
|
|
|||
|
|
@ -357,8 +357,23 @@
|
|||
from BaseInClass t1 LEFT join BaseInClass t2 on t1.BaseInClassId = t2.SuperInId
|
||||
</select>
|
||||
|
||||
|
||||
<!--行业树形结构-->
|
||||
<resultMap id="InClassMap" type="com.rzyc.bean.TreeModel">
|
||||
<id column="BaseInClassId" jdbcType="VARCHAR" property="id" />
|
||||
<result column="ClassCode" jdbcType="VARCHAR" property="code" />
|
||||
<result column="IndustryClassName" jdbcType="VARCHAR" property="label" />
|
||||
<result column="SuperInId" jdbcType="VARCHAR" property="parentId" />
|
||||
</resultMap>
|
||||
|
||||
<!--行业树形结构-->
|
||||
<select id="findInClass" resultMap="InClassMap">
|
||||
select t1.*
|
||||
from BaseInClass t1
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
select * from BaseInClass bc where hidden = 1
|
||||
select * from BaseInClass bc
|
||||
</select>
|
||||
|
||||
<select id="findByInType" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -2498,7 +2498,7 @@
|
|||
left join BookEntHT be on se.SysEnterpriseId = be.SysEnterpriseId
|
||||
where se.State = '启用'
|
||||
<if test="null != streetCode and '' != streetCode">
|
||||
AND FIND_IN_SET(#{streetCode},sys.area_path)
|
||||
AND FIND_IN_SET(#{streetCode},se.area_path)
|
||||
</if>
|
||||
group by se.SysEnterpriseId
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.rzyc.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.common.utils.*;
|
||||
import com.common.utils.encryption.MD5;
|
||||
|
|
@ -1719,14 +1720,35 @@ public class BaseController {
|
|||
/**
|
||||
* 行业类别
|
||||
* */
|
||||
public List<TreeModel>baseInClasses(int isTree, Integer type){
|
||||
List<TreeModel> baseInClasses = baseInClassMapper.findAllTree(type);
|
||||
for (TreeModel treeModel : baseInClasses){
|
||||
if(null == treeModel.getChildren() || 0 == treeModel.getChildren().size()){
|
||||
treeModel.setChildren(null);
|
||||
public List<TreeModel>baseInClasses(int isTree, Integer type)throws Exception{
|
||||
List<TreeModel> baseInClasses = baseInClassMapper.findInClass();
|
||||
JSONArray jsonArray = handleTreeModel(baseInClasses);
|
||||
List<TreeModel> treeModels = JSONArray.parseArray(jsonArray.toJSONString(),TreeModel.class);
|
||||
return treeModels;
|
||||
}
|
||||
|
||||
/**
|
||||
* 地区树形结构
|
||||
* @param treeModels
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private JSONArray handleTreeModel(List<TreeModel> treeModels)throws Exception{
|
||||
List<Map<String,Object>> data = new ArrayList<>();
|
||||
for(TreeModel treeModel : treeModels){
|
||||
if(StringUtils.isBlank(treeModel.getParentId())){
|
||||
treeModel.setParentId("");
|
||||
}
|
||||
Map<String,Object> entUserMap = new HashMap<String,Object>();
|
||||
entUserMap.put("label",treeModel.getLabel());
|
||||
entUserMap.put("id",treeModel.getId());
|
||||
entUserMap.put("parentId",treeModel.getParentId());
|
||||
entUserMap.put("code",treeModel.getCode());
|
||||
|
||||
data.add(entUserMap);
|
||||
}
|
||||
return baseInClasses;
|
||||
JSONArray result = TypeConversion.listToTree(JSONArray.parseArray(JSON.toJSONString(data)),"id","parentId","children");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ public class BigdataController extends com.rzyc.controller.BaseController {
|
|||
|
||||
@ApiOperation(value = "街道企业列表", notes = "街道企业列表")
|
||||
@GetMapping("/srteetEntList/{orgCode}")
|
||||
@ApiImplicitParam(name = "orgCode",value = "街道id",required = true)
|
||||
@ApiImplicitParam(name = "orgCode",value = "地区id 默认传甘孜的地区id",required = true)
|
||||
@ResponseBody
|
||||
public MultiResult<StreetEntInfo> srteetEntList(@PathVariable String orgCode)throws Exception{
|
||||
MultiResult<StreetEntInfo> result = new MultiResult<>();
|
||||
|
|
|
|||
|
|
@ -994,8 +994,12 @@ public class SettingController extends BaseController{
|
|||
public MultiResult<SysOrg> userAreaTree(@PathVariable String userId)throws Exception{
|
||||
//多条数据集合处理
|
||||
MultiResult<SysOrg> result = new MultiResult<>();
|
||||
|
||||
//用户地区编码
|
||||
String areaCode = getUserArea(userId);
|
||||
|
||||
//查找地区列表
|
||||
List<SysOrg> sysOrgs = sysOrgMapper.findAll();
|
||||
List<SysOrg> sysOrgs = sysOrgMapper.findUserArea(areaCode);
|
||||
//处理地区
|
||||
sysOrgs = handleArea(userId,sysOrgs);
|
||||
if(sysOrgs.size() >0){
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user