Commit 818bfd29 authored by tangwei's avatar tangwei

修改车辆调派值班人员

parent 3bd03ceb
......@@ -125,6 +125,14 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
List<Map<String, Object>> getDutyPersonByTeamIdAndCarId(
String dutyDate,
String departmentName);
List<Map<String, Object>> getDutyPersonByTeamIdAndCarIdone(
String dutyDate,
String departmentName);
/**
* 值班表中 【120急救排班】该急救站的当日值班员
* @param dutyDate
......
......@@ -36,6 +36,8 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
String state, String areasExpertise, String jobTitle, String bizOrgCode);
List<FirefightersDto> queryById(@Param("gw") String[] gw, @Param("name") String name);
List<FirefightersDto> queryByIdone(@Param("gw") String[] gw, @Param("name") String name);
List<Map<String, String>> selectNormalFirePerson(String jobId);
......
......@@ -371,6 +371,65 @@ LEFT JOIN cb_org_usr cou ON hh.userId = cou.sequence_nbr
</select>
<select id="getDutyPersonByTeamIdAndCarIdone" resultType="java.util.Map">
SELECT
(SELECT
cfi.field_value AS telephone
FROM
cb_dynamic_form_instance cfi
where cfi.instance_id = cou.sequence_nbr and cfi.field_code = 'telephone'
)AS mobilePhone,
hh.userId AS userId,
cou.biz_org_name AS userName,
cou.amos_org_id AS amosId
FROM
(
SELECT
userId,
instance_id
FROM
(
SELECT
MAX(
CASE
WHEN cbd.field_code = 'deptName' THEN
cbd.field_value
END
) AS deptName,
MAX(
CASE
WHEN cbd.field_code = 'userId' THEN
cbd.field_value
END
) AS userId,
cbd.instance_id
FROM
cb_dynamic_form_instance cbd
LEFT JOIN cb_duty_person_shift cps ON cbd.instance_id = cps.instance_id
WHERE
cps.duty_date = #{dutyDate}
AND cps.is_delete = FALSE
AND cbd.group_code = 'dutyPerson'
GROUP BY
cbd.instance_id
) ss
WHERE
ss.userId in ( select cb_firefighters.org_usr_id FROM cb_firefighters where cb_firefighters.fire_team_id=#{departmentName}
and cb_firefighters.org_usr_id is not null )
) hh
LEFT JOIN cb_org_usr cou ON hh.userId = cou.sequence_nbr
</select>
<select id="getDutyPersonByTeamIdAndAirId" resultType="java.util.Map">
SELECT
cfir.telephone AS mobilePhone,
......
......@@ -234,7 +234,30 @@
</foreach>
</if>
</select>
<select id="queryByIdone" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto">
SELECT
firefighters.sequence_nbr sequenceNbr ,
firefighters.name,
mobile_phone as mobilePhone,
amos_user_id amosUserId
FROM
(select * from cb_firefighters fr where is_delete = 0) firefighters
WHERE
fire_team_id =#{name}
<if test="gw != null">
And job_title_code In
<foreach item="item" collection="gw" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectNormalFirePerson"
resultType="Map">
SELECT
......
......@@ -190,6 +190,13 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
return firefightersMapper.queryById(gw,name);
}
public List<FirefightersDto> queryByIdone(String[] gw,String name){
return firefightersMapper.queryByIdone(gw,name);
}
/**
* 获取指定岗位名称下的队伍人员电话号码信息
* @param teamId
......
......@@ -32,6 +32,7 @@ import java.util.stream.IntStream;
import com.yeejoin.amos.boot.module.command.api.dto.FrontlineLiaisonDto;
import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonServiceImpl;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.*;
......@@ -108,6 +109,8 @@ import com.yeejoin.amos.component.rule.config.RuleConfig;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
/**
* 警情报送记录 服务实现类
......@@ -176,6 +179,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
IFireTeamService fireTeamService;
@Autowired
FireTeamMapper fireTeamMapper;
@Autowired
PowerTransferCompanyResourcesServiceImpl powerTransferCompanyResourcesService;
......@@ -1652,12 +1657,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String [] groupCode = jsonObject1.getString("fireBrigade").split(",");
List<String> positionType= Arrays.asList(groupCode);
//所属大队领导:本大队中消防人员中 岗位为:大队站、副大队长、代理大队长、代理副大队长、指挥员、副中队长、班组长;
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<OrgUsr>();
queryWrapper.eq(OrgUsr::getBizOrgCode, fireTeam.getBizOrgCode());
OrgUsr one = orgUsrService.getOne(queryWrapper);
if (jsonObject1.containsKey("fireBrigade")) {
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<OrgUsr>();
queryWrapper.eq(OrgUsr::getBizOrgCode, fireTeam.getBizOrgCode());
OrgUsr one = orgUsrService.getOne(queryWrapper);
//List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(one.getBizOrgName(),positionType);
List<FirefightersDto> fireBrigade = firefightersService.queryById(groupCode, one.getBizOrgName().toString());
List<FirefightersDto> fireBrigade = firefightersService.queryByIdone(groupCode, fireTeam.getSequenceNbr().toString());
fireBrigade.stream().forEach(f-> {
HashMap<String, Object> map = new HashMap<>();
map.put("mobilePhone", f.getMobilePhone());
......@@ -1670,7 +1678,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
//所在大队值班当日值班员;
if(jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),fireTeam.getCompanyName());
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarIdone(DateUtils.getDateNowShortStr(), fireTeam.getSequenceNbr().toString());
sendUserIds.addAll(mapList);
}
//支队
......@@ -1679,10 +1687,15 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
List<String> positionType= Arrays.asList(groupCode);
String departmentName= jsonObject1.getString("name");
//消防支队领导:本消防支队中消防人员中 岗位为:支队长、副支队长、党支部副书记、支队长助理、指挥员
QueryWrapper<FireTeam> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", departmentName);
FireTeam fireTeaml= fireTeamMapper.selectOne(queryWrapper);
if (jsonObject1.containsKey("fireBrigade")) {
//List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,positionType);
List<FirefightersDto> fireBrigade = firefightersService.queryById(groupCode, departmentName);
List<FirefightersDto> fireBrigade = firefightersService.queryByIdone(groupCode, fireTeaml.getSequenceNbr().toString());
fireBrigade.stream().forEach(f-> {
HashMap<String, Object> map = new HashMap<>();
map.put("mobilePhone", f.getMobilePhone());
......@@ -1697,7 +1710,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}
// 支队值班员: 值班表中 【值班排班】中本支队的当日值班员;
if(jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarIdone(DateUtils.getDateNowShortStr(),fireTeaml.getSequenceNbr().toString());
sendUserIds.addAll(mapList);
}
......
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