【admin】新增&优化 # 1、优化数据大屏设备列表、巡检单列表、检修员列表 2、优化后台管理设备列表 3、新增数据大屏巡检单统计、检修单统计
parent
eacfc63a15
commit
27b199adfe
|
@ -133,7 +133,7 @@ public class LargeDataScreenController {
|
|||
@GetMapping("/equipmentList")
|
||||
public Object equipmentList(@Validated PageParam pageParam,
|
||||
@RequestParam Map<String, String> params) {
|
||||
PageResult<EquipmentListVo> list = iEquipmentService.list(pageParam, params);
|
||||
PageResult<EquipmentListVo> list = iEquipmentService.largeDataList(pageParam, params);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
@ -182,8 +182,20 @@ public class LargeDataScreenController {
|
|||
* @return Object
|
||||
*/
|
||||
@GetMapping("/routingInspectionOrderStats")
|
||||
public Object routingInspectionOrdeStatsr(int orderStastic) {
|
||||
public Object routingInspectionOrdeStatsr(Integer orderStastic) {
|
||||
LargeDataVo largeDataVo = iLargeDataScreenService.routingInspectionOrdeStatsr(orderStastic);
|
||||
return AjaxResult.success(largeDataVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检修订单统计
|
||||
*
|
||||
* @author hcy
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/maintenanceOrderStats")
|
||||
public Object maintenanceOrdeStatsr(Integer orderStastic) {
|
||||
LargeDataVo largeDataVo = iLargeDataScreenService.maintenanceOrderStats(orderStastic);
|
||||
return AjaxResult.success(largeDataVo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,4 +84,12 @@ public interface IEquipmentService {
|
|||
* @return 结果
|
||||
*/
|
||||
Boolean checkEquipmentNumberUnique(EquipmentParam bo);
|
||||
|
||||
/**
|
||||
* 数据大屏设备列表
|
||||
* @param pageParam
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
PageResult<EquipmentListVo> largeDataList(PageParam pageParam, Map<String, String> params);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ 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.hcy.admin.service.client.IEquipmentService;
|
||||
import com.hcy.admin.service.region.IDevRegionService;
|
||||
import com.hcy.admin.validate.common.PageParam;
|
||||
import com.hcy.admin.validate.client.EquipmentParam;
|
||||
import com.hcy.admin.vo.client.EquipmentListVo;
|
||||
|
@ -38,6 +39,9 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
|||
@Resource
|
||||
ClientMapper clientMapper;
|
||||
|
||||
@Resource
|
||||
IDevRegionService regionService;
|
||||
|
||||
/**
|
||||
* 设备管理列表
|
||||
*
|
||||
|
@ -65,12 +69,15 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
|||
});
|
||||
|
||||
IPage<Equipment> iPage = equipmentMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
||||
Map<Long, String> regionMap = regionService.getRegionMap();//获取省市区
|
||||
|
||||
List<EquipmentListVo> list = new LinkedList<>();
|
||||
for(Equipment item : iPage.getRecords()) {
|
||||
EquipmentListVo vo = new EquipmentListVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
|
||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||
vo.setCity(regionMap.get(vo.getCityId()));
|
||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
||||
list.add(vo);
|
||||
}
|
||||
|
@ -94,9 +101,12 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
|||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在");
|
||||
|
||||
Map<Long, String> regionMap = regionService.getRegionMap();//获取省市区
|
||||
EquipmentDetailVo vo = new EquipmentDetailVo();
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||
vo.setCity(regionMap.get(vo.getCityId()));
|
||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -335,4 +345,39 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据大屏设备列表
|
||||
*
|
||||
* @author hcy
|
||||
* @param pageParam 分页参数
|
||||
* @param params 搜索参数
|
||||
* @return PageResult<EquipmentListVo>
|
||||
*/
|
||||
@Override
|
||||
public PageResult<EquipmentListVo> largeDataList(PageParam pageParam, Map<String, String> params) {
|
||||
Integer page = pageParam.getPageNo();
|
||||
Integer limit = pageParam.getPageSize();
|
||||
|
||||
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_delete", 0);
|
||||
queryWrapper.in("device_status", 1,2,3);
|
||||
queryWrapper.orderByDesc("id");
|
||||
|
||||
IPage<Equipment> iPage = equipmentMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
||||
Map<Long, String> regionMap = regionService.getRegionMap();//获取省市区
|
||||
|
||||
List<EquipmentListVo> list = new LinkedList<>();
|
||||
for(Equipment item : iPage.getRecords()) {
|
||||
EquipmentListVo vo = new EquipmentListVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||
vo.setCity(regionMap.get(vo.getCityId()));
|
||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,5 +55,12 @@ public interface ILargeDataScreenService {
|
|||
* @param orderStastic
|
||||
* @return
|
||||
*/
|
||||
LargeDataVo routingInspectionOrdeStatsr(int orderStastic);
|
||||
LargeDataVo routingInspectionOrdeStatsr(Integer orderStastic);
|
||||
|
||||
/**
|
||||
* 检修单统计
|
||||
* @param orderStastic
|
||||
* @return
|
||||
*/
|
||||
LargeDataVo maintenanceOrderStats(Integer orderStastic);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.hcy.admin.service.largeDataScreen.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.hcy.admin.service.largeDataScreen.ILargeDataScreenService;
|
||||
import com.hcy.admin.service.region.IDevRegionService;
|
||||
import com.hcy.admin.vo.client.EquipmentListVo;
|
||||
import com.hcy.admin.vo.largeData.EquipmentLargeDataVo;
|
||||
import com.hcy.admin.vo.largeData.LargeDataVo;
|
||||
|
@ -13,7 +14,10 @@ import com.hcy.common.entity.client.Client;
|
|||
import com.hcy.common.entity.client.Equipment;
|
||||
import com.hcy.common.entity.order.MaintenanceOrder;
|
||||
import com.hcy.common.entity.order.RoutingInspectionOrder;
|
||||
import com.hcy.common.enums.order.MaintenanceOrderStatusEnum;
|
||||
import com.hcy.common.enums.order.OrderStateEnum;
|
||||
import com.hcy.common.enums.equipment.EquipmentStateEnum;
|
||||
|
||||
import com.hcy.common.mapper.client.ClientMapper;
|
||||
import com.hcy.common.mapper.client.EquipmentMapper;
|
||||
import com.hcy.common.mapper.order.MaintenanceOrderMapper;
|
||||
|
@ -23,6 +27,7 @@ import com.hcy.common.mapper.user.UserMapper;
|
|||
import com.hcy.common.utils.TimeUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Timestamp;
|
||||
|
@ -31,6 +36,7 @@ import java.time.LocalTime;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 数据大屏管理实现类
|
||||
|
@ -56,6 +62,9 @@ public class LargeDataScreenServiceImpl implements ILargeDataScreenService {
|
|||
@Resource
|
||||
UserMapper userMapper;
|
||||
|
||||
@Resource
|
||||
IDevRegionService regionService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有设备对应状态的数量
|
||||
|
@ -188,9 +197,14 @@ public class LargeDataScreenServiceImpl implements ILargeDataScreenService {
|
|||
public List<UserLargeDataVo> reconditionList() {
|
||||
List<UserLargeDataDto> userLargeDataDtos = userMapper.reconditionList();
|
||||
List<UserLargeDataVo> list = new ArrayList<>();
|
||||
Map<Long, String> regionMap = regionService.getRegionMap();//获取省市区
|
||||
|
||||
for (UserLargeDataDto userLargeDataDto : userLargeDataDtos) {
|
||||
UserLargeDataVo vo = new UserLargeDataVo();
|
||||
BeanUtils.copyProperties(userLargeDataDto, vo);
|
||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||
vo.setCity(regionMap.get(vo.getCityId()));
|
||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||
list.add(vo);
|
||||
}
|
||||
return list;
|
||||
|
@ -203,24 +217,127 @@ public class LargeDataScreenServiceImpl implements ILargeDataScreenService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LargeDataVo routingInspectionOrdeStatsr(int orderStastic) {
|
||||
public LargeDataVo routingInspectionOrdeStatsr(Integer orderStastic) {
|
||||
//orderStastic 工单统计 0=日 1=月 2=年
|
||||
//今日
|
||||
LocalDateTime startTime = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MIN);
|
||||
LocalDateTime endTime = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MAX);
|
||||
//当月
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime monthStartTime = now.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
||||
LocalDateTime monthEndTime = now.withHour(23).withMinute(59).withSecond(59);
|
||||
LocalDateTime startTime = null;
|
||||
LocalDateTime endTime = null;
|
||||
|
||||
Assert.notNull(orderStastic, "orderStastic数据不能为空");
|
||||
|
||||
if(orderStastic == 0){
|
||||
//今日
|
||||
startTime = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MIN);
|
||||
endTime = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MAX);
|
||||
}else if(orderStastic == 1){
|
||||
//当月
|
||||
startTime = now.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
||||
endTime = now.withHour(23).withMinute(59).withSecond(59);
|
||||
}else if(orderStastic == 2){
|
||||
//当前年份
|
||||
startTime = now.withDayOfYear(1).withHour(0).withMinute(0).withSecond(0);
|
||||
endTime = now.withHour(23).withMinute(59).withSecond(59);
|
||||
}
|
||||
|
||||
//获取巡检订单总数
|
||||
Integer routingInspectionOrderCount = routingInspectionOrderMapper.selectCount(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("is_delete", 0));
|
||||
.eq("is_delete", 0)
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
//orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
//获取已完成订单总数
|
||||
Integer doneOrderCount = routingInspectionOrderMapper.selectCount(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("order_status", OrderStateEnum.COMPLETED.getStatus())
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
//获取巡检中订单总数
|
||||
Integer underOverhaulOrderCount = routingInspectionOrderMapper.selectCount(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("order_status", OrderStateEnum.DURING_INSPECTION.getStatus())
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
//获取待巡检订单总数
|
||||
Integer underWarrantyOrderCount = routingInspectionOrderMapper.selectCount(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("order_status", OrderStateEnum.TO_BE_INSPECTED.getStatus())
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
LargeDataVo vo = new LargeDataVo();
|
||||
vo.setOrderSum(routingInspectionOrderCount); //工单总数
|
||||
vo.setDoneOrderSum(doneOrderCount); //已完成订单数
|
||||
vo.setUnderOverhaulOrderSum(underOverhaulOrderCount); //巡检中订单数
|
||||
vo.setUnderWarrantyOrderSum(underWarrantyOrderCount); //待巡检订单数
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检修单统计
|
||||
*
|
||||
* @param orderStastic
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LargeDataVo maintenanceOrderStats(Integer orderStastic) {
|
||||
//orderStastic 工单统计 0=日 1=月 2=年
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
LocalDateTime startTime = null;
|
||||
LocalDateTime endTime = null;
|
||||
|
||||
Assert.notNull(orderStastic, "orderStastic数据不能为空");
|
||||
|
||||
if(orderStastic == 0){
|
||||
//今日
|
||||
startTime = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MIN);
|
||||
endTime = LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MAX);
|
||||
}else if(orderStastic == 1){
|
||||
//当月
|
||||
startTime = now.withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0);
|
||||
endTime = now.withHour(23).withMinute(59).withSecond(59);
|
||||
}else if(orderStastic == 2){
|
||||
//当前年份
|
||||
startTime = now.withDayOfYear(1).withHour(0).withMinute(0).withSecond(0);
|
||||
endTime = now.withHour(23).withMinute(59).withSecond(59);
|
||||
}
|
||||
|
||||
//获取巡检订单总数
|
||||
Integer routingInspectionOrderCount = maintenanceOrderMapper.selectCount(
|
||||
new QueryWrapper<MaintenanceOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
//orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-检测中;4-待客户确认;5-维修中;6-已完成;7-已退单;8-已关闭
|
||||
//获取已完成订单总数
|
||||
Integer doneOrderCount = maintenanceOrderMapper.selectCount(
|
||||
new QueryWrapper<MaintenanceOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("order_status", MaintenanceOrderStatusEnum.FINISHED.getStatus())
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
//获取检修中订单总数
|
||||
//获取保修中订单总数
|
||||
return null;
|
||||
Integer underOverhaulOrderCount = maintenanceOrderMapper.selectCount(
|
||||
new QueryWrapper<MaintenanceOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("order_status", MaintenanceOrderStatusEnum.CHECKING.getStatus())
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
//获取报修中订单总数
|
||||
Integer underWarrantyOrderCount = maintenanceOrderMapper.selectCount(
|
||||
new QueryWrapper<MaintenanceOrder>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("order_status", MaintenanceOrderStatusEnum.MAINTENANCE_ING.getStatus())
|
||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||
LargeDataVo vo = new LargeDataVo();
|
||||
vo.setOrderSum(routingInspectionOrderCount); //工单总数
|
||||
vo.setDoneOrderSum(doneOrderCount); //已完成订单数
|
||||
vo.setUnderOverhaulOrderSum(underOverhaulOrderCount); //检修中订单数
|
||||
vo.setUnderWarrantyOrderSum(underWarrantyOrderCount); //报修中订单数
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@ public class EquipmentDetailVo implements Serializable {
|
|||
private Long provinceId; // 省id
|
||||
private Long districtId; // 区id
|
||||
private Long cityId; // 市id
|
||||
private String province;// 省
|
||||
private String city;// 市
|
||||
private String district;// 区
|
||||
private String detailedAddress; // 详细地址
|
||||
private Integer inspectionCycle; // 巡检周期方式(0=天数间隔,1=固定日期)
|
||||
private Integer dailyAudit; // 每隔几天巡检
|
||||
|
|
|
@ -39,5 +39,11 @@ public class UserLargeDataVo implements Serializable {
|
|||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||
private String longitude; // 经度
|
||||
private String latitude; // 纬度
|
||||
|
||||
private String technicalGrade; // 技术等级
|
||||
private Long provinceId; //省id
|
||||
private Long cityId; //市id
|
||||
private Long districtId; //区id
|
||||
private String province; //省
|
||||
private String city; //市
|
||||
private String district; //区
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
|||
private Date createTime; // 创建时间
|
||||
private Long faultId; // 故障id
|
||||
private String familiarFaultName; //故障类型
|
||||
private String faultDescription; // 故障描述
|
||||
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long receiverId; // 接单人id
|
||||
private String receiverName; // 接单人名称
|
||||
|
|
|
@ -39,5 +39,11 @@ public class UserLargeDataDto implements Serializable {
|
|||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||
private String longitude; // 经度
|
||||
private String latitude; // 纬度
|
||||
|
||||
private String technicalGrade; // 技术等级
|
||||
private Long provinceId; //省id
|
||||
private Long cityId; //市id
|
||||
private Long districtId; //区id
|
||||
private String province; //省
|
||||
private String city; //市
|
||||
private String district; //区
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
<select id="reconditionList" resultType="com.hcy.common.dto.result.UserLargeDataDto">
|
||||
SELECT
|
||||
u.*
|
||||
u.* ,aa.technical_grade,aa.province_id,aa.city_id,aa.district_id
|
||||
FROM
|
||||
la_user AS u
|
||||
JOIN la_system_auth_admin AS aa ON aa.user_id = u.id
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
<select id="reconditionList" resultType="com.hcy.common.dto.result.UserLargeDataDto">
|
||||
SELECT
|
||||
u.*
|
||||
u.* ,aa.technical_grade,aa.province_id,aa.city_id,aa.district_id
|
||||
FROM
|
||||
la_user AS u
|
||||
JOIN la_system_auth_admin AS aa ON aa.user_id = u.id
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.hcy.front.controller;
|
||||
|
||||
|
||||
import com.hcy.common.core.AjaxResult;
|
||||
|
||||
import com.hcy.common.validator.annotation.IDMust;
|
||||
import com.hcy.front.service.client.IEquipmentService;
|
||||
import com.hcy.front.vo.client.EquipmentDetailVo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* 设备管理管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("api/equipment")
|
||||
public class EquipmentController {
|
||||
|
||||
@Resource
|
||||
IEquipmentService iEquipmentService;
|
||||
|
||||
/**
|
||||
* 设备管理详情
|
||||
*
|
||||
* @author hcy
|
||||
* @param number 主键ID
|
||||
* @return Object
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public Object detail(@Validated @IDMust() @RequestParam("number") String number) {
|
||||
EquipmentDetailVo detail = iEquipmentService.detail(number);
|
||||
return AjaxResult.success(detail);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.hcy.front.service.client;
|
||||
|
||||
|
||||
import com.hcy.front.vo.client.EquipmentDetailVo;
|
||||
|
||||
/**
|
||||
* 设备管理服务接口类
|
||||
*/
|
||||
public interface IEquipmentService {
|
||||
|
||||
/**
|
||||
* 设备管理详情
|
||||
*
|
||||
* @author hcy
|
||||
* @param number 主键ID
|
||||
* @return Equipment
|
||||
*/
|
||||
EquipmentDetailVo detail(String number);
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.hcy.front.service.client.impl;
|
||||
|
||||
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.hcy.common.core.PageResult;
|
||||
import com.hcy.common.entity.client.Client;
|
||||
import com.hcy.common.entity.client.Equipment;
|
||||
import com.hcy.common.enums.equipment.EquipmentStateEnum;
|
||||
import com.hcy.common.mapper.client.ClientMapper;
|
||||
import com.hcy.common.mapper.client.EquipmentMapper;
|
||||
import com.hcy.common.utils.StringUtil;
|
||||
import com.hcy.common.utils.TimeUtil;
|
||||
import com.hcy.front.service.client.IEquipmentService;
|
||||
import com.hcy.front.service.region.IDevRegionService;
|
||||
import com.hcy.front.vo.client.EquipmentDetailVo;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备管理实现类
|
||||
*/
|
||||
@Service
|
||||
public class EquipmentServiceImpl implements IEquipmentService {
|
||||
|
||||
@Resource
|
||||
EquipmentMapper equipmentMapper;
|
||||
|
||||
@Resource
|
||||
private IDevRegionService regionService;
|
||||
|
||||
@Resource
|
||||
ClientMapper clientMapper;
|
||||
|
||||
/**
|
||||
* 设备管理详情
|
||||
*
|
||||
* @author hcy
|
||||
* @param id 主键参数
|
||||
* @return Equipment
|
||||
*/
|
||||
@Override
|
||||
public EquipmentDetailVo detail(String number) {
|
||||
Equipment model = equipmentMapper.selectOne(
|
||||
new QueryWrapper<Equipment>()
|
||||
.eq("number", number)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在");
|
||||
Map<Long, String> regionMap = regionService.getRegionMap();
|
||||
EquipmentDetailVo vo = new EquipmentDetailVo();
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||
vo.setCity(regionMap.get(vo.getCityId()));
|
||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||
return vo;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.hcy.front.vo.client;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* EquipmentVo
|
||||
*/
|
||||
@Data
|
||||
public class EquipmentDetailVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id; // 主键id
|
||||
private Long clientId; // 客户id
|
||||
private Long moduleId; // 模块id
|
||||
private String number; // 设备编号
|
||||
private String name; // 设备名称
|
||||
private String model; // 设备型号
|
||||
private String manufacturers; // 设备厂家
|
||||
private String specification; // 设备规格
|
||||
private Integer deviceStatus; // 设备状态(0=停用,1=正常,2=保修中,3=检修中)
|
||||
private String longitude; // 经度
|
||||
private String latitude; // 纬度
|
||||
private Long provinceId; // 省id
|
||||
private Long cityId; // 市id
|
||||
private Long districtId; // 区id
|
||||
private String province;// 省
|
||||
private String city;// 市
|
||||
private String district;// 区
|
||||
private String detailedAddress; // 详细地址
|
||||
private Integer inspectionCycle; // 巡检周期方式(0=天数间隔,1=固定日期)
|
||||
private Integer dailyAudit; // 每隔几天巡检
|
||||
private String deviceCode; // 设备码
|
||||
private String clientName; // 客户名称
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.hcy.front.vo.client;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* EquipmentVo
|
||||
*/
|
||||
@Data
|
||||
public class EquipmentListVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id; // 主键id
|
||||
private Long clientId; // 客户id
|
||||
private Long moduleId; // 模块id
|
||||
private String number; // 设备编号
|
||||
private String name; // 设备名称
|
||||
private String model; // 设备型号
|
||||
private String manufacturers; // 设备厂家
|
||||
private String specification; // 设备规格
|
||||
private Integer deviceStatus; // 设备状态(0=停用,1=正常,2=保修中,3=检修中)
|
||||
private String longitude; // 经度
|
||||
private String latitude; // 纬度
|
||||
private Long provinceId; // 省id
|
||||
private Long districtId; // 区id
|
||||
private Long cityId; // 市id
|
||||
private String province; //省
|
||||
private String city; //市
|
||||
private String district; //区
|
||||
private String detailedAddress; // 详细地址
|
||||
private Integer inspectionCycle; // 巡检周期方式(0=天数间隔,1=固定日期)
|
||||
private Integer dailyAudit; // 每隔几天巡检
|
||||
private String deviceCode; // 设备码
|
||||
private String createTime; // 创建时间
|
||||
private String clientName; // 客户名称
|
||||
}
|
Loading…
Reference in New Issue