|
@@ -106,6 +106,9 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
|
@Autowired
|
|
|
EasFluMakeDateUtil easFluMakeDateUtil;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ EASCapacityTestUtil easCapacityTestUtil;
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<String, Object>> getSaleOrderInfo(Map<String, Object> map) {
|
|
|
return amsSaleOrderMapper.getSaleOrderInfo(map);
|
|
@@ -902,6 +905,8 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
|
throw new Exception("该车没有GPS定位信息,请联系销售公司物流部,申请是否可以派车。");
|
|
|
}
|
|
|
}
|
|
|
+ //校验结束,上传金蝶
|
|
|
+ pushCarNumberToEas(map);
|
|
|
// 得到车序号表主键
|
|
|
BigDecimal saleOrderMaterialId = DataChange.dataToBigDecimal(map.get("saleOrderMaterialId"));
|
|
|
// 得到承运商
|
|
@@ -2783,5 +2788,40 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
|
|
|
getEasPrimaryIds(Map);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 推送车牌号给金蝶
|
|
|
+ * @param map
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int pushCarNumberToEas(Map<String, Object> map) throws Exception {
|
|
|
+ // 调用EAS接口将车牌号传给金蝶
|
|
|
+ Map<String, Object> totalMap = easCapacityTestUtil.getTotalMap();
|
|
|
+ totalMap.put("input",map);
|
|
|
+ System.out.println(totalMap);
|
|
|
+ String json = JSONUtils.toJSONString(totalMap);
|
|
|
+ System.out.println(json);
|
|
|
+ Map<String,Object> s = joinFeign.pushCarNumberToEas(totalMap);
|
|
|
+ if (s == null || s.size() == 0) {
|
|
|
+ throw new Exception("登录金蝶失败!请重试派车!");
|
|
|
+ }else{
|
|
|
+ try{
|
|
|
+ JSONObject result = new JSONObject(s);
|
|
|
+ //如果status不为1,抛出异常
|
|
|
+ if(!result.getString("status").equals("1")){
|
|
|
+ throw new Exception("上传金蝶失败!请重试派车:"+result.getJSONObject("exception").getString("message"));
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ //只抛出自定义异常
|
|
|
+ if(e.getMessage().contains("Exception")){
|
|
|
+ throw new Exception("上传金蝶失败!请重试派车!");
|
|
|
+ }else{
|
|
|
+ throw new Exception(e.getMessage());
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
}
|