Commit bc05eb7a authored by wanghui's avatar wanghui

提供查性别接口

parent 03d21a9a
...@@ -23,7 +23,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -23,7 +23,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersZhDto> getFirefighters(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, List<FirefightersZhDto> getFirefighters(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize,
@Param("par") FirefightersDto par); @Param("par") FirefightersDto par);
Map<String, Long> getFirefightersCount(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param( Map<String, Long> getFirefightersCount(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, @Param(
"par") FirefightersDto par); "par") FirefightersDto par);
...@@ -32,12 +32,14 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -32,12 +32,14 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersTreeDto> getFirefightersJobTitleCount(String bizOrgCode); List<FirefightersTreeDto> getFirefightersJobTitleCount(String bizOrgCode);
List<Map<String,String>> getFirefightersName( ); List<Map<String, String>> getFirefightersName();
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId, List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle,String bizOrgCode); String state, String areasExpertise, String jobTitle, String bizOrgCode);
List<FirefightersDto> queryById(@Param("gw")String[] gw, @Param("name")String name); List<FirefightersDto> queryById(@Param("gw") String[] gw, @Param("name") String name);
List<Map<String,String>> selectNormalFirePerson(String jobId); List<Map<String, String>> selectNormalFirePerson(String jobId);
List<Firefighters> getPersonByCodes(@Param("list") List<String> list);
} }
...@@ -263,4 +263,12 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr ...@@ -263,4 +263,12 @@ LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
</select> </select>
<select id="getPersonByCodes" resultType="com.yeejoin.amos.boot.module.common.api.entity.Firefighters">
select * from cb_firefighters where
employee_number in
<foreach item="item" collection="list" index="index" open="(" separator="," close=")">
#{item}
</foreach>
and is_delete = 0
</select>
</mapper> </mapper>
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -186,5 +188,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -186,5 +188,14 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
public Object getAllFirefightersPerson(String jobId) { public Object getAllFirefightersPerson(String jobId) {
return firefightersMapper.selectNormalFirePerson(jobId); return firefightersMapper.selectNormalFirePerson(jobId);
} }
public Map<String, String> getPersonByCodes(List<String> list) {
List<Firefighters> personByCodes = firefightersMapper.getPersonByCodes(list);
// Map<String, String> personGenderMap = personByCodes.stream().distinct().collect(Collectors.toMap(Firefighters::getEmployeeNumber, Firefighters::getGender));
Map<String, String> personGenderMap = new HashMap<>();
for (Firefighters personByCode : personByCodes) {
personGenderMap.put(personByCode.getEmployeeNumber(), personByCode.getGender());
}
return personGenderMap;
}
} }
...@@ -18,11 +18,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -18,11 +18,7 @@ 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;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
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.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -419,4 +415,13 @@ public class FirefightersController extends BaseController { ...@@ -419,4 +415,13 @@ public class FirefightersController extends BaseController {
public ResponseModel<Object> getAllFirefightersPerson(String jobCode)throws Exception { public ResponseModel<Object> getAllFirefightersPerson(String jobCode)throws Exception {
return ResponseHelper.buildResponse(iFirefightersService.getAllFirefightersPerson(jobCode)); return ResponseHelper.buildResponse(iFirefightersService.getAllFirefightersPerson(jobCode));
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/get/personByCodes")
@ApiOperation(httpMethod = "GET", value = "根据code查性别", notes = "根据code查性别")
public ResponseModel<Map<String, String>> getPersonByCodes(@RequestParam(value = "list", required = true) List<String> list) {
return ResponseHelper.buildResponse(iFirefightersService.getPersonByCodes(list));
}
} }
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