yujian
2020-05-23 28cf328a098334b51a3e9d2d56f983fb8c862211
fanli/src/main/java/com/yeshi/fanli/service/impl/money/extract/ExtractServiceImpl.java
@@ -434,9 +434,9 @@
      json.put("payee_type", "ALIPAY_LOGONID");
      json.put("payee_account", extract.getAccount());
      json.put("amount", extract.getMoney());
      json.put("payer_show_name", appName + "App" + "提现");
      json.put("payer_show_name", appName);
      json.put("payee_real_name", extract.getName());
      json.put("remark", "来自" + appName + "App" + "的提现");
      json.put("remark", "来自重庆快省科技有限公司");
      request.setBizContent(json.toString());
      AlipayFundTransToaccountTransferResponse response = null;
      try {
@@ -523,7 +523,7 @@
    * @param session
    */
   @Transactional
   private void extractSuccess(Extract extract) {
   private void extractSuccess(Extract extract,String alipayNo) {
      // 老版本功能
      // List<MoneyRecord> list = moneyRecordDao.list("from MoneyRecord mr
      // where mr.extract.id = " + extract.getId());
@@ -546,21 +546,17 @@
      } catch (Exception e) {
         e.printStackTrace();
      }
      List<PayInfo> payInfoList = payInfoMapper.getListbyExtractId(extract.getId());
      String alipayNo = "";
      if (payInfoList != null && payInfoList.size() > 0)
         alipayNo = payInfoList.get(0).getOrderId();
      UserMoneyDetail detailNew = null;
      try {
         detailNew = UserMoneyDetailFactory.createExtract(updateExtract, alipayNo);
         detailNew = UserMoneyDetailFactory.createExtract(extract, alipayNo);
      } catch (UserMoneyDetailException e) {
         e.printStackTrace();
      }
      // 外显账户明细
      UserMoneyDetail userMoneyDetail = userMoneyDetailMapper.selectByTypeAndUidAndIdentifyCode(
            UserMoneyDetailTypeEnum.extract, extract.getUserInfo().getId(), extract.getId());
            UserMoneyDetailTypeEnum.extractNew, extract.getUserInfo().getId(), extract.getId());
      if (userMoneyDetail != null) {
         UserMoneyDetail detail = new UserMoneyDetail(userMoneyDetail.getId());
         detail.setShow(true);
@@ -603,8 +599,10 @@
      // 获取提现,获取提现验证
      List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
      typeList.add(UserMoneyDetailTypeEnum.extract);
      typeList.add(UserMoneyDetailTypeEnum.extractNew);
      typeList.add(UserMoneyDetailTypeEnum.extractReject);
      typeList.add(UserMoneyDetailTypeEnum.extractVerify);
      typeList.add(UserMoneyDetailTypeEnum.extractVerifyNew);
      BigDecimal extractMoney = userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, new Date(0),
            now);
      extractMoney = extractMoney.abs();
@@ -624,7 +622,7 @@
      BigDecimal after = hongBaoMoney.subtract(extractMoney.add(weiqaunMoney).add(balance).add(compensateMoney));
      if (after.compareTo(new BigDecimal("0")) != 0)
         throw new ExtractException(2, "结算资金异常");
         throw new ExtractException(2, "结算资金异常:" + after);
   }
   @Override
@@ -673,7 +671,7 @@
      if (response.isSuccess()) {
         String code = response.getCode();
         if ("10000".equals(code)) {
            extractSuccess(extract);
            extractSuccess(extract,response.getOrderId());
         } else {
            extractFail(extract, response.getSubMsg());
         }
@@ -741,7 +739,7 @@
   @Override
   public void testExtractSuccess(Long id) {
      Extract extract = extractMapper.selectByPrimaryKey(id);
      extractSuccess(extract);
      extractSuccess(extract,null);
      Long uid = extract.getUserInfo().getId();
      // 更新审核记录
@@ -1352,4 +1350,15 @@
      }
   }
   @Override
   public List<Extract> getExtractSucceedRecord(int page, int pageSize, Long uid) {
      return extractMapper.getExtractSucceedRecord((page-1)*pageSize, pageSize, uid);
   }
   @Override
   public long countExtractSucceedRecord(Long uid) {
       Long count = extractMapper.countExtractSucceedRecord(uid);
       return count== null? 0 : count;
   }
}