Commit 5eec06ef authored by kongfm's avatar kongfm

Merge remote-tracking branch 'origin/developer' into developer

parents 37c447e5 d0a011c5
......@@ -24,6 +24,8 @@ public class DateUtils {
public static final String MINUTE_ONLY_PATTERN = "mm";
public static final String HOUR_ONLY_PATTERN = "HH";
public static final String DATE_PATTERN_NUM = "yyyyMMdd";
public static final String CHN_DATE_PATTERN_YEAR = "yyyy年";
public static final String CHN_DATE_PATTERN_MONTH = "MM月";
/**
* 获取 当前年、半年、季度、月、日、小时 开始结束时间
......@@ -604,6 +606,7 @@ public class DateUtils {
System.out.println(dateTimeToDateStringIfTimeEndZero(dateTimeToDate(new Date())));*/
//System.out.println(dateBetween(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
//System.out.println(dateBetweenIncludeToday(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
// System.out.println(getDate(dateParse("2017-01-17", null)));
//System.out.println(getDate(dateParse("2017-01-17", null)));
/*
System.out.println(getDaysOfMonth(dateParse("2017-02-01", null)));
......@@ -612,6 +615,13 @@ public class DateUtils {
// .MONTH_PATTERN));
/*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null));
System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/
// System.out.println(dateFormat(new Date(), CHN_DATE_PATTERN_YEAR));
// System.out.println(dateFormat(new Date(), CHN_DATE_PATTERN_MONTH));
// System.out.println(getWeekOfYear(new Date()));
// System.out.println(getQuarterStr(getMonth(dateParse("2021-5-11", null))));
// System.out.println(getWeekBeginDate(dateParse("2021-10-11", null)));
// System.out.println(getWeekEndDate(dateParse("2021-10-11", null)));
System.out.println(secondsToTimeStr(3600));
}
......@@ -723,6 +733,79 @@ public class DateUtils {
}
/**
* 获取一年的第几周
*
* @param date
* @return
*/
public static int getWeekOfYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int week_of_year = c.get(Calendar.WEEK_OF_YEAR);
return week_of_year;
}
/**
* 通过月份计算季度
* @param month
* @return
*/
public static int getQuarter(int month) {
if(month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid.");
}
return (month - 1) / 3 + 1;
}
/**
* 通过月份计算季度
* @param month
* @return
*/
public static String getQuarterStr(int month) {
if(month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid.");
}
return (month - 1) / 3 + 1 + "";
}
/**
* 获取指定时间所在周的第一天日期
* @param date
* @return
*/
public static int getWeekBeginDate(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
System.out.println(calendar.getTime());
return getDate(calendar.getTime());
}
/**
* 获取指定时间所在周的最后一天日期
* @param date
* @return
*/
public static int getWeekEndDate(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
System.out.println(calendar.getTime());
return getDate(calendar.getTime());
}
public static String getWeekDate(Date date) throws ParseException {
String month = dateFormat(date, CHN_DATE_PATTERN_MONTH);
String weekDateStr = getWeekBeginDate(date) + "-" + getWeekEndDate(date);
return month + weekDateStr + "日";
}
/**
* 将秒数转换为时分秒格式
* @param times
* @return
......@@ -738,6 +821,4 @@ public class DateUtils {
time = String.format(time,h,m,s);
return time;
}
}
......@@ -58,7 +58,7 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
* @return
*/
Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName,
String linkageUnitType, String linkageUnitTypeCode, String emergencyLinkageUnitCode);
String linkageUnitType, String linkageUnitTypeCode, String emergencyLinkageUnitCode,String inAgreement);
List<LinkageUnitDto> exportToExcel(String unitName,String linkageUnitTypeCode,String emergencyLinkageUnitCode);
......
......@@ -89,4 +89,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
void updatelistByParentId(String codex, String code);
List< Map<String,String>> getPersonSimpleDetail();
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
}
......@@ -203,9 +203,22 @@
FROM
cb_linkage_unit clu
WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat('%',#{unitName}, '%')
</if>
<if test="inAgreement != null and inAgreement != ''">
<if test='inAgreement != "是"'>
AND now() &lt; clu.agreement_start_date or now() &gt; clu.agreement_end_date
</if>
<if test='inAgreement != "否"'>
AND now() between clu.agreement_start_date and clu.agreement_end_date
</if>
</if>
<if
test="linkageUnitType != null and linkageUnitType != ''">
AND clu.linkage_unit_type =#{linkageUnitType}
......
......@@ -669,4 +669,20 @@ LEFT JOIN (
AND field_code = 'telephone'
) cdf ON person.sequence_nbr = cdf.instance_id
</select>
<select id="countDeptByCompanyId" resultType="java.util.Map">
SELECT (SELECT count(1)
FROM cb_org_usr
WHERE biz_org_code LIKE
concat((SELECT biz_org_code FROM `cb_org_usr` WHERE sequence_nbr = t1.sequence_nbr),
'%'
)
AND biz_org_type = 'DEPARTMENT'
AND parent_id = t1.sequence_nbr) count,
sequence_nbr
FROM cb_org_usr t1
WHERE sequence_nbr IN
<foreach collection ='companyIdList' item='companyId' index='index' open="(" close= ")" separator=",">
#{companyId}
</foreach>
</select>
</mapper>
......@@ -23,7 +23,7 @@ public class AlertSubmittedZHDto {
@ApiModelProperty(value = "主键ID")
protected Long sequenceNbr;
@ApiModelProperty(value = "业务类型(警情续报、非警情确认、警情结案)")
@ApiModelProperty(value = "业务类型(警情续报、非警情确认、警情结案,警情归并)")
private String businessType;
@ApiModelProperty(value = "报送时间")
......@@ -38,4 +38,7 @@ public class AlertSubmittedZHDto {
@ApiModelProperty(value = "人员名称")
private String userName;
@ApiModelProperty(value = "警情信息")
private AlertCalledFormDto alertCalledFormDto;
}
......@@ -31,15 +31,20 @@ public class InstructionsZHDto {
@ApiModelProperty(value = "发送单位")
private String company="119值班中心";
@ApiModelProperty(value = "警情信息")
private AlertCalledFormDto alertCalledFormDto;
public InstructionsZHDto(Long sequenceNbr, String type, Date submissionTime, String content) {
public InstructionsZHDto(Long sequenceNbr, String type, Date submissionTime, String content, AlertCalledFormDto alertCalledFormDto) {
this.sequenceNbr = sequenceNbr;
this.type = type;
this.submissionTime = submissionTime;
this.content = content;
this.alertCalledFormDto = alertCalledFormDto;
}
public InstructionsZHDto() {
}
}
......@@ -41,6 +41,8 @@ public interface IAlertCalledService {
* **/
Object selectAlertCalledById( Long id);
Object selectAlertCalledByIdNoRedis(Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( Long id);
......
......@@ -220,4 +220,16 @@ public class LatentDanger extends BasicEntity {
*/
@TableField(exist = false)
private String processStateName;
/**
* 隐患创建人名称
*/
@TableField(exist = false)
private String checkUserName;
/**
* 复查执行人名称
*/
@TableField(exist = false)
private String executeUserName;
}
package com.yeejoin.amos.supervision.common.enums;
/**
* 计划频次类型枚举
*/
public enum PlanFrequencyEnum {
WEEK("周", "2", "周检查报告"),
MONTH("月", "3", "月检查报告"),
QUARTER("季度", "4", "季度检查报告");
String name;
String code;
String reportName;
PlanFrequencyEnum(String name, String code, String reportName) {
this.name = name;
this.code = code;
this.reportName = reportName;
}
public static PlanFrequencyEnum getEnumByCode(String code) {
for (PlanFrequencyEnum c : PlanFrequencyEnum.values()) {
if (c.getCode().equals(code)) {
return c;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getExtraInfo() {
return reportName;
}
public void setExtraInfo(String reportName) {
this.reportName = reportName;
}
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class CheckReportCompanyDto implements Serializable {
@ApiModelProperty(value = "单位id")
String id;
@ApiModelProperty(value = "单位名称")
String name;
@ApiModelProperty(value = "点位数量")
Integer deptCount;
@ApiModelProperty(value = "检查陪同人员")
String escortUser;
@ApiModelProperty(value = "检查结果")
String checkResult;
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CheckReportDangerDto implements Serializable {
@ApiModelProperty(value = "单位id")
String companyId;
@ApiModelProperty(value = "单位名称")
String companyName;
@ApiModelProperty(value = "隐患id")
String dangerId;
@ApiModelProperty(value = "存在问题")
String dangerName;
@ApiModelProperty(value = "隐患状态")
String dangerStateName;
@ApiModelProperty(value = "检查时间")
Date createDate;
@ApiModelProperty(value = "检查人员")
String checkUserName;
@ApiModelProperty(value = "复查人员")
String reviewUser;
@ApiModelProperty(value = "备注")
String remark;
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class CheckReportDto implements Serializable {
@ApiModelProperty(value = "检查报告id")
Long id;
@ApiModelProperty(value = "报告名称")
String name;
@ApiModelProperty(value = "所属计划名称")
String planName;
@ApiModelProperty(value = "计划检查类型")
String planCheckType;
@ApiModelProperty(value = "检查级别")
String planCheckLevel;
@ApiModelProperty(value = "计划开始时间")
Date startPlanTaskDate;
@ApiModelProperty(value = "计划结束时间")
Date endPlanTaskDate;
@ApiModelProperty(value = "执行人")
String checkUser;
@ApiModelProperty(value = "计划任务id")
Long planTaskId;
@ApiModelProperty(value = "实际开始时间")
Date startCheckDate;
@ApiModelProperty(value = "实际结束时间")
Date endCheckDate;
@ApiModelProperty(value = "检查单位数量")
Integer companyCount;
@ApiModelProperty(value = "存在问题单位数量")
Integer problemCompanyCount;
@ApiModelProperty(value = "是否有重大隐患(1有,0无)")
Boolean hasMajorDanger;
@ApiModelProperty(value = "存在安全隐患数量")
Integer dangerCount;
@ApiModelProperty(value = "现场已整改隐患数量")
Integer onsiteReformCount;
@ApiModelProperty(value = "复查隐患数量")
Integer reviewDangerCount;
@ApiModelProperty(value = "复查已整改隐患数量")
Integer reviewReformedCount;
@ApiModelProperty(value = "复查整改中隐患数量")
Integer reviewReformingCount;
@ApiModelProperty(value = "剩余隐患数量")
Integer remainderDangerCount;
@ApiModelProperty(value = "机构代码")
String orgCode;
@ApiModelProperty(value = "创建时间")
Date createDate;
@ApiModelProperty(value = "检查单位列表")
List<CheckReportCompanyDto> checkCompanyList;
@ApiModelProperty(value = "本次检查隐患列表")
List<CheckReportDangerDto> checkDangerList;
@ApiModelProperty(value = "本次隐患复查列表")
List<CheckReportDangerDto> reviewDangerList;
@ApiModelProperty(value = "本次隐患id")
String dangerIds;
@ApiModelProperty(value = "本次复查隐患id")
String reviewDangerIds;
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CheckReportParamDto implements Serializable {
@ApiModelProperty(value = "报告名称")
String name;
@ApiModelProperty(value = "计划名称")
String planName;
@ApiModelProperty(value = "计划检查类型")
String planCheckType;
@ApiModelProperty(value = "检查级别")
String checkLevel;
@ApiModelProperty(value = "检查开始时间")
Date startCheckTime;
@ApiModelProperty(value = "检查结束时间")
Date endCheckTime;
@ApiModelProperty(value = "检查执行人")
String checkUser;
@ApiModelProperty(value = "组织机构代码")
String orgCode;
}
......@@ -20,6 +20,11 @@ public class DangerDto implements Serializable {
private Long id;
/**
* 隐患id
*/
private Long dangerId;
/**
* 隐患名称
*/
private String dangerName;
......@@ -156,4 +161,13 @@ public class DangerDto implements Serializable {
*/
private Map bizInfo;
/**
* 复核人员名称
*/
private String executeUserName;
/**
* 创建时间
*/
private Date createDate;
}
package com.yeejoin.amos.supervision.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@TableName("p_check_report")
public class CheckReport extends BasicEntity {
@ApiModelProperty(value = "报告名称")
String name;
@ApiModelProperty(value = "计划类型(0单位级,1公司级)")
int planType;
@ApiModelProperty(value = "计划任务id")
Long planTaskId;
@ApiModelProperty(value = "任务执行人")
String checkUser;
@ApiModelProperty(value = "实际开始时间")
Date startCheckDate;
@ApiModelProperty(value = "实际结束时间")
Date endCheckDate;
@ApiModelProperty(value = "检查单位数量")
Integer companyCount;
@ApiModelProperty(value = "存在问题单位数量")
Integer problemCompanyCount;
@ApiModelProperty(value = "是否有重大隐患(1有,0无)")
Boolean hasMajorDanger;
@ApiModelProperty(value = "存在安全隐患id(逗号分割)")
String dangerIds;
@ApiModelProperty(value = "存在安全隐患数量")
Integer dangerCount;
@ApiModelProperty(value = "复查隐患id(逗号分割)")
String reviewDangerIds;
@ApiModelProperty(value = "现场已整改隐患数量")
Integer onsiteReformCount;
@ApiModelProperty(value = "复查隐患数量")
Integer reviewDangerCount;
@ApiModelProperty(value = "复查已整改隐患数量")
Integer reviewReformedCount;
@ApiModelProperty(value = "复查整改中隐患数量")
Integer reviewReformingCount;
@ApiModelProperty(value = "剩余隐患数量")
Integer remainingDangerCount;
@ApiModelProperty(value = "机构代码")
String orgCode;
}
......@@ -545,4 +545,17 @@ public class OrgUsrController extends BaseController {
public ResponseModel getUnSyncOrgCompanyList(@RequestParam List<Long> companyIdList) {
return ResponseHelper.buildResponse(iOrgUsrService.getUnSyncOrgCompanyList(companyIdList));
}
/**
* 根据机场单位id获取各单位下部门数量
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据机场单位id获取各单位下部门数量", notes = "根据机场单位id获取各单位下部门数量")
@GetMapping(value = "/amos/companyIds")
public ResponseModel<Map<String, Integer>> getDeptCountByCompanyIds(@RequestParam List<String> companyIdList) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getDeptCountByCompanyIds(companyIdList));
}
}
\ No newline at end of file
......@@ -72,11 +72,13 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
*/
@Override
public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page,
Boolean isDelete, String unitName,
String linkageUnitTypeCode,
String linkageUnitType, String emergencyLinkageUnitCode,
String inAgreement) {
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType,linkageUnitTypeCode, emergencyLinkageUnitCode);
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType,linkageUnitTypeCode, emergencyLinkageUnitCode,inAgreement);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode());
......@@ -88,6 +90,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
}
});
});
List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitListMap),
LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
......@@ -98,9 +101,8 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(item.getSequenceNbr());
item.setImage(sourceFiles);
return item;
}).filter(item -> StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement()))
.collect(Collectors.toList());
}).collect(Collectors.toList());
//.filter(item -> StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement()))
Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>();
page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize());
......
......@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -750,7 +751,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
// orgUsr.setSequenceNbr(id);
orgUsr.setSequenceNbr(id);
// 查询机构下的所有部门单位人员数据,进行bizOrgCode的统一修改 BUG 2880 by litw start 2021年9月16日
// String oriOrgCode = oriOrgUsr.getBizOrgCode();
// Map<String, Object> columnMap = new HashMap<>();
......@@ -1844,4 +1845,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrMapper.getPersonSimpleDetail();
}
public Map<String, Integer> getDeptCountByCompanyIds(List<String> companyIdList) {
Map<String, Integer> resultMap = Maps.newHashMap();
List<Map<String, Long>> companyDeptCountMapList;
if (!ValidationUtil.isEmpty(companyIdList)) {
companyDeptCountMapList = this.baseMapper.countDeptByCompanyId(companyIdList);
if (!ValidationUtil.isEmpty(companyDeptCountMapList)) {
companyDeptCountMapList.forEach(c -> {
resultMap.put(c.get("sequence_nbr").toString(), Integer.valueOf(c.get("count").intValue()));
});
}
}
return resultMap;
}
}
......@@ -117,6 +117,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private String topic;
@Value("${redis.cache.failure.time}")
private long time;
@Value("${mqtt.topic.command.power.deployment}")
private String topic1;
@Autowired
private OrgUsrServiceImpl iOrgUsrService;
......@@ -247,6 +249,29 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/**
* 根据灾情id 查询灾情详情
**/
@Override
public Object selectAlertCalledByIdNoRedis(Long id) {
// 警情基本信息
AlertCalled alertCalled = this.getById(id);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
List<FormValue> formValue = new ArrayList<FormValue>();
if (list != null && list.size() > 0) {
for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
"text", alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
}
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
return alertCalledFormVo;
}
/**
* <pre>
* 保存警情信息
* </pre>
......@@ -304,6 +329,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
emqKeeper.getMqttClient().publish(topic1, "1".getBytes(), RuleConfig.DEFAULT_QOS, true);
} else {
// 警情报送
// ****************************************************待确认开发
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -14,6 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
......@@ -43,7 +45,9 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.ObjectUtils;
import org.checkerframework.checker.units.qual.A;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -490,7 +494,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} 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, null);
listInstructionsZHDto.add(instruct);
});
......@@ -527,12 +531,28 @@ 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,null);
listInstructionsZHDto.add(instruct);
});
// 获取归并得警情信息
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(AlertCalled::getFatherAlert,id);
List<AlertCalled> alertCalleds = alertCalledService.getBaseMapper().selectList(queryWrapper);
alertCalleds.stream().forEach(e->{
AlertSubmittedZHDto alertSubmittedZHDto = new AlertSubmittedZHDto();
AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto) alertCalledService.selectAlertCalledByIdNoRedis(e.getSequenceNbr());
alertSubmittedZHDto.setAlertCalledFormDto(alertCalledFormDto);
alertSubmittedZHDto.setSequenceNbr(e.getSequenceNbr());
alertSubmittedZHDto.setBusinessType("警情归并");
alertSubmittedZHDto.setSubmissionTime(alertCalledFormDto.getAlertCalled().getCallTime());
alertSubmittedZHDto.setCompanyName(alertCalledFormDto.getAlertCalled().getCompanyName());
alertSubmittedZHDto.setUserName(alertCalledFormDto.getAlertCalled().getRecUserName());
InstructionsZHDto instruct = new InstructionsZHDto(alertSubmittedZHDto.getSequenceNbr(), alertSubmittedZHDto.getBusinessType(), alertSubmittedZHDto.getSubmissionTime(), null, alertSubmittedZHDto.getAlertCalledFormDto());
listInstructionsZHDto.add(instruct);
});
//排序时间倒序
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始*/
Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() {
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.latentdanger.business.dto.DangerExecuteSubmitDto;
import com.yeejoin.amos.latentdanger.business.dto.ExecuteSubmitDto;
......@@ -376,4 +377,13 @@ public class LatentDangerController extends BaseController {
public ResponseModel getUnFinishedDangerCount() {
return ResponseHelper.buildResponse((iLatentDangerService.getUnFinishedDangerCount()));
}
@ApiOperation(value = "获取隐患复查信息", notes = "获取隐患复查信息")
@GetMapping(value = "/supervision/reviewInfo")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getSupervisionReviewInfo(@RequestParam String orgCode, @RequestParam String t1,
@RequestParam String t2) {
return ResponseHelper.buildResponse(iLatentDangerService.getSupervisionReviewInfo(orgCode,
DateUtils.longStr2Date(t1), DateUtils.longStr2Date(t2)));
}
}
......@@ -13,5 +13,5 @@ public class LatentDangerFlowRecordBoExtend {
private Integer dangerOvertimeState;
private Integer dangerState;
private String dangerState;
}
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.latentdanger.business.param;
import com.yeejoin.amos.latentdanger.core.common.request.CommonPageable;
import lombok.Data;
import java.util.Date;
/**
* @author keyong
* @title: LatentDangerListParam
......@@ -41,4 +43,14 @@ public class LatentDangerListParam extends CommonPageable {
private String dangerIds;
private String orgCode;
/**
* 隐患开始时间
*/
private Date startTime;
/**
* 隐患结束时间
*/
private Date endTime;
}
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -173,4 +174,14 @@ public interface ILatentDangerService {
* @return
*/
Integer getUnFinishedDangerCount();
/**
* 获取消防监督复查隐患信息
*
* @param orgCode
* @param t1
* @param t2
* @return
*/
Object getSupervisionReviewInfo(String orgCode, Date t1, Date t2);
}
package com.yeejoin.amos.supervision.business.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckReportService;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date;
@RestController
@RequestMapping(value = "/check/report")
@Api(tags = "消防监督检查报告api")
public class CheckReportController extends BaseController {
@Autowired
ICheckReportService iCheckReportService;
@Autowired
DangerFeignClient dangerFeignClient;
/**
* 分页查询
*
* @param queryParam
* @param current
* @param size
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询检查报告", notes = "分页查询检查报告")
@PostMapping(value = "/page")
public ResponseModel queryPage(@RequestParam(value = "当前页") int current, @RequestParam(value = "分页大小") int size, @RequestBody(required = false) CheckReportParamDto queryParam) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
if (loginOrgCode.contains("-")) {
loginOrgCode = loginOrgCode.substring(0, loginOrgCode.indexOf("-"));
}
queryParam.setOrgCode(loginOrgCode);
Page page = new Page<>(current, size);
return ResponseHelper.buildResponse(iCheckReportService.pageList(page, queryParam));
}
/**
* 分页查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询检查报告详情", notes = "查询检查报告详情")
@GetMapping(value = "/detail/{id}")
public ResponseModel getDetailById(@PathVariable(value = "id") String id) {
return ResponseHelper.buildResponse(iCheckReportService.getDetailById(id));
}
}
package com.yeejoin.amos.supervision.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.supervision.business.dto.CheckReportMapperDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportCompanyDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import com.yeejoin.amos.supervision.dao.entity.CheckReport;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CheckReportMapper extends BaseMapper<CheckReport> {
/**
* 根据计划任务ID获取相关数据
* @param id
*/
CheckReportMapperDto queryByPlanTaskId(long id);
IPage<CheckReportDto> selectPageList(Page page, @Param("queryParam") CheckReportParamDto queryParam);
CheckReportDto selectDetailById(@Param("checkReportId") Long id);
List<CheckReportCompanyDto> getCheckReportCompanyList(Long planTaskId);
}
package com.yeejoin.amos.supervision.business.dao.mapper;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import org.apache.ibatis.annotations.Param;
public interface PlanTaskDetailMapper extends BaseMapper {
......@@ -10,7 +12,7 @@ public interface PlanTaskDetailMapper extends BaseMapper {
Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
int findPlanTaskDetailByTaskId( @Param(value="planTaskId") long planTaskId);
List<PlanTaskDetail> findPlanTaskDetailByTaskId(@Param(value="planTaskId") long planTaskId);
/**
* 更新隐患信息
......
package com.yeejoin.amos.supervision.business.dao.repository;
import com.yeejoin.amos.supervision.dao.entity.CheckReport;
import org.springframework.stereotype.Repository;
@Repository("iCheckReportDao")
public interface ICheckReportDao extends BaseDao<CheckReport, Long> {
}
package com.yeejoin.amos.supervision.business.dto;
import lombok.Data;
import java.util.Date;
@Data
public class CheckReportMapperDto {
Integer companyCount;
Long planTaskId;
String checkUser;
String checkTime;
Date planBeginDate;
Date planEndDate;
String latentDangerId;
String problemPointId;
Boolean hasMajorDanger;
}
......@@ -5,19 +5,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDangerDto;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import org.apache.ibatis.annotations.Delete;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
@FeignClient(value = "AMOS-LATENT-DANGER", path = "latentDanger/api/latent/danger", configuration = {FeignConfiguration.class,FeignClientErrorDecoder.class})
@FeignClient(value = "AMOS-LATENT-DANGER", path = "latentDanger/api/latent/danger", configuration =
{FeignConfiguration.class,FeignClientErrorDecoder.class})
public interface DangerFeignClient {
/**
......@@ -79,4 +82,17 @@ public interface DangerFeignClient {
*/
@DeleteMapping("/delete")
FeignClientResult<Boolean> deleteDangerBatch(@RequestParam String ids);
/**
* 根据参数获取隐患复查信息
*
* @param orgCode
* @param t1
* @param t2
* @return
*/
@GetMapping(value = "/supervision/reviewInfo")
FeignClientResult<Map<String, List<CheckReportDangerDto>>> getReviewInfoList(@RequestParam String orgCode,
@RequestParam String t1,
@RequestParam String t2);
}
......@@ -5,6 +5,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -35,4 +36,13 @@ public interface JCSFeignClient {
*/
@RequestMapping(value = "jcs/org-usr/amos/orgUserIds", method = RequestMethod.GET)
FeignClientResult getAmosIdListByUserIds(@RequestParam String orgUserIds);
/**
* 根据机场单位id批量获取各单位下的部门数量
*
* @param companyIdList 机场单位人员id
* @return
*/
@RequestMapping(value = "jcs/org-usr/amos/companyIds", method = RequestMethod.GET)
FeignClientResult<Map<String, Integer>> getDeptCountByCompanyIds(@RequestParam("companyIdList") List<String> companyIdList);
}
......@@ -9,6 +9,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
......@@ -55,6 +56,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -115,6 +117,12 @@ public class CheckServiceImpl implements ICheckService {
@Autowired
IHiddenDangerDao hiddenDangerDao;
@Autowired
IPlanService iPlanService;
@Autowired
ICheckReportService iCheckReportService;
private final int HTTP_OK_STATUS = 200;
@Value("${file.url}")
......@@ -1583,6 +1591,9 @@ public class CheckServiceImpl implements ICheckService {
saveDanger(allDanger, planTask, check, recordParam);
}
// 任务完成后生成检查报告
iCheckReportService.genCheckReport(planTask);
return checkInputItemDtoList;
} catch (Exception e) {
throw new Exception(e.getMessage(), e);
......
package com.yeejoin.amos.supervision.business.service.intfc;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import java.text.ParseException;
public interface ICheckReportService {
void genCheckReport(PlanTask planTask) throws ParseException;
/**
* 分页查询检查报告列表
*
* @param page
* @param queryParam
*/
IPage<CheckReportDto> pageList(Page page, CheckReportParamDto queryParam);
/**
* 根据报告id获取报告详情
*
* @param id
* @return
*/
CheckReportDto getDetailById(String id);
}
......@@ -17,7 +17,7 @@ ribbon.MaxAutoRetriesNextServer = 2
ribbon.MaxAutoRetries = 1
#DB properties:
spring.datasource.url = jdbc:mysql://172.16.10.66:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.url = jdbc:mysql://172.16.6.60:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.CheckReportMapper">
<select id="queryByPlanTaskId" resultType="com.yeejoin.amos.supervision.business.dto.CheckReportMapperDto">
SELECT
count( DISTINCT ptd.id ) companyCount,
ptd.task_no planTaskId,
GROUP_CONCAT( DISTINCT executor_name ) checkUser,
GROUP_CONCAT( DISTINCT c.check_time ) checkTime,
pt.begin_time planBeginDate,
pt.end_time planEndDate,
GROUP_CONCAT( DISTINCT hd.latent_danger_id ) latentDangerId,
GROUP_CONCAT( DISTINCT hd.point_id ) problemPointId,
IF
( count( DISTINCT ptd.major_danger_num ) > 0, 1, 0 ) hasMajorDanger
FROM
`p_plan_task_detail` ptd
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_hidden_danger hd ON hd.check_id = c.id
<where>
<if test="planTaskId !=null and planTaskId != ''">ptd.task_no = #{planTaskId}</if>
</where>
</select>
<select id="selectPageList" resultType="com.yeejoin.amos.supervision.core.common.dto.CheckReportDto">
select cr.*,
p.name planName,
p.check_type_name planCheckType,
p.check_level planCheckLevel
from p_check_report cr
LEFT JOIN p_plan_task pt ON pt.id = cr.plan_task_id
LEFT JOIN p_plan p ON p.id = pt.plan_id
<where>
1=1
<if test="queryParam != null and queryParam.name != null and queryParam.name != ''">
and cr.name like concat('%', #{queryParam.name}, '%')
</if>
<if test="queryParam != null and queryParam.planName != null and queryParam.planName != ''">
and p.name like concat('%', #{queryParam.planName}, '%')
</if>
<if test="queryParam != null and queryParam.planCheckType != null and queryParam.planCheckType != ''">
and p.check_type_id = #{queryParam.planCheckType}
</if>
<if test="queryParam != null and queryParam.checkLevel != null and queryParam.checkLevel != ''">
and p.check_level = #{queryParam.checkLevel}
</if>
<if test="queryParam != null and queryParam.startCheckTime != null and queryParam.startCheckTime != ''">
and cr.start_check_date <![CDATA[>=]]> #{queryParam.startCheckTime}
</if>
<if test="queryParam != null and queryParam.endCheckTime != null and queryParam.endCheckTime != ''">
and cr.end_check_date <![CDATA[<=]]> #{queryParam.endCheckTime}
</if>
<if test="queryParam != null and queryParam.checkUser != null and queryParam.checkUser != ''">
and cr.check_user like concat('%', #{queryParam.checkUser}, '%')
</if>
<if test="queryParam != null and queryParam.orgCode != null and queryParam.orgCode != ''">
and cr.org_code like concat(#{queryParam.orgCode}, '%')
</if>
</where>
order by cr.create_date desc
</select>
<select id="selectDetailById" resultType="com.yeejoin.amos.supervision.core.common.dto.CheckReportDto">
select cr.*,
p.name planName,
p.check_type_name planCheckType,
p.check_level planCheckLevel,
DATE_FORMAT(pt.begin_time, '%Y-%m-%d') startPlanTaskDate,
DATE_FORMAT(pt.end_time, '%Y-%m-%d') endPlanTaskDate
from p_check_report cr
LEFT JOIN p_plan_task pt on pt.id = cr.plan_task_id
left join p_plan p on p.id = pt.plan_id
where 1 = 1
and cr.id = #{checkReportId}
</select>
<select id="getCheckReportCompanyList"
resultType="com.yeejoin.amos.supervision.core.common.dto.CheckReportCompanyDto">
SELECT c.point_name name,
p.original_id id,
GROUP_CONCAT(DISTINCT ci.user_name) escortUser,
CASE
WHEN ci.safety_danger_num > 0 THEN
'存在隐患'
WHEN ci.is_ok = '1' THEN
'正常'
ELSE '异常'
END checkResult
FROM p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_point p ON p.id = c.point_id
WHERE c.plan_task_id = #{planTaskId}
GROUP BY c.id
</select>
</mapper>
\ No newline at end of file
......@@ -18,6 +18,9 @@
where pp.id = #{pointId}
and pt.id = #{planTaskId}
</select>
<select id="findPlanTaskDetailByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail">
select * from p_plan_task_detail where task_no = #{planTaskId}
</select>
<update id="updateDanger">
UPDATE p_plan_task_detail pptd,
......
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