Commit c2738cd5 authored by chenhao's avatar chenhao

Merge branch 'chenhao' into developer

parents d472496a fa926297
......@@ -21,7 +21,7 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
int selectPersonListCount(Map<String, Object> map);
List<Map<String, Object>> selectPersonList(Map<String, Object> map);
List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map);
List<OrgUsr> selectCompanyDepartmentMsg();
......
......@@ -60,33 +60,37 @@
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 IFNULL(v.field_value_label, v.field_value)
<if test="map.fields != null">
<foreach collection="map.fields" item="item" separator=",">MAX(case f.field_code when #{item} then IFNULL(v.field_value_label, v.field_value)
end) ${item}
</foreach>
</if>
FROM
cb_org_usr u LEFT JOIN
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
where
u.biz_org_type = #{bizOrgType}
u.biz_org_type = #{map.bizOrgType}
AND u.is_delete = 0
<if test="bizOrgName != null">
AND u.biz_org_name = #{bizOrgName}
<if test="map.bizOrgName != null">
AND u.biz_org_name like concat('%',#{map.bizOrgName},'%')
</if>
<if test="bizOrgCode != null and bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
<if test="map.personNumber!= null">
AND v.field_value like concat('%',#{map.personNumber},'%')
</if>
<if test="map.bizOrgCode != null and map.bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{map.bizOrgCode}, '%')
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
)a where a.sequenceNbr is not null
<if test="fieldsValue != null">
<foreach collection="fieldsValue.keys" item="item">AND a.${item} = #{fieldsValue[${item}]}</foreach>
<if test="map.fieldsValue != null">
<foreach collection="map.fieldsValue.keys" item="item">AND a.${item} = #{map.fieldsValue[${item}]}</foreach>
</if>
LIMIT #{pageNum}, #{pageSize}
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
......
......@@ -328,16 +328,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
Map<String, Object> map = new HashMap<>();
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 开始*/
map.put("bizOrgType", OrgPersonEnum.人员.getKey());
if (!ObjectUtils.isEmpty(req.get("bizOrgName"))) {
map.put("bizOrgName", req.get("bizOrgName"));
}
if (!ObjectUtils.isEmpty(req.get("personNumber"))) {
map.put("personNumber", req.get("personNumber"));
}
OrgUsr parent = this.getById(Long.valueOf(req.get("parentId").toString()));
map.put("bizOrgCode", ObjectUtils.isEmpty(parent) ? null : parent.getBizOrgCode());
req.remove("bizOrgName");
req.remove("pageSize");
req.remove("pageNum");
req.remove("parentId");
map.put("fieldsValue", req);
map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
pageBean.setTotal(this.baseMapper.selectPersonListCount(map));
......@@ -346,6 +353,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/
pageBean.setRecords(list);
return pageBean;
}
......
......@@ -55,15 +55,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -177,7 +169,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
} catch (MqttException e) {
throw new RuntimeException();
throw new RuntimeException();
}
return true;
}
......@@ -227,7 +219,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertSubmittedId = alertSubmitted.getSequenceNbr().toString();
Optional<AlertBusinessTypeEnum> alertBusinessTypeEnum =
EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
e -> e.getCode().equals(calledRo.getAlertTypeCode()));
e -> e.getCode().equals(calledRo.getAlertTypeCode()));
smsCode = alertBusinessTypeEnum.get().getSms_code();
}
// 组装人员信息
......@@ -443,50 +435,49 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Override
public List<InstructionsZHDto> getInstructionsZHDtoList(Long id) {
List<InstructionsZHDto> listInstructionsZHDto=new ArrayList<>();
List<InstructionsZHDto> listInstructionsZHDto = new ArrayList<>();
//获取调派记录
List<PowerTransferCompanyZHDto> listPowerTransferCompanyZHDto=powerTransferCompanyMapper.listPowerTransferCompanyZHDto(id);
listPowerTransferCompanyZHDto.stream().forEach(PowerTransferCompanyZHDto->{
String content="";
if(PowerTransferCompanyZHDto.getIsDistributionAgencies()){
content="调派"+PowerTransferCompanyZHDto.getCompanyName()+"前往"+PowerTransferCompanyZHDto.getAddress();
}else{
content="调派"+PowerTransferCompanyZHDto.getCompanyName()+PowerTransferCompanyZHDto.getSubmissionContent()+"前往"+PowerTransferCompanyZHDto.getAddress();
List<PowerTransferCompanyZHDto> listPowerTransferCompanyZHDto = powerTransferCompanyMapper.listPowerTransferCompanyZHDto(id);
listPowerTransferCompanyZHDto.stream().forEach(PowerTransferCompanyZHDto -> {
String content = "";
if (PowerTransferCompanyZHDto.getIsDistributionAgencies()) {
content = "调派" + PowerTransferCompanyZHDto.getCompanyName() + "前往" + PowerTransferCompanyZHDto.getAddress();
} else {
content = "调派" + PowerTransferCompanyZHDto.getCompanyName() + PowerTransferCompanyZHDto.getSubmissionContent() + "前往" + PowerTransferCompanyZHDto.getAddress();
}
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(),PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content);
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(), PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content);
listInstructionsZHDto.add(instruct);
});
//获取融合调度信息
List<AlertSubmittedZHDto> listAlertSubmittedZHDto= alertSubmittedMapper.listAlertSubmittedZHDto(id);
List<AlertSubmittedZHDto> listAlertSubmittedZHDto = alertSubmittedMapper.listAlertSubmittedZHDto(id);
listAlertSubmittedZHDto.stream().forEach(AlertSubmittedZHDto->{
JSONObject js= JSONObject.parseObject(AlertSubmittedZHDto.getSubmissionContent());
String content="";
listAlertSubmittedZHDto.stream().forEach(AlertSubmittedZHDto -> {
JSONObject js = JSONObject.parseObject(AlertSubmittedZHDto.getSubmissionContent());
String content = "";
switch(AlertSubmittedZHDto.getBusinessType()){
switch (AlertSubmittedZHDto.getBusinessType()) {
case "警情初报":
content="通知"+ AlertSubmittedZHDto.getCompanyName()+":"+AlertSubmittedZHDto.getUserName()+","+js.getString("address")+"发生"+js.getString("alertType");
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + js.getString("address") + "发生" + js.getString("alertType");
break;
case "警情续报":
content="通知"+ AlertSubmittedZHDto.getCompanyName()+":"+AlertSubmittedZHDto.getUserName()+","+"现场被困人数:"+js.getString("trappedNum")+"人伤亡人数:"+js.getString("casualtiesNum")+"人。";
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + "现场被困人数:" + js.getString("trappedNum") + "人伤亡人数:" + js.getString("casualtiesNum") + "人。";
break;
case "非警情确认":
content="通知"+ AlertSubmittedZHDto.getCompanyName()+":"+AlertSubmittedZHDto.getUserName()+","+"此警情现场确认为假警情。";
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + "此警情现场确认为假警情。";
break;
case "警情结案":
content="通知"+ AlertSubmittedZHDto.getCompanyName()+":"+AlertSubmittedZHDto.getUserName()+","+"此警情已完场警情处置,警情已结案。";
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," + "此警情已完场警情处置,警情已结案。";
break;
default:
......@@ -494,17 +485,26 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
break;
}
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(),AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content);
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(), AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content);
listInstructionsZHDto.add(instruct);
});
//排序时间倒序
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始*/
Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() {
@Override
public int compare(InstructionsZHDto o1, InstructionsZHDto o2) {
long i = o2.getSubmissionTime().getTime() - o1.getSubmissionTime().getTime();
if (i == 0) {
return (int) (o2.getSubmissionTime().getTime() - o1.getSubmissionTime().getTime());
}
return (int) i;
}
});
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 结束*/
return listInstructionsZHDto;
List<InstructionsZHDto> listA=listInstructionsZHDto.stream().sorted(Comparator.comparing(InstructionsZHDto::getSubmissionTime).reversed()).collect(Collectors.toList());
return listA;
}
/**
......
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