| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.google.common.collect.ImmutableMap; |
| | | import com.lkl.laop.sdk.exception.SDKException; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | |
| | | import com.ruoyi.system.service.TCrmSupplierService; |
| | | import com.ruoyi.system.service.TErpProcurementGoodsService; |
| | | import com.ruoyi.system.service.TErpProcurementService; |
| | | import com.ruoyi.system.task.base.QuartzManager; |
| | | import com.ruoyi.system.task.base.TimeJobType; |
| | | import com.ruoyi.system.task.jobs.LivePushJob; |
| | | import com.ruoyi.system.task.jobs.RevenueSharingJob; |
| | | import com.ruoyi.web.core.config.LakalaConfig; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | reqMap.put("req_data", map); |
| | | |
| | | |
| | | |
| | | String jsonString = JSON.toJSONString(reqMap); |
| | | // 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() + "api/v3/sacs/separate", jsonString, authorization1); |
| | | String responseStr = IOUtils.toString(response1.getEntity().getContent(), ENCODING); |
| | | |
| | | System.err.println("分佣!!!!"+responseStr); |
| | | Map<String, ? extends Object> maps = |
| | | new ImmutableMap.Builder<String, String>(). |
| | | put("id", erpProcurement.getId()).put("authorization", authorization1).put("body", jsonString) |
| | | .build(); |
| | | QuartzManager.addJob( |
| | | RevenueSharingJob.class, |
| | | (RevenueSharingJob.name+erpProcurement.getId()).toUpperCase(), |
| | | TimeJobType.REVENUE_SHARING, |
| | | DateUtils.localDateTimeToDate(LocalDateTime.now().plusSeconds(30)), |
| | | maps |
| | | ); |
| | | |
| | | JSONObject jsonObject = JSONObject.parseObject(responseStr); |
| | | if ("成功".equals(jsonObject.getString("msg"))) { |
| | | Object o1 = jsonObject.get("resp_data"); |
| | | JSONObject jsonObject2 = JSONObject.parseObject(o1.toString()); |
| | | String separate_no = jsonObject2.getString("separate_no"); |
| | | erpProcurement.setSeparateNo(separate_no); |
| | | erpProcurementService.updateById(erpProcurement); |
| | | } |
| | | // org.apache.http.HttpResponse response1 = post(LakalaConfig.getServerUrl() + "api/v3/sacs/separate", jsonString, authorization1); |
| | | // String responseStr = IOUtils.toString(response1.getEntity().getContent(), ENCODING); |
| | | // System.err.println("分佣!!!!"+responseStr); |
| | | // JSONObject jsonObject = JSONObject.parseObject(responseStr); |
| | | // if ("成功".equals(jsonObject.getString("msg"))) { |
| | | // Object o1 = jsonObject.get("resp_data"); |
| | | // JSONObject jsonObject2 = JSONObject.parseObject(o1.toString()); |
| | | // String separate_no = jsonObject2.getString("separate_no"); |
| | | // erpProcurement.setSeparateNo(separate_no); |
| | | // erpProcurementService.updateById(erpProcurement); |
| | | // } |
| | | |
| | | // 响应success |
| | | JSONObject responseJsonObject = new JSONObject(); |
| | |
| | | + IOUtils.toString(response.getEntity().getContent(), ENCODING)); |
| | | } |
| | | String responseStr = IOUtils.toString(response.getEntity().getContent(), ENCODING); |
| | | System.out.println("退款!!"+responseStr); |
| | | JSONObject jsonObject = JSONObject.parseObject(responseStr); |
| | | JSONObject jsonObject2 = jsonObject.getJSONObject("resp_data"); |
| | | String code = jsonObject2.getString("log_no"); |