Commit aaa94427 authored by luben's avatar luben

Merge branch 'dev' into 'main'

Dev

See merge request !136
parents 0f98524c ff7a291a
Pipeline #143292 passed with stages
in 6 minutes and 5 seconds
...@@ -75,7 +75,7 @@ public class RegionController extends BaseController { ...@@ -75,7 +75,7 @@ public class RegionController extends BaseController {
GridRegionUserExample.Criteria criteria = example.createCriteria(); GridRegionUserExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(user.getUserId()); criteria.andUserIdEqualTo(user.getUserId());
// criteria.andUserIdEqualTo("8c48c6cab96e462a9632492762c4cfaa"); // criteria.andUserIdEqualTo("1");
criteria.andIsValidEqualTo("1"); criteria.andIsValidEqualTo("1");
List<GridRegionUser> relationship = gridRegionUserService.selectByExample(example); List<GridRegionUser> relationship = gridRegionUserService.selectByExample(example);
......
...@@ -53,8 +53,13 @@ public class HouseResourceController { ...@@ -53,8 +53,13 @@ public class HouseResourceController {
return AjaxResult.success(houseResourceService.pageHouseResources(query)); return AjaxResult.success(houseResourceService.pageHouseResources(query));
} }
@GetMapping("/list") @GetMapping("/profileGraph")
public AjaxResult getProfileGraphHouseResources(HouseResourcePageQuery query) { public AjaxResult getProfileGraphHouseResources(HouseResourcePageQuery query) {
return AjaxResult.success(houseResourceService.profileGraphHouseResources(query)); return AjaxResult.success(houseResourceService.profileGraphHouseResources(query));
} }
@GetMapping("/list")
public AjaxResult getListHouseResources(HouseResourcePageQuery query) {
return AjaxResult.success(houseResourceService.listHouseResources(query));
}
} }
...@@ -107,6 +107,18 @@ public class GridRegion implements Serializable { ...@@ -107,6 +107,18 @@ public class GridRegion implements Serializable {
private String status; private String status;
private String pName;
private String pId;
public String getpName(){return pName;}
public void setpName(String pName){this.pName = pName;}
public String getpId(){return pId;}
public void setpId(String pId){this.pId = pId;}
public String getStatus(){return status;} public String getStatus(){return status;}
public void setStatus(String status){this.status=status;} public void setStatus(String status){this.status=status;}
......
...@@ -61,4 +61,6 @@ public interface GridRegionMapper { ...@@ -61,4 +61,6 @@ public interface GridRegionMapper {
List<GridRegion> getAllLevelTwoByType(@Param("wgCodeLikes")List<String> wgCodeLikes); List<GridRegion> getAllLevelTwoByType(@Param("wgCodeLikes")List<String> wgCodeLikes);
String getWgCodeById(String id); String getWgCodeById(String id);
List<GridRegion> selectAllByIdAndWgType(@Param("wgType")String wgType, @Param("wgCode")String wgCode);
} }
\ No newline at end of file
...@@ -23,4 +23,6 @@ public interface HouseResourceMapper { ...@@ -23,4 +23,6 @@ public interface HouseResourceMapper {
IPage<HouseResourcePage> selectPage(IPage<HouseResource> page, @Param("query") HouseResourcePageQuery houseResourcePageQuery); IPage<HouseResourcePage> selectPage(IPage<HouseResource> page, @Param("query") HouseResourcePageQuery houseResourcePageQuery);
List<HouseResourcePage> selectProfileGraph(@Param("query") HouseResourcePageQuery houseResourcePageQuery); List<HouseResourcePage> selectProfileGraph(@Param("query") HouseResourcePageQuery houseResourcePageQuery);
List<HouseResourcePage> selectList(@Param("query") HouseResourcePageQuery houseResourcePageQuery);
} }
...@@ -316,6 +316,17 @@ public class GridRegionFacadeService { ...@@ -316,6 +316,17 @@ public class GridRegionFacadeService {
// appPageModel.setRecordCount(res.size()); // appPageModel.setRecordCount(res.size());
appPageModel.setRecordCount(count); appPageModel.setRecordCount(count);
appPageModel.setPageCount((long) Math.ceil(1.0 * count / pageSize)); appPageModel.setPageCount((long) Math.ceil(1.0 * count / pageSize));
if(level.equals("3")){
for(GridRegion role : roles) {
String type = role.getWgType();
String code = role.getWgParentId();
List<GridRegion> twoLevel = gridRegionMapper.selectAllByIdAndWgType(type,code);
if(twoLevel != null && !twoLevel.isEmpty()) {
role.setpId(twoLevel.get(0).getId());
role.setpName(twoLevel.get(0).getWgName());
}
}
}
// List<GridRegionWithCompanyItem> itemList = BeanCopyUtil.bathToBean(res, GridRegionWithCompanyItem.class); // List<GridRegionWithCompanyItem> itemList = BeanCopyUtil.bathToBean(res, GridRegionWithCompanyItem.class);
List<GridRegionWithCompanyItem> itemList = BeanCopyUtil.bathToBean(roles, GridRegionWithCompanyItem.class); List<GridRegionWithCompanyItem> itemList = BeanCopyUtil.bathToBean(roles, GridRegionWithCompanyItem.class);
itemList.forEach( e -> { itemList.forEach( e -> {
......
...@@ -21,4 +21,6 @@ public interface HouseResourceService { ...@@ -21,4 +21,6 @@ public interface HouseResourceService {
IPage<HouseResourcePage> pageHouseResources(HouseResourcePageQuery query); IPage<HouseResourcePage> pageHouseResources(HouseResourcePageQuery query);
List<HouseResourceProfileGraph> profileGraphHouseResources(HouseResourcePageQuery query); List<HouseResourceProfileGraph> profileGraphHouseResources(HouseResourcePageQuery query);
List<HouseResourcePage> listHouseResources(HouseResourcePageQuery query);
} }
...@@ -165,12 +165,22 @@ public class HouseResourceServiceImpl implements HouseResourceService { ...@@ -165,12 +165,22 @@ public class HouseResourceServiceImpl implements HouseResourceService {
houseResourceProfileGraph.setId(k); houseResourceProfileGraph.setId(k);
GridRegion gridRegion = gridRegionMapper.selectByPrimaryKey(k); GridRegion gridRegion = gridRegionMapper.selectByPrimaryKey(k);
houseResourceProfileGraph.setWgName(gridRegion.getWgName()); houseResourceProfileGraph.setWgName(gridRegion.getWgName());
houseResourceProfileGraph.setHouseResources(v); houseResourceProfileGraph.setHouseResources(handleHouseList(v));
resourceProfileGraphList.add(houseResourceProfileGraph); resourceProfileGraphList.add(houseResourceProfileGraph);
}); });
return resourceProfileGraphList; return resourceProfileGraphList;
} }
@Override
public List<HouseResourcePage> listHouseResources(HouseResourcePageQuery query) {
List<HouseResourcePage> list = houseResourceMapper.selectList(query);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
} else {
return handleHouseList(list);
}
}
private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) { private List<HouseResourcePage> handleHouseList(List<HouseResourcePage> list) {
list.forEach(x -> { list.forEach(x -> {
GridRegion two = gridRegionMapper.selectByPrimaryKey(x.getTwo()); GridRegion two = gridRegionMapper.selectByPrimaryKey(x.getTwo());
......
...@@ -701,6 +701,13 @@ ...@@ -701,6 +701,13 @@
<select id="getWgCodeById" resultType="java.lang.String"> <select id="getWgCodeById" resultType="java.lang.String">
select wg_code from grid_region where id = #{id} select wg_code from grid_region where id = #{id}
</select> </select>
<select id="selectAllByIdAndWgType" resultType="com.ruoyi.system.domain.grid.GridRegion">
select
<include refid="Base_Column_List" />
from grid_region where is_valid = '1'
and wg_type = #{wgType}
and wg_code = #{wgCode}
</select>
<update id="changeTreeNodeName"> <update id="changeTreeNodeName">
update grid_region set wg_name=#{name} where id = #{id} update grid_region set wg_name=#{name} where id = #{id}
......
...@@ -175,4 +175,38 @@ ...@@ -175,4 +175,38 @@
</if> </if>
</where> </where>
</select> </select>
<select id="selectList" resultType="com.ruoyi.system.domain.house.vo.HouseResourcePage">
SELECT
t1.wg_name AS wgName4,
t2.*
FROM
grid_region t1
LEFT JOIN house_resource t2 ON t1.id = t2.four
<where>
<if test="query.wgType != null">
and t2.type = #{query.wgType}
</if>
<if test="query.two != null and query.two != ''">
and t2.two = #{query.two}
</if>
<if test="query.three != null and query.three != ''">
and t2.three = #{query.three}
</if>
<if test="query.four != null and query.four != ''">
and t2.four = #{query.four}
</if>
<if test="query.houseResourceAttribute != null">
and t2.house_resource_attribute = #{query.houseResourceAttribute}
</if>
<if test="query.hireStatus != null">
and t2.hire_status = #{query.hireStatus}
</if>
<if test="query.houseNumber != null and query.houseNumber != ''">
and t2.house_number like concat('%', #{query.houseNumber}, '%')
</if>
<if test="query.sortWay != null and query.sortWay != ''">
order by t2.house_area ${query.sortWay}
</if>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
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