【admin】新增&优化# 1.新增查询设备对应状态的数量 2、优化大屏免登录接口 3、优化巡检工单的设备字段 4、优化小程序巡检单列表接口同时查三种状态的工单、优化工单状态 5、优化巡检单列表
parent
faee0d88a8
commit
fafdef8b99
|
@ -55,7 +55,7 @@ public class AdminInterceptor implements HandlerInterceptor {
|
||||||
|
|
||||||
// 免登录接口
|
// 免登录接口
|
||||||
List<String> notLoginUri = Arrays.asList(AdminConfig.notLoginUri);
|
List<String> notLoginUri = Arrays.asList(AdminConfig.notLoginUri);
|
||||||
if (notLoginUri.contains(auths)) {
|
if (notLoginUri.contains(auths) || auths.contains(AdminConfig.notLoginUriApi)) {
|
||||||
return HandlerInterceptor.super.preHandle(request, response, handler);
|
return HandlerInterceptor.super.preHandle(request, response, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@ public class AdminConfig {
|
||||||
// 令牌的集合
|
// 令牌的集合
|
||||||
public static final String backstageTokenSet = "backstage:token:set:";
|
public static final String backstageTokenSet = "backstage:token:set:";
|
||||||
|
|
||||||
|
// 免登录验证的接口
|
||||||
|
public static final String notLoginUriApi = "largeDataScreen";
|
||||||
|
|
||||||
// 免登录验证
|
// 免登录验证
|
||||||
public static String[] notLoginUri = new String[]{
|
public static String[] notLoginUri = new String[]{
|
||||||
"system:login", // 登录接口
|
"system:login", // 登录接口
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.hcy.admin.controller.largeDataScreen;
|
||||||
|
|
||||||
|
import com.hcy.admin.service.largeDataScreen.ILargeDataScreenService;
|
||||||
|
import com.hcy.admin.vo.client.EquipmentLargeDataVo;
|
||||||
|
import com.hcy.common.core.AjaxResult;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据大屏
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/largeDataScreen")
|
||||||
|
public class LargeDataScreenController {
|
||||||
|
@Resource
|
||||||
|
ILargeDataScreenService iLargeDataScreenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有设备对应状态的数量
|
||||||
|
*
|
||||||
|
* @author hcy
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@GetMapping("/deviceStatusQuantity")
|
||||||
|
public Object deviceStatusQuantity() {
|
||||||
|
EquipmentLargeDataVo equipmentLargeDataVo = iLargeDataScreenService.deviceStatusQuantity();
|
||||||
|
return AjaxResult.success(equipmentLargeDataVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户设备最多的5个客户信息
|
||||||
|
*
|
||||||
|
* @author hcy
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
@GetMapping("/clientEquipment")
|
||||||
|
public Object clientEquipment() {
|
||||||
|
List<EquipmentLargeDataVo> list = iLargeDataScreenService.clientEquipmentList();
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.hcy.admin.service.largeDataScreen;
|
||||||
|
|
||||||
|
import com.hcy.admin.vo.client.EquipmentLargeDataVo;
|
||||||
|
import com.hcy.admin.vo.sparePart.SparePartListVo;
|
||||||
|
import com.hcy.common.core.PageResult;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据大屏服务接口类
|
||||||
|
*/
|
||||||
|
public interface ILargeDataScreenService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有设备对应状态的数量
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
EquipmentLargeDataVo deviceStatusQuantity();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户设备最多的5个客户信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EquipmentLargeDataVo> clientEquipmentList();
|
||||||
|
}
|
|
@ -0,0 +1,76 @@
|
||||||
|
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.vo.client.EquipmentLargeDataVo;
|
||||||
|
import com.hcy.admin.vo.sparePart.SparePartListVo;
|
||||||
|
import com.hcy.common.core.PageResult;
|
||||||
|
import com.hcy.common.dto.ClientLargeDataDto;
|
||||||
|
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 org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据大屏管理实现类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class LargeDataScreenServiceImpl implements ILargeDataScreenService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
EquipmentMapper equipmentMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
ClientMapper clientMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有设备对应状态的数量
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EquipmentLargeDataVo deviceStatusQuantity() {
|
||||||
|
// 设备状态(0=停用,1=正常,2=保修中,3=检修中)
|
||||||
|
//正常
|
||||||
|
Integer normalCount = equipmentMapper.selectCount(
|
||||||
|
new QueryWrapper<Equipment>()
|
||||||
|
.eq("device_status", EquipmentStateEnum.NORMAL.getStatus())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
);
|
||||||
|
//检修中
|
||||||
|
Integer underOverhaulCount = equipmentMapper.selectCount(
|
||||||
|
new QueryWrapper<Equipment>()
|
||||||
|
.eq("device_status", EquipmentStateEnum.UNDEROVERHAUL.getStatus())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
);
|
||||||
|
//报修中
|
||||||
|
Integer underWarrantyCount = equipmentMapper.selectCount(
|
||||||
|
new QueryWrapper<Equipment>()
|
||||||
|
.eq("device_status", EquipmentStateEnum.UNDERWARRANTY.getStatus())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
);
|
||||||
|
EquipmentLargeDataVo equipmentLargeDataVo = new EquipmentLargeDataVo();
|
||||||
|
equipmentLargeDataVo.setNormalCount(normalCount);
|
||||||
|
equipmentLargeDataVo.setUnderOverhaulCount(underOverhaulCount);
|
||||||
|
equipmentLargeDataVo.setUnderWarrantyCount(underWarrantyCount);
|
||||||
|
return equipmentLargeDataVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户设备最多的5个客户信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EquipmentLargeDataVo> clientEquipmentList() {
|
||||||
|
List<ClientLargeDataDto> clientLargeDataDtos = clientMapper.clientEquipmentList();
|
||||||
|
for (ClientLargeDataDto clientLargeDataDto : clientLargeDataDtos) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hcy.admin.service.order.impl;
|
package com.hcy.admin.service.order.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.hcy.admin.AdminThreadLocal;
|
import com.hcy.admin.AdminThreadLocal;
|
||||||
|
@ -8,10 +9,12 @@ import com.hcy.admin.validate.common.PageParam;
|
||||||
import com.hcy.admin.validate.order.RoutingInspectionOrderParam;
|
import com.hcy.admin.validate.order.RoutingInspectionOrderParam;
|
||||||
import com.hcy.admin.vo.order.RoutingInspectionOrderListVo;
|
import com.hcy.admin.vo.order.RoutingInspectionOrderListVo;
|
||||||
import com.hcy.admin.vo.order.RoutingInspectionOrderDetailVo;
|
import com.hcy.admin.vo.order.RoutingInspectionOrderDetailVo;
|
||||||
|
import com.hcy.common.constant.GlobalConstant;
|
||||||
import com.hcy.common.core.PageResult;
|
import com.hcy.common.core.PageResult;
|
||||||
import com.hcy.common.dto.RoutingInspectionOrderDto;
|
import com.hcy.common.dto.RoutingInspectionOrderDto;
|
||||||
import com.hcy.common.entity.client.Client;
|
import com.hcy.common.entity.client.Client;
|
||||||
import com.hcy.common.entity.client.Equipment;
|
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.entity.order.RoutingInspectionOrder;
|
||||||
import com.hcy.common.entity.system.SystemAuthAdmin;
|
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||||
import com.hcy.common.enums.order.OrderStateEnum;
|
import com.hcy.common.enums.order.OrderStateEnum;
|
||||||
|
@ -19,12 +22,14 @@ import com.hcy.common.mapper.client.ClientMapper;
|
||||||
import com.hcy.common.mapper.client.EquipmentMapper;
|
import com.hcy.common.mapper.client.EquipmentMapper;
|
||||||
import com.hcy.common.mapper.order.RoutingInspectionOrderMapper;
|
import com.hcy.common.mapper.order.RoutingInspectionOrderMapper;
|
||||||
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
||||||
|
import com.hcy.common.mapper.user.UserMapper;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,6 +50,9 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
@Resource
|
@Resource
|
||||||
SystemAuthAdminMapper systemAuthAdminMapper;
|
SystemAuthAdminMapper systemAuthAdminMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
UserMapper userMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 巡检订单列表
|
* 巡检订单列表
|
||||||
*
|
*
|
||||||
|
@ -61,13 +69,13 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
|
|
||||||
inspectionOrderDto.setOrderNo(StringUtils.isEmpty(params.get("orderNo")) ? null : params.get("orderNo"));
|
inspectionOrderDto.setOrderNo(StringUtils.isEmpty(params.get("orderNo")) ? null : params.get("orderNo"));
|
||||||
inspectionOrderDto.setClientName(StringUtils.isEmpty(params.get("clientName")) ? null : params.get("clientName"));
|
inspectionOrderDto.setClientName(StringUtils.isEmpty(params.get("clientName")) ? null : params.get("clientName"));
|
||||||
inspectionOrderDto.setDeviceName(StringUtils.isEmpty(params.get("deviceName")) ? null : params.get("deviceName"));
|
inspectionOrderDto.setEquipmentName(StringUtils.isEmpty(params.get("equipmentName")) ? null : params.get("equipmentName"));
|
||||||
inspectionOrderDto.setReceiverName(StringUtils.isEmpty(params.get("receiverName")) ? null : params.get("receiverName"));
|
inspectionOrderDto.setReceiverName(StringUtils.isEmpty(params.get("receiverName")) ? null : params.get("receiverName"));
|
||||||
if(StringUtils.isNotEmpty(params.get("orderSource"))){
|
if(StringUtils.isNotEmpty(params.get("orderSource"))){
|
||||||
inspectionOrderDto.setOrderSource(Long.valueOf(params.get("orderSource")));
|
inspectionOrderDto.setOrderSource(Long.valueOf(params.get("orderSource")));
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotEmpty(params.get("inspectionOrderStatus"))){
|
if(StringUtils.isNotEmpty(params.get("orderStatus"))){
|
||||||
inspectionOrderDto.setInspectionOrderStatus(Long.valueOf(params.get("inspectionOrderStatus")));
|
inspectionOrderDto.setOrderStatus(Long.valueOf(params.get("orderStatus")));
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.pageList(page, inspectionOrderDto);
|
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.pageList(page, inspectionOrderDto);
|
||||||
|
@ -116,8 +124,8 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
new QueryWrapper<Equipment>()
|
new QueryWrapper<Equipment>()
|
||||||
.eq("id", model.getEquipmentId())
|
.eq("id", model.getEquipmentId())
|
||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
vo.setDeviceNumber(equipment.getNumber());
|
vo.setEquipmentNo(equipment.getNumber());
|
||||||
vo.setDeviceName(equipment.getName());
|
vo.setEquipmentName(equipment.getName());
|
||||||
vo.setDetailedAddress(equipment.getDetailedAddress());
|
vo.setDetailedAddress(equipment.getDetailedAddress());
|
||||||
//接单人
|
//接单人
|
||||||
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
@ -140,17 +148,18 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
@Override
|
@Override
|
||||||
public void add(RoutingInspectionOrderParam routingInspectionOrderParam) {
|
public void add(RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||||
RoutingInspectionOrder model = new RoutingInspectionOrder();
|
RoutingInspectionOrder model = new RoutingInspectionOrder();
|
||||||
//model.setOrderNo(routingInspectionOrderParam.getOrderNo()); // 订单编号
|
|
||||||
//定时任务创建的巡检单是系统创建,客服的是客服创建
|
//定时任务创建的巡检单是系统创建,客服的是客服创建
|
||||||
model.setOrderSource(OrderStateEnum.CUSTOMER_SERVICE_CREATION.getStatus()); // 订单来源 1-系统创建;4-客服创建
|
model.setOrderSource(OrderStateEnum.CUSTOMER_SERVICE_CREATION.getStatus()); // 订单来源 1-系统创建;4-客服创建
|
||||||
model.setRepairWorkOrderFlow(routingInspectionOrderParam.getRepairWorkOrderFlow());
|
model.setRepairWorkOrderFlow(routingInspectionOrderParam.getRepairWorkOrderFlow());
|
||||||
// 工单去向(0=工单池,1=检修员) 工单去向是工单池的话,工单状态是待抢单
|
// 工单去向(0=工单池,1=检修员) 工单去向是工单池的话,工单状态是待抢单
|
||||||
if(routingInspectionOrderParam.getRepairWorkOrderFlow() == OrderStateEnum.WORK_ORDER_TANK.getStatus()){
|
if(routingInspectionOrderParam.getRepairWorkOrderFlow() == OrderStateEnum.WORK_ORDER_TANK.getStatus()){
|
||||||
model.setInspectionOrderStatus(OrderStateEnum.WAITING_LIST.getStatus()); // 订单状态 0-待抢单;
|
model.setOrderStatus(OrderStateEnum.WAITING_LIST.getStatus()); // 订单状态 0-待抢单;
|
||||||
}else{
|
}else{
|
||||||
model.setInspectionOrderStatus(OrderStateEnum.PENDING_ORDER.getStatus());// 订单状态 1-待接单;
|
model.setOrderStatus(OrderStateEnum.PENDING_ORDER.getStatus());// 订单状态 1-待接单;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.setOrderNo(getOrderNo()); // 订单编号
|
||||||
model.setClientId(routingInspectionOrderParam.getClientId()); //客户id
|
model.setClientId(routingInspectionOrderParam.getClientId()); //客户id
|
||||||
model.setEquipmentId(routingInspectionOrderParam.getEquipmentId());// 设备id
|
model.setEquipmentId(routingInspectionOrderParam.getEquipmentId());// 设备id
|
||||||
model.setReceiverId(routingInspectionOrderParam.getReceiverId()); // 接单人id
|
model.setReceiverId(routingInspectionOrderParam.getReceiverId()); // 接单人id
|
||||||
|
@ -273,4 +282,37 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
routingInspectionOrderMapper.updateById(model);
|
routingInspectionOrderMapper.updateById(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工单编号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getOrderNo() {
|
||||||
|
//获取当前日期并将其进行格式化
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
String formatDate = simpleDateFormat.format(new Date());
|
||||||
|
|
||||||
|
StringBuilder currentOrderNo = new StringBuilder(formatDate + "000001");
|
||||||
|
RoutingInspectionOrder routingInspectionOrder = routingInspectionOrderMapper.selectOne(new LambdaQueryWrapper<RoutingInspectionOrder>()
|
||||||
|
.eq(RoutingInspectionOrder::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||||
|
.like(RoutingInspectionOrder::getOrderNo, formatDate)
|
||||||
|
.orderByDesc(RoutingInspectionOrder::getOrderNo)
|
||||||
|
.last("limit 1"));
|
||||||
|
//当天日期加第一条流水号,如果数据库不存在,则代表今天第一条数据
|
||||||
|
if (routingInspectionOrder == null) {
|
||||||
|
return currentOrderNo.toString();
|
||||||
|
} else {
|
||||||
|
int lastOrderNo = Integer.parseInt(routingInspectionOrder.getOrderNo().substring(8));
|
||||||
|
int length = String.valueOf((lastOrderNo + 1)).length();
|
||||||
|
StringBuilder newOrderNo = new StringBuilder(lastOrderNo + 1 + "");
|
||||||
|
|
||||||
|
//如果流水号长度小于6位,则在前面补0
|
||||||
|
if (length < 6) {
|
||||||
|
for (int i = 0; i < 6 - length; i++) {
|
||||||
|
newOrderNo.insert(0, "0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return formatDate + newOrderNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,7 +294,7 @@ public class SparePartServiceImpl implements ISparePartService {
|
||||||
for(SparePart item : iPage.getRecords()) {
|
for(SparePart item : iPage.getRecords()) {
|
||||||
SparePartListVo vo = new SparePartListVo();
|
SparePartListVo vo = new SparePartListVo();
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
if(purchaseDivisor != null){
|
if(purchaseDivisor != null && vo.getUnitPrice() != null){
|
||||||
//采购员采购时的销售价(配件采购里的销售价)=配件价格*配件采购价格因子(当前用户所属客户的配件采购价格因子)
|
//采购员采购时的销售价(配件采购里的销售价)=配件价格*配件采购价格因子(当前用户所属客户的配件采购价格因子)
|
||||||
vo.setUnitPrice(vo.getUnitPrice().multiply(purchaseDivisor)); // 采购员采购时的销售价
|
vo.setUnitPrice(vo.getUnitPrice().multiply(purchaseDivisor)); // 采购员采购时的销售价
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,6 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
|
|
||||||
SystemAuthAdminVo item = new SystemAuthAdminVo();
|
SystemAuthAdminVo item = new SystemAuthAdminVo();
|
||||||
BeanUtils.copyProperties(dto, item);
|
BeanUtils.copyProperties(dto, item);
|
||||||
|
|
||||||
//设置角色名称
|
//设置角色名称
|
||||||
List<SystemAuthRole> systemAuthRoleListByIds = systemAuthRoleMapper.findSystemAuthRoleListByIds(dto.getRole());
|
List<SystemAuthRole> systemAuthRoleListByIds = systemAuthRoleMapper.findSystemAuthRoleListByIds(dto.getRole());
|
||||||
StringBuilder roleName = new StringBuilder();
|
StringBuilder roleName = new StringBuilder();
|
||||||
|
@ -146,6 +145,10 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
|
|
||||||
SystemAuthAdminVo vo = new SystemAuthAdminVo();
|
SystemAuthAdminVo vo = new SystemAuthAdminVo();
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
|
Map<Long, String> regionMap = regionService.getRegionMap();
|
||||||
|
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||||
|
vo.setCity(regionMap.get(vo.getCityId()));
|
||||||
|
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||||
//只查询没有被该工厂绑定的用户
|
//只查询没有被该工厂绑定的用户
|
||||||
if(param.getPlantId() != null){
|
if(param.getPlantId() != null){
|
||||||
Plant model = plantMapper.selectOne(
|
Plant model = plantMapper.selectOne(
|
||||||
|
|
|
@ -31,7 +31,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 inspectionOrderStatus;
|
private Integer 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;
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.hcy.admin.vo.client;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据大屏ClientVo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ClientLargeDataVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id; // id
|
||||||
|
private String clientName; // 客户名称
|
||||||
|
private Integer number; //序号
|
||||||
|
private Integer equipmentCount; // 设备总数
|
||||||
|
private Integer normalCount; //正常数量
|
||||||
|
private Integer underOverhaulCount; //检修中数量
|
||||||
|
private Integer underWarrantyCount; //报修中数量
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.hcy.admin.vo.client;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据大屏EquipmentVo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EquipmentLargeDataVo 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 detailedAddress; // 详细地址
|
||||||
|
private Integer inspectionCycle; // 巡检周期方式(0=天数间隔,1=固定日期)
|
||||||
|
private Integer dailyAudit; // 每隔几天巡检
|
||||||
|
private String deviceCode; // 设备码
|
||||||
|
private String createTime; // 创建时间
|
||||||
|
private String clientName; // 客户名称
|
||||||
|
|
||||||
|
private Integer normalCount; //正常数量
|
||||||
|
private Integer underOverhaulCount; //检修中数量
|
||||||
|
private Integer underWarrantyCount; //报修中数量
|
||||||
|
|
||||||
|
}
|
|
@ -22,7 +22,7 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
||||||
private String orderNo; // 订单编号
|
private String orderNo; // 订单编号
|
||||||
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Integer orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
private Long equipmentId; // 设备id
|
private Long equipmentId; // 设备id
|
||||||
private Long receiverId; // 接单人id
|
private Long receiverId; // 接单人id
|
||||||
|
@ -32,8 +32,8 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
||||||
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||||
private BigDecimal orderDistance; // 订单距离
|
private BigDecimal orderDistance; // 订单距离
|
||||||
private String clientName; // 客户名称
|
private String clientName; // 客户名称
|
||||||
private String deviceNumber; //设备编号
|
private String equipmentNo; //设备编号
|
||||||
private String deviceName; //设备名称
|
private String equipmentName; //设备名称
|
||||||
private String detailedAddress; // 设备详细地址
|
private String detailedAddress; // 设备详细地址
|
||||||
private String receiverName; // 接单人名称
|
private String receiverName; // 接单人名称
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,15 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
private String clientName; // 客户名称
|
private String clientName; // 客户名称
|
||||||
private Long equipmentId; // 设备id
|
private Long equipmentId; // 设备id
|
||||||
private String deviceNumber; //设备编号
|
private String equipmentNo; //设备编号
|
||||||
private String deviceName; //设备名称
|
private String equipmentName; //设备名称
|
||||||
private String detailedAddress; // 设备详细地址
|
private String detailedAddress; // 设备详细地址
|
||||||
private Long creatorId; // 创建人id
|
private Long creatorId; // 创建人id
|
||||||
private String creatorName; //创建人名称
|
private String creatorName; //创建人名称
|
||||||
private String createTime; // 创建时间
|
private String createTime; // 创建时间
|
||||||
private Long faultId; // 故障id
|
private Long faultId; // 故障id
|
||||||
private String familiarFaultName; //故障类型
|
private String familiarFaultName; //故障类型
|
||||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
private Long receiverId; // 接单人id
|
private Long receiverId; // 接单人id
|
||||||
private String receiverName; // 接单人名称
|
private String receiverName; // 接单人名称
|
||||||
private Date receiverTime; // 接单时间
|
private Date receiverTime; // 接单时间
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.hcy.common.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据大屏ClientVo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ClientLargeDataDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id; // id
|
||||||
|
private Integer number; //序号
|
||||||
|
private String clientName; // 客户名称
|
||||||
|
private Integer equipmentCount; // 设备总数
|
||||||
|
private Integer normalCount; //正常数量
|
||||||
|
private Integer underOverhaulCount; //检修中数量
|
||||||
|
private Integer underWarrantyCount; //报修中数量
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -18,15 +18,15 @@ public class RoutingInspectionOrderDto implements Serializable {
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
private String clientName; // 客户名称
|
private String clientName; // 客户名称
|
||||||
private Long equipmentId; // 设备id
|
private Long equipmentId; // 设备id
|
||||||
private String deviceNumber; //设备编号
|
private String equipmentNo; //设备编号
|
||||||
private String deviceName; //设备名称
|
private String equipmentName; //设备名称
|
||||||
private String detailedAddress; // 设备详细地址
|
private String detailedAddress; // 设备详细地址
|
||||||
private Long creatorId; // 创建人id
|
private Long creatorId; // 创建人id
|
||||||
private String creatorName; //创建人名称
|
private String creatorName; //创建人名称
|
||||||
private String createTime; // 创建时间
|
private String createTime; // 创建时间
|
||||||
private Long faultId; // 故障id
|
private Long faultId; // 故障id
|
||||||
private String familiarFaultName; //故障类型
|
private String familiarFaultName; //故障类型
|
||||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
private Long receiverId; // 接单人id
|
private Long receiverId; // 接单人id
|
||||||
private String receiverName; // 接单人名称
|
private String receiverName; // 接单人名称
|
||||||
private Date receiverTime; // 接单时间
|
private Date receiverTime; // 接单时间
|
||||||
|
|
|
@ -21,9 +21,10 @@ public class RoutingInspectionOrder implements Serializable {
|
||||||
@TableId(value="id", type= IdType.AUTO)
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
private Long id; // 主键id
|
private Long id; // 主键id
|
||||||
private String orderNo; // 订单编号
|
private String orderNo; // 订单编号
|
||||||
|
private Long userId; // 用户id
|
||||||
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Integer orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
private Long equipmentId; // 设备id
|
private Long equipmentId; // 设备id
|
||||||
private Long faultId; // 故障id
|
private Long faultId; // 故障id
|
||||||
|
|
|
@ -1,12 +1,26 @@
|
||||||
package com.hcy.common.mapper.client;
|
package com.hcy.common.mapper.client;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.hcy.common.core.basics.IBaseMapper;
|
import com.hcy.common.core.basics.IBaseMapper;
|
||||||
|
import com.hcy.common.dto.ClientLargeDataDto;
|
||||||
|
import com.hcy.common.dto.RoutingInspectionOrderDto;
|
||||||
import com.hcy.common.entity.client.Client;
|
import com.hcy.common.entity.client.Client;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户Mapper
|
* 客户Mapper
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ClientMapper extends IBaseMapper<Client> {
|
public interface ClientMapper extends IBaseMapper<Client> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取客户设备最多的5个客户信息,需要显示客户名称、设备总数、
|
||||||
|
* 设备状态为正常的总数、设备状态为检修的总数、设备状态为报修的总数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ClientLargeDataDto> clientEquipmentList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?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.hcy.common.mapper.order.RoutingInspectionOrderMapper">
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="com.hcy.common.entity.client.Client">
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="clientEquipmentList" resultType="com.hcy.common.dto.ClientLargeDataDto">
|
||||||
|
SELECT
|
||||||
|
c.client_name,COUNT(e.client_id) AS equipmentCount,
|
||||||
|
SUM(CASE WHEN e.device_status = 1 THEN 1 ELSE 0 END) AS normalCount,
|
||||||
|
SUM(CASE WHEN e.device_status = 2 THEN 1 ELSE 0 END) AS underOverhaulCount,
|
||||||
|
SUM(CASE WHEN e.device_status = 3 THEN 1 ELSE 0 END) AS underWarrantyCount
|
||||||
|
FROM
|
||||||
|
la_client as c
|
||||||
|
JOIN
|
||||||
|
la_equipment as e ON e.client_id = c.id
|
||||||
|
where c.is_delete = 0 and e.is_delete = 0
|
||||||
|
GROUP BY
|
||||||
|
c.id
|
||||||
|
ORDER BY
|
||||||
|
total_devices DESC
|
||||||
|
LIMIT 5;
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -9,17 +9,17 @@
|
||||||
SELECT
|
SELECT
|
||||||
i.*,
|
i.*,
|
||||||
c.client_name,
|
c.client_name,
|
||||||
e.number as deviceNumber,e.name as deviceName,e.detailed_address,
|
e.number as equipmentNo,e.name as equipmentName,e.detailed_address,
|
||||||
a.nickname as creatorName,
|
a.nickname as creatorName,
|
||||||
f.`name` as familiarFaultName,
|
f.`name` as familiarFaultName,
|
||||||
aa.nickname as receiverName
|
u.nickname as receiverName
|
||||||
FROM
|
FROM
|
||||||
la_routing_inspection_order AS i
|
la_routing_inspection_order AS i
|
||||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||||
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
||||||
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
||||||
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
||||||
LEFT JOIN la_system_auth_admin as aa on i.receiver_id = aa.id
|
LEFT JOIN la_user as u on i.receiver_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
i.is_delete = 0
|
i.is_delete = 0
|
||||||
<if test="form.orderNo != null and form.orderNo != ''">
|
<if test="form.orderNo != null and form.orderNo != ''">
|
||||||
|
@ -28,17 +28,17 @@
|
||||||
<if test="form.clientName != null and form.clientName != ''">
|
<if test="form.clientName != null and form.clientName != ''">
|
||||||
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.deviceName != null and form.deviceName != ''">
|
<if test="form.equipmentName != null and form.equipmentName != ''">
|
||||||
and e.`name` LIKE concat('%', #{form.deviceName}, '%')
|
and e.`name` LIKE concat('%', #{form.equipmentName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.receiverName != null and form.receiverName != ''">
|
<if test="form.receiverName != null and form.receiverName != ''">
|
||||||
and aa.nickname LIKE concat('%', #{form.receiverName}, '%')
|
and u.nickname LIKE concat('%', #{form.receiverName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.orderSource != null">
|
<if test="form.orderSource != null">
|
||||||
and i.order_source = #{form.orderSource}
|
and i.order_source = #{form.orderSource}
|
||||||
</if>
|
</if>
|
||||||
<if test="form.inspectionOrderStatus != null">
|
<if test="form.orderStatus != null">
|
||||||
and i.inspection_order_status = #{form.inspectionOrderStatus}
|
and i.order_status = #{form.orderStatus}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY i.id DESC
|
ORDER BY i.id DESC
|
||||||
</select>
|
</select>
|
||||||
|
@ -47,17 +47,17 @@
|
||||||
SELECT
|
SELECT
|
||||||
i.*,
|
i.*,
|
||||||
c.client_name,
|
c.client_name,
|
||||||
e.number as deviceNumber,e.name as deviceName,e.detailed_address,
|
e.number as equipmentNo,e.name as equipmentName,e.detailed_address,
|
||||||
a.nickname as creatorName,
|
a.nickname as creatorName,
|
||||||
f.`name` as familiarFaultName,
|
f.`name` as familiarFaultName,
|
||||||
aa.nickname as receiverName
|
u.nickname as receiverName
|
||||||
FROM
|
FROM
|
||||||
la_routing_inspection_order AS i
|
la_routing_inspection_order AS i
|
||||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||||
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
||||||
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
||||||
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
||||||
LEFT JOIN la_system_auth_admin as aa on i.receiver_id = aa.id
|
LEFT JOIN la_user as u on i.receiver_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
i.is_delete = 0
|
i.is_delete = 0
|
||||||
<if test="form.likeWork != null and form.likeWork != ''">
|
<if test="form.likeWork != null and form.likeWork != ''">
|
||||||
|
@ -69,8 +69,11 @@
|
||||||
<if test="form.likeWork != null and form.likeWork != ''">
|
<if test="form.likeWork != null and form.likeWork != ''">
|
||||||
OR e.number LIKE concat('%', #{form.likeWork}, '%')
|
OR e.number LIKE concat('%', #{form.likeWork}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.inspectionOrderStatus != null">
|
<if test="form.orderStatus != null">
|
||||||
and i.inspection_order_status = #{form.inspectionOrderStatus}
|
and i.order_status = #{form.orderStatus}
|
||||||
|
</if>
|
||||||
|
<if test="form.orderStatus == null">
|
||||||
|
and i.order_status in (1,2,5)
|
||||||
</if>
|
</if>
|
||||||
ORDER BY i.id DESC
|
ORDER BY i.id DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -4,21 +4,9 @@
|
||||||
|
|
||||||
<select id="list" resultType="com.hcy.common.dto.SystemAuthAdminDto">
|
<select id="list" resultType="com.hcy.common.dto.SystemAuthAdminDto">
|
||||||
SELECT
|
SELECT
|
||||||
t.id,
|
t.*,
|
||||||
t.dept_id,
|
sd.NAME AS dept
|
||||||
t.post_id,
|
|
||||||
t.username,
|
|
||||||
t.nickname,
|
|
||||||
t.avatar,
|
|
||||||
t.role,
|
|
||||||
t.user_id,
|
|
||||||
sd.NAME AS dept,
|
|
||||||
t.is_multipoint,
|
|
||||||
t.is_disable,
|
|
||||||
t.last_login_ip,
|
|
||||||
t.last_login_time,
|
|
||||||
t.create_time,
|
|
||||||
t.update_time
|
|
||||||
FROM
|
FROM
|
||||||
la_system_auth_admin t
|
la_system_auth_admin t
|
||||||
LEFT JOIN la_system_auth_role sr ON sr.id = t.role
|
LEFT JOIN la_system_auth_role sr ON sr.id = t.role
|
||||||
|
|
|
@ -9,17 +9,17 @@
|
||||||
SELECT
|
SELECT
|
||||||
i.*,
|
i.*,
|
||||||
c.client_name,
|
c.client_name,
|
||||||
e.number as deviceNumber,e.name as deviceName,e.detailed_address,
|
e.number as equipmentNo,e.name as equipmentName,e.detailed_address,
|
||||||
a.nickname as creatorName,
|
a.nickname as creatorName,
|
||||||
f.`name` as familiarFaultName,
|
f.`name` as familiarFaultName,
|
||||||
aa.nickname as receiverName
|
u.nickname as receiverName
|
||||||
FROM
|
FROM
|
||||||
la_routing_inspection_order AS i
|
la_routing_inspection_order AS i
|
||||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||||
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
||||||
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
||||||
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
||||||
LEFT JOIN la_system_auth_admin as aa on i.receiver_id = aa.id
|
LEFT JOIN la_user as u on i.receiver_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
i.is_delete = 0
|
i.is_delete = 0
|
||||||
<if test="form.orderNo != null and form.orderNo != ''">
|
<if test="form.orderNo != null and form.orderNo != ''">
|
||||||
|
@ -28,17 +28,17 @@
|
||||||
<if test="form.clientName != null and form.clientName != ''">
|
<if test="form.clientName != null and form.clientName != ''">
|
||||||
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.deviceName != null and form.deviceName != ''">
|
<if test="form.equipmentName != null and form.equipmentName != ''">
|
||||||
and e.`name` LIKE concat('%', #{form.deviceName}, '%')
|
and e.`name` LIKE concat('%', #{form.equipmentName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.receiverName != null and form.receiverName != ''">
|
<if test="form.receiverName != null and form.receiverName != ''">
|
||||||
and aa.nickname LIKE concat('%', #{form.receiverName}, '%')
|
and u.nickname LIKE concat('%', #{form.receiverName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.orderSource != null">
|
<if test="form.orderSource != null">
|
||||||
and i.order_source = #{form.orderSource}
|
and i.order_source = #{form.orderSource}
|
||||||
</if>
|
</if>
|
||||||
<if test="form.inspectionOrderStatus != null">
|
<if test="form.orderStatus != null">
|
||||||
and i.inspection_order_status = #{form.inspectionOrderStatus}
|
and i.order_status = #{form.orderStatus}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY i.id DESC
|
ORDER BY i.id DESC
|
||||||
</select>
|
</select>
|
||||||
|
@ -47,17 +47,17 @@
|
||||||
SELECT
|
SELECT
|
||||||
i.*,
|
i.*,
|
||||||
c.client_name,
|
c.client_name,
|
||||||
e.number as deviceNumber,e.name as deviceName,e.detailed_address,
|
e.number as equipmentNo,e.name as equipmentName,e.detailed_address,
|
||||||
a.nickname as creatorName,
|
a.nickname as creatorName,
|
||||||
f.`name` as familiarFaultName,
|
f.`name` as familiarFaultName,
|
||||||
aa.nickname as receiverName
|
u.nickname as receiverName
|
||||||
FROM
|
FROM
|
||||||
la_routing_inspection_order AS i
|
la_routing_inspection_order AS i
|
||||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||||
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
LEFT JOIN la_equipment AS e ON i.equipment_id = e.id
|
||||||
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
||||||
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
LEFT JOIN la_fault AS f ON i.fault_id = f.id
|
||||||
LEFT JOIN la_system_auth_admin as aa on i.receiver_id = aa.id
|
LEFT JOIN la_user as u on i.receiver_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
i.is_delete = 0
|
i.is_delete = 0
|
||||||
<if test="form.likeWork != null and form.likeWork != ''">
|
<if test="form.likeWork != null and form.likeWork != ''">
|
||||||
|
@ -69,8 +69,11 @@
|
||||||
<if test="form.likeWork != null and form.likeWork != ''">
|
<if test="form.likeWork != null and form.likeWork != ''">
|
||||||
OR e.number LIKE concat('%', #{form.likeWork}, '%')
|
OR e.number LIKE concat('%', #{form.likeWork}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="form.inspectionOrderStatus != null">
|
<if test="form.orderStatus != null">
|
||||||
and i.inspection_order_status = #{form.inspectionOrderStatus}
|
and i.order_status = #{form.orderStatus}
|
||||||
|
</if>
|
||||||
|
<if test="form.orderStatus == null">
|
||||||
|
and i.order_status in (1,2,5)
|
||||||
</if>
|
</if>
|
||||||
ORDER BY i.id DESC
|
ORDER BY i.id DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -4,21 +4,9 @@
|
||||||
|
|
||||||
<select id="list" resultType="com.hcy.common.dto.SystemAuthAdminDto">
|
<select id="list" resultType="com.hcy.common.dto.SystemAuthAdminDto">
|
||||||
SELECT
|
SELECT
|
||||||
t.id,
|
t.*,
|
||||||
t.dept_id,
|
sd.NAME AS dept
|
||||||
t.post_id,
|
|
||||||
t.username,
|
|
||||||
t.nickname,
|
|
||||||
t.avatar,
|
|
||||||
t.role,
|
|
||||||
t.user_id,
|
|
||||||
sd.NAME AS dept,
|
|
||||||
t.is_multipoint,
|
|
||||||
t.is_disable,
|
|
||||||
t.last_login_ip,
|
|
||||||
t.last_login_time,
|
|
||||||
t.create_time,
|
|
||||||
t.update_time
|
|
||||||
FROM
|
FROM
|
||||||
la_system_auth_admin t
|
la_system_auth_admin t
|
||||||
LEFT JOIN la_system_auth_role sr ON sr.id = t.role
|
LEFT JOIN la_system_auth_role sr ON sr.id = t.role
|
||||||
|
|
|
@ -63,10 +63,8 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
|
|
||||||
inspectionOrderDto.setLikeWork(StringUtils.isEmpty(params.get("likeWork")) ? null : params.get("likeWork"));
|
inspectionOrderDto.setLikeWork(StringUtils.isEmpty(params.get("likeWork")) ? null : params.get("likeWork"));
|
||||||
//默认查询待接单的巡检单
|
//默认查询待接单的巡检单
|
||||||
if(StringUtils.isNotEmpty(params.get("inspectionOrderStatus"))){
|
if(StringUtils.isNotEmpty(params.get("orderStatus"))){
|
||||||
inspectionOrderDto.setInspectionOrderStatus(Long.valueOf(params.get("inspectionOrderStatus")));
|
inspectionOrderDto.setOrderStatus(Long.valueOf(params.get("orderStatus")));
|
||||||
}else{
|
|
||||||
inspectionOrderDto.setInspectionOrderStatus(Long.valueOf(OrderStateEnum.PENDING_ORDER.getStatus()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.frontPageList(page, inspectionOrderDto);
|
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.frontPageList(page, inspectionOrderDto);
|
||||||
|
@ -115,8 +113,8 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
new QueryWrapper<Equipment>()
|
new QueryWrapper<Equipment>()
|
||||||
.eq("id", model.getEquipmentId())
|
.eq("id", model.getEquipmentId())
|
||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
vo.setDeviceNumber(equipment.getNumber());
|
vo.setEquipmentNo(equipment.getNumber());
|
||||||
vo.setDeviceName(equipment.getName());
|
vo.setEquipmentName(equipment.getName());
|
||||||
vo.setDetailedAddress(equipment.getDetailedAddress());
|
vo.setDetailedAddress(equipment.getDetailedAddress());
|
||||||
//接单人
|
//接单人
|
||||||
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
@ -146,7 +144,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
Assert.notNull(model, "数据不存在!");
|
Assert.notNull(model, "数据不存在!");
|
||||||
|
|
||||||
model.setReceiverTime(new Date()); //接单时间
|
model.setReceiverTime(new Date()); //接单时间
|
||||||
model.setInspectionOrderStatus(OrderStateEnum.TO_BE_INSPECTED.getStatus()); //用户接单后工单状态为待巡检
|
model.setOrderStatus(OrderStateEnum.TO_BE_INSPECTED.getStatus()); //用户接单后工单状态为待巡检
|
||||||
|
|
||||||
routingInspectionOrderMapper.updateById(model);
|
routingInspectionOrderMapper.updateById(model);
|
||||||
}
|
}
|
||||||
|
@ -166,7 +164,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
|
|
||||||
Assert.notNull(model, "数据不存在!");
|
Assert.notNull(model, "数据不存在!");
|
||||||
|
|
||||||
model.setInspectionOrderStatus(OrderStateEnum.DURING_INSPECTION.getStatus()); //用户开始巡检后工单状态为巡检中
|
model.setOrderStatus(OrderStateEnum.DURING_INSPECTION.getStatus()); //用户开始巡检后工单状态为巡检中
|
||||||
routingInspectionOrderMapper.updateById(model);
|
routingInspectionOrderMapper.updateById(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +188,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
model.setInspectionResult(routingInspectionOrderParam.getInspectionResult()); //巡检结果(0=正常 1=异常)
|
model.setInspectionResult(routingInspectionOrderParam.getInspectionResult()); //巡检结果(0=正常 1=异常)
|
||||||
String inspectionResultRemark = routingInspectionOrderParam.getInspectionResultRemark();//巡检结果备注
|
String inspectionResultRemark = routingInspectionOrderParam.getInspectionResultRemark();//巡检结果备注
|
||||||
model.setInspectionPhoto(routingInspectionOrderParam.getInspectionPhoto()); // 巡检照片
|
model.setInspectionPhoto(routingInspectionOrderParam.getInspectionPhoto()); // 巡检照片
|
||||||
model.setInspectionOrderStatus(OrderStateEnum.COMPLETED.getStatus()); //故障检测完工单状态就为已完成
|
model.setOrderStatus(OrderStateEnum.COMPLETED.getStatus()); //故障检测完工单状态就为已完成
|
||||||
routingInspectionOrderMapper.updateById(model);
|
routingInspectionOrderMapper.updateById(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,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 inspectionOrderStatus;
|
private Integer 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;
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
||||||
private String orderNo; // 订单编号
|
private String orderNo; // 订单编号
|
||||||
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Integer orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
private Long equipmentId; // 设备id
|
private Long equipmentId; // 设备id
|
||||||
private Long receiverId; // 接单人id
|
private Long receiverId; // 接单人id
|
||||||
|
@ -28,8 +28,8 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
||||||
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||||
private BigDecimal orderDistance; // 订单距离
|
private BigDecimal orderDistance; // 订单距离
|
||||||
private String clientName; // 客户名称
|
private String clientName; // 客户名称
|
||||||
private String deviceNumber; //设备编号
|
private String equipmentNo; //设备编号
|
||||||
private String deviceName; //设备名称
|
private String equipmentName; //设备名称
|
||||||
private String detailedAddress; // 设备详细地址
|
private String detailedAddress; // 设备详细地址
|
||||||
private String receiverName; // 接单人名称
|
private String receiverName; // 接单人名称
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
||||||
private Long clientId; // 客户id
|
private Long clientId; // 客户id
|
||||||
private String clientName; // 客户名称
|
private String clientName; // 客户名称
|
||||||
private Long equipmentId; // 设备id
|
private Long equipmentId; // 设备id
|
||||||
private String deviceNumber; //设备编号
|
private String equipmentNo; //设备编号
|
||||||
private String deviceName; //设备名称
|
private String equipmentName; //设备名称
|
||||||
private String detailedAddress; // 设备详细地址
|
private String detailedAddress; // 设备详细地址
|
||||||
private String createTime; // 创建时间
|
private String createTime; // 创建时间
|
||||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue