Commit 61334154 authored by luben's avatar luben

Merge branch 'dev-lb' into 'dev'

Dev lb

See merge request !134
parents 90da7c48 b40c7040
Pipeline #143290 failed with stages
in 2 minutes and 58 seconds
......@@ -69,13 +69,13 @@ public class RegionController extends BaseController {
@RequestParam("pageSize") Integer pageSize) {
try {
AjaxResult result = new AjaxResult();
SysUser user = SecurityUtils.getLoginUser().getUser();
// SysUser user = SecurityUtils.getLoginUser().getUser();
//网格
GridRegionUserExample example = new GridRegionUserExample();
GridRegionUserExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(user.getUserId());
// criteria.andUserIdEqualTo(user.getUserId());
// criteria.andUserIdEqualTo("8c48c6cab96e462a9632492762c4cfaa");
criteria.andUserIdEqualTo("1");
criteria.andIsValidEqualTo("1");
List<GridRegionUser> relationship = gridRegionUserService.selectByExample(example);
......
......@@ -107,6 +107,18 @@ public class GridRegion implements Serializable {
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 void setStatus(String status){this.status=status;}
......
......@@ -61,4 +61,6 @@ public interface GridRegionMapper {
List<GridRegion> getAllLevelTwoByType(@Param("wgCodeLikes")List<String> wgCodeLikes);
String getWgCodeById(String id);
List<GridRegion> selectAllByIdAndWgType(@Param("wgType")String wgType, @Param("wgCode")String wgCode);
}
\ No newline at end of file
......@@ -316,6 +316,17 @@ public class GridRegionFacadeService {
// appPageModel.setRecordCount(res.size());
appPageModel.setRecordCount(count);
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(roles, GridRegionWithCompanyItem.class);
itemList.forEach( e -> {
......
......@@ -701,6 +701,13 @@
<select id="getWgCodeById" resultType="java.lang.String">
select wg_code from grid_region where id = #{id}
</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 grid_region set wg_name=#{name} where id = #{id}
......
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