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