【admin】优化# 1、优化数据大屏设备列表根据用户id进行查询 2、优化数据大屏巡检单汇总、检修单汇总 3、优化大屏设备列表 4、优化小程序巡检单的工单池 5、优化小程序的巡检单列表,根据是否客户 0-客户端 1-检修员端进行查询 6、pc端system/admin/list接口添加返回一下工单状态 7、优化后台管理设备列表
parent
319e395a65
commit
416c12469e
|
@ -78,6 +78,14 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||||
vo.setCity(regionMap.get(vo.getCityId()));
|
vo.setCity(regionMap.get(vo.getCityId()));
|
||||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||||
|
//获取客户名称
|
||||||
|
Client client = clientMapper.selectOne(
|
||||||
|
new QueryWrapper<Client>()
|
||||||
|
.eq("id", item.getClientId())
|
||||||
|
.last("limit 1"));
|
||||||
|
if (client != null){
|
||||||
|
vo.setClientName(client.getClientName());
|
||||||
|
}
|
||||||
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
||||||
list.add(vo);
|
list.add(vo);
|
||||||
}
|
}
|
||||||
|
@ -122,14 +130,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
|
|
||||||
model.setNumber(equipmentParam.getNumber());
|
model.setNumber(equipmentParam.getNumber());
|
||||||
model.setClientId(equipmentParam.getClientId());//客户id
|
model.setClientId(equipmentParam.getClientId());//客户id
|
||||||
Client client = clientMapper.selectOne(
|
|
||||||
new QueryWrapper<Client>()
|
|
||||||
.eq("id", equipmentParam.getClientId())
|
|
||||||
.eq("is_delete", 0)
|
|
||||||
.last("limit 1"));
|
|
||||||
if (client != null){
|
|
||||||
model.setClientName(client.getClientName());
|
|
||||||
}
|
|
||||||
model.setName(equipmentParam.getName());
|
model.setName(equipmentParam.getName());
|
||||||
model.setModel(equipmentParam.getModel()); // 设备型号
|
model.setModel(equipmentParam.getModel()); // 设备型号
|
||||||
model.setManufacturers(equipmentParam.getManufacturers()); // 设备厂家
|
model.setManufacturers(equipmentParam.getManufacturers()); // 设备厂家
|
||||||
|
@ -166,14 +166,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
|
|
||||||
model.setId(equipmentParam.getId());
|
model.setId(equipmentParam.getId());
|
||||||
model.setClientId(equipmentParam.getClientId());
|
model.setClientId(equipmentParam.getClientId());
|
||||||
Client client = clientMapper.selectOne(
|
|
||||||
new QueryWrapper<Client>()
|
|
||||||
.eq("id", equipmentParam.getClientId())
|
|
||||||
.eq("is_delete", 0)
|
|
||||||
.last("limit 1"));
|
|
||||||
if (client != null){
|
|
||||||
model.setClientName(client.getClientName());
|
|
||||||
}
|
|
||||||
model.setModuleId(equipmentParam.getModuleId());
|
model.setModuleId(equipmentParam.getModuleId());
|
||||||
model.setNumber(equipmentParam.getNumber());
|
model.setNumber(equipmentParam.getNumber());
|
||||||
model.setName(equipmentParam.getName());
|
model.setName(equipmentParam.getName());
|
||||||
|
@ -256,14 +248,6 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
|
|
||||||
for (Equipment equipment : modelList) {
|
for (Equipment equipment : modelList) {
|
||||||
equipment.setClientId(equipmentParam.getClientId());//客户id
|
equipment.setClientId(equipmentParam.getClientId());//客户id
|
||||||
Client client = clientMapper.selectOne(
|
|
||||||
new QueryWrapper<Client>()
|
|
||||||
.eq("id", equipment.getClientId())
|
|
||||||
.eq("is_delete", 0)
|
|
||||||
.last("limit 1"));
|
|
||||||
if (client != null){
|
|
||||||
equipment.setClientName(client.getClientName());
|
|
||||||
}
|
|
||||||
equipment.setUpdateTime(System.currentTimeMillis() / 1000);
|
equipment.setUpdateTime(System.currentTimeMillis() / 1000);
|
||||||
equipmentMapper.updateById(equipment);
|
equipmentMapper.updateById(equipment);
|
||||||
}
|
}
|
||||||
|
@ -360,6 +344,9 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
Integer limit = pageParam.getPageSize();
|
Integer limit = pageParam.getPageSize();
|
||||||
|
|
||||||
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>();
|
||||||
|
if(params.get("clientId") != null){
|
||||||
|
queryWrapper.eq("client_id", Long.parseLong(params.get("clientId")));
|
||||||
|
}
|
||||||
queryWrapper.eq("is_delete", 0);
|
queryWrapper.eq("is_delete", 0);
|
||||||
queryWrapper.in("device_status", 1,2,3);
|
queryWrapper.in("device_status", 1,2,3);
|
||||||
queryWrapper.orderByDesc("id");
|
queryWrapper.orderByDesc("id");
|
||||||
|
|
|
@ -260,18 +260,19 @@ public class LargeDataScreenServiceImpl implements ILargeDataScreenService {
|
||||||
.eq("order_status", OrderStateEnum.DURING_INSPECTION.getStatus())
|
.eq("order_status", OrderStateEnum.DURING_INSPECTION.getStatus())
|
||||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||||
//获取待巡检订单总数
|
//获取报修中订单总数
|
||||||
Integer underWarrantyOrderCount = routingInspectionOrderMapper.selectCount(
|
Integer underWarrantyOrderCount = routingInspectionOrderMapper.selectCount(
|
||||||
new QueryWrapper<RoutingInspectionOrder>()
|
new QueryWrapper<RoutingInspectionOrder>()
|
||||||
.eq("is_delete", 0)
|
.eq("is_delete", 0)
|
||||||
.eq("order_status", OrderStateEnum.TO_BE_INSPECTED.getStatus())
|
.ne("order_status", OrderStateEnum.COMPLETED.getStatus())
|
||||||
|
.ne("order_status", OrderStateEnum.DURING_INSPECTION.getStatus())
|
||||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||||
LargeDataVo vo = new LargeDataVo();
|
LargeDataVo vo = new LargeDataVo();
|
||||||
vo.setOrderSum(routingInspectionOrderCount); //工单总数
|
vo.setOrderSum(routingInspectionOrderCount); //工单总数
|
||||||
vo.setDoneOrderSum(doneOrderCount); //已完成订单数
|
vo.setDoneOrderSum(doneOrderCount); //已完成订单数
|
||||||
vo.setUnderOverhaulOrderSum(underOverhaulOrderCount); //巡检中订单数
|
vo.setUnderOverhaulOrderSum(underOverhaulOrderCount); //巡检中订单数
|
||||||
vo.setUnderWarrantyOrderSum(underWarrantyOrderCount); //待巡检订单数
|
vo.setUnderWarrantyOrderSum(underWarrantyOrderCount); //报修中订单数
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,14 +323,15 @@ public class LargeDataScreenServiceImpl implements ILargeDataScreenService {
|
||||||
Integer underOverhaulOrderCount = maintenanceOrderMapper.selectCount(
|
Integer underOverhaulOrderCount = maintenanceOrderMapper.selectCount(
|
||||||
new QueryWrapper<MaintenanceOrder>()
|
new QueryWrapper<MaintenanceOrder>()
|
||||||
.eq("is_delete", 0)
|
.eq("is_delete", 0)
|
||||||
.eq("order_status", MaintenanceOrderStatusEnum.CHECKING.getStatus())
|
.eq("order_status", MaintenanceOrderStatusEnum.MAINTENANCE_ING.getStatus())
|
||||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||||
//获取报修中订单总数
|
//获取报修中订单总数
|
||||||
Integer underWarrantyOrderCount = maintenanceOrderMapper.selectCount(
|
Integer underWarrantyOrderCount = maintenanceOrderMapper.selectCount(
|
||||||
new QueryWrapper<MaintenanceOrder>()
|
new QueryWrapper<MaintenanceOrder>()
|
||||||
.eq("is_delete", 0)
|
.eq("is_delete", 0)
|
||||||
.eq("order_status", MaintenanceOrderStatusEnum.MAINTENANCE_ING.getStatus())
|
.ne("order_status", MaintenanceOrderStatusEnum.FINISHED.getStatus())
|
||||||
|
.ne("order_status", MaintenanceOrderStatusEnum.MAINTENANCE_ING.getStatus())
|
||||||
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
.ge("create_time", Timestamp.valueOf(startTime)) // 开始时间
|
||||||
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
.le("create_time", Timestamp.valueOf(endTime))); // 结束时间
|
||||||
LargeDataVo vo = new LargeDataVo();
|
LargeDataVo vo = new LargeDataVo();
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.hcy.common.entity.fault.Fault;
|
||||||
import com.hcy.common.entity.order.MaintenanceOrder;
|
import com.hcy.common.entity.order.MaintenanceOrder;
|
||||||
import com.hcy.common.entity.system.SystemAuthAdmin;
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
import com.hcy.common.entity.user.User;
|
import com.hcy.common.entity.user.User;
|
||||||
|
import com.hcy.common.enums.equipment.EquipmentStateEnum;
|
||||||
import com.hcy.common.enums.order.MaintenanceOrderStatusEnum;
|
import com.hcy.common.enums.order.MaintenanceOrderStatusEnum;
|
||||||
import com.hcy.common.enums.order.OrderStateEnum;
|
import com.hcy.common.enums.order.OrderStateEnum;
|
||||||
import com.hcy.common.exception.OperateException;
|
import com.hcy.common.exception.OperateException;
|
||||||
|
@ -158,6 +159,15 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
MaintenanceOrder model = new MaintenanceOrder();
|
MaintenanceOrder model = new MaintenanceOrder();
|
||||||
BeanUtils.copyProperties(maintenanceOrderParam, model);
|
BeanUtils.copyProperties(maintenanceOrderParam, model);
|
||||||
|
|
||||||
|
//创建检修单,设备状态就变成报修中
|
||||||
|
Equipment equipment = equipmentMapper.selectOne(
|
||||||
|
new QueryWrapper<Equipment>()
|
||||||
|
.eq("id", model.getEquipmentId())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.last("limit 1"));
|
||||||
|
equipment.setDeviceStatus(EquipmentStateEnum.UNDERWARRANTY.getStatus());
|
||||||
|
equipmentMapper.updateById(equipment);
|
||||||
|
|
||||||
//订单去向
|
//订单去向
|
||||||
Integer repairWorkOrderFlow = maintenanceOrderParam.getRepairWorkOrderFlow();
|
Integer repairWorkOrderFlow = maintenanceOrderParam.getRepairWorkOrderFlow();
|
||||||
if (repairWorkOrderFlow == OrderStateEnum.WORK_ORDER_TANK.getStatus()) {
|
if (repairWorkOrderFlow == OrderStateEnum.WORK_ORDER_TANK.getStatus()) {
|
||||||
|
|
|
@ -157,6 +157,15 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||||
vo.setCity(regionMap.get(vo.getCityId()));
|
vo.setCity(regionMap.get(vo.getCityId()));
|
||||||
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||||
|
|
||||||
|
//获取小程序用户的receiveOrderStatus 接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||||
|
User user = userMapper.selectOne(
|
||||||
|
new QueryWrapper<User>()
|
||||||
|
.eq("id", vo.getUserId()));
|
||||||
|
if(user != null){
|
||||||
|
vo.setReceiveOrderStatus(user.getReceiveOrderStatus());
|
||||||
|
}
|
||||||
|
|
||||||
//只查询没有被该工厂绑定的用户
|
//只查询没有被该工厂绑定的用户
|
||||||
if(param.getPlantId() != null){
|
if(param.getPlantId() != null){
|
||||||
Plant model = plantMapper.selectOne(
|
Plant model = plantMapper.selectOne(
|
||||||
|
|
|
@ -83,5 +83,6 @@ public class ClientParam implements Serializable {
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
private Long creatorId;
|
private Long creatorId;
|
||||||
|
private String shortName; // 客户简称
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,5 +34,6 @@ public class ClientDetailVo implements Serializable {
|
||||||
private BigDecimal partMaintainDivisor; // 配件维修价格因子
|
private BigDecimal partMaintainDivisor; // 配件维修价格因子
|
||||||
private String remark; // 备注
|
private String remark; // 备注
|
||||||
private Long creatorId; // 创建人id
|
private Long creatorId; // 创建人id
|
||||||
|
private String shortName; // 客户简称
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,4 +42,6 @@ public class ClientListVo implements Serializable {
|
||||||
private Date createTime; // 创建时间
|
private Date createTime; // 创建时间
|
||||||
private Date updateTime; // 更新时间
|
private Date updateTime; // 更新时间
|
||||||
private List<Equipment> equipmentList; //设备列表
|
private List<Equipment> equipmentList; //设备列表
|
||||||
|
private String shortName; // 客户简称
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,4 +41,6 @@ public class SystemAuthAdminVo implements Serializable {
|
||||||
private Integer age; // 年龄
|
private Integer age; // 年龄
|
||||||
private String email; // 邮箱
|
private String email; // 邮箱
|
||||||
private String technicalGrade; // 技术等级
|
private String technicalGrade; // 技术等级
|
||||||
|
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,9 @@ public class RoutingInspectionOrderDto implements Serializable {
|
||||||
private Long orderSource; // 订单来源 1-系统创建;4-客服创建
|
private Long orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||||
private Long repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
private Long repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||||
private Long receiverType; // 接单类型 0-区域派单;1-距离派单
|
private Long receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||||
|
private Long provinceId; // 省id
|
||||||
|
private Long cityId; // 市id
|
||||||
|
private Long districtId; // 区id
|
||||||
private String remark; // 备注
|
private String remark; // 备注
|
||||||
private Date orderAccomplishTime; // 订单完成时间
|
private Date orderAccomplishTime; // 订单完成时间
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
|
@ -40,4 +43,7 @@ public class RoutingInspectionOrderDto implements Serializable {
|
||||||
private Integer queryType; // 查询类型 0-离我最近 1-时间优先
|
private Integer queryType; // 查询类型 0-离我最近 1-时间优先
|
||||||
private Date cancelOrderTime; // 取消订单时间
|
private Date cancelOrderTime; // 取消订单时间
|
||||||
private String cancelCause; // 取消原因
|
private String cancelCause; // 取消原因
|
||||||
|
private Long equipmentProvinceId; //设备省id
|
||||||
|
private Long equipmentDistrictId; //设备区id
|
||||||
|
private Long equipmentCityId; //设备市id
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,5 +38,5 @@ public class Client implements Serializable {
|
||||||
private Date createTime; // 创建时间
|
private Date createTime; // 创建时间
|
||||||
private Date updateTime; // 更新时间
|
private Date updateTime; // 更新时间
|
||||||
private Integer isDelete; // 是否删除 0-未删除 1-删除
|
private Integer isDelete; // 是否删除 0-未删除 1-删除
|
||||||
|
private String shortName; // 客户简称
|
||||||
}
|
}
|
|
@ -37,5 +37,4 @@ public class Equipment implements Serializable {
|
||||||
private Long createTime; // 创建时间
|
private Long createTime; // 创建时间
|
||||||
private Long updateTime; // 更新时间
|
private Long updateTime; // 更新时间
|
||||||
private Long deleteTime; // 删除时间
|
private Long deleteTime; // 删除时间
|
||||||
private String clientName; // 客户名称
|
|
||||||
}
|
}
|
|
@ -64,7 +64,12 @@
|
||||||
LEFT JOIN la_user as u on i.receiver_id = u.id
|
LEFT JOIN la_user as u on i.receiver_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
i.is_delete = 0
|
i.is_delete = 0
|
||||||
and i.receiver_id = #{form.receiverId}
|
<if test="form.receiverId != null and form.receiverId != ''">
|
||||||
|
and i.receiver_id = #{form.receiverId}
|
||||||
|
</if>
|
||||||
|
<if test="param.clientId != null">
|
||||||
|
and i.client_id = #{form.clientId}
|
||||||
|
</if>
|
||||||
<if test="form.likeWork != null and form.likeWork != ''">
|
<if test="form.likeWork != null and form.likeWork != ''">
|
||||||
and (i.order_no like concat('%', #{form.likeWork}, '%')
|
and (i.order_no like concat('%', #{form.likeWork}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -93,6 +98,9 @@
|
||||||
a.nickname as creatorName,
|
a.nickname as creatorName,
|
||||||
f.`name` as familiarFaultName,
|
f.`name` as familiarFaultName,
|
||||||
u.nickname as receiverName,
|
u.nickname as receiverName,
|
||||||
|
e.province_id as equipmentProvinceId,
|
||||||
|
e.district_id as equipmentDistrictId,
|
||||||
|
e.city_id as equipmentCityId,
|
||||||
e.longitude,
|
e.longitude,
|
||||||
e.latitude
|
e.latitude
|
||||||
FROM
|
FROM
|
||||||
|
|
|
@ -31,13 +31,13 @@ public class RoutingInspectionOrderController {
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param pageParam 分页参数
|
* @param pageParam 分页参数
|
||||||
* @param params 搜索参数
|
* @param routingInspectionOrderParam 搜索参数
|
||||||
* @return Object
|
* @return Object
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Object list(@Validated PageParam pageParam,
|
public Object list(@Validated PageParam pageParam,
|
||||||
@RequestParam Map<String, String> params) {
|
RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||||
PageResult<RoutingInspectionOrderListVo> list = iRoutingInspectionOrderService.list(pageParam, params);
|
PageResult<RoutingInspectionOrderListVo> list = iRoutingInspectionOrderService.list(pageParam, routingInspectionOrderParam);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,10 @@ public interface IRoutingInspectionOrderService {
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param pageParam 分页参数
|
* @param pageParam 分页参数
|
||||||
* @param params 搜索参数
|
* @param routingInspectionOrderParam 搜索参数
|
||||||
* @return PageResult<RoutingInspectionOrderVo>
|
* @return PageResult<RoutingInspectionOrderVo>
|
||||||
*/
|
*/
|
||||||
PageResult<RoutingInspectionOrderListVo> list(PageParam pageParam, Map<String, String> params);
|
PageResult<RoutingInspectionOrderListVo> list(PageParam pageParam, RoutingInspectionOrderParam routingInspectionOrderParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 巡检订单详情
|
* 巡检订单详情
|
||||||
|
|
|
@ -66,6 +66,9 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
@Resource
|
@Resource
|
||||||
UserMapper userMapper;
|
UserMapper userMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
SystemAuthAdminMapper systemAuthAdminMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
FaultMapper faultMapper;
|
FaultMapper faultMapper;
|
||||||
|
|
||||||
|
@ -77,22 +80,26 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param pageParam 分页参数
|
* @param pageParam 分页参数
|
||||||
* @param params 搜索参数
|
* @param routingInspectionOrderParam 搜索参数
|
||||||
* @return PageResult<RoutingInspectionOrderListVo>
|
* @return PageResult<RoutingInspectionOrderListVo>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<RoutingInspectionOrderListVo> list(PageParam pageParam, Map<String, String> params) {
|
public PageResult<RoutingInspectionOrderListVo> list(PageParam pageParam, RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||||
|
|
||||||
Page<RoutingInspectionOrderDto> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
|
Page<RoutingInspectionOrderDto> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
|
||||||
RoutingInspectionOrderDto inspectionOrderDto = new RoutingInspectionOrderDto();
|
RoutingInspectionOrderDto inspectionOrderDto = new RoutingInspectionOrderDto();
|
||||||
|
|
||||||
inspectionOrderDto.setLikeWork(StringUtils.isEmpty(params.get("likeWork")) ? null : params.get("likeWork"));
|
inspectionOrderDto.setLikeWork(routingInspectionOrderParam.getLikeWork());
|
||||||
//默认查询待接单的巡检单
|
//默认查询待接单的巡检单
|
||||||
if(StringUtils.isNotEmpty(params.get("orderStatus"))){
|
inspectionOrderDto.setOrderStatus(routingInspectionOrderParam.getOrderStatus());
|
||||||
inspectionOrderDto.setOrderStatus(Long.valueOf(params.get("orderStatus")));
|
|
||||||
|
//isClient; //是否客户 0-客户端 1-检修员端
|
||||||
|
if(routingInspectionOrderParam.getIsClient() == MaintenanceOrderStatusEnum.REPAIRER.getStatus()){
|
||||||
|
inspectionOrderDto.setReceiverId(FrontThreadLocal.getUserId().longValue()); //只查询当前用户的巡检单
|
||||||
|
}else{
|
||||||
|
inspectionOrderDto.setClientId(routingInspectionOrderParam.getClientId()); //查询客户的巡检单
|
||||||
}
|
}
|
||||||
|
|
||||||
inspectionOrderDto.setReceiverId(FrontThreadLocal.getUserId().longValue()); //只查询当前用户的巡检单
|
|
||||||
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.frontPageList(page, inspectionOrderDto);
|
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.frontPageList(page, inspectionOrderDto);
|
||||||
|
|
||||||
List<RoutingInspectionOrderListVo> list = new LinkedList<>();
|
List<RoutingInspectionOrderListVo> list = new LinkedList<>();
|
||||||
|
@ -285,22 +292,44 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
RoutingInspectionOrderDto inspectionOrderDto = new RoutingInspectionOrderDto();
|
RoutingInspectionOrderDto inspectionOrderDto = new RoutingInspectionOrderDto();
|
||||||
BeanUtils.copyProperties(routingInspectionOrderParam,inspectionOrderDto);
|
BeanUtils.copyProperties(routingInspectionOrderParam,inspectionOrderDto);
|
||||||
|
|
||||||
List<RoutingInspectionOrderDto> routingInspectionOrderDto = routingInspectionOrderMapper.list(inspectionOrderDto);
|
List<RoutingInspectionOrderDto> routingInspectionOrderList = routingInspectionOrderMapper.list(inspectionOrderDto);
|
||||||
|
SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
new QueryWrapper<SystemAuthAdmin>()
|
||||||
|
.eq("user_id", FrontThreadLocal.getUserId()));
|
||||||
|
|
||||||
List<RoutingInspectionOrderListVo> returnData = new LinkedList<>();
|
List<RoutingInspectionOrderListVo> returnData = new LinkedList<>();
|
||||||
for (RoutingInspectionOrderDto item : routingInspectionOrderDto) {
|
for (RoutingInspectionOrderDto item : routingInspectionOrderList) {
|
||||||
|
|
||||||
//判断抢单距离大于订单距离则返回订单
|
if(routingInspectionOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){
|
||||||
double distance = ToolsUtil.getDistance(item.getLongitude(), item.getLatitude()
|
//判断抢单距离大于订单距离则返回订单
|
||||||
, routingInspectionOrderParam.getLongitude(), routingInspectionOrderParam.getLatitude());
|
double distance = ToolsUtil.getDistance(item.getLongitude(), item.getLatitude()
|
||||||
if(item.getOrderDistance().compareTo(BigDecimal.valueOf((distance / 1000))) >= 0){
|
, routingInspectionOrderParam.getLongitude(), routingInspectionOrderParam.getLatitude());
|
||||||
// 计算距离
|
|
||||||
|
if(item.getReceiverType() == OrderStateEnum.REGIONAL_DISPATCH.getStatus()){
|
||||||
|
if(item.getEquipmentProvinceId().equals(systemAuthAdmin.getProvinceId()) &&
|
||||||
|
item.getEquipmentCityId().equals(systemAuthAdmin.getCityId()) &&
|
||||||
|
item.getEquipmentDistrictId().equals(systemAuthAdmin.getDistrictId()) ){
|
||||||
|
|
||||||
|
// 计算距离
|
||||||
|
RoutingInspectionOrderListVo vo = new RoutingInspectionOrderListVo();
|
||||||
|
BeanUtils.copyProperties(item, vo);
|
||||||
|
vo.setDistance(distance);
|
||||||
|
returnData.add(vo);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(item.getOrderDistance().compareTo(BigDecimal.valueOf((distance / 1000))) >= 0){
|
||||||
|
// 计算距离
|
||||||
|
RoutingInspectionOrderListVo vo = new RoutingInspectionOrderListVo();
|
||||||
|
BeanUtils.copyProperties(item, vo);
|
||||||
|
vo.setDistance(distance);
|
||||||
|
returnData.add(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
RoutingInspectionOrderListVo vo = new RoutingInspectionOrderListVo();
|
RoutingInspectionOrderListVo vo = new RoutingInspectionOrderListVo();
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
vo.setDistance(String.valueOf(distance));
|
|
||||||
returnData.add(vo);
|
returnData.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(routingInspectionOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){
|
if(routingInspectionOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){
|
||||||
|
@ -310,18 +339,23 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
//将米数转换为km
|
//将米数转换为km
|
||||||
for (RoutingInspectionOrderListVo inspectionOrderListVo : returnData) {
|
for (RoutingInspectionOrderListVo routingInspectionOrderListVo : returnData) {
|
||||||
double distance = Double.parseDouble(inspectionOrderListVo.getDistance());
|
if(routingInspectionOrderListVo.getDistance() != null){
|
||||||
if(distance < 1000){
|
double distance = routingInspectionOrderListVo.getDistance();
|
||||||
inspectionOrderListVo.setDistance(distance + "米");
|
if(distance < 1000){
|
||||||
}else{
|
routingInspectionOrderListVo.setPracticalDistance(df.format(distance) + "米");
|
||||||
double km = distance / 1000;
|
}else{
|
||||||
inspectionOrderListVo.setDistance(df.format(km) + "km");
|
double km = distance / 1000;
|
||||||
|
routingInspectionOrderListVo.setPracticalDistance(df.format(km) + "km");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return returnData;
|
return returnData;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class RoutingInspectionOrderParam implements Serializable {
|
||||||
@DecimalMin(value = "0", message = "orderSource参数值不能少于0", groups = {create.class, update.class})
|
@DecimalMin(value = "0", message = "orderSource参数值不能少于0", groups = {create.class, update.class})
|
||||||
private Integer orderSource;
|
private Integer orderSource;
|
||||||
|
|
||||||
private Integer orderStatus;
|
private Long orderStatus;
|
||||||
|
|
||||||
@DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class, update.class})
|
@DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class, update.class})
|
||||||
private Long clientId;
|
private Long clientId;
|
||||||
|
@ -83,4 +83,6 @@ public class RoutingInspectionOrderParam implements Serializable {
|
||||||
private double latitude; //纬度
|
private double latitude; //纬度
|
||||||
private Integer queryType; // 查询类型 0-离我最近 1-时间优先
|
private Integer queryType; // 查询类型 0-离我最近 1-时间优先
|
||||||
private String cancelCause; // 取消原因
|
private String cancelCause; // 取消原因
|
||||||
|
|
||||||
|
private Integer isClient; //是否客户 0-客户端 1-检修员端
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,14 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
||||||
private String detailedAddress; // 设备详细地址
|
private String detailedAddress; // 设备详细地址
|
||||||
private Date createTime; // 创建时间
|
private Date createTime; // 创建时间
|
||||||
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
private String distance; //距离
|
private Double distance; //距离
|
||||||
|
private String practicalDistance; //实际距离
|
||||||
|
|
||||||
private BigDecimal orderDistance; // 订单距离
|
private BigDecimal orderDistance; // 订单距离
|
||||||
private Date cancelOrderTime; // 取消订单时间
|
private Date cancelOrderTime; // 取消订单时间
|
||||||
private String cancelCause; // 取消原因
|
private String cancelCause; // 取消原因
|
||||||
|
|
||||||
|
private Long equipmentProvinceId; //设备省id
|
||||||
|
private Long equipmentDistrictId; //设备区id
|
||||||
|
private Long equipmentCityId; //设备市id
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue