【admin&front】新增&优化# 1.修复若干bug 2.新增仓库配件数量 3、优化配件采购列表新增客户名称
parent
75c1388eb9
commit
3bbc1d47a6
|
@ -531,19 +531,18 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
.eq("id", repairOrderParam.getId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
model.setReceiverId(repairOrderParam.getReceiverId());
|
||||
|
||||
//如果是退单状态,重新派工后状态改为待接单
|
||||
if(model.getOrderStatus() == OrderStateEnum.RETURNED_ORDER.getStatus()){
|
||||
model.setOrderStatus(OrderStateEnum.PENDING_ORDER.getStatus());
|
||||
}
|
||||
repairOrderMapper.updateById(model);
|
||||
|
||||
//重新指派员工
|
||||
if(repairOrderParam.getReceiverId() != null && repairOrderParam.getId() != null){
|
||||
model.setOrderStatus(MaintenanceOrderStatusEnum.PENDING_ORDER.getStatus());
|
||||
model.setReceiverId(repairOrderParam.getReceiverId()); // 接单人id
|
||||
repairOrderMapper.updateById(model);
|
||||
|
||||
User user = userMapper.selectById(repairOrderParam.getReceiverId());
|
||||
if(user != null){
|
||||
|
|
|
@ -17,6 +17,8 @@ import com.hcy.common.constant.GlobalConstant;
|
|||
import com.hcy.common.core.PageResult;
|
||||
import com.hcy.common.dto.order.OrderSparePart;
|
||||
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.order.MaintenanceOrder;
|
||||
import com.hcy.common.entity.order.RepairOrder;
|
||||
import com.hcy.common.entity.sparePart.SparePart;
|
||||
|
@ -31,6 +33,8 @@ import com.hcy.common.enums.order.MaintenanceOrderStatusEnum;
|
|||
import com.hcy.common.enums.order.OrderOperateRecordEnum;
|
||||
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.order.MaintenanceOrderMapper;
|
||||
import com.hcy.common.mapper.order.OrderSparePartMapper;
|
||||
import com.hcy.common.mapper.order.RepairOrderMapper;
|
||||
|
@ -86,6 +90,12 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
@Resource
|
||||
OrderOperateRecordServiceImpl orderOperateRecordService;
|
||||
|
||||
@Resource
|
||||
ClientMapper clientMapper;
|
||||
|
||||
@Resource
|
||||
ClientContactsMapper clientContactsMapper;
|
||||
|
||||
/**
|
||||
* 备件出入库审核列表
|
||||
*
|
||||
|
@ -273,6 +283,24 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
}
|
||||
}
|
||||
|
||||
// 获取客户名称
|
||||
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(new LambdaQueryWrapper<SystemAuthAdmin>()
|
||||
.eq(SystemAuthAdmin::getId, item.getCreatorId()));
|
||||
if(authAdmin != null){
|
||||
ClientContacts clientContacts = clientContactsMapper.selectOne(new LambdaQueryWrapper<ClientContacts>()
|
||||
.eq(ClientContacts::getAdminId, authAdmin.getId()));
|
||||
if(clientContacts != null){
|
||||
Client client = clientMapper.selectOne(new LambdaQueryWrapper<Client>()
|
||||
.eq(Client::getId, clientContacts.getClientId()));
|
||||
if(client != null){
|
||||
vo.setClientName(client.getClientName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
list.add(vo);
|
||||
}
|
||||
|
||||
|
@ -531,6 +559,8 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
model.setAuditState(AuditStateEnum.AUDITED.getStatus()); // 审核状态(0=未审核,1=已审核,2=已取消)
|
||||
model.setAuditTime(new Date()); // 审核时间
|
||||
model.setAuditIdea(sparePartStockAuditParam.getAuditIdea()); // 审核意见
|
||||
model.setAuditorId(Long.valueOf(AdminThreadLocal.getAdminId())); // 审核人id
|
||||
|
||||
|
||||
// 出库时需要判断库存数量是否大于出库数量,大于才允许出库;反之,提示备件库存数量不足
|
||||
//获取待审核备件信息
|
||||
|
@ -827,11 +857,16 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
.eq("id", sparePartAudit.getSparePartsId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if(sparePart != null){
|
||||
// 出库时需要判断库存数量是否大于出库数量,大于才允许出库;反之,提示备件库存数量不足
|
||||
if (sparePart.getQuantity() >= sparePartAudit.getCount()) {
|
||||
} else {
|
||||
throw new OperateException(sparePart.getSparePartsName() + "备件库存数量不足,请联系客服人员!");
|
||||
}
|
||||
}else {
|
||||
throw new OperateException("当前仓库所对应的配件已被删除,请联系客服人员!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (model.getReceiptType() == AuditStateEnum.ALLOT.getStatus()) {
|
||||
|
@ -845,11 +880,16 @@ public class SparePartStockAuditServiceImpl implements ISparePartStockAuditServi
|
|||
.eq("warehouse_id", model.getExportWarehouse())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if(sparePart != null){
|
||||
// 出库时需要判断库存数量是否大于出库数量,大于才允许出库;反之,提示备件库存数量不足
|
||||
if (sparePart.getQuantity() >= sparePartAudit.getCount()) {
|
||||
} else {
|
||||
throw new OperateException(sparePart.getSparePartsName() + "备件库存数量不足,请联系客服人员!");
|
||||
}
|
||||
}else{
|
||||
throw new OperateException("当前仓库所对应的配件已被删除,请联系客服人员!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,12 @@ public class WarehouseServiceImpl implements IWarehouseService {
|
|||
WarehouseDetailVo vo = new WarehouseDetailVo();
|
||||
BeanUtils.copyProperties(warehouse, vo);
|
||||
|
||||
//获取配件数量
|
||||
Integer sparePartCount = sparePartMapper.selectCount(new LambdaQueryWrapper<SparePart>()
|
||||
.eq(SparePart::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||
.eq(SparePart::getWarehouseId, warehouse.getId()));
|
||||
vo.setSparePartCount(sparePartCount);
|
||||
|
||||
vo.setCreateTime(TimeUtil.timestampToDate(warehouse.getCreateTime()));
|
||||
vo.setUpdateTime(TimeUtil.timestampToDate(warehouse.getUpdateTime()));
|
||||
lists.add(vo);
|
||||
|
|
|
@ -49,10 +49,6 @@ public class SparePartStockAuditParam implements Serializable {
|
|||
@Length(max = 32, message = "supplier参数不能超出32个字符", groups = {create.class, update.class})
|
||||
private String supplier;
|
||||
|
||||
//@NotNull(message = "responsiblePerson参数缺失", groups = {create.class, update.class})
|
||||
@Length(max = 32, message = "responsiblePerson参数不能超出32个字符", groups = {create.class, update.class})
|
||||
private String responsiblePerson;
|
||||
|
||||
// @NotNull(message = "handlingTime参数缺失", groups = {create.class, update.class})
|
||||
private Date handlingTime;
|
||||
|
||||
|
@ -105,4 +101,5 @@ public class SparePartStockAuditParam implements Serializable {
|
|||
|
||||
private String createTimeStart; //创建时间
|
||||
private String createTimeEnd; //创建时间
|
||||
private String responsiblePerson; // 经办人
|
||||
}
|
||||
|
|
|
@ -62,4 +62,7 @@ public class SparePartStockAuditDetailVo implements Serializable {
|
|||
private List<OrderSparePartListVo> orderSparePartListVoList; //订单配件
|
||||
private String recipientAndPhone; //领用员工/联系电话
|
||||
private String creator; // 创建人
|
||||
|
||||
private Long auditorId; // 审核人id
|
||||
private String responsiblePerson; // 经办人
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class SparePartStockAuditListVo implements Serializable {
|
|||
private Long importWarehouse; // 调入仓库
|
||||
private Long exportWarehouse; // 调出仓库
|
||||
private String supplier; // 供应商
|
||||
private String responsiblePerson; // 经办人
|
||||
|
||||
private String consignee; // 收货单位(人员)
|
||||
private Integer auditState; // 审核状态(0=未审核,1=已审核,2=已取消)
|
||||
private Integer auditResult; // 审核结果(0=已通过,1=未通过)
|
||||
|
@ -61,4 +61,7 @@ public class SparePartStockAuditListVo implements Serializable {
|
|||
private String recipientAndPhone; //领用员工/联系电话
|
||||
private String supplierPhone; // 供应商/电话
|
||||
private String creator; // 创建人
|
||||
private Long auditorId; // 审核人id
|
||||
private String responsiblePerson; // 经办人
|
||||
private String clientName; // 客户名称
|
||||
}
|
||||
|
|
|
@ -21,5 +21,5 @@ public class WarehouseDetailVo implements Serializable {
|
|||
private String warehouseAddress; // 仓库地址
|
||||
private String createTime; // 创建时间
|
||||
private String updateTime; // 更新时间
|
||||
|
||||
private Integer sparePartCount; // 配件数量
|
||||
}
|
||||
|
|
|
@ -55,5 +55,7 @@ public class SparePartStockAudit implements Serializable {
|
|||
private Integer purchaseStatus; //配件领用状态(0=待审核,1=未通过,2=待管理员审核,3=待发货,4=待收货,5=已完成,6=填写中,7=收货超期)
|
||||
private String purchaseIdea; //采购意见
|
||||
private Date consignerTime; //发货时间
|
||||
private Integer creatorId;
|
||||
private Integer creatorId; // 创建人id
|
||||
private Long auditorId; // 审核人id 经办人
|
||||
|
||||
}
|
|
@ -322,6 +322,8 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
repairOrder.setOrderAccomplishTime(new Date()); //订单完成时间
|
||||
repairOrderMapper.updateById(repairOrder);
|
||||
|
||||
// 用户确认报废就新增操作记录
|
||||
if(repairOrderParam.getScrapConfirmation() == RepairOrderStatusEnum.YES.getStatus()){
|
||||
User user = userMapper.selectById(repairOrder.getReceiverId());
|
||||
if(user != null){
|
||||
//新增维修单操作记录
|
||||
|
@ -331,6 +333,8 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传维修中、维修后照片
|
||||
*/
|
||||
|
@ -924,12 +928,6 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
repairOrder.setWarehouseType(repairOrderParam.getWarehouseType()); // 仓库类型 0-我的仓库 1-公共仓库
|
||||
repairOrder.setQuotationTime(new Date()); // 报价时间
|
||||
|
||||
//新增维修单操作记录
|
||||
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
||||
,OrderOperateRecordEnum.CUSTOMER_QUOTATION.getDesc()
|
||||
,OrderOperateRecordEnum.QUOTATION.getStatus()
|
||||
,"【"+FrontThreadLocal.get("username")+"】已经为客户发送服务报价。");
|
||||
|
||||
Client client = clientMapper.findClientById(repairOrder.getClientId());
|
||||
//判断当前客户是全包还是半包
|
||||
if(client.getMaintainType() == ClientStatusEnum.MODULE_MAINTENANCE_ALL_WRAPPED.getStatus()){
|
||||
|
@ -982,6 +980,12 @@ public class RepairOrderServiceImpl implements IRepairOrderService {
|
|||
}
|
||||
repairOrder.setTotalAmount(actualAmount); // 总金额
|
||||
repairOrder.setActualAmount(actualAmount); // 实际金额
|
||||
|
||||
//新增维修单操作记录
|
||||
orderOperateRecordService.addRepairOrder(repairOrder.getId()
|
||||
,OrderOperateRecordEnum.CUSTOMER_QUOTATION.getDesc()
|
||||
,OrderOperateRecordEnum.QUOTATION.getStatus()
|
||||
,"【"+FrontThreadLocal.get("username")+"】已经为客户发送服务报价。");
|
||||
}else{
|
||||
//报废选了“是”,这里是发送报废确认
|
||||
//新增维修单操作记录
|
||||
|
|
Loading…
Reference in New Issue