|
@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
@@ -150,7 +151,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
//查询是此订单是否已签收过
|
|
|
Integer check = utilsMapper.checkoutReceipt(orderNumber);
|
|
|
if(check == null){
|
|
|
- autoReceipt(orderNumber);
|
|
|
+ autoReceipt(orderNumber, map.get("resultTareWeightTime"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -184,7 +185,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
//查询是此订单是否已签收过
|
|
|
Integer check = utilsMapper.checkoutReceipt(orderNumber);
|
|
|
if(check == null){
|
|
|
- autoReceipt(orderNumber);
|
|
|
+ autoReceipt(orderNumber, map.get("resultTareWeightTime"));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -296,14 +297,23 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
* 自动签收
|
|
|
* @return
|
|
|
*/
|
|
|
- public void autoReceipt(String orderNumber){
|
|
|
+ public void autoReceipt(String orderNumber, Object tareWeightTime){
|
|
|
TmstruckReceiptResult tmstruckReceiptResult = new TmstruckReceiptResult();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
//通过运输订单号查询总实绩ID
|
|
|
BigDecimal resultTotalId = utilsMapper.getTotalIdByOrderNumber(orderNumber);
|
|
|
tmstruckReceiptResult.setResultTotalId(resultTotalId);
|
|
|
tmstruckReceiptResult.setStatus(new BigDecimal(1));
|
|
|
tmstruckReceiptResult.setInsertUsername("admin");
|
|
|
- tmstruckReceiptResult.setInsertTime(new Date());
|
|
|
+ Date receiptTime;
|
|
|
+ try {
|
|
|
+ //取皮重时间为收货时间
|
|
|
+ receiptTime = sdf.parse((String) tareWeightTime);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ receiptTime = new Date();
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ }
|
|
|
+ tmstruckReceiptResult.setInsertTime(receiptTime);
|
|
|
int i = tmstruckReceiptResultMapper.updateByTotalResultId(tmstruckReceiptResult);
|
|
|
if(i == 1) {
|
|
|
System.out.println(orderNumber + "收货成功");
|