Browse Source

修改工单超时

single_db
caoyizhong 1 year ago
parent
commit
1c286167a0
  1. 9
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesCompletionRecipientEntity.java
  2. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesCompletionRecordEntity.java
  3. 9
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java
  4. 4
      blade-service/logpm-aftersales/pom.xml
  5. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  6. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesOvertimeFineMapper.xml
  7. 37
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

9
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesCompletionRecipientEntity.java

@ -90,11 +90,16 @@ public class AftersalesCompletionRecipientEntity extends TenantEntity {
* 异常工单ID
*/
@ApiModelProperty(value = "异常工单ID")
private String workOrderId;
private Long workOrderId;
/**
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
/**
* 说明
*/
@ApiModelProperty(value = "说明")
private String explain;
}

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesCompletionRecordEntity.java

@ -96,11 +96,11 @@ public class AftersalesCompletionRecordEntity extends TenantEntity {
* 异常工单ID
*/
@ApiModelProperty(value = "异常工单ID")
private String workOrderId;
private Long workOrderId;
/**
* 仓库ID
*/
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
private Long warehouseId;
}

9
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessorEntity.java

@ -97,4 +97,13 @@ public class AftersalesProcessorEntity extends TenantEntity {
@ApiModelProperty(value = "仓库ID")
private Long warehouseId;
/**
* 指派时间
*/
@ApiModelProperty(value = "指派时间")
private Date assignTime;
}

4
blade-service/logpm-aftersales/pom.xml

@ -73,6 +73,10 @@
<artifactId>blade-biz-common</artifactId>
<version>${bladex.project.version}</version>
</dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
</dependencies>
<build>
<plugins>

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -23,6 +23,7 @@ import com.logpm.aftersales.entity.AftersalesSettlementEntity;
import com.logpm.aftersales.excel.AftersalesWorkOrderImporter;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.xxl.job.core.handler.annotation.XxlJob;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -39,6 +40,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.User;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
@ -145,12 +147,15 @@ public class AftersalesWorkOrderController extends BladeController {
}
/**
* 客服异常工单 查询处理超时的数据 待处理
* 客服异常工单 查询处理超时的数据 待处理r
*/
@GetMapping("/isItTimeout")
// @GetMapping("/isItTimeout")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询处理超时的数据", notes = "传入aftersalesWorkOrder")
@XxlJob("syncWarehouseToNew")
@Scheduled(cron = "0 0/1 * * * ?")
public void getIsItTimeout() {
log.info("查询处理超时的数据>>>>>>>>");
aftersalesWorkOrderService.getIsItTimeout();
}

3
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesOvertimeFineMapper.xml

@ -25,7 +25,8 @@
<result column="remarks" property="remarks"/>
</resultMap>
<select id="pageListOwn" resultType="com.logpm.aftersales.vo.AftersalesOvertimeFineVO" >
select laof.id,lawo.work_order_number workOrderNumber,lawo.work_order_type workOrderType,lawo.discovery_node discoveryNode,COUNT(laof.id) ,laof.create_time createTime,laof.timeout
select laof.id,lawo.work_order_number workOrderNumber,lawo.work_order_type workOrderType,lawo.discovery_node discoveryNode,COUNT(laof.id) ,laof.create_time createTime,
laof.timeout,laof.money
from logpm_aftersales_overtime_fine laof
LEFT JOIN logpm_aftersales_work_order lawo on lawo.id = laof.work_order_id
<where>

37
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -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);
}

Loading…
Cancel
Save