Commit f4d406ca authored by KeYong's avatar KeYong

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

parents 8a5614dd 318ca194
......@@ -37,6 +37,9 @@ public class FirefightersContractDto extends BaseDto {
@ApiModelProperty(value = "到期时间")
private Date expireTime;
@ApiModelProperty(value = "起始时间")
private Date startTime;
@ApiModelProperty(value = "服务内容")
private String serviceContent;
......
......@@ -22,7 +22,10 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
/**
* 查询全部 分页
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @param current 当前页
* @return
*/
......@@ -30,11 +33,17 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
List<FailureDetails> selectAllPage(Long current,Long size, Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/**
* 查询我发起的 分页
* current 当前页
* size 条数
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @return
*/
List<FailureDetails> selectISubPage(Long current,Long size, Long currentStatus,
......@@ -42,7 +51,10 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
/**
* 查询待处理 分页
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @param
* @return
*/
......@@ -58,7 +70,10 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
String startTime,String endTime, Integer submissionPid);
/**
* 查询待处理 维修人员分页
*
* @param currentStatus 当前任务状态
* * @param startTime 起始时间
* * @param endTime 结束时间
* * @param submissionPid 报送人
* @param
* @return
*/
......
......@@ -29,9 +29,11 @@
</if>
</where>
order by submission_time DESC limit #{current},#{size}
</select>
<select id="selectISubPage" resultType="com.yeejoin.amos.boot.module.common.api.entity.FailureDetails">
SELECT sequence_nbr,
current_status,
......
package com.yeejoin.amos.boot.module.tzs.api.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.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -43,8 +45,21 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @param workOrderNumber
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(@Param("alertCalledQueryDto") AlertCalledQueryDto alertCalledQueryDto);
Page<List<AlertCalledQueryDto>> queryAlertListByQueryDto(IPage<AlertCalledQueryDto> page,
String workOrderNumber,
String creator,
String emergency,
String emergencyTimeStart,
String emergencyTimeEnd,
String emergencyCall,
String deviceId,
String elevatorAddress,
String alertType,
String alertSource,
String alertStage,
String alertStatus,
String address);
}
package com.yeejoin.amos.boot.module.tzs.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import java.util.List;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
/**
* 警情接警填报记录接口类
......@@ -32,10 +34,22 @@ public interface IAlertCalledService {
/**
* 根据查询条件返回警情记录
* @param alertCalledQueryDto
* @param workOrderNumber
* @return
*/
List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto);
Page<AlertCalledQueryDto> queryAlertListByQueryDto(IPage<AlertCalledQueryDto> page,
@Condition(Operator.like) String workOrderNumber,
@Condition(Operator.like) String creator,
@Condition(Operator.like) String emergency,
@Condition(Operator.lt) String emergencyTimeStart,
@Condition(Operator.gt) String emergencyTimeEnd,
@Condition(Operator.like) String emergencyCall,
@Condition(Operator.like) String deviceId,
@Condition(Operator.like) String elevatorAddress,
@Condition(Operator.eq) String alertType,
@Condition(Operator.eq) String alertSource,
@Condition(Operator.eq) String alertStage,
@Condition(Operator.eq) String alertStatus);
/**
* 更新警情阶段信息
......
......@@ -145,7 +145,7 @@
</if>
</select>
<select id="queryAlertListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto">
<select id="queryAlertListByQueryDto" resultType="java.util.Map">
SELECT
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
......@@ -170,52 +170,49 @@
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.rescue_code = a.device_id
WHERE 1=1
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
AND a.work_order_number like CONCAT(CONCAT('%',#{alertCalledQueryDto.workOrderNumber}),'%')
<if test="workOrderNumber != null and workOrderNumber != ''">
AND a.work_order_number like CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if>
<if test="alertCalledQueryDto.creator != null and alertCalledQueryDto.creator != ''">
AND a.rec_user_name like CONCAT(CONCAT('%',#{alertCalledQueryDto.creator}),'%')
<if test="creator != null and creator != ''">
AND a.rec_user_name like CONCAT(CONCAT('%',#{creator}),'%')
</if>
<if test="alertCalledQueryDto.emergency != null and alertCalledQueryDto.emergency != ''">
AND a.emergency_person like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergency}),'%')
<if test="emergency != null and emergency != ''">
AND a.emergency_person like CONCAT(CONCAT('%',#{emergency}),'%')
</if>
<if test="alertCalledQueryDto.emergencyTimeStart != null ">
and #{alertCalledQueryDto.emergencyTimeStart} <![CDATA[ <= ]]> a.call_time
<if test="emergencyTimeStart != null ">
and #{emergencyTimeStart} <![CDATA[ <= ]]> a.call_time
</if>
<if test="alertCalledQueryDto.emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> #{alertCalledQueryDto.emergencyTimeEnd}
<if test="emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> #{emergencyTimeEnd}
</if>
<if test="alertCalledQueryDto.workOrderNumber != null and alertCalledQueryDto.workOrderNumber != ''">
<if test="workOrderNumber != null and workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
<if test="alertCalledQueryDto.emergencyCall != null and alertCalledQueryDto.emergencyCall != ''">
AND a.emergency_call like CONCAT(CONCAT('%',#{alertCalledQueryDto.emergencyCall}),'%')
<if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like CONCAT(CONCAT('%',#{emergencyCall}),'%')
</if>
<if test="alertCalledQueryDto.deviceId != null and alertCalledQueryDto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{alertCalledQueryDto.deviceId}),'%')
<if test="deviceId != null and deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{deviceId}),'%')
</if>
<if test="alertCalledQueryDto.elevatorAddress != null and alertCalledQueryDto.elevatorAddress != ''">
AND e.address like CONCAT(CONCAT('%',#{alertCalledQueryDto.elevatorAddress}),'%')
<if test="elevatorAddress != null and elevatorAddress != ''">
AND e.address like CONCAT(CONCAT('%',#{elevatorAddress}),'%')
</if>
<if test="alertCalledQueryDto.address != null and alertCalledQueryDto.address != ''">
AND a.region_code like CONCAT(CONCAT('%',#{alertCalledQueryDto.address}),'%')
<if test="address != null and address != ''">
AND a.region_code like CONCAT(CONCAT('%',#{address}),'%')
</if>
<if test="alertCalledQueryDto.alertType != null and alertCalledQueryDto.alertType != ''">
AND a.alarm_type_code = #{alertCalledQueryDto.alertType}
<if test="alertType != null and alertType != ''">
AND a.alarm_type_code = #{alertType}
</if>
<if test="alertCalledQueryDto.alertSource != null and alertCalledQueryDto.alertSource != ''">
AND a.alert_source_code = #{alertCalledQueryDto.alertSource}
<if test="alertSource != null and alertSource != ''">
AND a.alert_source_code = #{alertSource}
</if>
<if test="alertCalledQueryDto.alertStage != null and alertCalledQueryDto.alertStage != ''">
AND a.alert_stage_code = #{alertCalledQueryDto.alertStage}
<if test="alertStage != null and alertStage != ''">
AND a.alert_stage_code = #{alertStage}
</if>
<if test="alertCalledQueryDto.alertStatus != null and alertCalledQueryDto.alertStatus != ''">
AND a.alert_status = #{alertCalledQueryDto.alertStatus}
</if>
ORDER BY a.rec_date
<if test="alertCalledQueryDto.pageNum != null and alertCalledQueryDto.pageSize != ''">
limit #{alertCalledQueryDto.pageNum},#{alertCalledQueryDto.pageSize}
<if test="alertStatus != null and alertStatus != ''">
AND a.alert_status = #{alertStatus}
</if>
......
......@@ -6,7 +6,6 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.ApiImplicitParam;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -146,6 +145,7 @@ public class FailureDetailsController extends BaseController {
failureDetailsDtoList.add(failureDetailsDto);
});
failureDetailDTOsIPage.setRecords(failureDetailsDtoList);
failureDetailDTOsIPage.setTotal(failureDetailsIPage.getTotal());
return ResponseHelper.buildResponse(failureDetailDTOsIPage);
}
......@@ -242,4 +242,53 @@ public class FailureDetailsController extends BaseController {
}
}
/**
* Web端列表分页查询
*
* @param current 当前页
* @param size 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/weblist")
@ApiOperation(httpMethod = "GET", value = "Web端列表分页查询", notes = "Web端列表分页查询")
public ResponseModel<IPage<FailureDetailsDto>> queryForPageList(@RequestParam(value = "current") Long current, @RequestParam
(value = "size") Long size, Long currentStatus,
String submissionName,
String startTime,
String endTime,
Integer submissionBranchId,
Long sequenceNbr ) {
Page<FailureDetailsDto> page = new Page<>();
if (current > 0) {
page.setCurrent((current - 1) * size);
} else {
page.setCurrent(current);
}
page.setSize(size);
ReginParams userInfo = getSelectedOrgInfo();
IPage<FailureDetailsDto> failureDetailDTOsIPage = new Page<>();
IPage<FailureDetailsDto> failureDetailsIPage = failureDetailsServiceImpl.queryForPageList(page, userInfo,
currentStatus, startTime, endTime, submissionName,submissionBranchId,sequenceNbr);
BeanUtils.copyProperties(failureDetailsIPage, FailureDetailsDto.class);
List<FailureDetailsDto> records = failureDetailsIPage.getRecords();
List<FailureDetailsDto> failureDetailsDtoList = new ArrayList<>();
records.forEach(failureDetails -> {
FailureDetailsDto failureDetailsDto = new FailureDetailsDto();
BeanUtils.copyProperties(failureDetails, failureDetailsDto);
failureDetailsDto.setCurrentStatusName(
Constants.currentStatusNameMap.get(failureDetails.getCurrentStatus()));
failureDetailsDtoList.add(failureDetailsDto);
});
failureDetailDTOsIPage.setRecords(failureDetailsDtoList);
failureDetailDTOsIPage.setTotal(failureDetailsIPage.getTotal());
return ResponseHelper.buildResponse(failureDetailDTOsIPage);
}
}
......@@ -104,6 +104,16 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return this.queryForWaitManage(page, userInfo, currentStatus, startTime, endTime, userId);
}
/**
* web端列表查询
*/
public IPage<FailureDetailsDto> queryForPageList(Page<FailureDetailsDto> page, ReginParams userInfo, Long currentStatus,
String startTime, String endTime, String submissionName, Integer submissionBranchId,
Long sequenceNbr ) {
return queryForPage(page,"",false,currentStatus,startTime, endTime, submissionName,submissionBranchId,sequenceNbr);
}
/**
* 待处理分页查询
......@@ -239,8 +249,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Long departmentId = failureDetailsDto.getBizCode();
Date processTime = model.getSubmissionTime();
String processAuditorName = failureDetailsDto.getSubmissionName();
System.out.println(System.currentTimeMillis());
repairlog(faultId, processAuditorId, departmentId, processTime, processDepartment, processResult, processAuditorName);
if (excuteTask(instance.getString("id"), userInfo, null)) {
return true;
} else {
throw new Exception("执行流程失败");
......
......@@ -5,14 +5,9 @@ import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,14 +15,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
......@@ -38,8 +27,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
......
......@@ -5,12 +5,10 @@ import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
......
......@@ -279,7 +279,7 @@ public interface CheckMapper extends BaseMapper {
long getCheckCount(HashMap<String, Object> params);
List<HashMap<String, Object>> getChecks(HashMap<String, Object> params);
List<Map<String, Object>> getChecks(HashMap<String, Object> params);
Map<String, Object> getCheckDetail(@Param(value = "id") String id);
......
......@@ -1090,8 +1090,8 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public Page<HashMap<String, Object>> getCheckPage(HashMap<String, Object> params, CommonPageable page) {
List<HashMap<String, Object>> content = Lists.newArrayList();
public Page<Map<String, Object>> getCheckPage(HashMap<String, Object> params, CommonPageable page) {
List<Map<String, Object>> content = Lists.newArrayList();
long total = checkMapper.getCheckCount(params);
if (total == 0) {
return new PageImpl<>(content, page, total);
......@@ -1100,7 +1100,7 @@ public class CheckServiceImpl implements ICheckService {
params.put("pageSize", page.getPageSize());
content = checkMapper.getChecks(params);
if (0 < content.size()) {
for (HashMap<String, Object> map : content) {
for (Map<String, Object> map : content) {
if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
......
......@@ -258,7 +258,7 @@ public interface ICheckService {
*/
Map<String,CheckRecordDto> obtainLastCheckRecord(String[] relationId);
Page<HashMap<String, Object>> getCheckPage(HashMap<String, Object> map, CommonPageable pageable);
Page<Map<String, Object>> getCheckPage(HashMap<String, Object> map, CommonPageable pageable);
Map<String, Object> getCheckDetail(String id);
/**
......
package com.yeejoin.amos.maintenance.jpush;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.model.PushPayload;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.param.PushMsgParam;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -7,23 +11,17 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.param.PushMsgParam;
import cn.jpush.api.JPushClient;
import cn.jpush.api.push.model.PushPayload;
@Service
public class AppMessagePushService {
protected static final Logger log = LoggerFactory
.getLogger(AppMessagePushService.class);
@Autowired
private com.yeejoin.amos.maintenance.feign.PushFeign PushFeign;
protected static final Logger log = LoggerFactory
.getLogger(AppMessagePushService.class);
@Autowired
private com.yeejoin.amos.maintenance.feign.PushFeign PushFeign;
// private static String APP_KEY;
//
// private static String MASTER_SECRET;
......@@ -36,20 +34,21 @@ public class AppMessagePushService {
// public void setMasterSecret(String masterSecret) {
// this.MASTER_SECRET = masterSecret;
// }
@Value("${params.isPush}")
private String isPush;
protected static final String APP_KEY = "1b3f7b961200f4b236811dfe";
protected static final String MASTER_SECRET = "8b650e645fb3a43c96be02b2";
//
private static JPushClient jpushClient = new JPushClient(MASTER_SECRET,
APP_KEY);
public static String buildJpushUserKey(String userId) {
return XJConstant.JPUSH_USER_KEY + "_" + userId;
}
@Value("${params.isPush}")
private String isPush;
protected static final String APP_KEY = "1b3f7b961200f4b236811dfe";
protected static final String MASTER_SECRET = "8b650e645fb3a43c96be02b2";
//
private static JPushClient jpushClient = new JPushClient(MASTER_SECRET,
APP_KEY);
public static String buildJpushUserKey(String userId) {
return XJConstant.JPUSH_USER_KEY + "_" + userId;
}
// private static JPushClient jpushClient = null;
//
// public static JPushClient getJPushClient(String APP_KEY, String MASTER_SECRET) {
......@@ -61,29 +60,29 @@ public class AppMessagePushService {
// }
/*public void sendMessage(List<PushMsgParam> responses)
{
PushFeign.sendMessage(responses);
try
{
if(responses!=null && "true".equals(isPush))
{
for(PushMsgParam response:responses)
{
PushPayload payload = buildPushPayload(response);
jpushClient.sendPush(payload);
}
}
}
catch (Exception e){
log.error(e.getMessage(),e);
e.printStackTrace();
}
}
/*public void sendMessage(List<PushMsgParam> responses)
{
PushFeign.sendMessage(responses);
try
{
if(responses!=null && "true".equals(isPush))
{
for(PushMsgParam response:responses)
{
PushPayload payload = buildPushPayload(response);
jpushClient.sendPush(payload);
}
}
}
catch (Exception e){
log.error(e.getMessage(),e);
e.printStackTrace();
}
}
*/
private PushPayload buildPushPayload(PushMsgParam response) {
CommonResponse commonResponse = PushFeign.buildPushPayload(response);
return (PushPayload)commonResponse.getDataList();
private PushPayload buildPushPayload(PushMsgParam response) {
CommonResponse commonResponse = PushFeign.buildPushPayload(response);
return (PushPayload) commonResponse.getDataList();
/*if(JPushTypeEnum.ALL.getCode().equals(response.getType())){
return PushPayload.newBuilder()
.setPlatform(Platform.android())
......@@ -102,19 +101,19 @@ public class AppMessagePushService {
.build();
}*/
}
public void sendMessage(PushMsgParam response){
try {
if(null!=response && "true".equals(isPush)){
CommonResponse commonResponse = PushFeign.sendMessageone(response);
}
} catch (Exception e) {
log.error(e.getMessage(),e);
e.printStackTrace();
}
}
}
public void sendMessage(PushMsgParam response) {
try {
if (null != response && "true".equals(isPush)) {
CommonResponse commonResponse = PushFeign.sendMessageone(response);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
e.printStackTrace();
}
}
}
......@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
import com.baomidou.mybatisplus.core.toolkit.SystemClock;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -17,13 +16,9 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl;
......@@ -41,7 +36,6 @@ 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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -53,7 +47,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -277,33 +270,85 @@ public class AlertCalledController extends BaseController {
queryWrapper.orderByDesc("call_time");
queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
if(null != alertCalled.getCallTimeStart() && null != alertCalled.getCallTimeEnd()) {
queryWrapper.between("call_time", alertCalled.getCallTimeStart(),
alertCalled.getCallTimeEnd().getTime());
} else {
queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
}
if (alertCalled.getIsFatherAlert()) { // 0:接警;1:处警
queryWrapper.isNull("father_alert");
}
if(ValidationUtil.isEmpty(alertCalled.getType())) {
queryWrapper.eq("type",alertCalled.getType());
}
if(ValidationUtil.isEmpty(alertCalled.getAlarmType())) {
queryWrapper.eq("alarm_type",alertCalled.getAlarmType());
}
if(ValidationUtil.isEmpty(alertCalled.getAlertSource())) {
queryWrapper.eq("alert_source",alertCalled.getAlertSource());
}
return queryWrapper;
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录")
@PostMapping("/selectRecord")
public ResponseModel<Page<AlertCalledQueryDto>> queryAlertCalledByPager(@RequestBody AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
@GetMapping("/selectRecord")
public ResponseModel<Page<AlertCalledQueryDto>> queryAlertCalledByPager(AlertCalledQueryDto alertCalledQueryDto,
@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize) {
Page<AlertCalledQueryDto> page = new Page<AlertCalledQueryDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<AlertCalledQueryDto> pageBean = iAlertCalledService.queryAlertListByQueryDto(
page,
alertCalledQueryDto.getWorkOrderNumber(),
alertCalledQueryDto.getCreator(),
alertCalledQueryDto.getEmergency(),
alertCalledQueryDto.getEmergencyTimeStart() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeStart()),
alertCalledQueryDto.getEmergencyTimeEnd() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeEnd()),
alertCalledQueryDto.getEmergencyCall(),
alertCalledQueryDto.getDeviceId(),
alertCalledQueryDto.getElevatorAddress(),
alertCalledQueryDto.getAlertType(),
alertCalledQueryDto.getAlertSource(),
alertCalledQueryDto.getAlertStage(),
alertCalledQueryDto.getAlertStatus());
Page<AlertCalledQueryDto> result = new Page<AlertCalledQueryDto>(alertCalledQueryDto.getPageNum(), alertCalledQueryDto.getPageSize());
long totle = list.size();
result.setRecords(list);
long totle = pageBean.getTotal();
result.setRecords(pageBean.getRecords());
result.setTotal(totle);
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@PostMapping("/exportSelectRecord")
public void exportAlertCalled(@RequestBody AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledQueryDto> list = iAlertCalledService.queryAlertListByQueryDto(alertCalledQueryDto);
@GetMapping("/exportSelectRecord")
public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
Page<AlertCalledQueryDto> page = new Page<AlertCalledQueryDto>();
Page<AlertCalledQueryDto> pageBean = iAlertCalledService.queryAlertListByQueryDto(
page,
alertCalledQueryDto.getWorkOrderNumber(),
alertCalledQueryDto.getCreator(),
alertCalledQueryDto.getEmergency(),
alertCalledQueryDto.getEmergencyTimeStart() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeStart()),
alertCalledQueryDto.getEmergencyTimeEnd() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeEnd()),
alertCalledQueryDto.getEmergencyCall(),
alertCalledQueryDto.getDeviceId(),
alertCalledQueryDto.getElevatorAddress(),
alertCalledQueryDto.getAlertType(),
alertCalledQueryDto.getAlertSource(),
alertCalledQueryDto.getAlertStage(),
alertCalledQueryDto.getAlertStatus());
List<AlertCalledQueryDto> list = pageBean.getRecords();
String fileName = "警情事件记录" + System.currentTimeMillis();
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list,
AlertCalledQueryDto.class, null, false);
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -27,6 +30,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
......@@ -148,9 +153,32 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
}
@Override
public List<AlertCalledQueryDto> queryAlertListByQueryDto(AlertCalledQueryDto alertCalledQueryDto) {
List<AlertCalledQueryDto> list = alertCalledMapper.queryAlertListByQueryDto(alertCalledQueryDto);
return list;
public Page<AlertCalledQueryDto> queryAlertListByQueryDto(IPage<AlertCalledQueryDto> page,
@Condition(Operator.like) String workOrderNumber,
@Condition(Operator.like) String creator,
@Condition(Operator.like) String emergency,
@Condition(Operator.gt) String emergencyTimeStart,
@Condition(Operator.lt) String emergencyTimeEnd,
@Condition(Operator.like) String emergencyCall,
@Condition(Operator.like) String deviceId,
@Condition(Operator.like) String elevatorAddress,
@Condition(Operator.eq) String alertType,
@Condition(Operator.eq) String alertSource,
@Condition(Operator.eq) String alertStage,
@Condition(Operator.eq) String alertStatus
) {
Page<List<AlertCalledQueryDto>>list = alertCalledMapper.queryAlertListByQueryDto(
page,workOrderNumber,creator,emergency,emergencyTimeStart,
emergencyTimeEnd,emergencyCall,deviceId,elevatorAddress,alertType,
alertSource,alertStage,alertStatus,null);
Page<AlertCalledQueryDto> page1 = new Page<>();
List<AlertCalledQueryDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(list.getRecords()),AlertCalledQueryDto.class);
page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize());
page1.setTotal(list.getTotal());
page1.setRecords(resultDtoList);
return page1;
}
@Override
......
......@@ -103,7 +103,7 @@
<not>
<columnExists tableName="cb_firefighters_contract" columnName="start_time"/>
</not>
</preConditions>
</preConditions>
<comment>modify table cb_firefighters_contract add one columns</comment>
<sql>
ALTER TABLE `cb_firefighters_contract` ADD start_time date COMMENT '起始时间';
......
......@@ -1912,12 +1912,13 @@
pp.belong_system_name systemName,
pp.address address,
pp.original_id equipId,
CONCAT(pp.address, pp.building_name) buildingName,
CONCAT_WS('',pp.building_name,pp.address) buildingName,
pc.org_code AS orgCode
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
) a
<include refid="mobile-check-record-where" />
order by checkDate
limit #{offset},#{pageSize}
</select>
......@@ -1947,20 +1948,20 @@
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{beginTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
a.checkDate <![CDATA[>=]]> #{beginTime}
AND a.checkDate <![CDATA[<=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
a.checkDate <![CDATA[<=]]> #{endTime}
AND a.checkDate <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{beginTime}
AND a.endTime <![CDATA[>]]> #{beginTime}
a.checkDate <![CDATA[<=]]> #{beginTime}
AND a.checkDate <![CDATA[>]]> #{beginTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{beginTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
a.checkDate <![CDATA[<=]]> #{beginTime}
AND a.checkDate <![CDATA[>=]]> #{endTime}
)
)
</if>
......@@ -2013,7 +2014,7 @@
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.address address,
CONCAT(pp.address, pp.building_name) buildingName,
CONCAT_WS('',pp.building_name,pp.address) buildingName,
pc.org_code AS orgCode
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
......
......@@ -26,7 +26,7 @@
<springboot.version>2.3.11.RELEASE</springboot.version>
<springcloud.version>Hoxton.SR8</springcloud.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<tyboot-version>1.1.20Ty-SNAPSHOT</tyboot-version>
<tyboot-version>1.1.20</tyboot-version>
<amos.version>1.6.0</amos.version>
<itext.version>7.1.1</itext.version>
</properties>
......
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