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

消防人员改造

parent 45acc3fa
......@@ -72,7 +72,7 @@ public class TreeParser {
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if (map.getJobTitleCode().equals(codeString)) {
if (null != map.getJobTitleCode() && map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
......@@ -150,7 +150,7 @@ public class TreeParser {
Integer num = 0;
if (list != null && list.size() > 0) {
for (FirefightersTreeDto map : list) {
if (map.getJobTitleCode().equals(codeString)) {
if (null != map.getJobTitleCode() && map.getJobTitleCode().equals(codeString)) {
num = Integer.valueOf((String) map.getNum());
break;
}
......
......@@ -120,4 +120,10 @@ public class FirefightersDto extends BaseDto {
@ApiModelProperty(value = "amos账户id")
private String amosUserId;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
}
......@@ -138,4 +138,10 @@ public class Firefighters extends BaseEntity {
@ApiModelProperty(value = "amos账户id")
private String amosUserId;
@ApiModelProperty(value = "机构/部门名称")
private String bizOrgName;
@ApiModelProperty(value = "机构编码")
private String bizOrgCode;
}
......@@ -30,7 +30,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
Map<String, Object> listToSelectById(@Param("id") Long id);
List<FirefightersTreeDto> getFirefightersJobTitleCount();
List<FirefightersTreeDto> getFirefightersJobTitleCount(String bizOrgCode);
List<Map<String,String>> getFirefightersName( );
......
......@@ -25,7 +25,7 @@ public interface IFirefightersService {
Map<String, Object> listToSelectById(Long id);
List<Menu> getFirefightersJobTitleCount() throws Exception;
List<Menu> getFirefightersJobTitleCount(String bizOrgCode) throws Exception;
void saveFirefighters(FirefightersInfoDto firefighters);
......
......@@ -10,6 +10,7 @@
jobTitleCode
from cb_firefighters a
where a.is_delete = 0
<if test='bizOrgCode!=null and bizOrgCode!=""'>and a.biz_org_code = #{bizOrgCode}</if>
GROUP BY a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
......@@ -20,6 +21,7 @@
cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where
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.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
......@@ -61,6 +63,7 @@
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
IFNULL(a.`biz_org_name`, '无') `bizOrgName`,
IFNULL(a.job_title, '无')
jobTitle,
IFNULL(b.administrative_position, '无')
......
......@@ -116,14 +116,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
@Override
public List<Menu> getFirefightersJobTitleCount() throws Exception {
public List<Menu> getFirefightersJobTitleCount(String bizOrgCode) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", "GWMC");
queryWrapper.orderByAsc("sort_num");
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", firefightersMapper.getFirefightersJobTitleCount());
"getParent", firefightersMapper.getFirefightersJobTitleCount(bizOrgCode));
return menus;
}
......@@ -155,8 +155,6 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
/**
* 获取指定用户ID下的队伍人员电话号码信息
* @param teamId
* @param jobTitleArray
* @return
*/
public List<Map<String, Object>> getDetailByIds(List<Long> ids) {
......
......@@ -6,6 +6,12 @@ import java.util.Map;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -92,6 +98,11 @@ public class FirefightersController extends BaseController {
DataDictionaryServiceImpl dataDictionaryService;
@Value("${redis.cache.failure.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 {
}
}
@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 {
* @throws Exception
*/
@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查询")
public ResponseModel<Object> getFirefightersJobTitleCount() throws Exception {
List<Menu> menus = iFirefightersService.getFirefightersJobTitleCount();
public ResponseModel<Object> getFirefightersJobTitleCount(String bizOrgCode) throws Exception {
List<Menu> menus = iFirefightersService.getFirefightersJobTitleCount(bizOrgCode);
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