Commit 13fa5dff authored by 李腾威's avatar 李腾威

消防人员改造

parent 45acc3fa
...@@ -72,7 +72,7 @@ public class TreeParser { ...@@ -72,7 +72,7 @@ public class TreeParser {
Integer num = 0; Integer num = 0;
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) { for (FirefightersTreeDto map : list) {
if (map.getJobTitleCode().equals(codeString)) { if (null != map.getJobTitleCode() && map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum()); num = Integer.valueOf((String) map.getNum());
break; break;
} }
...@@ -150,7 +150,7 @@ public class TreeParser { ...@@ -150,7 +150,7 @@ public class TreeParser {
Integer num = 0; Integer num = 0;
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) { for (FirefightersTreeDto map : list) {
if (map.getJobTitleCode().equals(codeString)) { if (null != map.getJobTitleCode() && map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum()); num = Integer.valueOf((String) map.getNum());
break; break;
} }
......
...@@ -120,4 +120,10 @@ public class FirefightersDto extends BaseDto { ...@@ -120,4 +120,10 @@ public class FirefightersDto extends BaseDto {
@ApiModelProperty(value = "amos账户id") @ApiModelProperty(value = "amos账户id")
private String amosUserId; private String amosUserId;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
} }
...@@ -138,4 +138,10 @@ public class Firefighters extends BaseEntity { ...@@ -138,4 +138,10 @@ public class Firefighters extends BaseEntity {
@ApiModelProperty(value = "amos账户id") @ApiModelProperty(value = "amos账户id")
private String amosUserId; private String amosUserId;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
} }
...@@ -30,7 +30,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -30,7 +30,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
Map<String, Object> listToSelectById(@Param("id") Long id); Map<String, Object> listToSelectById(@Param("id") Long id);
List<FirefightersTreeDto> getFirefightersJobTitleCount(); List<FirefightersTreeDto> getFirefightersJobTitleCount(String bizOrgCode);
List<Map<String,String>> getFirefightersName( ); List<Map<String,String>> getFirefightersName( );
......
...@@ -25,7 +25,7 @@ public interface IFirefightersService { ...@@ -25,7 +25,7 @@ public interface IFirefightersService {
Map<String, Object> listToSelectById(Long id); Map<String, Object> listToSelectById(Long id);
List<Menu> getFirefightersJobTitleCount() throws Exception; List<Menu> getFirefightersJobTitleCount(String bizOrgCode) throws Exception;
void saveFirefighters(FirefightersInfoDto firefighters); void saveFirefighters(FirefightersInfoDto firefighters);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
jobTitleCode jobTitleCode
from cb_firefighters a from cb_firefighters a
where a.is_delete = 0 where a.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and a.biz_org_code = #{bizOrgCode}</if>
GROUP BY a.job_title_code GROUP BY a.job_title_code
</select> </select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm --> <!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
...@@ -20,6 +21,7 @@ ...@@ -20,6 +21,7 @@
cb_firefighters_post b on cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where a.sequence_nbr=b.firefighters_id where
a.is_delete=0 a.is_delete=0
<if test='par.bizOrgCode!=null'>and a.biz_org_code like concat ('%',#{par.bizOrgCode},'%')</if>
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if> <if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if> <if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</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>
...@@ -61,6 +63,7 @@ ...@@ -61,6 +63,7 @@
a.sequence_nbr a.sequence_nbr
sequenceNbr, sequenceNbr,
IFNULL(a.`name`, '无') `name`, IFNULL(a.`name`, '无') `name`,
IFNULL(a.`biz_org_name`, '无') `bizOrgName`,
IFNULL(a.job_title, '无') IFNULL(a.job_title, '无')
jobTitle, jobTitle,
IFNULL(b.administrative_position, '无') IFNULL(b.administrative_position, '无')
......
...@@ -116,14 +116,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -116,14 +116,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
} }
@Override @Override
public List<Menu> getFirefightersJobTitleCount() throws Exception { public List<Menu> getFirefightersJobTitleCount(String bizOrgCode) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "GWMC"); queryWrapper.eq("type", "GWMC");
queryWrapper.orderByAsc("sort_num"); queryWrapper.orderByAsc("sort_num");
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()); "getParent", firefightersMapper.getFirefightersJobTitleCount(bizOrgCode));
return menus; return menus;
} }
...@@ -155,8 +155,6 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -155,8 +155,6 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
} }
/** /**
* 获取指定用户ID下的队伍人员电话号码信息 * 获取指定用户ID下的队伍人员电话号码信息
* @param teamId
* @param jobTitleArray
* @return * @return
*/ */
public List<Map<String, Object>> getDetailByIds(List<Long> ids) { public List<Map<String, Object>> getDetailByIds(List<Long> ids) {
......
...@@ -6,6 +6,12 @@ import java.util.Map; ...@@ -6,6 +6,12 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.interceptors.PermissionInterceptorContext;
import com.yeejoin.amos.boot.module.common.api.core.framework.PersonIdentify;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -92,6 +98,11 @@ public class FirefightersController extends BaseController { ...@@ -92,6 +98,11 @@ public class FirefightersController extends BaseController {
DataDictionaryServiceImpl dataDictionaryService; DataDictionaryServiceImpl dataDictionaryService;
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Value("${auth-key-fire-fighters:fire_fighters_info}")
private String authKey;
/** /**
...@@ -166,6 +177,21 @@ public class FirefightersController extends BaseController { ...@@ -166,6 +177,21 @@ public class FirefightersController extends BaseController {
} }
} }
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUserAndType", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登录人及类型获取公司树", notes = "根据登录人及类型获取公司树")
public ResponseModel<List<OrgMenuDto>> companyTreeByUserAndType() {
// 获取登陆人角色
ReginParams reginParams = getSelectedOrgInfo();
// 权限赋值
PermissionInterceptorContext.setDataAuthRule(authKey);
List<OrgMenuDto> menus = iOrgUsrService.companyTreeByUserAndType(reginParams, OrgPersonEnum.公司.getKey());
return ResponseHelper.buildResponse(menus);
}
/** /**
* 修改消防队员 * 修改消防队员
* *
...@@ -337,10 +363,10 @@ public class FirefightersController extends BaseController { ...@@ -337,10 +363,10 @@ public class FirefightersController extends BaseController {
* @throws Exception * @throws Exception
*/ */
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getFirefightersJobTitleCount", method = RequestMethod.GET) @RequestMapping(value = "/job/getFirefightersJobTitleCount", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<Object> getFirefightersJobTitleCount() throws Exception { public ResponseModel<Object> getFirefightersJobTitleCount(String bizOrgCode) throws Exception {
List<Menu> menus = iFirefightersService.getFirefightersJobTitleCount(); List<Menu> menus = iFirefightersService.getFirefightersJobTitleCount(bizOrgCode);
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
/** /**
......
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