| | |
| | | private final HistoryOverdueMapper historyOverdueMapper; |
| | | private final PaymentSlipMapper paymentSlipMapper; |
| | | private final BipRequestRecordMapper bipRequestRecordMapper; |
| | | private final ContractExecDateMapper contractExecDateMapper; |
| | | private final RemoteDeptService remoteDeptService; |
| | | private final RedisTemplate redisTemplate; |
| | | |
| | |
| | | if (contract.getAmount().compareTo(contract.getPaidAmount()) == 0) { |
| | | contract.setBillingStatus("2"); |
| | | contract.setContractStatus(3); |
| | | contractService.updateById(contract); |
| | | payCompleteContractList.add(contract); |
| | | } |
| | | //付款 且 付款未全付 |
| | | if (contract.getAmount().compareTo(contract.getPaidAmount()) > 0) { |
| | | payNoCompleteContractList.add(contract); |
| | | } |
| | | if (StrUtil.isNotEmpty(contract.getContractCategory())&&StrUtil.equals(contract.getContractCategory(),"water_house")){ |
| | | List<ContractExecDate> execDateList = contractExecDateMapper.selectList(Wrappers.<ContractExecDate>lambdaQuery() |
| | | .eq(ContractExecDate::getContractId,contract.getId()).eq(ContractExecDate::getGenFlag,"0")); |
| | | if (ArrayUtil.isEmpty(execDateList.toArray())){ |
| | | List<ContractPaymentSchedule> contractPaymentScheduleList = contractPaymentScheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery() |
| | | .eq(ContractPaymentSchedule::getContractId, contract.getId())); |
| | | if (ArrayUtil.isNotEmpty(contractPaymentScheduleList.toArray())&&contractPaymentScheduleList.stream().allMatch(item -> Objects.equals(item.getPaymentStatus(), 2))) { |
| | | contract.setContractStatus(3); |
| | | contractService.updateById(contract); |
| | | } |
| | | } |
| | | }else { |
| | | contractService.updateById(contract); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | String result = HttpUtil.post(url + "/yonbip/EFI/collection/list?access_token=" + finalAccessToken, params.toJSONString()); |
| | | log.info("SK_CX Response:{}", result); |
| | | //保存请求记录 |
| | | saveBipRequestRecord(params, result); |
| | | saveBipRequestRecord(params,"<XSJZ_SK_CX_001>-收款单查询接口", result); |
| | | JSONObject resultJson = JSONObject.parseObject(result); |
| | | if (resultJson.containsKey("code") && resultJson.getString("code").equals("200")) { |
| | | handleAndSave(bipCode, resultJson); |
| | |
| | | return params; |
| | | } |
| | | |
| | | private void getAccessToken(String accessToken) { |
| | | @Override |
| | | public String getAccessToken(String accessToken) { |
| | | long timestamp = System.currentTimeMillis(); |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("appKey", appKey); |
| | |
| | | JSONObject tokenJson = JSONObject.parseObject(getTokenResult); |
| | | if (!tokenJson.containsKey("code") || !tokenJson.getString("code").equals("200")) { |
| | | log.error("Get access_token ERROR"); |
| | | return; |
| | | return ""; |
| | | } |
| | | if (ObjUtil.isNull(tokenJson.get("data")) || ObjUtil.isNull(JSONObject.parseObject(tokenJson.getString("data")))) { |
| | | log.error("access_token value exception"); |
| | | return; |
| | | return ""; |
| | | } |
| | | accessToken = JSONObject.parseObject(tokenJson.getString("data")).getString("access_token"); |
| | | log.info("access_token value:", accessToken); |
| | | redisTemplate.opsForValue().set("BIP_TOKEN", accessToken, tokenJson.getIntValue("expire") - 10, TimeUnit.SECONDS); |
| | | return accessToken; |
| | | } |
| | | |
| | | private void saveBipRequestRecord(JSONObject params, String result) { |
| | | @Override |
| | | public void saveBipRequestRecord(JSONObject params, String methodName, String result) { |
| | | BipRequestRecord record = new BipRequestRecord(); |
| | | record.setInterfaceName("<XSJZ_SK_CX_001>-收款单查询接口"); |
| | | record.setInterfaceName(methodName); |
| | | record.setRequestParams(params.toJSONString()); |
| | | record.setResponseParams(result); |
| | | record.setResponseCode(JSONObject.parseObject(result).getString("code")); |
| | |
| | | if (contract.getAmount().compareTo(contract.getPaidAmount()) == 0) { |
| | | contract.setBillingStatus("2"); |
| | | contract.setContractStatus(3); |
| | | contractService.updateById(contract); |
| | | payCompleteContractList.add(contract); |
| | | } |
| | | //付款 且 付款未全付 |
| | | if (contract.getAmount().compareTo(contract.getPaidAmount()) > 0) { |
| | | payNoCompleteContractList.add(contract); |
| | | } |
| | | if (StrUtil.isNotEmpty(contract.getContractCategory())&&StrUtil.equals(contract.getContractCategory(),"water_house")){ |
| | | List<ContractExecDate> execDateList = contractExecDateMapper.selectList(Wrappers.<ContractExecDate>lambdaQuery() |
| | | .eq(ContractExecDate::getContractId,contract.getId()).eq(ContractExecDate::getGenFlag,"0")); |
| | | if (ArrayUtil.isEmpty(execDateList)){ |
| | | List<ContractPaymentSchedule> contractPaymentScheduleList = contractPaymentScheduleMapper.selectList(Wrappers.<ContractPaymentSchedule>lambdaQuery() |
| | | .eq(ContractPaymentSchedule::getContractId, contract.getId())); |
| | | if (ArrayUtil.isNotEmpty(contractPaymentScheduleList.toArray())&&contractPaymentScheduleList.stream().allMatch(item -> Objects.equals(item.getPaymentStatus(), 2))) { |
| | | contract.setContractStatus(3); |
| | | contractService.updateById(contract); |
| | | } |
| | | } |
| | | }else { |
| | | contractService.updateById(contract); |
| | | } |
| | | } |
| | | }); |
| | | |