|
|
|
@ -257,11 +257,15 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
List<AftersalesProcessorEntity> list = new ArrayList<>(); |
|
|
|
|
aftersalesWorkOrder.getProcessorEntityList().forEach(i ->{ |
|
|
|
|
AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrder, myCurrentWarehouse, i); |
|
|
|
|
list.add(processor); |
|
|
|
|
// list.add(processor);
|
|
|
|
|
//添加指派记录
|
|
|
|
|
if(ProcessorTypesOfStatusConstant.chulifang.getValue().equals(i.getTypesOf())){ |
|
|
|
|
//处理方
|
|
|
|
|
addSurveRecord(aftersalesWorkOrder, user, i); |
|
|
|
|
processor.setAssignTime(new Date()); |
|
|
|
|
list.add(processor); |
|
|
|
|
}else{ |
|
|
|
|
list.add(processor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
@ -481,7 +485,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
LocalDateTime before48Hours = now.minusHours(48); |
|
|
|
|
// 获取48小时前的时间戳(秒数)
|
|
|
|
|
long timestamp = before48Hours.toEpochSecond(ZoneOffset.ofHours(8)); |
|
|
|
|
long l = i.getUpdateTime().getTime() / 1000; |
|
|
|
|
long l = i.getAssignTime().getTime() / 1000; |
|
|
|
|
long l1 = timestamp - l; |
|
|
|
|
if (l1 > 0) { |
|
|
|
|
//已超时
|
|
|
|
@ -495,24 +499,35 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
|
|
|
|
|
// 假设有两个时间戳(秒数)
|
|
|
|
|
long timestamp1 = new Date().getTime() / 1000; // 现在时间
|
|
|
|
|
long timestamp2 = i.getUpdateTime().getTime() / 1000; // 修改时间
|
|
|
|
|
long timestamp2 = i.getAssignTime().getTime() / 1000; // 修改时间
|
|
|
|
|
|
|
|
|
|
// 将时间戳转换为Instant对象
|
|
|
|
|
Instant instant1 = Instant.ofEpochSecond(timestamp1); |
|
|
|
|
Instant instant2 = Instant.ofEpochSecond(timestamp2); |
|
|
|
|
log.info("现在时间》》》{}",instant1); |
|
|
|
|
log.info("修改时间》》》{}",instant2); |
|
|
|
|
// 计算两个时间戳之间的小时差
|
|
|
|
|
Duration duration = Duration.between(instant1, instant2); |
|
|
|
|
|
|
|
|
|
long seconds = duration.getSeconds(); |
|
|
|
|
long hours1 = seconds / 3600; |
|
|
|
|
long minutes = (seconds % 3600) / 60; |
|
|
|
|
long remainingseconds = seconds % 60; |
|
|
|
|
String formattedTime = String.format("%02d:%02d:%02d", Math.abs(hours1), Math.abs(minutes), Math.abs(remainingseconds) ); // 差值格式化为HH:m:ss形武
|
|
|
|
|
System.out.println("时间差为: "+ formattedTime); // 出结
|
|
|
|
|
|
|
|
|
|
long hours = duration.toHours(); |
|
|
|
|
Integer number = Integer.valueOf((int)hours); |
|
|
|
|
Integer number =Math.abs( Integer.valueOf((int)hours) ); |
|
|
|
|
int i1 = DictTimeoutEnum.huifushijian.getValue(); |
|
|
|
|
int ci = 0; |
|
|
|
|
while (number > i1) { |
|
|
|
|
i1 += DictTimeoutEnum.huifushijian.getValue(); |
|
|
|
|
ci += 1; |
|
|
|
|
} |
|
|
|
|
//查询超时的记录
|
|
|
|
|
//查询处理方的超时的记录
|
|
|
|
|
List<AftersalesOvertimeFineEntity> list = aftersalesOvertimeFineService.list(Wrappers.<AftersalesOvertimeFineEntity>query().lambda() |
|
|
|
|
.eq(AftersalesOvertimeFineEntity::getWorkOrderId, i.getId()) |
|
|
|
|
.eq(AftersalesOvertimeFineEntity::getWorkOrderId, i.getWorkOrderId()) |
|
|
|
|
.eq(AftersalesOvertimeFineEntity::getProcessorId, i.getId()) |
|
|
|
|
); |
|
|
|
|
int size = list.size(); |
|
|
|
|
for (int q = 0; q < ci ; q++){ |
|
|
|
@ -525,9 +540,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
aftersalesProcessorService.updateById(processor); |
|
|
|
|
//添加超时记录
|
|
|
|
|
AftersalesOvertimeFineEntity overtimeFineEntity = new AftersalesOvertimeFineEntity(); |
|
|
|
|
overtimeFineEntity.setWorkOrderId(i.getId()); |
|
|
|
|
overtimeFineEntity.setWorkOrderId(i.getWorkOrderId()); |
|
|
|
|
overtimeFineEntity.setMoney(BigDecimal.valueOf(50)); |
|
|
|
|
overtimeFineEntity.setTimeout(String.valueOf(hours)); |
|
|
|
|
overtimeFineEntity.setTimeout(formattedTime); |
|
|
|
|
overtimeFineEntity.setBusinessId(i.getBusinessId()); |
|
|
|
|
overtimeFineEntity.setBusinessName(i.getBusinessName()); |
|
|
|
|
overtimeFineEntity.setProcessorId(i.getId()); |
|
|
|
@ -535,9 +550,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
}else if(q > size){ |
|
|
|
|
//添加新的超时记录
|
|
|
|
|
AftersalesOvertimeFineEntity overtimeFineEntity = new AftersalesOvertimeFineEntity(); |
|
|
|
|
overtimeFineEntity.setWorkOrderId(i.getId()); |
|
|
|
|
overtimeFineEntity.setWorkOrderId(i.getWorkOrderId()); |
|
|
|
|
overtimeFineEntity.setMoney(BigDecimal.valueOf(50)); |
|
|
|
|
overtimeFineEntity.setTimeout(String.valueOf(hours)); |
|
|
|
|
overtimeFineEntity.setTimeout(formattedTime); |
|
|
|
|
overtimeFineEntity.setBusinessId(i.getBusinessId()); |
|
|
|
|
overtimeFineEntity.setBusinessName(i.getBusinessName()); |
|
|
|
|
overtimeFineEntity.setProcessorId(i.getId()); |
|
|
|
@ -1043,6 +1058,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
//不存在 添加处理方信息
|
|
|
|
|
AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrderDTO, myCurrentWarehouse, i); |
|
|
|
|
processor.setConditions(ProcessorConditionsStatusConstant.xinzeng.getValue()); |
|
|
|
|
processor.setAssignTime(new Date()); |
|
|
|
|
processorEntityList.add(processor); |
|
|
|
|
} |
|
|
|
|
//添加指定处理结果
|
|
|
|
@ -1291,6 +1307,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
AftersalesProcessorEntity processor = new AftersalesProcessorEntity(); |
|
|
|
|
processor.setId(one.getId()); |
|
|
|
|
processor.setProcessingStatus(type); |
|
|
|
|
processor.setAssignTime(new Date()); |
|
|
|
|
return aftersalesProcessorService.updateById(processor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|