【admin&front】修复# 1、优化检修单列表、详情创建人名称 2、优化维修单、巡检单操作记录
parent
a53b42f186
commit
d6e9508b3f
|
@ -32,13 +32,13 @@ public class EquipmentController {
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param pageParam 分页参数
|
* @param pageParam 分页参数
|
||||||
* @param params 搜索参数
|
* @param equipmentParam 搜索参数
|
||||||
* @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) {
|
EquipmentParam equipmentParam) {
|
||||||
PageResult<EquipmentListVo> list = iEquipmentService.list(pageParam, params);
|
PageResult<EquipmentListVo> list = iEquipmentService.list(pageParam, equipmentParam);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,10 +19,10 @@ public interface IEquipmentService {
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param pageParam 分页参数
|
* @param pageParam 分页参数
|
||||||
* @param params 搜索参数
|
* @param equipmentParam 搜索参数
|
||||||
* @return PageResult<EquipmentVo>
|
* @return PageResult<EquipmentVo>
|
||||||
*/
|
*/
|
||||||
PageResult<EquipmentListVo> list(PageParam pageParam, Map<String, String> params);
|
PageResult<EquipmentListVo> list(PageParam pageParam, EquipmentParam equipmentParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备管理详情
|
* 设备管理详情
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.hcy.admin.vo.client.EquipmentDetailVo;
|
||||||
import com.hcy.admin.vo.client.EquipmentModelDetailVo;
|
import com.hcy.admin.vo.client.EquipmentModelDetailVo;
|
||||||
import com.hcy.admin.vo.sparePart.SparePartListVo;
|
import com.hcy.admin.vo.sparePart.SparePartListVo;
|
||||||
import com.hcy.common.core.PageResult;
|
import com.hcy.common.core.PageResult;
|
||||||
|
import com.hcy.common.dto.EquipmentDto;
|
||||||
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.client.EquipmentModel;
|
import com.hcy.common.entity.client.EquipmentModel;
|
||||||
|
@ -30,6 +31,8 @@ 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.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,32 +61,29 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param pageParam 分页参数
|
* @param pageParam 分页参数
|
||||||
* @param params 搜索参数
|
* @param equipmentParam 搜索参数
|
||||||
* @return PageResult<EquipmentListVo>
|
* @return PageResult<EquipmentListVo>
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<EquipmentListVo> list(PageParam pageParam, Map<String, String> params) {
|
public PageResult<EquipmentListVo> list(PageParam pageParam, EquipmentParam equipmentParam) {
|
||||||
Integer page = pageParam.getPageNo();
|
Integer page = pageParam.getPageNo();
|
||||||
Integer limit = pageParam.getPageSize();
|
Integer limit = pageParam.getPageSize();
|
||||||
|
|
||||||
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>();
|
EquipmentDto equipmentDto = new EquipmentDto();
|
||||||
queryWrapper.eq("is_delete", 0);
|
BeanUtils.copyProperties(equipmentParam,equipmentDto);
|
||||||
queryWrapper.orderByDesc("id");
|
|
||||||
|
|
||||||
equipmentMapper.setSearch(queryWrapper, params, new String[]{
|
// 将Date转换为时间戳
|
||||||
"like:number:str",
|
equipmentDto.setCreateTimeStartLong(TimeUtil.dateToTimestamp(equipmentParam.getCreateTimeStart()));
|
||||||
"like:name:str",
|
equipmentDto.setCreateTimeEndLong(TimeUtil.dateToTimestamp(equipmentParam.getCreateTimeEnd()));
|
||||||
"=:clientId@client_id:int",
|
|
||||||
"like:clientName@client_name:str",
|
|
||||||
"=:deviceStatus@device_status:int",
|
|
||||||
"datetime:createTimeStart-createTimeEnd@create_time:str",
|
Page<EquipmentDto> iPage = equipmentMapper.pageList(new Page<>(page, limit), equipmentDto);
|
||||||
});
|
|
||||||
|
|
||||||
IPage<Equipment> iPage = equipmentMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
|
||||||
Map<Long, String> regionMap = regionService.getRegionMap();//获取省市区
|
Map<Long, String> regionMap = regionService.getRegionMap();//获取省市区
|
||||||
|
|
||||||
List<EquipmentListVo> list = new LinkedList<>();
|
List<EquipmentListVo> list = new LinkedList<>();
|
||||||
for(Equipment item : iPage.getRecords()) {
|
for(EquipmentDto item : iPage.getRecords()) {
|
||||||
EquipmentListVo vo = new EquipmentListVo();
|
EquipmentListVo vo = new EquipmentListVo();
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||||
|
|
|
@ -174,6 +174,18 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
//设置设备模块信息
|
//设置设备模块信息
|
||||||
vo.setEquipmentModel(equipmentModelDetailVo);
|
vo.setEquipmentModel(equipmentModelDetailVo);
|
||||||
|
|
||||||
|
//获取创建人名称
|
||||||
|
User userName = userMapper.selectOne(new LambdaQueryWrapper<User>()
|
||||||
|
.eq(User::getId, item.getCreatorId()));
|
||||||
|
if(userName != null){
|
||||||
|
vo.setCreatorName(userName.getNickname());
|
||||||
|
}else {
|
||||||
|
SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.selectById(item.getCreatorId());
|
||||||
|
if(systemAuthAdmin != null){
|
||||||
|
vo.setCreatorName(systemAuthAdmin.getNickname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list.add(vo);
|
list.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,6 +409,39 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
model.setFaultId(param.getFaultId());
|
model.setFaultId(param.getFaultId());
|
||||||
model.setFaultDescription(param.getFaultDescription());
|
model.setFaultDescription(param.getFaultDescription());
|
||||||
model.setRemark(param.getRemark());
|
model.setRemark(param.getRemark());
|
||||||
|
//修改派单方式
|
||||||
|
if(param.getReceiverType() != null && param.getId() != null){
|
||||||
|
//原本派单方式
|
||||||
|
String oldReceiverType;
|
||||||
|
if(model.getReceiverType() == 0){
|
||||||
|
oldReceiverType = OrderStateEnum.REGIONAL_DISPATCH.getDesc();
|
||||||
|
}else{
|
||||||
|
oldReceiverType = OrderStateEnum.DISTANCE_ORDER.getDesc();
|
||||||
|
}
|
||||||
|
//现在派单方式
|
||||||
|
String newReceiverType;
|
||||||
|
if(param.getReceiverType() == 0){
|
||||||
|
newReceiverType = OrderStateEnum.REGIONAL_DISPATCH.getDesc();
|
||||||
|
}else{
|
||||||
|
newReceiverType = OrderStateEnum.DISTANCE_ORDER.getDesc();
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addMaintenanceOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.ALTER_RECEIVER_TYPE.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已修改派单方式。原本派单方式为:" +
|
||||||
|
oldReceiverType + ",已修改派单方式为:" + newReceiverType + "。");
|
||||||
|
|
||||||
|
}
|
||||||
|
//修改抢单范围
|
||||||
|
if(param.getOrderDistance() != null && param.getId() != null){
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addMaintenanceOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.ALTER_ORDER_DISTANCE.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已修改抢单范围。原本抢单范围为:" +
|
||||||
|
model.getOrderDistance() + "公里,已修改抢单范围为:" + model.getOrderDistance() + "公里。");
|
||||||
|
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new OperateException("工单已被接单,无法编辑");
|
throw new OperateException("工单已被接单,无法编辑");
|
||||||
}
|
}
|
||||||
|
@ -441,6 +486,15 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
BigDecimal actualAmount = maintenanceOrderParam.getActualAmount();
|
BigDecimal actualAmount = maintenanceOrderParam.getActualAmount();
|
||||||
model.setActualAmount(actualAmount);
|
model.setActualAmount(actualAmount);
|
||||||
maintenanceOrderMapper.updateById(model);
|
maintenanceOrderMapper.updateById(model);
|
||||||
|
|
||||||
|
User user = userMapper.selectById(model.getReceiverId());
|
||||||
|
if(user != null){
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addMaintenanceOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.MODIFY_SERVICE_QUOTATION.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已修改服务报价。原服务报价为:" +
|
||||||
|
model.getActualAmount() + ",现服务报价为:" + maintenanceOrderParam.getActualAmount());
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new OperateException("当前工单状态,无法修改服务报价");
|
throw new OperateException("当前工单状态,无法修改服务报价");
|
||||||
}
|
}
|
||||||
|
@ -457,6 +511,13 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
model.setOrderStatus(MaintenanceOrderStatusEnum.RETURNED.getStatus());
|
model.setOrderStatus(MaintenanceOrderStatusEnum.RETURNED.getStatus());
|
||||||
model.setReturnCause(maintenanceOrderParam.getReturnCause());
|
model.setReturnCause(maintenanceOrderParam.getReturnCause());
|
||||||
maintenanceOrderMapper.updateById(model);
|
maintenanceOrderMapper.updateById(model);
|
||||||
|
|
||||||
|
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addMaintenanceOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.RETURN_TECHNICIAN.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已退回检修。退回原因:" + maintenanceOrderParam.getReturnCause() + "。");
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
throw new OperateException("当前工单状态,无法退回检修");
|
throw new OperateException("当前工单状态,无法退回检修");
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,6 +464,28 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
model.setOrderDistance(null); //派单距离
|
model.setOrderDistance(null); //派单距离
|
||||||
}
|
}
|
||||||
repairOrderMapper.updateById(model);
|
repairOrderMapper.updateById(model);
|
||||||
|
|
||||||
|
//原本派单方式
|
||||||
|
String oldReceiverType;
|
||||||
|
if(model.getReceiverType() == 0){
|
||||||
|
oldReceiverType = OrderStateEnum.REGIONAL_DISPATCH.getDesc();
|
||||||
|
}else{
|
||||||
|
oldReceiverType = OrderStateEnum.DISTANCE_ORDER.getDesc();
|
||||||
|
}
|
||||||
|
//现在派单方式
|
||||||
|
String newReceiverType;
|
||||||
|
if(repairOrderParam.getReceiverType() == 0){
|
||||||
|
newReceiverType = OrderStateEnum.REGIONAL_DISPATCH.getDesc();
|
||||||
|
}else{
|
||||||
|
newReceiverType = OrderStateEnum.DISTANCE_ORDER.getDesc();
|
||||||
|
}
|
||||||
|
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addRepairOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.ALTER_RECEIVER_TYPE.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已修改派单方式。原本派单方式为:" +
|
||||||
|
oldReceiverType + ",已修改派单方式为:" + newReceiverType + "。");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -486,6 +508,14 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
model.setOrderDistance(null); //派单距离
|
model.setOrderDistance(null); //派单距离
|
||||||
}
|
}
|
||||||
repairOrderMapper.updateById(model);
|
repairOrderMapper.updateById(model);
|
||||||
|
|
||||||
|
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addRepairOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.ALTER_ORDER_DISTANCE.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已修改抢单范围。原本抢单范围为:" +
|
||||||
|
model.getOrderDistance() + "公里,已修改抢单范围为:" + model.getOrderDistance() + "公里。");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -541,6 +571,15 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
BigDecimal actualAmount = repairOrderParam.getActualAmount();
|
BigDecimal actualAmount = repairOrderParam.getActualAmount();
|
||||||
model.setActualAmount(actualAmount);
|
model.setActualAmount(actualAmount);
|
||||||
repairOrderMapper.updateById(model);
|
repairOrderMapper.updateById(model);
|
||||||
|
|
||||||
|
User user = userMapper.selectById(model.getReceiverId());
|
||||||
|
if(user != null){
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addRepairOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.MODIFY_SERVICE_QUOTATION.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已修改服务报价。原服务报价为:" +
|
||||||
|
model.getActualAmount() + ",现服务报价为:" + repairOrderParam.getActualAmount());
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new OperateException("当前工单状态,无法修改服务报价");
|
throw new OperateException("当前工单状态,无法修改服务报价");
|
||||||
}
|
}
|
||||||
|
@ -562,8 +601,16 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
model.setOrderStatus(MaintenanceOrderStatusEnum.RETURNED.getStatus());
|
model.setOrderStatus(MaintenanceOrderStatusEnum.RETURNED.getStatus());
|
||||||
model.setReturnCause(repairOrderParam.getReturnCause());
|
model.setReturnCause(repairOrderParam.getReturnCause());
|
||||||
repairOrderMapper.updateById(model);
|
repairOrderMapper.updateById(model);
|
||||||
|
|
||||||
|
User user = userMapper.selectById(model.getReceiverId());
|
||||||
|
if(user != null){
|
||||||
|
//新增订单操作记录
|
||||||
|
orderOperateRecordService.addRepairOrder(model.getId()
|
||||||
|
,OrderOperateRecordEnum.RETURN_MAINTENANCE_UNIT.getDesc()
|
||||||
|
,"【"+AdminThreadLocal.get("username")+"】已退回维修。退回原因:" + repairOrderParam.getReturnCause() + "。");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new OperateException("当前工单状态,无法退回检修");
|
throw new OperateException("当前工单状态,无法退回维修");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
}
|
}
|
||||||
|
|
||||||
//新增巡检单操作记录
|
//新增巡检单操作记录
|
||||||
orderOperateRecordService.addMaintenanceOrder(model.getId()
|
orderOperateRecordService.addRoutingInspectionOrder(model.getId()
|
||||||
, OrderOperateRecordEnum.NEW_CREATE.getDesc()
|
, OrderOperateRecordEnum.NEW_CREATE.getDesc()
|
||||||
,"客户【"+AdminThreadLocal.get("username")+"】创建了巡检工单。");
|
,"客户【"+AdminThreadLocal.get("username")+"】创建了巡检工单。");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.hcy.admin.service.sparePart.impl;
|
package com.hcy.admin.service.sparePart.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.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -13,8 +14,10 @@ import com.hcy.common.constant.GlobalConstant;
|
||||||
import com.hcy.common.core.PageResult;
|
import com.hcy.common.core.PageResult;
|
||||||
import com.hcy.common.entity.client.Client;
|
import com.hcy.common.entity.client.Client;
|
||||||
import com.hcy.common.entity.client.ClientContacts;
|
import com.hcy.common.entity.client.ClientContacts;
|
||||||
|
import com.hcy.common.entity.order.MaintenanceOrder;
|
||||||
import com.hcy.common.entity.sparePart.SparePart;
|
import com.hcy.common.entity.sparePart.SparePart;
|
||||||
import com.hcy.common.entity.warehouse.Warehouse;
|
import com.hcy.common.entity.warehouse.Warehouse;
|
||||||
|
import com.hcy.common.enums.order.MaintenanceOrderStatusEnum;
|
||||||
import com.hcy.common.exception.OperateException;
|
import com.hcy.common.exception.OperateException;
|
||||||
import com.hcy.common.mapper.client.ClientContactsMapper;
|
import com.hcy.common.mapper.client.ClientContactsMapper;
|
||||||
import com.hcy.common.mapper.client.ClientMapper;
|
import com.hcy.common.mapper.client.ClientMapper;
|
||||||
|
@ -72,11 +75,10 @@ public class SparePartServiceImpl implements ISparePartService {
|
||||||
// 取得查询页的条件
|
// 取得查询页的条件
|
||||||
if (StringUtil.isNotEmpty(params.get("likeWork"))) {
|
if (StringUtil.isNotEmpty(params.get("likeWork"))) {
|
||||||
pageDto.setLikeWork(params.get("likeWork"));
|
pageDto.setLikeWork(params.get("likeWork"));
|
||||||
queryWrapper.like("spare_parts_code", pageDto.getLikeWork());
|
queryWrapper.and(query -> query.like("spare_parts_code", pageDto.getLikeWork())
|
||||||
queryWrapper.or();
|
.or()
|
||||||
queryWrapper.like("spare_parts_name", pageDto.getLikeWork());
|
.like("spare_parts_name", pageDto.getLikeWork()));
|
||||||
}
|
}
|
||||||
|
|
||||||
queryWrapper.eq("is_delete", 0);
|
queryWrapper.eq("is_delete", 0);
|
||||||
queryWrapper.orderByDesc("id");
|
queryWrapper.orderByDesc("id");
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.hibernate.validator.constraints.Length;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,6 +76,12 @@ public class EquipmentParam implements Serializable {
|
||||||
@Length(max = 255, message = "deviceCode参数不能超出255个字符", groups = {create.class, update.class})
|
@Length(max = 255, message = "deviceCode参数不能超出255个字符", groups = {create.class, update.class})
|
||||||
private String deviceCode;
|
private String deviceCode;
|
||||||
|
|
||||||
|
private Date frontPollingTime; //上次巡检时间
|
||||||
|
private Long createTime; // 创建时间
|
||||||
|
|
||||||
private List<Integer> ids; //批量停用
|
private List<Integer> ids; //批量停用
|
||||||
private String clientName; // 客户名称
|
private String clientName; // 客户名称
|
||||||
|
|
||||||
|
private String createTimeStart; // 开始时间
|
||||||
|
private String createTimeEnd; // 结束时间
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.hcy.common.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备管理实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EquipmentDto implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
private Long id; // 主键id
|
||||||
|
private Long clientId; // 客户id
|
||||||
|
private String clientName; // 客户名称
|
||||||
|
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 Date frontPollingTime; //上次巡检时间
|
||||||
|
private String deviceCode; // 设备码
|
||||||
|
private Integer isDelete; // 是否删除: [0=否, 1=是]
|
||||||
|
private Long createTime; // 创建时间
|
||||||
|
private Long updateTime; // 更新时间
|
||||||
|
private Long deleteTime; // 删除时间
|
||||||
|
|
||||||
|
private Long createTimeStartLong; // 开始时间
|
||||||
|
private Long createTimeEndLong; // 结束时间
|
||||||
|
}
|
|
@ -20,7 +20,12 @@ public enum OrderOperateRecordEnum {
|
||||||
FAULT_DETECT(4,"故障检测"),
|
FAULT_DETECT(4,"故障检测"),
|
||||||
CUSTOMER_CONFIRM(5,"客户确认"),
|
CUSTOMER_CONFIRM(5,"客户确认"),
|
||||||
INSPECTION_COMPLETED(5,"巡检完成"),
|
INSPECTION_COMPLETED(5,"巡检完成"),
|
||||||
|
ALTER_RECEIVER_TYPE(5, "修改派单方式"),
|
||||||
|
ALTER_ORDER_DISTANCE(5, "修改抢单范围"),
|
||||||
SPARE_PARTS_RECEIVE(9,"配件领用"),
|
SPARE_PARTS_RECEIVE(9,"配件领用"),
|
||||||
|
MODIFY_SERVICE_QUOTATION(9,"修改服务报价"),
|
||||||
|
RETURN_MAINTENANCE_UNIT(10,"退回维修员"),
|
||||||
|
RETURN_TECHNICIAN(10, "退回检修员"),
|
||||||
UPLOADING_IN_MAINTENANCE(6, "上传维修中照片"),
|
UPLOADING_IN_MAINTENANCE(6, "上传维修中照片"),
|
||||||
UPLOADING_AFTER_REPAIR(7, "上传维修后照片"),
|
UPLOADING_AFTER_REPAIR(7, "上传维修后照片"),
|
||||||
SPARE_PARTS_AUDIT_ONE(5,"备件领用一级审核"),
|
SPARE_PARTS_AUDIT_ONE(5,"备件领用一级审核"),
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
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.EquipmentDto;
|
||||||
import com.hcy.common.dto.largeDataDto.ClientLargeDataDto;
|
import com.hcy.common.dto.largeDataDto.ClientLargeDataDto;
|
||||||
|
import com.hcy.common.dto.order.RepairOrderDto;
|
||||||
import com.hcy.common.entity.client.Equipment;
|
import com.hcy.common.entity.client.Equipment;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@ -16,6 +19,14 @@ import java.util.List;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface EquipmentMapper extends IBaseMapper<Equipment> {
|
public interface EquipmentMapper extends IBaseMapper<Equipment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备列表
|
||||||
|
* @param page
|
||||||
|
* @param form
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<EquipmentDto> pageList(@Param("page") Page page, @Param("form") EquipmentDto form);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取每个省最多设备的前五
|
* 获取每个省最多设备的前五
|
||||||
* @return
|
* @return
|
||||||
|
|
|
@ -42,4 +42,32 @@
|
||||||
equipmentCount DESC
|
equipmentCount DESC
|
||||||
LIMIT 5;
|
LIMIT 5;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="pageList" resultType="com.hcy.common.dto.EquipmentDto">
|
||||||
|
select e.*,c.client_name as clientName
|
||||||
|
from la_equipment as e
|
||||||
|
LEFT JOIN la_client AS c ON e.client_id = c.id
|
||||||
|
where
|
||||||
|
e.is_delete = 0
|
||||||
|
<if test="form.number != null and form.number != ''">
|
||||||
|
and e.number like concat('%', #{form.number}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="form.name != null and form.name != ''">
|
||||||
|
and e.name like concat('%', #{form.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="form.clientId != null">
|
||||||
|
and e.client_id = #{form.clientId}
|
||||||
|
</if>
|
||||||
|
<if test="form.clientName != null and form.clientName != ''">
|
||||||
|
and c.client_name like concat('%', #{form.clientName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="form.deviceStatus != null">
|
||||||
|
and e.device_status = #{form.deviceStatus}
|
||||||
|
</if>
|
||||||
|
<if test="form.createTimeStartLong != null and form.createTimeEndLong != null">
|
||||||
|
and (e.create_time >= ${form.createTimeStartLong} AND e.create_time <= ${form.createTimeEndLong})
|
||||||
|
</if>
|
||||||
|
|
||||||
|
ORDER BY e.id DESC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
LEFT JOIN la_user as u2 on ro.receiver_id = u2.id
|
LEFT JOIN la_user as u2 on ro.receiver_id = u2.id
|
||||||
where
|
where
|
||||||
ro.is_delete = 0
|
ro.is_delete = 0
|
||||||
|
and ro.repair_work_order_flow = 0
|
||||||
<if test="form.id != null">
|
<if test="form.id != null">
|
||||||
and ro.id = #{form.id}
|
and ro.id = #{form.id}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
WHERE
|
WHERE
|
||||||
aa.is_delete = 0
|
aa.is_delete = 0
|
||||||
AND u.is_delete = 0
|
AND u.is_delete = 0
|
||||||
AND aa.role = 6
|
AND aa.role like '%6%'
|
||||||
and u.longitude is not null
|
and u.longitude is not null
|
||||||
and u.latitude is not null
|
and u.latitude is not null
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class RepairOrderController {
|
||||||
IRepairOrderService iRepairOrderService;
|
IRepairOrderService iRepairOrderService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修订单列表
|
* 维修工单池
|
||||||
*
|
*
|
||||||
* @param repairOrderParam 搜索参数
|
* @param repairOrderParam 搜索参数
|
||||||
* @return Object
|
* @return Object
|
||||||
|
|
|
@ -134,8 +134,12 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
|
|
||||||
MaintenanceOrder lastmMaintenanceOrder = maintenanceOrderMapper.findLastMaintenanceOrderByTime(TimeUtil.getCurrentTimeYYYYMMDD());
|
MaintenanceOrder lastmMaintenanceOrder = maintenanceOrderMapper.findLastMaintenanceOrderByTime(TimeUtil.getCurrentTimeYYYYMMDD());
|
||||||
model.setOrderNo(OrderUtil.getOrderNo(lastmMaintenanceOrder == null ? "" :lastmMaintenanceOrder.getOrderNo()));
|
model.setOrderNo(OrderUtil.getOrderNo(lastmMaintenanceOrder == null ? "" :lastmMaintenanceOrder.getOrderNo()));
|
||||||
|
|
||||||
|
|
||||||
model.setCreatorId(FrontThreadLocal.getUserId().longValue());
|
model.setCreatorId(FrontThreadLocal.getUserId().longValue());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
maintenanceOrderMapper.insert(model);
|
maintenanceOrderMapper.insert(model);
|
||||||
|
|
||||||
//新增检修单操作记录
|
//新增检修单操作记录
|
||||||
|
@ -192,6 +196,8 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
BeanUtils.copyProperties(item, vo);
|
BeanUtils.copyProperties(item, vo);
|
||||||
returnData.add(vo);
|
returnData.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(maintenanceOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){
|
if(maintenanceOrderParam.getQueryType() == MaintenanceOrderStatusEnum.NEAREST_TO_ME.getStatus()){
|
||||||
|
@ -214,6 +220,19 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (MaintenanceOrderListVo returnDatum : returnData) {
|
||||||
|
//获取创建人名称
|
||||||
|
User userName = userMapper.selectOne(new LambdaQueryWrapper<User>()
|
||||||
|
.eq(User::getId, returnDatum.getCreatorId()));
|
||||||
|
if(userName != null){
|
||||||
|
returnDatum.setCreatorName(userName.getNickname());
|
||||||
|
}else {
|
||||||
|
SystemAuthAdmin adminName = systemAuthAdminMapper.selectById(returnDatum.getCreatorId());
|
||||||
|
if(adminName != null){
|
||||||
|
returnDatum.setCreatorName(adminName.getNickname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,6 +297,18 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
equipment.getDetailedAddress());
|
equipment.getDetailedAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取创建人名称
|
||||||
|
User userName = userMapper.selectOne(new LambdaQueryWrapper<User>()
|
||||||
|
.eq(User::getId, item.getCreatorId()));
|
||||||
|
if(userName != null){
|
||||||
|
vo.setCreatorName(userName.getNickname());
|
||||||
|
}else {
|
||||||
|
SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.selectById(item.getCreatorId());
|
||||||
|
if(systemAuthAdmin != null){
|
||||||
|
vo.setCreatorName(systemAuthAdmin.getNickname());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
returnData.add(vo);
|
returnData.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +435,7 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
vo.setFaultName(fault.getName());
|
vo.setFaultName(fault.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置创建人姓名
|
/*//设置创建人姓名
|
||||||
if(maintenanceOrder.getOrderSource() == OrderStateEnum.CUSTOMER_REPORT.getStatus()){
|
if(maintenanceOrder.getOrderSource() == OrderStateEnum.CUSTOMER_REPORT.getStatus()){
|
||||||
ClientContacts clientContacts = clientContactsMapper.findClientContactsByUserId(maintenanceOrder.getCreatorId());
|
ClientContacts clientContacts = clientContactsMapper.findClientContactsByUserId(maintenanceOrder.getCreatorId());
|
||||||
if(clientContacts != null){
|
if(clientContacts != null){
|
||||||
|
@ -415,6 +446,17 @@ public class MaintenanceOrderServiceImpl implements IMaintenanceOrderService {
|
||||||
if(systemAuthAdmin != null){
|
if(systemAuthAdmin != null){
|
||||||
vo.setCreatorName(systemAuthAdmin.getNickname());
|
vo.setCreatorName(systemAuthAdmin.getNickname());
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
User userName = userMapper.selectOne(new LambdaQueryWrapper<User>()
|
||||||
|
.eq(User::getId, maintenanceOrder.getCreatorId()));
|
||||||
|
if(userName != null){
|
||||||
|
vo.setCreatorName(userName.getNickname());
|
||||||
|
}else {
|
||||||
|
SystemAuthAdmin systemAuthAdmin = systemAuthAdminMapper.selectById(maintenanceOrder.getCreatorId());
|
||||||
|
if(systemAuthAdmin != null){
|
||||||
|
vo.setCreatorName(systemAuthAdmin.getNickname());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置接单人名称
|
//设置接单人名称
|
||||||
|
|
|
@ -298,12 +298,7 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
,"【"+user.getUsername()+"】已经完成任务");
|
,"【"+user.getUsername()+"】已经完成任务");
|
||||||
}
|
}
|
||||||
|
|
||||||
//将设备状态修改成正常
|
|
||||||
Equipment equipment = equipmentMapper.findEquipmentById(repairOrder.getEquipmentId());
|
|
||||||
if(equipment != null){
|
|
||||||
equipment.setDeviceStatus(EquipmentStateEnum.NORMAL.getStatus());
|
|
||||||
equipmentMapper.updateById(equipment);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repairOrderMapper.updateById(repairOrder);
|
repairOrderMapper.updateById(repairOrder);
|
||||||
|
@ -333,7 +328,7 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
//新增维修单操作记录
|
//新增维修单操作记录
|
||||||
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
||||||
,OrderOperateRecordEnum.FINISH.getDesc()
|
,OrderOperateRecordEnum.FINISH.getDesc()
|
||||||
,"【"+user.getUsername()+"】已经完成任务");
|
,"【"+user.getUsername()+"】确认报废,已经完成任务");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,13 +399,6 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
repairOrder.setCompleteImg(repairOrderParam.getCompleteImg()); // 完工照片
|
repairOrder.setCompleteImg(repairOrderParam.getCompleteImg()); // 完工照片
|
||||||
repairOrderMapper.updateById(repairOrder);
|
repairOrderMapper.updateById(repairOrder);
|
||||||
|
|
||||||
//将设备状态修改成正常
|
|
||||||
Equipment equipment = equipmentMapper.findEquipmentById(repairOrder.getEquipmentId());
|
|
||||||
if(equipment != null){
|
|
||||||
equipment.setDeviceStatus(EquipmentStateEnum.NORMAL.getStatus());
|
|
||||||
equipmentMapper.updateById(equipment);
|
|
||||||
}
|
|
||||||
|
|
||||||
//新增维修单操作记录
|
//新增维修单操作记录
|
||||||
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
||||||
,OrderOperateRecordEnum.FILL_IN_RECEIPT.getDesc()
|
,OrderOperateRecordEnum.FILL_IN_RECEIPT.getDesc()
|
||||||
|
@ -982,6 +970,12 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
||||||
}
|
}
|
||||||
repairOrder.setTotalAmount(actualAmount); // 总金额
|
repairOrder.setTotalAmount(actualAmount); // 总金额
|
||||||
repairOrder.setActualAmount(actualAmount); // 实际金额
|
repairOrder.setActualAmount(actualAmount); // 实际金额
|
||||||
|
}else{
|
||||||
|
//报废选了“是”,这里是发送报废确认
|
||||||
|
//新增维修单操作记录
|
||||||
|
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
||||||
|
,OrderOperateRecordEnum.CUSTOMER_CONFIRM.getDesc()
|
||||||
|
,"客户【"+client.getClientName()+"】已确认报废。");
|
||||||
}
|
}
|
||||||
|
|
||||||
repairOrder.setFaultId(repairOrderParam.getFaultId()); //故障原因id
|
repairOrder.setFaultId(repairOrderParam.getFaultId()); //故障原因id
|
||||||
|
|
|
@ -37,4 +37,6 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
||||||
private Integer creatorId; // 创建人id
|
private Integer creatorId; // 创建人id
|
||||||
private Date cancelOrderTime; // 取消订单时间
|
private Date cancelOrderTime; // 取消订单时间
|
||||||
private String cancelCause; // 取消原因
|
private String cancelCause; // 取消原因
|
||||||
|
private String remark; // 备注
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue