|
@@ -1,5 +1,6 @@
|
|
|
package com.steerinfo.dil.service.impl;
|
|
|
|
|
|
+import com.steerinfo.dil.feign.OmsFeign;
|
|
|
import com.steerinfo.dil.mapper.TmstruckTimeTaskResultMapper;
|
|
|
import com.steerinfo.dil.mapper.UtilsMapper;
|
|
|
import com.steerinfo.dil.model.TmstruckTimeTaskResult;
|
|
@@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.xml.crypto.Data;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
@@ -38,6 +40,9 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
|
|
|
private UtilsMapper utilsMapper;
|
|
|
@Autowired
|
|
|
private UtilsServiceImpl utilsService;
|
|
|
+ @Autowired
|
|
|
+ private OmsFeign omsFeign;
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -146,6 +151,9 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
|
|
|
//如果订单类型为5
|
|
|
String personnelSsoId =(String) map.get("personnelSsoId");
|
|
|
String orderNumber =(String) map.get("orderNumber");
|
|
|
+ //根据运输订单号查找运输订单id
|
|
|
+ BigDecimal orderId = utilsMapper.getOrderIdByOrderNumber(orderNumber);
|
|
|
+ map.put("orderId",orderId);
|
|
|
BigDecimal inwardType =DataChange.dataToBigDecimal(map.get("inwardType"));
|
|
|
if (inwardType.intValue()==5){
|
|
|
generateTimeTaskResult(map);
|
|
@@ -164,11 +172,39 @@ public class TmstruckTimeTaskResultServiceImpl implements ITmstruckTimeTaskResul
|
|
|
tmstruckTimeTaskResult.setTimeTaskResultId(tmstruckTimeTaskResult.getTimeTaskResultId());
|
|
|
tmstruckTimeTaskResult.setResultValue(new BigDecimal((dueTime/(1000*60))));
|
|
|
tmstruckTimeTaskResult.setUpdateTime(new Date());
|
|
|
+ tmstruckTimeTaskResult.setUpdateUsername(personnelSsoId);
|
|
|
i+=tmstruckTimeTaskResultMapper.updateByPrimaryKeySelective(tmstruckTimeTaskResult);
|
|
|
+ //判断计时结束后推送新的订单
|
|
|
+ pushOrderForPause(map);
|
|
|
}
|
|
|
|
|
|
return i;
|
|
|
}
|
|
|
+ //判断计时订单结束后推单
|
|
|
+ @Override
|
|
|
+ public int pushOrderForPause(Map<String, Object> map) {
|
|
|
+ int i=0;
|
|
|
+ //关闭内转订单
|
|
|
+ map.put("orderStatus", 2);
|
|
|
+ i = utilsMapper.updateOrderStatusByOrderIdOrNum(map);
|
|
|
+ BigDecimal orderId1 = DataChange.dataToBigDecimal(map.get("orderId"));
|
|
|
+ map= tmstruckTimeTaskResultMapper.selectInwardDueTimeByOrderId(orderId1);
|
|
|
+ //根据运输订单id查找需求日期是否超过一个月
|
|
|
+ if(map != null) {
|
|
|
+ Date dueDate = (Date) map.get("dueTime");
|
|
|
+ //当前时间小于截至日期
|
|
|
+ long DueTime = dueDate.getTime() + 86400000;
|
|
|
+ //获取当前时间
|
|
|
+ Date date = new Date();
|
|
|
+ long nowTime = date.getTime();
|
|
|
+ if (nowTime < DueTime) {
|
|
|
+ //推送
|
|
|
+ omsFeign.addNewTransportOrder(orderId1);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 司机申请结束
|