【admin】优化# 1、优化配件发货接口添加字段:发货时间 2、优化sparePartPurchase/detail接口返回客户名称,客户地址 3、优化sparePartStockAudit/detai接口的配件列表返回仓库名称
parent
c780e29995
commit
ab69f6bb85
|
@ -114,7 +114,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
//设备编号、名称、地址
|
||||
Equipment equipment = equipmentMapper.selectOne(
|
||||
new QueryWrapper<Equipment>()
|
||||
.eq("id", model.getDeviceId())
|
||||
.eq("id", model.getEquipmentId())
|
||||
.last("limit 1"));
|
||||
vo.setDeviceNumber(equipment.getNumber());
|
||||
vo.setDeviceName(equipment.getName());
|
||||
|
@ -152,7 +152,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
}
|
||||
|
||||
model.setClientId(routingInspectionOrderParam.getClientId()); //客户id
|
||||
model.setDeviceId(routingInspectionOrderParam.getDeviceId());// 设备id
|
||||
model.setEquipmentId(routingInspectionOrderParam.getEquipmentId());// 设备id
|
||||
model.setReceiverId(routingInspectionOrderParam.getReceiverId()); // 接单人id
|
||||
model.setRemark(routingInspectionOrderParam.getRemark()); // 备注
|
||||
model.setReceiverType(routingInspectionOrderParam.getReceiverType()); // 接单类型 0-区域派单;1-距离派单
|
||||
|
|
|
@ -133,11 +133,11 @@ public class SparePartServiceImpl implements ISparePartService {
|
|||
.eq("id", id)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在");
|
||||
|
||||
SparePartDetailVo vo = new SparePartDetailVo();
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
//获取仓库名
|
||||
Warehouse warehouse = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.eq("id", model.getWarehouseId())
|
||||
|
@ -279,25 +279,25 @@ public class SparePartServiceImpl implements ISparePartService {
|
|||
ClientContacts clientId = clientContactsMapper.selectOne(
|
||||
new QueryWrapper<ClientContacts>()
|
||||
.eq("admin_id", adminId)
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
Assert.notNull(clientId, "数据不存在!");
|
||||
//当前用户所属客户的配件采购价格因子
|
||||
Client model = clientMapper.selectOne(
|
||||
new QueryWrapper<Client>()
|
||||
.eq("id", clientId.getClientId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
BigDecimal purchaseDivisor = model.getPurchaseDivisor(); // 配件采购价格因子
|
||||
BigDecimal purchaseDivisor = null;
|
||||
if(clientId != null){
|
||||
//当前用户所属客户的配件采购价格因子
|
||||
Client model = clientMapper.selectOne(
|
||||
new QueryWrapper<Client>()
|
||||
.eq("id", clientId.getClientId())
|
||||
.last("limit 1"));
|
||||
purchaseDivisor = model.getPurchaseDivisor(); // 配件采购价格因子
|
||||
}
|
||||
|
||||
List<SparePartListVo> list = new LinkedList<>();
|
||||
for(SparePart item : iPage.getRecords()) {
|
||||
SparePartListVo vo = new SparePartListVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
//采购员采购时的销售价(配件采购里的销售价)=配件价格*配件采购价格因子(当前用户所属客户的配件采购价格因子)
|
||||
vo.setUnitPrice(vo.getUnitPrice().multiply(purchaseDivisor)); // 采购员采购时的销售价
|
||||
if(purchaseDivisor != null){
|
||||
//采购员采购时的销售价(配件采购里的销售价)=配件价格*配件采购价格因子(当前用户所属客户的配件采购价格因子)
|
||||
vo.setUnitPrice(vo.getUnitPrice().multiply(purchaseDivisor)); // 采购员采购时的销售价
|
||||
}
|
||||
vo.setCreateTime(TimeUtil.timestampToDate(item.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtil.timestampToDate(item.getUpdateTime()));
|
||||
Warehouse warehouse = warehouseMapper.selectOne(
|
||||
|
|
|
@ -84,7 +84,6 @@ public class SparePartInWarehouseServiceImpl implements ISparePartInWarehouseSer
|
|||
Warehouse warehouse = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.eq("id", item.getWarehouseId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
vo.setWarehouseName(warehouse.getWarehouseName());
|
||||
list.add(vo);
|
||||
|
@ -115,7 +114,6 @@ public class SparePartInWarehouseServiceImpl implements ISparePartInWarehouseSer
|
|||
Warehouse warehouse = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.eq("id", model.getWarehouseId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
vo.setWarehouseName(warehouse.getWarehouseName());
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.hcy.admin.AdminThreadLocal;
|
||||
import com.hcy.admin.service.region.IDevRegionService;
|
||||
import com.hcy.admin.service.sparePartPurchase.ISparePartPurchaseService;
|
||||
import com.hcy.admin.validate.common.PageParam;
|
||||
import com.hcy.admin.validate.sparePartStockAudit.SparePartStockAuditParam;
|
||||
|
@ -11,12 +12,16 @@ import com.hcy.admin.vo.SparePartAudit.SparePartAuditListVo;
|
|||
import com.hcy.admin.vo.sparePartPurchase.SparePartPurchaseListVo;
|
||||
import com.hcy.common.core.PageResult;
|
||||
import com.hcy.common.entity.SparePartAudit.SparePartAudit;
|
||||
import com.hcy.common.entity.client.Client;
|
||||
import com.hcy.common.entity.client.ClientContacts;
|
||||
import com.hcy.common.entity.sparePart.SparePart;
|
||||
import com.hcy.common.entity.sparePartStockAudit.SparePartStockAudit;
|
||||
import com.hcy.common.entity.warehouse.Warehouse;
|
||||
import com.hcy.common.enums.audit.AuditStateEnum;
|
||||
import com.hcy.common.exception.OperateException;
|
||||
import com.hcy.common.mapper.SparePartAudit.SparePartAuditMapper;
|
||||
import com.hcy.common.mapper.client.ClientContactsMapper;
|
||||
import com.hcy.common.mapper.client.ClientMapper;
|
||||
import com.hcy.common.mapper.sparePart.SparePartMapper;
|
||||
import com.hcy.common.mapper.sparePartStockAudit.SparePartStockAuditMapper;
|
||||
import com.hcy.common.mapper.warehouse.WarehouseMapper;
|
||||
|
@ -47,6 +52,15 @@ public class SparePartPurchaseServiceImpl implements ISparePartPurchaseService {
|
|||
@Resource
|
||||
WarehouseMapper warehouseMapper;
|
||||
|
||||
@Resource
|
||||
ClientContactsMapper clientContactsMapper;
|
||||
|
||||
@Resource
|
||||
ClientMapper clientMapper;
|
||||
|
||||
@Resource
|
||||
private IDevRegionService regionService;
|
||||
|
||||
/**
|
||||
* 备件采购列表
|
||||
*
|
||||
|
@ -185,6 +199,28 @@ public class SparePartPurchaseServiceImpl implements ISparePartPurchaseService {
|
|||
vo.setSparePartAuditList(listVo);
|
||||
vo.setResponsiblePersonPhone(vo.getResponsiblePerson() + "/" + vo.getPhone()); //采购人/联系电话
|
||||
|
||||
|
||||
//获取客户id
|
||||
ClientContacts clientId = clientContactsMapper.selectOne(
|
||||
new QueryWrapper<ClientContacts>()
|
||||
.eq("admin_id", model.getResponsiblePersonId())
|
||||
.last("limit 1"));
|
||||
Map<Long, String> regionMap = regionService.getRegionMap();
|
||||
if(clientId != null) {
|
||||
//获取当前用户的客户,获取客户名称、地址
|
||||
Client client = clientMapper.selectOne(
|
||||
new QueryWrapper<Client>()
|
||||
.eq("id", clientId.getClientId())
|
||||
.last("limit 1"));
|
||||
vo.setClientName(client.getClientName());
|
||||
//获取客户地址
|
||||
String province = regionMap.get(client.getProvinceId());
|
||||
String city = regionMap.get(client.getCityId());
|
||||
String district = regionMap.get(client.getDistrictId());
|
||||
|
||||
vo.setClientAddress(province + city + district + client.getAddress());
|
||||
}
|
||||
|
||||
vo.setHandlingTime(TimeUtil.timestampToDate(model.getHandlingTime())); //经办时间
|
||||
return vo;
|
||||
}
|
||||
|
@ -239,6 +275,9 @@ public class SparePartPurchaseServiceImpl implements ISparePartPurchaseService {
|
|||
model.setPurchaseStatus(AuditStateEnum.UNREVIEWED.getStatus()); //状态 未审核
|
||||
}
|
||||
|
||||
//获取当前用户id
|
||||
Integer adminId = AdminThreadLocal.getAdminId();
|
||||
model.setResponsiblePersonId(adminId);
|
||||
// 获取当前的用户
|
||||
Object username = AdminThreadLocal.get("username");
|
||||
model.setResponsiblePerson((String) username); // 经办人
|
||||
|
@ -302,6 +341,9 @@ public class SparePartPurchaseServiceImpl implements ISparePartPurchaseService {
|
|||
}else {
|
||||
model.setPurchaseStatus(AuditStateEnum.UNREVIEWED.getStatus()); //状态 未审核
|
||||
}
|
||||
//获取当前用户id
|
||||
Integer adminId = AdminThreadLocal.getAdminId();
|
||||
model.setResponsiblePersonId(adminId);
|
||||
// 获取当前的用户
|
||||
Object username = AdminThreadLocal.get("username");
|
||||
model.setResponsiblePerson((String) username); // 经办人
|
||||
|
@ -509,6 +551,7 @@ public class SparePartPurchaseServiceImpl implements ISparePartPurchaseService {
|
|||
|
||||
model.setConsigner(sparePartStockAuditParam.getConsigner()); //发货人
|
||||
model.setConsignerPhone(sparePartStockAuditParam.getConsignerPhone()); //发货人联系电话
|
||||
model.setConsignerTime(new Date()); //发货时间
|
||||
model.setShipAddress(sparePartStockAuditParam.getShipAddress()); //发货地址
|
||||
model.setLogisticsCompany(sparePartStockAuditParam.getLogisticsCompany()); //物流公司
|
||||
model.setTrackingNumber(sparePartStockAuditParam.getTrackingNumber()); //物流编号
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.hcy.admin.service.sparePartStockAudit.ISparePartStockAuditService;
|
||||
import com.hcy.admin.validate.common.PageParam;
|
||||
import com.hcy.admin.validate.sparePartStockAudit.SparePartStockAuditParam;
|
||||
import com.hcy.admin.vo.SparePartAudit.SparePartAuditListVo;
|
||||
import com.hcy.admin.vo.sparePartStockAudit.SparePartStockAuditListVo;
|
||||
import com.hcy.admin.vo.sparePartStockAudit.SparePartStockAuditDetailVo;
|
||||
import com.hcy.common.core.PageResult;
|
||||
|
@ -86,7 +87,6 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
Warehouse warehouse = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.eq("id", item.getWarehouseId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if (warehouse != null){
|
||||
vo.setWarehouseName(warehouse.getWarehouseName());
|
||||
|
@ -149,7 +149,6 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
Warehouse warehouse = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.eq("id", model.getWarehouseId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if (warehouse != null){
|
||||
vo.setWarehouseName(warehouse.getWarehouseName());
|
||||
|
@ -182,7 +181,7 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
.eq("is_delete", 0)
|
||||
);
|
||||
//获取备件信息
|
||||
List<SparePartAudit> listVo = new ArrayList<>();
|
||||
List<SparePartAuditListVo> listVo = new ArrayList<>();
|
||||
for (SparePartAudit sparePartAudit : stockAuditId) {
|
||||
SparePart sparePart = sparePartMapper.selectOne(
|
||||
new QueryWrapper<SparePart>()
|
||||
|
@ -190,12 +189,20 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
SparePartAudit sparePartAudit1 = new SparePartAudit();
|
||||
SparePartAuditListVo sparePartAudit1 = new SparePartAuditListVo();
|
||||
BeanUtils.copyProperties(sparePart, sparePartAudit1);
|
||||
sparePartAudit1.setId(sparePartAudit.getId());
|
||||
sparePartAudit1.setSparePartsId(sparePart.getId());
|
||||
sparePartAudit1.setStockAuditId(sparePartAudit.getStockAuditId());
|
||||
sparePartAudit1.setCount(sparePartAudit.getCount()); // 入库数量
|
||||
//获取仓库名称
|
||||
Warehouse warehouseName = warehouseMapper.selectOne(
|
||||
new QueryWrapper<Warehouse>()
|
||||
.eq("id", sparePart.getWarehouseId())
|
||||
.last("limit 1"));
|
||||
if (warehouseName != null){
|
||||
sparePartAudit1.setWarehouseName(warehouseName.getWarehouseName());
|
||||
}
|
||||
listVo.add(sparePartAudit1);
|
||||
}
|
||||
vo.setSupplierPhone(model.getSupplier() + "/" + model.getPhone()); // 供应商/电话
|
||||
|
@ -351,7 +358,7 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
// 出库时需要判断库存数量是否大于出库数量,大于才允许出库;反之,提示备件库存数量不足
|
||||
if(sparePart.getQuantity() >= sparePartAudit.getCount()){
|
||||
sparePart.setQuantity(sparePart.getQuantity() - sparePartAudit.getCount());
|
||||
if(model.getPurchaseStatus() == AuditStateEnum.CHECKPENDING.getStatus()){
|
||||
if(model.getPurchaseStatus() != null && model.getPurchaseStatus() == AuditStateEnum.CHECKPENDING.getStatus()){
|
||||
model.setPurchaseStatus(AuditStateEnum.WAITDELIVER.getStatus()); //审核通过改成待发货
|
||||
}
|
||||
}else{
|
||||
|
|
|
@ -375,6 +375,7 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
model.setAge(systemAuthAdminParam.getAge());
|
||||
model.setEmail(systemAuthAdminParam.getEmail());
|
||||
model.setTechnicalGrade(systemAuthAdminParam.getTechnicalGrade());
|
||||
model.setReceiveOrderStatus(systemAuthAdminParam.getReceiveOrderStatus()); // 接单状态
|
||||
systemAuthAdminMapper.insert(model);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ public class RoutingInspectionOrderParam implements Serializable {
|
|||
@DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long clientId;
|
||||
|
||||
@DecimalMin(value = "0", message = "deviceId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long deviceId;
|
||||
@DecimalMin(value = "0", message = "equipmentId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long equipmentId;
|
||||
|
||||
@DecimalMin(value = "0", message = "provinceId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long provinceId;
|
||||
|
|
|
@ -76,4 +76,6 @@ public class SystemAuthAdminParam implements Serializable {
|
|||
private Integer age; // 年龄
|
||||
private String email; // 邮箱
|
||||
private String technicalGrade; // 技术等级
|
||||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class MaintenanceOrderDetailVo implements Serializable {
|
|||
private Long orderSource; // 订单来源 0-客户上报;1-系统创建;2-维修员创建;3-检修员创建;4-客服创建;5-维修主管创建
|
||||
private Long orderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-检测中;4-待客户确认;5-维修中;6-已完成;7-已退单;8-已关闭
|
||||
private Long clientId; // 客户id
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private Long faultId; // 故障id
|
||||
private String faultDescription; // 故障描述
|
||||
private String faultImg; // 故障图片
|
||||
|
|
|
@ -24,7 +24,7 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
|||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long clientId; // 客户id
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private Long receiverId; // 接单人id
|
||||
private Date receiverTime; // 接单时间
|
||||
private String remark; // 备注
|
||||
|
|
|
@ -23,14 +23,14 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
|||
private Date orderAccomplishTime; // 订单完成时间
|
||||
private Long clientId; // 客户id
|
||||
private String clientName; // 客户名称
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private String deviceNumber; //设备编号
|
||||
private String deviceName; //设备名称
|
||||
private String detailedAddress; // 设备详细地址
|
||||
private Long creatorId; // 创建人id
|
||||
private String creatorName; //创建人名称
|
||||
private String createTime; // 创建时间
|
||||
private Long familiarFaultId; // 常见维修结论id
|
||||
private Long faultId; // 故障id
|
||||
private String familiarFaultName; //故障类型
|
||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long receiverId; // 接单人id
|
||||
|
|
|
@ -22,4 +22,5 @@ public class SparePartDetailVo implements Serializable {
|
|||
private Integer quantity; // 库存数量
|
||||
private BigDecimal unitPrice; // 单价
|
||||
private String warehouseName; // 所属仓库名
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -49,5 +50,7 @@ public class SparePartPurchaseListVo implements Serializable {
|
|||
private String createTimeStart;
|
||||
private String createTimeEnd;
|
||||
private String purchaseIdea; //采购意见
|
||||
|
||||
private String clientName; // 客户名称
|
||||
private String clientAddress; // 客户地址
|
||||
private Date consignerTime; //发货时间
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hcy.admin.vo.sparePartStockAudit;
|
||||
|
||||
import com.hcy.admin.vo.SparePartAudit.SparePartAuditListVo;
|
||||
import com.hcy.common.entity.SparePartAudit.SparePartAudit;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
@ -36,7 +37,7 @@ public class SparePartStockAuditDetailVo implements Serializable {
|
|||
private String warehouseName; // 所属仓库名
|
||||
private String importWarehouseName; // 调入仓库名
|
||||
private String exportWarehouseName; // 调出仓库名
|
||||
private List<SparePartAudit> sparePartAuditList; //待入库的备件
|
||||
private List<SparePartAuditListVo> sparePartAuditList; //待入库的备件
|
||||
private Long outInWarehouseType; // 出入库类别(0=采购入库,1=库存调拨,2=员工领料,3=销售出库)
|
||||
private String supplierPhone; // 供应商/电话
|
||||
private String consigneePhone; // 收货单位(人员)/电话
|
||||
|
|
|
@ -17,14 +17,14 @@ public class RoutingInspectionOrderDto implements Serializable {
|
|||
private Date orderAccomplishTime; // 订单完成时间
|
||||
private Long clientId; // 客户id
|
||||
private String clientName; // 客户名称
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private String deviceNumber; //设备编号
|
||||
private String deviceName; //设备名称
|
||||
private String detailedAddress; // 设备详细地址
|
||||
private Long creatorId; // 创建人id
|
||||
private String creatorName; //创建人名称
|
||||
private String createTime; // 创建时间
|
||||
private Long familiarFaultId; // 常见维修结论id
|
||||
private Long faultId; // 故障id
|
||||
private String familiarFaultName; //故障类型
|
||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long receiverId; // 接单人id
|
||||
|
|
|
@ -25,7 +25,7 @@ public class RoutingInspectionOrder implements Serializable {
|
|||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long clientId; // 客户id
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private Long faultId; // 故障id
|
||||
private String faultDescription; // 故障描述
|
||||
private String faultImg; // 故障图片
|
||||
|
@ -46,10 +46,10 @@ public class RoutingInspectionOrder implements Serializable {
|
|||
private String remark; // 备注
|
||||
private Integer creatorId; // 创建人id
|
||||
private Date orderAccomplishTime; // 订单完成时间
|
||||
private Long familiarFaultId; // 常见维修结论id
|
||||
private Date createTime; // 创建时间
|
||||
private Date updateTime; // 更新时间
|
||||
private Integer isDelete; // 是否删除 0-未删除 1-删除
|
||||
private Long maintenanceId; //检修单id
|
||||
private Integer InspectionResult; //巡检结果(0=正常 1=异常)
|
||||
private Integer inspectionResult; //巡检结果(0=正常 1=异常)
|
||||
private String inspectionPhoto; //巡检照片
|
||||
}
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 备件出入库审核实体
|
||||
|
@ -56,4 +57,6 @@ public class SparePartStockAudit implements Serializable {
|
|||
private Integer recipientNumber; //领用数量
|
||||
private Integer purchaseStatus; //配件领用状态(0=待审核,1=未通过,2=待管理员审核,3=待发货,4=待收货,5=已完成,6=填写中,7=收货超期)
|
||||
private String purchaseIdea; //采购意见
|
||||
private Integer responsiblePersonId; //经办人id
|
||||
private Date consignerTime; //发货时间
|
||||
}
|
|
@ -46,4 +46,5 @@ public class SystemAuthAdmin implements Serializable {
|
|||
private String technicalGrade; // 技术等级
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long userId; //用户id
|
||||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
FROM
|
||||
la_routing_inspection_order AS i
|
||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||
LEFT JOIN la_equipment AS e ON i.device_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_common_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
|
||||
WHERE
|
||||
i.is_delete = 0
|
||||
|
@ -54,9 +54,9 @@
|
|||
FROM
|
||||
la_routing_inspection_order AS i
|
||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||
LEFT JOIN la_equipment AS e ON i.device_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_common_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
|
||||
WHERE
|
||||
i.is_delete = 0
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?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.MaintenanceOrderMapper">
|
||||
|
||||
<select id="list" resultType="com.hcy.common.dto.order.MaintenanceOrderDto">
|
||||
SELECT
|
||||
lmo.*,
|
||||
lf.`name` as faultName,
|
||||
lc.client_name as clientName,
|
||||
le.number as equipmentNo,
|
||||
le.name as equipmentName,
|
||||
le.detailed_address as detailedAddress,
|
||||
lsaa.username as creatorName,
|
||||
lu.username as receiverName,
|
||||
le.province_id as equipmentProvinceId,
|
||||
le.district_id as equipmentDistrictId,
|
||||
le.city_id as equipmentCityId
|
||||
FROM
|
||||
la_maintenance_order AS lmo
|
||||
LEFT JOIN la_client AS lc ON lc.id = lmo.client_id
|
||||
LEFT JOIN la_equipment AS le ON le.id = lmo.equipment_id
|
||||
LEFT JOIN la_fault AS lf On lf.id = lmo.fault_id
|
||||
LEFT JOIN la_system_auth_admin AS lsaa ON lsaa.id = lmo.creator_id
|
||||
LEFT JOIN la_user AS lu ON lu.id = lmo.receiver_id
|
||||
<where>
|
||||
lmo.is_delete = 0
|
||||
<if test="param.orderNo != null and param.orderNo != ''">
|
||||
and lmo.order_no like concat('%',#{param.orderNo},'%')
|
||||
</if>
|
||||
<if test="param.orderSource != null">
|
||||
and lmo.order_source = #{param.orderSource}
|
||||
</if>
|
||||
<if test="param.clientName != null and param.clientName != ''">
|
||||
and lc.name like concat('%',#{param.clientName},'%')
|
||||
</if>
|
||||
<if test="param.creatorName != null and param.creatorName != ''">
|
||||
and lsaa.username like concat('%',#{param.creatorName},'%')
|
||||
</if>
|
||||
<if test="param.receiverName != null and param.receiverName != ''">
|
||||
and lu.username like concat('%',#{param.receiverName},'%')
|
||||
</if>
|
||||
<if test="param.orderStatus != null">
|
||||
and order_status = #{param.orderStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
|
@ -16,9 +16,9 @@
|
|||
FROM
|
||||
la_routing_inspection_order AS i
|
||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||
LEFT JOIN la_equipment AS e ON i.device_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_common_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
|
||||
WHERE
|
||||
i.is_delete = 0
|
||||
|
@ -54,9 +54,9 @@
|
|||
FROM
|
||||
la_routing_inspection_order AS i
|
||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||
LEFT JOIN la_equipment AS e ON i.device_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_common_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
|
||||
WHERE
|
||||
i.is_delete = 0
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -112,7 +113,7 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
//设备编号、名称、地址
|
||||
Equipment equipment = equipmentMapper.selectOne(
|
||||
new QueryWrapper<Equipment>()
|
||||
.eq("id", model.getDeviceId())
|
||||
.eq("id", model.getEquipmentId())
|
||||
.last("limit 1"));
|
||||
vo.setDeviceNumber(equipment.getNumber());
|
||||
vo.setDeviceName(equipment.getName());
|
||||
|
@ -144,7 +145,9 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
model.setReceiverTime(new Date()); //接单时间
|
||||
model.setInspectionOrderStatus(OrderStateEnum.TO_BE_INSPECTED.getStatus()); //用户接单后工单状态为待巡检
|
||||
|
||||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
||||
|
@ -182,7 +185,11 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
model.setFaultId(routingInspectionOrderParam.getFaultId()); // 故障id
|
||||
model.setFaultDescription(routingInspectionOrderParam.getFaultDescription()); // 故障描述
|
||||
model.setInspectionResult(routingInspectionOrderParam.getInspectionResult()); //巡检结果(0=正常 1=异常)
|
||||
String inspectionResultRemark = routingInspectionOrderParam.getInspectionResultRemark();//巡检结果备注
|
||||
model.setInspectionPhoto(routingInspectionOrderParam.getInspectionPhoto()); // 巡检照片
|
||||
model.setInspectionOrderStatus(OrderStateEnum.COMPLETED.getStatus()); //故障检测完工单状态就为已完成
|
||||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
|
|
@ -36,8 +36,8 @@ public class RoutingInspectionOrderParam implements Serializable {
|
|||
@DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long clientId;
|
||||
|
||||
@DecimalMin(value = "0", message = "deviceId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long deviceId;
|
||||
@DecimalMin(value = "0", message = "equipmentId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long equipmentId;
|
||||
|
||||
@DecimalMin(value = "0", message = "provinceId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long provinceId;
|
||||
|
@ -62,6 +62,10 @@ public class RoutingInspectionOrderParam implements Serializable {
|
|||
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||
private BigDecimal orderDistance; // 订单距离
|
||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Integer InspectionResult; //巡检结果(0=正常 1=异常)
|
||||
private Integer inspectionResult; //巡检结果(0=正常 1=异常)
|
||||
private Long faultId; // 故障id
|
||||
private String faultDescription; // 故障描述
|
||||
private String inspectionResultRemark; //巡检结果备注
|
||||
private String inspectionPhoto; //巡检照片
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
|||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long clientId; // 客户id
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private Long receiverId; // 接单人id
|
||||
private Date receiverTime; // 接单时间
|
||||
private String remark; // 备注
|
||||
|
|
|
@ -18,7 +18,7 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
|||
private Date orderAccomplishTime; // 订单完成时间
|
||||
private Long clientId; // 客户id
|
||||
private String clientName; // 客户名称
|
||||
private Long deviceId; // 设备id
|
||||
private Long equipmentId; // 设备id
|
||||
private String deviceNumber; //设备编号
|
||||
private String deviceName; //设备名称
|
||||
private String detailedAddress; // 设备详细地址
|
||||
|
|
Loading…
Reference in New Issue