Browse Source

提现申请增加详情信息

zc 1 month ago
parent
commit
dfb39ac3b0

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/store/StoreCashOutRecord.java

@@ -113,4 +113,8 @@ public class StoreCashOutRecord extends Model<StoreCashOutRecord> {
     @ApiModelProperty(value = "结算账户")
     @TableField(value = "settlement_account")
     private String settlementAccount;
+
+    @ApiModelProperty(value = "拒绝原因")
+    @TableField(value = "approve_fail_reason")
+    private String approveFailReason;
 }

+ 3 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/ManagementInfoVo.java

@@ -83,7 +83,7 @@ public class ManagementInfoVo {
     private Integer orderTransactionNumber;
     @ApiModelProperty(value = "详情-核验金额")
     private Double verificationAmount;
-    @ApiModelProperty(value = "提现申请-申请类型")
+    @ApiModelProperty(value = "提现申请-申请类型0:手动, 1:自动")
     private Integer cashOutType;
     @ApiModelProperty(value = "提现申请-申请类型名称")
     private String cashOutTypeName;
@@ -147,4 +147,6 @@ public class ManagementInfoVo {
     private Date payTime;
     @ApiModelProperty(value = "订单id")
     private Integer orderId;
+    @ApiModelProperty(value = "拒绝原因")
+    private String approveFailReason;
 }

+ 2 - 0
alien-entity/src/main/java/shop/alien/mapper/ManagementInfoMapper.java

@@ -34,6 +34,8 @@ public interface ManagementInfoMapper {
 
     IPage<ManagementInfoVo> getApplicationForWithdrawal(IPage<ManagementInfoVo> iPage, @Param("storeId") Integer storeId, @Param("storeName") String storeName);
 
+    ManagementInfoVo getCashOutDetail( @Param("id") Integer id);
+
     IPage<ManagementInfoVo> getStoreOrderDetail(IPage<ManagementInfoVo> iPage, @Param("storeId") String storeId, @Param("orderNo") String orderNo, @Param("userId") String userId, @Param("userName") String userName);
 
     //获取平台净利润

+ 30 - 0
alien-entity/src/main/resources/mapper/ManagementInfoMapper.xml

@@ -253,6 +253,36 @@
             AND store.store_name LIKE CONCAT('%', #{storeName}, '%')
         </if>
     </select>
+
+    <select id="getCashOutDetail" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
+        SELECT
+        cash.id AS cash_id,
+        store.store_name AS store_name ,
+        storeUser.phone AS store_phone ,
+        store.id AS store_id,
+        cash.cash_out_type,
+        CASE
+        cash.cash_out_type
+        WHEN 0 THEN
+        "手动提现"
+        WHEN 1 THEN
+        "到期自动提现"
+        END AS cash_out_type_name,
+        ROUND(IFNULL(cash.money, 0) / 100,2) AS money,
+        cash.created_time,
+        cash.payment_date,
+        cash.approve_time,
+        cash.pay_date,
+        cash.fail_reason,
+        cash.payment_status,
+        cash.approve_fail_reason
+        FROM
+        store_cash_out_record cash
+        LEFT JOIN store_info store ON cash.store_id = store.id
+        LEFT JOIN store_user storeUser ON storeUser.store_id = store.id
+        WHERE cash.id = #{id}
+    </select>
+
     <select id="getPlatformNetProfit" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
         select IFNULL(ROUND(sum(all_data.platform_profit),2), 0) AS profit from
         (SELECT

+ 10 - 0
alien-store/src/main/java/shop/alien/store/controller/ManagementInfoController.java

@@ -91,6 +91,16 @@ public class ManagementInfoController {
         return R.data(managementInfoService.getApplicationForWithdrawal(page, size, storeId, storeName));
     }
 
+    @ApiOperation("提现申请详情")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "提现申请id", dataType = "Integer", paramType = "query")
+    })
+    @GetMapping("/getCashOutDetail")
+    public R<ManagementInfoVo> getCashOutDetail(
+            @RequestParam(value = "id") Integer id) {
+        return R.data(managementInfoService.getCashOutDetail(id));
+    }
+
     @ApiOperation("生成结算回执单")
     @ApiImplicitParams({
             @ApiImplicitParam(name = "cashId", value = "提现记录id", dataType = "String", paramType = "query"),

+ 2 - 0
alien-store/src/main/java/shop/alien/store/service/ManagementInfoService.java

@@ -29,6 +29,8 @@ public interface ManagementInfoService {
      */
     IPage<ManagementInfoVo> getApplicationForWithdrawal(int pageNo, int pageSize, Integer storeId, String storeName);
 
+    ManagementInfoVo getCashOutDetail(Integer id);
+
     /**
      * 店铺明细账单统计
      */

+ 5 - 0
alien-store/src/main/java/shop/alien/store/service/impl/ManagementInfoServiceImpl.java

@@ -179,6 +179,11 @@ public class ManagementInfoServiceImpl implements ManagementInfoService {
     }
 
     @Override
+    public ManagementInfoVo getCashOutDetail(Integer id) {
+        return managementInfoMapper.getCashOutDetail(id);
+    }
+
+    @Override
     public HashMap<String, Object> storeDetailBillingStatistics(String storeId) {
         // 获取当前日期
         LocalDate currentDate = LocalDate.now();

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/impl/StoreIncomeDetailsRecordServiceImpl.java

@@ -302,7 +302,7 @@ public class StoreIncomeDetailsRecordServiceImpl extends ServiceImpl<StoreIncome
                     // 提现失败
                     storeCashOutRecord.setPaymentStatus(2);
                     storeCashOutRecord.setApproveTime(new Date());// 审批时间
-                    storeCashOutRecord.setFailReason("支付失败");
+                    storeCashOutRecord.setFailReason("支付宝回传异常情况");
                     storeCashOutRecord.setPayDate(new Date());//支付时间
                     storeCashOutRecordMapper.updateById(storeCashOutRecord);
                     // 提现失败通知
@@ -311,7 +311,7 @@ public class StoreIncomeDetailsRecordServiceImpl extends ServiceImpl<StoreIncome
                 }
             } else {
                 storeCashOutRecord.setPaymentStatus(4);
-                storeCashOutRecord.setFailReason(failReason);
+                storeCashOutRecord.setApproveFailReason(failReason);
                 storeCashOutRecord.setApproveTime(new Date());// 审批时间
                 storeCashOutRecordMapper.updateById(storeCashOutRecord);
                 // 拒绝将账单中的提现记录置空