Commit 0b9ff18c authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 76a13fd7 7c5b3e67
......@@ -32,7 +32,7 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersTreeDto> getFirefightersJobTitleCount();
List<String> getFirefightersName( );
List<Map<String,String>> getFirefightersName( );
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle);
......
......@@ -227,6 +227,15 @@ public interface IOrgUsrService {
AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception;
/**
* 根据机场人员id(逗号分割)获取amos账号信息列表
*
* @param orgUserIds
* @return
* @exception
*/
List<String> getAmosIdListByOrgUserId(String orgUserIds) throws Exception;
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
* @param ids
* @return
......
......@@ -27,9 +27,9 @@
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldCodes" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
i.GROUP_CODE groupCode
<foreach collection="fieldCodes" item="value" index="key">
,MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
</foreach>
from
cb_dynamic_form_instance i
......@@ -67,9 +67,9 @@
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldCodes" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key},
i.GROUP_CODE groupCode
<foreach collection="fieldCodes" item="value" index="key" >
, MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key},
IF(FIND_IN_SET(i.field_type,'radio,select,treeSelect'), MAX(CASE WHEN i.FIELD_CODE = #{key} THEN
i.FIELD_VALUE_LABEL END), null) as ${key}Label
</foreach>
......@@ -120,9 +120,9 @@
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldCodes" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
i.GROUP_CODE groupCode
<foreach collection="fieldCodes" item="value" index="key" >
, MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
</foreach>
from
cb_dynamic_form_instance i
......@@ -208,9 +208,9 @@
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldCodes" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key},
i.GROUP_CODE groupCode
<foreach collection="fieldCodes" item="value" index="key" >
,MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key},
IF(FIND_IN_SET(i.field_type,'radio,select,treeSelect'), MAX(CASE WHEN i.FIELD_CODE = #{key} THEN
i.FIELD_VALUE_LABEL END), null) as ${key}Label
</foreach>
......
......@@ -159,9 +159,10 @@ WHERE
<if test='jobTitle!=null'>and f.job_title_code = #{jobTitle}</if>
</select>
<select id="getFirefightersName" resultType="string">
<select id="getFirefightersName" resultType="Map">
SELECT
cb_firefighters.name
cb_firefighters.name AS name,
cb_firefighters.mobile_phone AS phone
FROM
cb_firefighters
WHERE
......
......@@ -23,33 +23,51 @@
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
u.biz_org_code bizOrgCode,
<if test="fields != null">
<foreach collection="fields" item="item" separator=",">MAX(case f.field_code when #{item} then v.field_value
end) ${item}
</foreach>
</if>
g.*
FROM
cb_org_usr u LEFT JOIN
cb_dynamic_form_instance v on u.sequence_nbr = v.instance_id
LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id
cb_org_usr u
LEFT JOIN
( SELECT
v.`instance_id`,
max(case v.field_code when 'personNumber' then IFNULL(v.field_value_label,v.field_value) end) personNumber,
max(case v.field_code when 'certificatesTypeCode' then IFNULL(v.field_value_label,v.field_value) end) certificatesTypeCode,
max(case v.field_code when 'gender' then IFNULL(v.field_value_label,v.field_value) end) gender,
max(case v.field_code when 'certificatesNumber' then IFNULL(v.field_value_label,v.field_value) end) certificatesNumber,
max(case v.field_code when 'telephone' then IFNULL(v.field_value_label,v.field_value) end) telephone,
max(case v.field_code when 'state' then IFNULL(v.field_value_label,v.field_value) end) state,
max(case v.field_code when 'safetyTraining' then IFNULL(v.field_value_label,v.field_value) end) safetyTraining,
max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode,
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
max(case v.field_code when 'fireManagementPostCode' then IFNULL(v.field_value_label,v.field_value) end) fireManagementPostCode,
max(case v.field_code when 'positionType' then IFNULL(v.field_value_label,v.field_value) end) positionType,
max(case v.field_code when 'certificateType' then IFNULL(v.field_value_label,v.field_value) end) certificateType,
max(case v.field_code when 'holdingTime' then IFNULL(v.field_value_label,v.field_value) end) holdingTime,
max(case v.field_code when 'auditCycle' then IFNULL(v.field_value_label,v.field_value) end) auditCycle,
max(case v.field_code when 'personImg' then IFNULL(v.field_value_label,v.field_value) end) personImg,
max(case v.field_code when 'certificateImg' then IFNULL(v.field_value_label,v.field_value) end) certificateImg
FROM
`cb_dynamic_form_instance` v
WHERE
v.group_code = 246
GROUP BY
v.`instance_id`
) g
on u.sequence_nbr = g.instance_id
where
u.biz_org_type = #{bizOrgType}
AND u.is_delete = 0
<if test="bizOrgName != null">
AND u.biz_org_name = #{bizOrgName}
</if>
<if test="bizOrgCode != null and bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
u.biz_org_type = 'person'
AND
u.is_delete = 0
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
order by u.rec_date desc
)a where a.sequenceNbr is not null
<if test="fieldsValue != null">
<foreach collection="fieldsValue.keys" item="item">AND a.${item} = #{fieldsValue[${item}]}</foreach>
</if>
</select>
<!--机场单位人员按时间倒叙排列add order by u.rec_date desc 2021-09-08 by kongfm -->
......@@ -72,7 +90,7 @@
max(case v.field_code when 'gender' then IFNULL(v.field_value_label,v.field_value) end) gender,
max(case v.field_code when 'certificatesNumber' then IFNULL(v.field_value_label,v.field_value) end) certificatesNumber,
max(case v.field_code when 'telephone' then IFNULL(v.field_value_label,v.field_value) end) telephone,
max(case v.field_code when 'state' then IFNULL(v.field_value_label,v.field_value) end) state,
max(case v.field_code when 'stateCode' then IFNULL(v.field_value_label,v.field_value) end) state,
max(case v.field_code when 'safetyTraining' then IFNULL(v.field_value_label,v.field_value) end) safetyTraining,
max(case v.field_code when 'administrativePositionCode' then IFNULL(v.field_value_label,v.field_value) end) administrativePositionCode,
max(case v.field_code when 'internalPositionCode' then IFNULL(v.field_value_label,v.field_value) end) internalPositionCode,
......
......@@ -36,7 +36,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
List<AlertCalledTodyDto> getTodayAlertCalled();
List<String> getContactName( );
List<Map<String,String>> getContactName( );
List<String> getAddress();
......
......@@ -232,9 +232,10 @@
</select>
<select id="getContactName" resultType="string">
<select id="getContactName" resultType="Map">
SELECT
jc_alert_called.contact_user
jc_alert_called.contact_user AS name,
jc_alert_called.contact_phone AS phone
FROM
jc_alert_called
WHERE
......
......@@ -25,9 +25,13 @@ public class AlertCalledFormDto extends BaseDto{
@ApiModelProperty(value = "动态表单值")
private List<FormValue> dynamicFormAlert;
@ApiModelProperty(value = "报警录音")
private String alertRecord;
public AlertCalledFormDto(AlertCalledDto alertCalledDto, List<FormValue> formValue) {
public AlertCalledFormDto(AlertCalledDto alertCalledDto, List<FormValue> formValue, String alertRecord) {
this.alertCalledDto = alertCalledDto;
this.dynamicFormAlert = formValue;
this.alertRecord = alertRecord;
}
}
......@@ -515,13 +515,26 @@ public class OrgUsrController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/amos/{orgUserId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据机场人员id获取amos平台人员信息", notes = "根据机场人员id获取amos平台人员信息")
@GetMapping(value = "/amos/{orgUserId}")
public ResponseModel<AgencyUserModel> getAmosIdByOrgUserId(@PathVariable String orgUserId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getAmosIdByOrgUserId(orgUserId));
}
/**
* 根据机场人员id(逗号分割)获取amos平台人员id列表
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据机场人员id(逗号分割)获取amos平台人员id列表", notes = "根据机场人员id(逗号分割)获取amos平台人员id列表")
@GetMapping(value = "/amos/orgUserIds")
public ResponseModel<List<String>> getAmosIdListByOrgUserId(@RequestParam String orgUserIds) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getAmosIdListByOrgUserId(orgUserIds));
}
/**
* 根据单位id列表或未同步的机场单位列表
*
* @return
......
......@@ -124,7 +124,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
return menus;
}
public List<String> getFirefightersName() {
public List<Map<String,String>> getFirefightersName() {
return firefightersMapper.getFirefightersName();
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
......@@ -1720,6 +1721,26 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
@Override
public List<String> getAmosIdListByOrgUserId(String orgUserIds) throws Exception {
if (ValidationUtil.isEmpty(orgUserIds)) {
throw new Exception("账号不存在");
}
List<String> orgUserIdList = Lists.newArrayList(orgUserIds.split(","));
List<OrgUsr> orgUsrList = this.baseMapper.selectList(new LambdaQueryWrapper<OrgUsr>().in(OrgUsr::getSequenceNbr,
orgUserIdList));
if (ValidationUtil.isEmpty(orgUsrList)) {
throw new Exception("账号不存在");
}
List<AgencyUserModel> amosUserList =
Privilege.agencyUserClient.queryByIds(Joiner.on(",").join(orgUsrList.stream().map(OrgUsr::getAmosOrgId).collect(Collectors.toList())), false).getResult();
if (ValidationUtil.isEmpty(amosUserList)) {
throw new Exception("账号不存在");
}
return amosUserList.stream().map(AgencyUserModel::getUserName).collect(Collectors.toList());
}
@Override
public List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList) {
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.notIn(OrgUsr::getSequenceNbr, companyIdList).eq(OrgUsr::getIsDelete, false).eq(OrgUsr::getBizOrgType, "COMPANY");
......
......@@ -362,7 +362,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public ResponseModel< List<String>> getContact ( ) {
public ResponseModel< List<Map<String,String>>> getContact ( ) {
return ResponseHelper.buildResponse(iAlertCalledService.getContactName());
}
......
......@@ -797,9 +797,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
public List<String> getContactName() {
List<String> firefightersName = firefightersService.getFirefightersName();
List<String> contactNames = alertCalledMapper.getContactName();
public List<Map<String,String>> getContactName() {
List<Map<String,String>> firefightersName = firefightersService.getFirefightersName();
List<Map<String,String>> contactNames = alertCalledMapper.getContactName();
firefightersName.addAll(contactNames);
return firefightersName;
......
......@@ -29,6 +29,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
......@@ -102,6 +103,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
ISourceFileService ISourceFileService;
@Autowired
VoiceRecordFileServiceImpl voiceRecordFileServiceImpl;
private final Logger logger = LogManager.getLogger(AlertCalledServiceImpl.class);
......@@ -139,7 +143,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalledDto.setUseUnit(elevator.getUseUnit());
alertCalledDto.setRegionCode(elevator.getRegionCode());
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledDto, formValue);
String voiceRecord = "";
VoiceRecordFile temp = voiceRecordFileServiceImpl.getOne(new LambdaQueryWrapper<VoiceRecordFile>().eq(VoiceRecordFile::getAlertId,id).eq(VoiceRecordFile::getAlertStageCode,"860").orderByAsc(VoiceRecordFile::getRecDate));
if(temp != null) {
voiceRecord = temp.getFilePath();
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledDto, formValue,voiceRecord);
redisUtils.set(RedisKey.TZS_ALERTCALLED_ID+id, JSON.toJSON(alertCalledFormVo),time);
return alertCalledFormVo;
......@@ -198,7 +207,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalledDto.setUseUnit(elevator.getUseUnit());
alertCalledDto.setRegionCode(elevator.getRegionCode());
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledDto, formValue);
String voiceRecord = "";
VoiceRecordFile temp = voiceRecordFileServiceImpl.getOne(new LambdaQueryWrapper<VoiceRecordFile>().eq(VoiceRecordFile::getAlertId,id).eq(VoiceRecordFile::getAlertStageCode,"860").orderByAsc(VoiceRecordFile::getRecDate));
if(temp != null) {
voiceRecord = temp.getFilePath();
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalledDto, formValue,voiceRecord);
return alertCalledFormVo;
}
......
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