|
@@ -83,7 +83,13 @@ public class OmstrainOrderServiceImpl implements IOmstrainOrderService {
|
|
|
if(map.get("trainOrderId") != null){
|
|
|
trainOrderId = DataChange.dataToBigDecimal(map.get("trainOrderId"));
|
|
|
}else{
|
|
|
- trainOrderId = omstrainOrderMapper.getTrainOrder();
|
|
|
+
|
|
|
+ List<BigDecimal> trainOrderIds = omstrainOrderMapper.getTrainOrderIds(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
|
+ if(trainOrderIds.size() > 0){
|
|
|
+ trainOrderId = trainOrderIds.get(0);
|
|
|
+ }else{
|
|
|
+ trainOrderId = omstrainOrderMapper.getTrainOrder();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
String trainOrderNumber = DataChange.generateEightDigitsNumber("WHYDD",trainOrderId.intValue());
|
|
@@ -136,51 +142,56 @@ public class OmstrainOrderServiceImpl implements IOmstrainOrderService {
|
|
|
}else{
|
|
|
i =+ omstrainOrderMapper.insertSelective(omstrainOrder);
|
|
|
}
|
|
|
-
|
|
|
- Map<String, Object> RemoteMap = joinFeign.selectSaleSteelOrder(map);
|
|
|
- List<Map<String,Object>> data =(List<Map<String, Object>>) RemoteMap.get("data");
|
|
|
-
|
|
|
- String inwardWarehouse = omstrainOrderMapper.getInwardWarehouse(orderId);
|
|
|
- if (inwardWarehouse!=null) {
|
|
|
- if (inwardWarehouse.contains("重庆金田")) {
|
|
|
- for (Map<String,Object> jintianMap:data) {
|
|
|
- Map<String, Object> orchardStorehouse = new HashMap<>();
|
|
|
- List<Map<String, Object>> orchardStorehouseList = new ArrayList<>();
|
|
|
- Object sendTime = jintianMap.get("sendTime");
|
|
|
- String transportType = (String) jintianMap.get("transportType");
|
|
|
-
|
|
|
- orchardStorehouse.put("sendTime", sendTime);
|
|
|
-
|
|
|
- orchardStorehouse.put("sysCode", "DGXT");
|
|
|
-
|
|
|
- orchardStorehouse.put("warehouseCode", "LJJT");
|
|
|
-
|
|
|
- orchardStorehouse.put("transportType", transportType);
|
|
|
-
|
|
|
- jintianMap.remove("sendTime");
|
|
|
- jintianMap.remove("transportType");
|
|
|
- orchardStorehouseList.add(jintianMap);
|
|
|
- orchardStorehouse.put("details", orchardStorehouseList);
|
|
|
-
|
|
|
- sendMesToGuoyuan(orchardStorehouse);
|
|
|
- }
|
|
|
- } else if (inwardWarehouse.contains("成都城嘉")) {
|
|
|
-
|
|
|
-
|
|
|
- String token = DagonloginChenJiaku();
|
|
|
- if (token != null) {
|
|
|
- for (Map<String,Object> map1:data) {
|
|
|
- map1.put("token", token);
|
|
|
-
|
|
|
- sendMesToChengJia(map1);
|
|
|
+ try {
|
|
|
+ Map<String, Object> RemoteMap = joinFeign.selectSaleSteelOrder(map);
|
|
|
+ List<Map<String,Object>> data =(List<Map<String, Object>>) RemoteMap.get("data");
|
|
|
+
|
|
|
+ String inwardWarehouse = omstrainOrderMapper.getInwardWarehouse(orderId);
|
|
|
+ if (inwardWarehouse!=null) {
|
|
|
+ if (inwardWarehouse.equals("重庆金田库")) {
|
|
|
+ for (Map<String,Object> jitianMap:data) {
|
|
|
+ Map<String, Object> orchardStorehouse = new HashMap<>();
|
|
|
+ List<Map<String, Object>> orchardStorehouseList = new ArrayList<>();
|
|
|
+ Object sendTime = jitianMap.get("sendTime");
|
|
|
+ String transportType = (String) jitianMap.get("transportType");
|
|
|
+
|
|
|
+ orchardStorehouse.put("sendTime", sendTime);
|
|
|
+
|
|
|
+ orchardStorehouse.put("sysCode", "DGXT");
|
|
|
+
|
|
|
+ orchardStorehouse.put("warehouseCode", "LJJT");
|
|
|
+
|
|
|
+ orchardStorehouse.put("transportType", transportType);
|
|
|
+
|
|
|
+ jitianMap.remove("sendTime");
|
|
|
+ jitianMap.remove("transportType");
|
|
|
+
|
|
|
+ orchardStorehouseList.add(jitianMap);
|
|
|
+ orchardStorehouse.put("details", orchardStorehouseList);
|
|
|
+
|
|
|
+ sendMesToGuoyuan(orchardStorehouse);
|
|
|
+ }
|
|
|
+ } else if (inwardWarehouse.equals("成都城嘉库")) {
|
|
|
+
|
|
|
+
|
|
|
+ String token = DagonloginChenJiaku();
|
|
|
+ if (token != null) {
|
|
|
+ for (Map<String,Object> map1:data) {
|
|
|
+ map1.put("token", token);
|
|
|
+ sendMesToChengJia(map1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ System.out.println("登录城嘉库失败");
|
|
|
}
|
|
|
- } else {
|
|
|
- System.out.println("登录城嘉库失败");
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } finally {
|
|
|
+ return i;
|
|
|
}
|
|
|
- return i;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|