Commit c17116fb authored by 李腾威's avatar 李腾威

bug 4387 4375

parent 3191bec5
...@@ -121,6 +121,19 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -121,6 +121,19 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
List<Menu> menus = TreeParser.getTreeContainsCount(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", List<Menu> menus = TreeParser.getTreeContainsCount(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", "getCount"); "getParent", "getCount");
// root.setChildren(menus); // root.setChildren(menus);
for (Menu m:menus
) {
if( null != m.children) {
List<Menu> children = m.getChildren();
int count = 0;
for (Menu mm:children
) {
count = count + mm.num;
}
m.setNum(count);
}
}
return Lists.newArrayList(menus); return Lists.newArrayList(menus);
} }
public List<DataDictionary> getwaterResourceTypeTree(String bizOrgCode) throws Exception { public List<DataDictionary> getwaterResourceTypeTree(String bizOrgCode) throws Exception {
......
...@@ -44,4 +44,7 @@ public class FireTeamListDto { ...@@ -44,4 +44,7 @@ public class FireTeamListDto {
@ApiModelProperty(value = "所属单位") @ApiModelProperty(value = "所属单位")
private String company; private String company;
@ApiModelProperty(value = "树节点子节点id集合")
private List<String> typeCodes;
} }
...@@ -7,6 +7,8 @@ import lombok.Data; ...@@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 消防队员 * 消防队员
* *
...@@ -71,6 +73,9 @@ public class FirefightersDto extends BaseDto { ...@@ -71,6 +73,9 @@ public class FirefightersDto extends BaseDto {
@ApiModelProperty(value = "岗位名称") @ApiModelProperty(value = "岗位名称")
private String jobTitle; private String jobTitle;
@ApiModelProperty(value = "岗位名称")
private List<String> jobTitles;
@ApiModelProperty(value = "岗位code") @ApiModelProperty(value = "岗位code")
private String jobTitleCode; private String jobTitleCode;
......
...@@ -44,7 +44,11 @@ ...@@ -44,7 +44,11 @@
WHERE WHERE
a.is_delete = 0 a.is_delete = 0
<if test='par.parent != null'>and a.parent = #{par.parent}</if> <if test='par.parent != null'>and a.parent = #{par.parent}</if>
<if test='par.typeCode != null'>and a.type_code = #{par.typeCode}</if> <if test='par.typeCodes != null'>and a.type_code in
<foreach collection="par.typeCodes" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test='par.companyCode != null'>and a.company_code = #{par.companyCode}</if> <if test='par.companyCode != null'>and a.company_code = #{par.companyCode}</if>
<if test='par.company != null and par.company != -1'>and a.company = #{par.company}</if> <if test='par.company != null and par.company != -1'>and a.company = #{par.company}</if>
<if test='par.name != null'>and a.name like concat('%', #{par.name}, '%')</if> <if test='par.name != null'>and a.name like concat('%', #{par.name}, '%')</if>
......
...@@ -28,8 +28,13 @@ ...@@ -28,8 +28,13 @@
<if test='par.state!=null'>and a.state_code= #{par.state}</if> <if test='par.state!=null'>and a.state_code= #{par.state}</if>
<if test='par.company!=null and par.company!= -1'>and a.company= #{par.company}</if> <if test='par.company!=null and par.company!= -1'>and a.company= #{par.company}</if>
<if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if> <if test='par.fireTeamId!=null'>and a.fire_team_id= #{par.fireTeamId}</if>
<if test='par.jobTitle!=null'>and a.job_title_code =#{par.jobTitle}</if> <if test='par.jobTitles!=null'>and a.job_title_code in
<if test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code <foreach collection="par.jobTitles" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if
test='par.areasExpertiseCode!=null and par.areasExpertiseCode!="0"'>and b.areas_expertise_code
=#{par.areasExpertiseCode} =#{par.areasExpertiseCode}
</if> </if>
<if test='par.company!=null and par.company!= -1'>and a.company= #{par.company}</if> <if test='par.company!=null and par.company!= -1'>and a.company= #{par.company}</if>
......
...@@ -106,6 +106,10 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -106,6 +106,10 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
team.setNodeIds(teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList())); team.setNodeIds(teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList()));
} }
if(!ValidationUtil.isEmpty(team.getTypeCode())) {
team.setTypeCodes(Arrays.asList(team.getTypeCode().split(",")));
}
IPage<FireTeamCardDto> fireTeamListPage = this.baseMapper.getFireTeamForPage(page, team); IPage<FireTeamCardDto> fireTeamListPage = this.baseMapper.getFireTeamForPage(page, team);
List<FireTeamCardDto> fireTeamList = fireTeamListPage.getRecords(); List<FireTeamCardDto> fireTeamList = fireTeamListPage.getRecords();
Map<Object, Long> finalTeamCarCountMap = teamCarCountMap; Map<Object, Long> finalTeamCarCountMap = teamCarCountMap;
......
...@@ -125,6 +125,18 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -125,6 +125,18 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper); Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", firefightersMapper.getFirefightersJobTitleCount(bizOrgCode)); "getParent", firefightersMapper.getFirefightersJobTitleCount(bizOrgCode));
for (Menu m:menus
) {
if( null != m.children) {
List<Menu> children = m.getChildren();
int count = 0;
for (Menu mm:children
) {
count = count + mm.num;
}
m.setNum(count);
}
}
return menus; return menus;
} }
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
...@@ -9,6 +10,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -9,6 +10,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite; import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...@@ -26,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -65,6 +70,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -65,6 +70,8 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Value("${auth-key-key-site:key_site_info}") @Value("${auth-key-key-site:key_site_info}")
private String authKey; private String authKey;
@Autowired
private RedisUtils redisUtils;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -94,7 +101,13 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -94,7 +101,13 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
@Override @Override
public List<KeySiteExcleDto> exportToExcel(String name, Long buildingId, String fireEnduranceRate, public List<KeySiteExcleDto> exportToExcel(String name, Long buildingId, String fireEnduranceRate,
String useNature, String fireFacilitiesInfo, String bizOrgCode) { String useNature, String fireFacilitiesInfo, String bizOrgCode) {
List<KeySiteDto> list = this.queryForKeySiteList(name,buildingId,fireEnduranceRate,useNature,fireFacilitiesInfo,bizOrgCode); // 导出模板增加权限
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
// 权限处理
String bizOrgCodeNew = reginParams.getPersonIdentity().getBizOrgCode();
List<KeySiteDto> list = this.queryForKeySiteList(name,buildingId,fireEnduranceRate,useNature,fireFacilitiesInfo,bizOrgCodeNew);
List<KeySiteExcleDto> excleList = new ArrayList<>(); List<KeySiteExcleDto> excleList = new ArrayList<>();
list.forEach(i -> { list.forEach(i -> {
KeySiteExcleDto keySiteExcleDto = new KeySiteExcleDto(); KeySiteExcleDto keySiteExcleDto = new KeySiteExcleDto();
......
...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -346,6 +347,10 @@ public class FirefightersController extends BaseController { ...@@ -346,6 +347,10 @@ public class FirefightersController extends BaseController {
pageNum = 1; pageNum = 1;
pageSize = Integer.MAX_VALUE; pageSize = Integer.MAX_VALUE;
} }
if(!ValidationUtil.isEmpty(firefighters.getJobTitle())) {
firefighters.setJobTitles(Arrays.asList(firefighters.getJobTitle().split(",")));
}
List<FirefightersZhDto> list = iFirefightersService.getFirefighters((pageNum - 1) * pageSize, pageSize, List<FirefightersZhDto> list = iFirefightersService.getFirefighters((pageNum - 1) * pageSize, pageSize,
firefighters); firefighters);
Map<String, Long> num = iFirefightersService.getFirefightersCount((pageNum - 1) * pageSize, pageSize, Map<String, Long> num = iFirefightersService.getFirefightersCount((pageNum - 1) * pageSize, pageSize,
......
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