ruoyi-api/ruoyi-api-account/src/main/java/com/ruoyi/account/api/model/WithdrawalRequests.java
@@ -74,9 +74,13 @@ @TableField("audit_status") private Integer auditStatus; @ApiModelProperty(value = "状态(1=处理中,2=成功)") @ApiModelProperty(value = "状态(1=处理中,2=成功,3=失败)") @TableField("status") private Integer status; @ApiModelProperty(value = "处理结果") @TableField("remark") private String remark; @ApiModelProperty(value = "到账时间") @TableField("arrival_time") ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/ShopWithdraw.java
@@ -59,10 +59,14 @@ @TableField("audit_msg") private String auditMsg; @ApiModelProperty(value = "状态(1=申请中,2=已到账)") @ApiModelProperty(value = "状态(1=申请中,2=已到账,3=失败)") @TableField("status") private Integer status; @ApiModelProperty(value = "处理结果") @TableField("remark") private String remark; @ApiModelProperty(value = "到账时间") @TableField("arrival_time") private LocalDateTime arrivalTime; ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/UserCouponController.java
@@ -98,7 +98,9 @@ List<Goods> data1 = goodsClient.getAllGoods().getData(); List<String> collect = data1.stream().map(Goods::getName).collect(Collectors.toList()); goodNames.addAll(collect); }else{ }else if(StringUtils.isEmpty(data.getForGoodIds())){ goodNames.addAll(JSON.parseArray(data.getGoodsNameJson(), String.class)); }else { String[] split = vo.getForGoodIds().split(","); R<List<Goods>> goodsById = goodsClient.getGoodsById(split); if (goodsById.getData()!=null){ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WithdrawalRequestsController.java
@@ -158,9 +158,9 @@ @PostMapping("/withdrawalCallback") public Object withdrawalCallback(@RequestBody SinglePayCallbackResult singlePayCallbackResult){ Integer status = singlePayCallbackResult.getStatus(); String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); WithdrawalRequests withdrawalRequests = withdrawalRequestsService.getById(merchantOrderNo); if(203 == status || 205 == status){ String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); WithdrawalRequests withdrawalRequests = withdrawalRequestsService.getById(merchantOrderNo); if(1 == withdrawalRequests.getStatus()){ withdrawalRequests.setStatus(2); withdrawalRequests.setArrivalTime(LocalDateTime.now()); @@ -169,8 +169,39 @@ JSONObject jsonObject = new JSONObject(); jsonObject.put("statusCode", 2001); return jsonObject; }else{ //回退扣除的金额,添加明细记录 //修改用户的可提现金额 BigDecimal withdrawalAmount = withdrawalRequests.getWithdrawalAmount(); AppUser appUser = appUserService.getById(withdrawalRequests.getAppUserId()); BigDecimal withdrawableAmount = appUser.getWithdrawableAmount(); BigDecimal withdrawnAmount = appUser.getWithdrawnAmount(); BigDecimal balance = appUser.getBalance(); appUser.setWithdrawableAmount(withdrawableAmount.add(withdrawalAmount).setScale(2, RoundingMode.HALF_EVEN)); appUser.setWithdrawnAmount(withdrawnAmount.subtract(withdrawalAmount).setScale(2, RoundingMode.HALF_EVEN)); appUser.setBalance(appUser.getBalance().add(withdrawalAmount).setScale(2, RoundingMode.HALF_EVEN)); appUserService.updateById(appUser); //添加变动明细 BalanceChangeRecord balanceChangeRecord = new BalanceChangeRecord(); balanceChangeRecord.setAppUserId(appUser.getId()); balanceChangeRecord.setVipId(appUser.getVipId()); balanceChangeRecord.setOrderId(withdrawalRequests.getId()); balanceChangeRecord.setChangeType(2); balanceChangeRecord.setBeforeAmount(balance); balanceChangeRecord.setChangeAmount(withdrawalAmount); balanceChangeRecord.setAfterAmount(appUser.getBalance()); balanceChangeRecord.setDelFlag(0); balanceChangeRecord.setCreateTime(LocalDateTime.now()); balanceChangeRecordService.save(balanceChangeRecord); withdrawalRequests.setStatus(3); withdrawalRequests.setRemark(singlePayCallbackResult.getErrorCodeDesc()); withdrawalRequestsService.updateById(withdrawalRequests); JSONObject jsonObject = new JSONObject(); jsonObject.put("statusCode", 2001); return jsonObject; } return new JSONObject(); } } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/WalletServiceImpl.java
@@ -42,7 +42,7 @@ // 获取提现审核中的金额 List<WithdrawalRequests> waitAuditList = withdrawalRequestsService.list(new LambdaQueryWrapper<WithdrawalRequests>() .eq(WithdrawalRequests::getAppUserId, userId) .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT)); .eq(WithdrawalRequests::getAuditStatus, WithdrawalAuditStatus.WAIT_AUDIT.getCode())); BigDecimal reduce = waitAuditList.stream().map(WithdrawalRequests::getWithdrawalAmount).reduce(BigDecimal.ZERO, BigDecimal::add); WalletVO walletVO = new WalletVO(); walletVO.setWithdrawalAmount(appUser.getWithdrawableAmount()); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/OrderRefundPassListVo.java
@@ -22,4 +22,24 @@ private Integer refundMethod; @ApiModelProperty("售后状态(1待审核2已完成3已拒绝4待退货5待平台收货)") private Integer status; private String orderNumber; private String userName; private Integer passStatus; public void setOrderNumber(String orderNumber) { this.orderNumber = orderNumber; this.setCode(orderNumber); } public void setUserName(String userName) { this.userName = userName; this.setName(userName); } public void setPassStatus(Integer passStatus) { this.passStatus = passStatus; this.setStatus(passStatus); } } ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -62,7 +62,7 @@ point, order_status as status, distribution_mode as distributionMode from t_order where del_flag = 0 and pay_status = 2 and end_time is not null and distribution_mode != 2 from t_order where del_flag = 0 and pay_status = 2 <if test="null != item.code and '' != item.code"> and order_number like CONCAT('%', #{item.code}, '%') </if> @@ -85,7 +85,7 @@ and order_status in (4, 8) </if> <if test="null != item.shopId"> and shop_id = #{item.shopId} and address_json is null and shop_id = #{item.shopId} and distribution_mode != 2 </if> order by create_time desc </select> ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShareController.java
@@ -149,10 +149,14 @@ SysUser sysUser = sysUserClient.getSysUser(userid).getData(); share.setAddType(sysUser.getRoleType() == 1 ? 1 : 3); share.setAppletShare(0); share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); if(sysUser.getRoleType() == 2){ share.setObjectId(sysUser.getObjectId().longValue()); } if (sysUser.getRoleType() == 1){ share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); }else{ share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); } share.setDelFlag(0); shareService.save(share); return R.ok(); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -270,7 +270,7 @@ if (!shopService.cheUserByPhone(phone)) { return R.fail("该手机号未注册"); } if (shop.getPid()!=null){ if (shop.getPid() != null && shop.getPid() != 0){ Shop shopP = shopService.getById(shop.getPid()); if (shopP.getPid()!=null&&shopP.getPid()!=0&& shopP.getPid().equals(shop.getId())){ return R.fail("门店之间不能互相作为上级门店"); ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopWithdrawController.java
@@ -263,9 +263,9 @@ @PostMapping("/withdrawalCallback") public Object withdrawalCallback(@RequestBody SinglePayCallbackResult singlePayCallbackResult){ Integer status = singlePayCallbackResult.getStatus(); String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); ShopWithdraw shopWithdraw = shopWithdrawService.getById(merchantOrderNo); if(203 == status || 205 == status){ String merchantOrderNo = singlePayCallbackResult.getMerchantOrderNo(); ShopWithdraw shopWithdraw = shopWithdrawService.getById(merchantOrderNo); if(1 == shopWithdraw.getStatus()){ shopWithdraw.setStatus(2); shopWithdraw.setArrivalTime(LocalDateTime.now()); @@ -274,8 +274,35 @@ JSONObject jsonObject = new JSONObject(); jsonObject.put("statusCode", 2001); return jsonObject; }else{ //回退金额和添加变动明细 Shop shop = shopService.getById(shopWithdraw.getShopId()); BigDecimal balance = shop.getBalance(); BigDecimal canWithdrawMoney = shop.getCanWithdrawMoney(); BigDecimal withdrawMoney = shop.getWithdrawMoney(); shop.setBalance(balance.add(shopWithdraw.getMoney()).setScale(2, RoundingMode.HALF_EVEN)); shop.setCanWithdrawMoney(canWithdrawMoney.add(shopWithdraw.getMoney()).setScale(2, RoundingMode.HALF_EVEN)); shop.setWithdrawMoney(withdrawMoney.subtract(shopWithdraw.getMoney()).setScale(2, RoundingMode.HALF_EVEN)); shopService.updateById(shop); //添加门店变动明细 ShopBalanceStatement shopBalanceStatement = new ShopBalanceStatement(); shopBalanceStatement.setShopId(shop.getId()); shopBalanceStatement.setType(4); shopBalanceStatement.setHistoricalBalance(balance); shopBalanceStatement.setVariableAmount(shopWithdraw.getMoney()); shopBalanceStatement.setBalance(shop.getBalance()); shopBalanceStatement.setCreateUserId(shopWithdraw.getAuditUserId()); shopBalanceStatement.setCreateTime(LocalDateTime.now()); shopBalanceStatement.setObjectId(shopWithdraw.getId()); shopBalanceStatementService.save(shopBalanceStatement); shopWithdraw.setStatus(3); shopWithdraw.setRemark(singlePayCallbackResult.getErrorCodeDesc()); shopWithdrawService.updateById(shopWithdraw); JSONObject jsonObject = new JSONObject(); jsonObject.put("statusCode", 2001); return jsonObject; } return new JSONObject(); } }