Browse Source

接口业务调试

master
pry 8 months ago
parent
commit
dae125b8b5
3 changed files with 18 additions and 6 deletions
  1. +10
    -2
      app/src/main/java/com/bpa/scalage/MainActivity.java
  2. +5
    -1
      app/src/main/java/com/bpa/scalage/MenuSelectionActivity.java
  3. +3
    -3
      app/src/main/java/com/bpa/scalage/Server/APIServer.java

+ 10
- 2
app/src/main/java/com/bpa/scalage/MainActivity.java View File

@@ -262,7 +262,11 @@ public class MainActivity extends AppCompatActivity {
String goodId = DataBus.getInstance().SelectFood.id;
String goodsName=DataBus.getInstance().SelectFood.name;
String chipCode = DataBus.getInstance().CurrentCart;
APIServer.CreateOrder(new AddGoodInfo(orderId,goodId,goodsName,DataBus.getInstance().xf_weight,chipCode),null,(error)->{T.show(MainActivity.this,error);});
APIServer.CreateOrder(new AddGoodInfo(orderId,goodId,goodsName,DataBus.getInstance().xf_weight,chipCode),null,(error)->{
this.runOnUiThread(()->{
T.show(MainActivity.this,error);
});
});
}else
{
DataBus.getInstance().xf_weight=0;
@@ -297,6 +301,10 @@ public class MainActivity extends AppCompatActivity {
DataBus.getInstance().xf_sjprice=0;
RefreshConsumption();
});
},(error)->{T.show(MainActivity.this,error);});
},(error)->{
this.runOnUiThread(()->{
T.show(MainActivity.this,error);
});
});
}
}

+ 5
- 1
app/src/main/java/com/bpa/scalage/MenuSelectionActivity.java View File

@@ -96,7 +96,11 @@ public class MenuSelectionActivity extends AppCompatActivity{
}
title.setText(ConfigName.getInstance().Shop_Name);
});
},(error)->{T.show(MenuSelectionActivity.this,error);});
},(error)->{
this.runOnUiThread(()->{
T.show(MenuSelectionActivity.this,error);
});
});
}




+ 3
- 3
app/src/main/java/com/bpa/scalage/Server/APIServer.java View File

@@ -37,7 +37,7 @@ public class APIServer {
* 获取菜品信息
*/
public static void GetDishInformation(IRunT<List<String>> callback,IRunT<String> faultCallback){
String url = "http://192.168.1.50:5001/api/ExternalPlatform/WeighingService/GetGoodsInfo";
String url = "http://111.9.47.105:21995/saasbase/api/ExternalPlatform/WeighingService/GetGoodsInfo";
String key = "64059261-1599-472c-b418-3c18b4e3883e";

APIHelper.Post(url,new Object(),key,(s)->{
@@ -58,7 +58,7 @@ public class APIServer {
* 获取RFID和订单的信息
*/
public static void GetOrderInfo(String ChipCode,IRunT<WeighOrderDto> callback,IRunT<String> faultCallback){
String url = "http://192.168.1.50:5003/api/ExternalPlatform/WeighOrder/GetWeighOrderByChipCode";
String url = "http://111.9.47.105:21995/order/api/ExternalPlatform/WeighOrder/GetWeighOrderByChipCode";
String key = "1bef8f66-1896-46ae-a724-101a709d5a26";
ChipCodeRequiredModel crm = new ChipCodeRequiredModel(ChipCode);

@@ -79,7 +79,7 @@ public class APIServer {
* 添加商品子订单
*/
public static void CreateOrder(AddGoodInfo agi, IRun callback,IRunT<String> faultCallback){
String url = "http://192.168.1.50:5003/api/ExternalPlatform/WeighOrder/AddWeighOrderGoods";
String url = "http://111.9.47.105:21995/order/api/ExternalPlatform/WeighOrder/AddWeighOrderGoods";
String key = "1bef8f66-1896-46ae-a724-101a709d5a26";
AddGoodModel agm = new AddGoodModel();
agm.data.add(agi);


Loading…
Cancel
Save