From 87dc04e8ef1580218961acbda378f0fd0e5bec89 Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期四, 09 十月 2025 16:48:31 +0800 Subject: [PATCH] update --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java | 53 ++++++++++++++++++++++++++++++++++------------------- 1 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java index 679665e..139a22a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSysOrderController.java @@ -245,21 +245,21 @@ BigDecimal allMoney = erpProcurement.getPayMoney(); // 平台应得分账 - BigDecimal payMoney = erpProcurement.getPayMoney(); + BigDecimal payMoney = erpProcurement.getMoney(); ArrayList<HashMap<String, Object>> objects = new ArrayList<>(); // 根据供应商id分组 Map<String, List<TErpProcurementGoods>> collect = list.stream().collect(Collectors.groupingBy(TErpProcurementGoods::getSupplierId)); - for (Map.Entry<String, List<TErpProcurementGoods>> entry : collect.entrySet()) { - HashMap<String, Object> map1 = new HashMap<>(); - String supplierId = entry.getKey(); - TCrmSupplier supplier = crmSupplierService.getById(supplierId); - List<TErpProcurementGoods> value = entry.getValue(); - BigDecimal reduce = value.stream().map(TErpProcurementGoods::getSupplierMoney).reduce(BigDecimal.ZERO, BigDecimal::add); - payMoney = payMoney.subtract(reduce); - map1.put("recv_no", supplier.getRecvMerchantNo()); - map1.put("separate_value", reduce.multiply(BigDecimal.valueOf(100)).intValue() + ""); -// objects.add(map1); - } +// for (Map.Entry<String, List<TErpProcurementGoods>> entry : collect.entrySet()) { +// HashMap<String, Object> map1 = new HashMap<>(); +// String supplierId = entry.getKey(); +// TCrmSupplier supplier = crmSupplierService.getById(supplierId); +// List<TErpProcurementGoods> value = entry.getValue(); +// BigDecimal reduce = value.stream().map(TErpProcurementGoods::getSupplierMoney).reduce(BigDecimal.ZERO, BigDecimal::add); +// payMoney = payMoney.subtract(reduce); +// map1.put("recv_no", supplier.getRecvMerchantNo()); +// map1.put("separate_value", reduce.multiply(BigDecimal.valueOf(100)).intValue() + ""); +//// objects.add(map1); +// } HashMap<String, Object> map1 = new HashMap<>(); //TODO hzt map1.put("recv_no", "SR2024000006413"); @@ -281,9 +281,18 @@ String jsonString = JSON.toJSONString(reqMap); - post.body(jsonString); - HttpResponse response = post.execute(); - String responseStr = response.body(); +// String authorization1 = getAuthorization(jsonString); +// post.header("Authorization", SCHEMA + " " + authorization); +// +// post.body(jsonString); +// HttpResponse response = post.execute(); +// String responseStr = response.body(); + + String authorization1 = getAuthorization(jsonString); + org.apache.http.HttpResponse response1 = post(LakalaConfig.getServerUrl() + "sit/api/v3/sacs/separate", jsonString, authorization1); + String responseStr = IOUtils.toString(response1.getEntity().getContent(), ENCODING); + + JSONObject jsonObject = JSONObject.parseObject(responseStr); if ("成功".equals(jsonObject.getString("msg"))) { Object o1 = jsonObject.get("resp_data"); @@ -446,7 +455,7 @@ String outTradeNo = time + str; // 操作分账 - HttpRequest post = HttpUtil.createPost(LakalaConfig.getServerUrl() + "sit/api/v3/sacs/fallback"); +// HttpRequest post = HttpUtil.createPost(LakalaConfig.getServerUrl() + "sit/api/v3/sacs/fallback"); HashMap<String, Object> reqMap = new HashMap<>(); reqMap.put("version", "3.0"); reqMap.put("req_time", DateUtils.dateTimeNow()); @@ -481,9 +490,15 @@ String jsonString = JSON.toJSONString(reqMap); - post.body(jsonString); - HttpResponse response = post.execute(); - String responseStr = response.body(); + + String authorization1 = getAuthorization(jsonString); + org.apache.http.HttpResponse response1 = post(LakalaConfig.getServerUrl() + "sit/api/v3/sacs/fallback", jsonString, authorization1); + String responseStr = IOUtils.toString(response1.getEntity().getContent(), ENCODING); + + +// post.body(jsonString); +// HttpResponse response = post.execute(); +// String responseStr = response.body(); return R.ok(responseStr); -- Gitblit v1.7.1