|
@@ -4,11 +4,13 @@ import com.alibaba.druid.support.json.JSONUtils;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.steerinfo.dil.feign.JoinFeign;
|
|
|
+import com.steerinfo.dil.feign.OtmsFeign;
|
|
|
import com.steerinfo.dil.feign.TmsTruckFeign;
|
|
|
import com.steerinfo.dil.mapper.*;
|
|
|
import com.steerinfo.dil.model.*;
|
|
|
import com.steerinfo.dil.service.IAmsSaleOrderService;
|
|
|
import com.steerinfo.dil.util.*;
|
|
|
+import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -93,6 +95,8 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
|
@Resource
|
|
|
EasSaleOrderStatusUtil easSaleOrderStatusUtil;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ OtmsFeign otmsFeign;
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getSaleOrderInfo(Map<String, Object> map) {
|
|
@@ -817,6 +821,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
|
@Override
|
|
|
public int dispatchSteelOrder(List<Map<String, Object>> mapList) throws Exception {
|
|
|
Map<String, Object> stringObjectMap = mapList.get(0);
|
|
|
+ Integer isCheckGps = amsSaleOrderMapper.getDispachSwitch();
|
|
|
Integer saleStatus = amsSaleOrderMapper.findStatus(DataChange.dataToBigDecimal(stringObjectMap.get("saleOrderMaterialId")));
|
|
|
String selfMention = amsSaleOrderMapper.findSelfMention(DataChange.dataToBigDecimal(stringObjectMap.get("saleOrderMaterialId")));
|
|
|
if (saleStatus == 1) {
|
|
@@ -840,6 +845,18 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
|
}
|
|
|
throw new Exception(capacityNumber+"有未完成的运输订单任务,无法派单");
|
|
|
}
|
|
|
+ if(isCheckGps!=null && isCheckGps==0){
|
|
|
+ Map<String,Object> locationResult = null;
|
|
|
+ try{
|
|
|
+ Map<String,Object> data = (Map<String,Object>)otmsFeign.getCurrentLocation(capacityNumber).getData();
|
|
|
+ locationResult = (Map<String,Object>)data.get("result");
|
|
|
+ }catch (Exception e){
|
|
|
+ //出现任何异常不抛出,不终止程序
|
|
|
+ }
|
|
|
+ if(locationResult==null || locationResult.get("lon")==null || locationResult.get("lat")==null){
|
|
|
+ throw new Exception("该车没有GPS定位信息,请联系销售公司物流部,申请是否可以派车。");
|
|
|
+ }
|
|
|
+ }
|
|
|
// 得到车序号表主键
|
|
|
BigDecimal saleOrderMaterialId = DataChange.dataToBigDecimal(map.get("saleOrderMaterialId"));
|
|
|
// 得到承运商
|