Browse Source

网格员巡查功能接口

master
zhaoqifeng 4 years ago
parent
commit
5231b71caa
  1. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffPatrolInitResultDTO.java
  2. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

12
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffPatrolInitResultDTO.java

@ -31,6 +31,16 @@ public class StaffPatrolInitResultDTO implements Serializable {
* 最小时间间隔单位s默认30后面可以做成客户可配置参数
*/
private Integer carmDown;
/**
* 巡查开始时间
*/
private String patrolStartTime;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名
*/
private String gridName;
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -89,6 +89,20 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
result.setLatestSerialNum(PatrolConstant.END.equals(entity.getStatus()) ? NumConstant.ONE_NEG : detail.getSerialNum());
result.setCarmDown(NumConstant.THIRTY);
result.setPatrolStartTime(DateUtils.format(entity.getPatrolStartTime(), DateUtils.DATE_TIME_PATTERN));
//状态为巡查中时返回所在网格ID和名称
if (PatrolConstant.PATROLLING.equals(entity.getStatus())) {
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> gridResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if (!gridResult.success() || null == gridResult.getData()) {
//查询网格名称失败
log.error(String.format("查找网格信息失败,网格Id:【%s】", formDTO.getGridId()));
throw new RenException(gridResult.getCode(), gridResult.getMsg());
}
CustomerGridDTO grid = gridResult.getData();
result.setGridId(grid.getId());
result.setGridName(grid.getGridName());
}
return result;
}

Loading…
Cancel
Save