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
......
......@@ -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
......
......@@ -20,14 +20,18 @@ public class AlertCalledFormDto extends BaseDto{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情基本信息")
private AlertCalledDto alertCalledDto;
private AlertCalledDto alertCalledDto;
@ApiModelProperty(value = "动态表单值")
private List<FormValue> dynamicFormAlert;
@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