| | |
| | | import com.by4cloud.platformx.business.mapper.*; |
| | | import com.by4cloud.platformx.business.service.BankStatementService; |
| | | import com.by4cloud.platformx.business.service.PaymentConfirmService; |
| | | import com.by4cloud.platformx.business.vo.CustInfoVo; |
| | | import com.by4cloud.platformx.business.vo.ReceiveBipVo; |
| | | import com.by4cloud.platformx.business.vo.ReceiveItemVo; |
| | | import com.by4cloud.platformx.business.vo.StatementContractVo; |
| | |
| | | pushCollectionSgb(statement, updateDTO.getContractCollectionList()); |
| | | } |
| | | |
| | | // //判断是否内部单位 |
| | | // CustInfoVo custInfoVo = bipViewMapper.selectBaseInfoByCustName(statement.getPayBankAccName()); |
| | | // if (ObjUtil.isNull(custInfoVo)){ |
| | | // return R.ok(); |
| | | // } |
| | | // //bip推送 |
| | | // if (bipFlag&&custInfoVo.getCustCode().equals("01")) { |
| | | // return pushSaveCollection(statement, updateDTO.getContractCollectionList()); |
| | | // } |
| | | // log.info("内部往来收款单,客户名称:{},客户类型:{},不用保存收款单",custInfoVo.getCustName(),custInfoVo.getCustclass()); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | |
| | | // HttpResponse resp = HttpUtil.createPost(sgbErp + "/apilink/arclose/create?corpsecret=12345678&appserver=appserver1&accountid=888&tradeid=" |
| | | // + IdUtil.fastUUID()) |
| | | // .header("Content-Type","application/x-www-form-urlencoded") |
| | | // .body(URLEncodeUtil.encode(request.toJSONString(), StandardCharsets.UTF_8)) |
| | | // .form("",request.toJSONString()) |
| | | // .timeout(30000) |
| | | // // 指定编码格式 |
| | | // .charset(StandardCharsets.UTF_8) |
| | | // .execute(); |
| | | |
| | | log.info("工业泵收款入参:{}", "=" +request.toJSONString()); |
| | | OkHttpClient client = new OkHttpClient().newBuilder() |
| | | .build(); |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "=" + request.toJSONString()); |
| | | Request req = new Request.Builder() |
| | | .url(sgbErp + "/apilink/arclose/create?corpsecret=12345678&appserver=appserver1&accountid=888&tradeid=" + IdUtil.fastUUID()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | String result = ""; |
| | | try (Response response = client.newCall(req).execute()){ |
| | | if (response.isSuccessful()) { |
| | | // 仅调用一次string(),结果存入变量复用,后续所有逻辑直接读取该变量 |
| | | result = response.body().string(); |
| | | // 业务逻辑直接使用result,禁止再次调用response.body().string() |
| | | } |
| | | log.info("工业泵收款入参:{}", "=" + request.toJSONString()); |
| | | OkHttpClient client = new OkHttpClient().newBuilder() |
| | | .build(); |
| | | MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); |
| | | RequestBody body = RequestBody.create(mediaType, "=" + request.toJSONString()); |
| | | Request req = new Request.Builder() |
| | | .url(sgbErp + "/apilink/arclose/create?corpsecret=12345678&appserver=appserver1&accountid=888&tradeid=" + IdUtil.fastUUID()) |
| | | .method("POST", body) |
| | | .addHeader("Content-Type", "application/x-www-form-urlencoded") |
| | | .build(); |
| | | String result = ""; |
| | | try (Response response = client.newCall(req).execute()) { |
| | | if (response.isSuccessful()) { |
| | | // 仅调用一次string(),结果存入变量复用,后续所有逻辑直接读取该变量 |
| | | result = response.body().string(); |
| | | // 业务逻辑直接使用result,禁止再次调用response.body().string() |
| | | } |
| | | log.info("工业泵收款回参:{}", result); |
| | | saveErpRequestRecord("sgb", "/apilink/arclose/create", request.toJSONString(), result); |
| | | JSONObject respJson = JSONObject.parseObject(result); |
| | |
| | | djt.put("cBankAccount", statement.getReceiveBankAccAcc());//本方银行账号 |
| | | djt.put("cBank", statement.getPayBankAccName());//本方银行账号 |
| | | djt.put("cContractType", "161"); |
| | | if (CollUtil.size(contractCollectionList)==1) { |
| | | if (CollUtil.size(contractCollectionList) == 1) { |
| | | Contract contractHeader = contractMapper.selectById(contractCollectionList.get(0).getId()); |
| | | djt.put("cContractID", contractHeader.getErpContractNo()); |
| | | } |
| | |
| | | djti.put("cPersonCode", "00164");//业务员编码 |
| | | djti.put("cConID", contract.getErpContractNo());//合同编码 |
| | | djti.put("款项类型", "应收款"); |
| | | djti.put("cConType","镇江市"); |
| | | djti.put("cConType", "镇江市"); |
| | | array.add(djti); |
| | | }); |
| | | |
| | |
| | | item.setBipParam(updateDTO.getBipParam()); |
| | | bankStatementItemMapper.updateById(item); |
| | | BankStatement statement = baseMapper.selectById(item.getStatetId()); |
| | | |
| | | //判断是否内部单位 |
| | | CustInfoVo custInfoVo = bipViewMapper.selectBaseInfoByCustName(statement.getPayBankAccName()); |
| | | if (ObjUtil.isNotNull(custInfoVo) && custInfoVo.getCustCode().equals("01")) { |
| | | log.info("内部往来收款单,客户名称:{},客户类型:{},不用保存收款单", custInfoVo.getCustName(), custInfoVo.getCustclass()); |
| | | return R.failed("内部往来收款单,不用推送BIP"); |
| | | } |
| | | |
| | | return pushSaveCollection(statement, item); |
| | | } |
| | | } |