Browse Source

提现列表调试

skyline 1 năm trước cách đây
mục cha
commit
831639d839

+ 29 - 15
admin-web/src/views/admin/finance/withdraw.vue

@@ -75,9 +75,26 @@
                 {{ row[field.prop] }}
               </div>
             </template>
+            <template v-else-if="'stationId'===field.prop">
+              <div class="flex-align-items-center text-align-center">
+                <div>
+                  {{ row.stationId }}
+                </div>
+                <hr/>
+                <div>
+                  {{ row.stationName }}
+                </div>
+              </div>
+            </template>
             <template v-else-if="field.prop==='type'">
               <ext-d-label type="Object.type" :model-value="row[field.prop]"></ext-d-label>
             </template>
+            <template v-else-if="field.prop==='status'">
+              <ext-d-label type="WithdrawnRecord.status" :model-value="row[field.prop]"></ext-d-label>
+            </template>
+            <template v-else-if="field.prop==='paymentStatus'">
+              <ext-d-label type="WithdrawnRecord.paymentStatus" :model-value="row[field.prop]"></ext-d-label>
+            </template>
             <template v-else-if="['withdrawnAmount','amount','amountReceivable','amountReceived','cardBalance','coinMoney','discountAmount','discountMoney'].includes(field.prop)">
               {{ u.fmt.fmtMoney(row[field.prop]) }}
             </template>
@@ -119,6 +136,7 @@ import ExtTable from "/@/components/form/ExtTable.vue";
 import mittBus from '/@/utils/mitt';
 
 import {ElButton} from 'element-plus'
+import ExtDLabel from "/@/components/form/ExtDLabel.vue";
 
 
 //定义引用
@@ -141,19 +159,15 @@ const state = reactive({
   importConfig: {},
   exportConfig: {},
   columns: [
-    {label: '站点id', width: 180, prop: 'stationId', query: true, type: 'select', resizable: true,conf:{url:'washStation/list',valueKey:'stationId',labelKey:'stationName'}},
-    {label: '提现金额', width: 180, prop: 'withdrawnAmount', query: true, type: 'number', resizable: true},
-    {
-      label: '状态', prop: 'status', sortable: 'custom', align: 'center', query: true,
-      type: 'dict', conf: {dict: 'WithdrawnRecord.status'}
-    },
-    {label: '打款状态', width: 180, prop: 'paymentStatus', query: true,
-      type: 'dict', conf: {dict: 'WithdrawnRecord.paymentStatus'}},
-    {label: '审核人', width: 180, prop: 'reviewer', query: true, type: 'text', resizable: true},
-    {label: '审核时间', width: 180, prop: 'reviewTime', query: true, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
-    {label: '打款人', width: 180, prop: 'payer', query: true, type: 'text', resizable: true},
-    {label: '打款时间', width: 180, prop: 'paymentTime', query: true, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
-    {label: '备注', width: 180, prop: 'remark', query: false, type: 'text', resizable: true},
+    {label: '提现站点', width: 180, prop: 'stationId', query: true, type: 'select', resizable: true,conf:{url:'washStation/list',valueKey:'stationId',labelKey:'stationName'}},
+    {label: '提现金额', width: 100, prop: 'withdrawnAmount', type: 'number', resizable: true},
+    {label: '审核状态', width: 100, prop: 'status', align: 'center', query: true,type: 'dict', conf: {dict: 'WithdrawnRecord.status'}},
+    {label: '打款状态', width: 100, prop: 'paymentStatus', query: true,type: 'dict', conf: {dict: 'WithdrawnRecord.paymentStatus'}},
+    {label: '审核人', width: 120, prop: 'reviewer', type: 'text', resizable: true},
+    {label: '审核时间', width: 180, prop: 'reviewTime', sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
+    {label: '打款人', width: 120, prop: 'payer', type: 'text', resizable: true},
+    {label: '打款时间', width: 180, prop: 'paymentTime', sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
+    {label: '备注', width: 180, prop: 'remark', type: 'text', resizable: true},
     {label: '申请时间', width: 180, prop: 'createTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
     {label: '更新时间', width: 180, prop: 'updateTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
     {
@@ -233,7 +247,7 @@ const handleWithdrawAudit = (withdraw:any) => {
 }
 
 const handleWithdrawConfirm = (withdraw:any) => {
-  $body(`finance/confirmWithdrawnPayment`,withdraw).then(res=>{
+  $body(`finance/confirmWithdrawnPayment`,{id:withdraw.id,paymentStatus:1}).then(res=>{
     Msg.message(`提现审核通过`)
     loadData(true)
   })
@@ -247,4 +261,4 @@ const handleWithdrawConfirm = (withdraw:any) => {
 // defineExpose({
 //     loadData,
 // });
-</script>
+</script>

+ 3 - 0
car-wash-entity/src/main/java/com/kym/entity/WithdrawnRecord.java

@@ -1,6 +1,7 @@
 package com.kym.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.kym.entity.BaseEntity;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -56,6 +57,7 @@ public class WithdrawnRecord extends BaseEntity {
     /**
      * 审核时间
      */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime reviewTime;
 
     /**
@@ -66,6 +68,7 @@ public class WithdrawnRecord extends BaseEntity {
     /**
      * 打款时间
      */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime paymentTime;
 
     /**

+ 71 - 0
car-wash-entity/src/main/java/com/kym/entity/vo/WithdrawnRecordVo.java

@@ -0,0 +1,71 @@
+package com.kym.entity.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.kym.entity.BaseEntity;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
+
+/**
+ * 站点账户提现记录表
+ */
+@Data
+@Accessors(chain = true)
+public class WithdrawnRecordVo extends BaseEntity {
+
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 站点id
+     */
+    private String stationId;
+
+    /**
+     * 站点名称
+     */
+    private String stationName;
+
+    /**
+     * 提现金额(分)
+     */
+    private Integer withdrawnAmount;
+
+    /**
+     * 状态:0-待审核,1-审核通过,2-审核失败
+     */
+    private Integer status;
+
+    /**
+     * 打款状态:0-未打款,1-已打款
+     */
+    private Integer paymentStatus;
+
+    /**
+     * 审核人
+     */
+    private String reviewer;
+
+    /**
+     * 审核时间
+     */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime reviewTime;
+
+    /**
+     * 打款人
+     */
+    private String payer;
+
+    /**
+     * 打款时间
+     */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime paymentTime;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 2 - 1
car-wash-service/src/main/java/com/kym/service/WithdrawnRecordService.java

@@ -3,6 +3,7 @@ package com.kym.service;
 import com.kym.entity.WithdrawnRecord;
 import com.kym.entity.common.PageBean;
 import com.kym.entity.queryParams.WithdrawnQueryParam;
+import com.kym.entity.vo.WithdrawnRecordVo;
 import com.kym.service.mybatisplus.MyBaseService;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -16,7 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
  */
 public interface WithdrawnRecordService extends MyBaseService<WithdrawnRecord> {
 
-    PageBean<WithdrawnRecord> listWithdrawnRecords(WithdrawnQueryParam params);
+    PageBean<WithdrawnRecordVo> listWithdrawnRecords(WithdrawnQueryParam params);
 
     void reviewWithdrawn(WithdrawnQueryParam params);
 

+ 14 - 3
car-wash-service/src/main/java/com/kym/service/impl/WithdrawnRecordServiceImpl.java

@@ -6,9 +6,12 @@ import com.kym.common.utils.CommUtil;
 import com.kym.entity.WithdrawnRecord;
 import com.kym.entity.common.PageBean;
 import com.kym.entity.queryParams.WithdrawnQueryParam;
+import com.kym.entity.vo.WithdrawnRecordVo;
 import com.kym.mapper.WithdrawnRecordMapper;
 import com.kym.service.WithdrawnRecordService;
+import com.kym.service.cache.KymCache;
 import com.kym.service.mybatisplus.MyBaseServiceImpl;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -26,13 +29,21 @@ import java.time.LocalDateTime;
 public class WithdrawnRecordServiceImpl extends MyBaseServiceImpl<WithdrawnRecordMapper, WithdrawnRecord> implements WithdrawnRecordService {
 
     @Override
-    public PageBean<WithdrawnRecord> listWithdrawnRecords(WithdrawnQueryParam params) {
+    public PageBean<WithdrawnRecordVo> listWithdrawnRecords(WithdrawnQueryParam params) {
         PageHelper.startPage(params.getPageNum(), params.getPageSize());
         var res = lambdaQuery()
                 .eq(CommUtil.isNotEmptyAndNull(params.getStationId()), WithdrawnRecord::getStationId, params.getStationId())
+                .eq(CommUtil.isNotEmptyAndNull(params.getStatus()), WithdrawnRecord::getStatus, params.getStatus())
+                .eq(CommUtil.isNotEmptyAndNull(params.getPaymentStatus()), WithdrawnRecord::getPaymentStatus, params.getPaymentStatus())
                 .orderByDesc(WithdrawnRecord::getId)
                 .list();
-        return new PageBean<>(res);
+        var voList = res.stream().map(item -> {
+            var vo = new WithdrawnRecordVo();
+            BeanUtils.copyProperties(item, vo);
+            vo.setStationName(KymCache.INSTANCE.getStationNameById(item.getStationId()));
+            return vo;
+        }).toList();
+        return new PageBean<>(voList);
     }
 
     @Override
@@ -54,7 +65,7 @@ public class WithdrawnRecordServiceImpl extends MyBaseServiceImpl<WithdrawnRecor
         lambdaUpdate()
                 .set(WithdrawnRecord::getPaymentStatus, params.getPaymentStatus())
                 .set(WithdrawnRecord::getPayer, StpUtil.getSession().getString("username"))
-                .set(WithdrawnRecord::getWithdrawnAmount, LocalDateTime.now())
+                .set(WithdrawnRecord::getPaymentTime, LocalDateTime.now())
                 .eq(WithdrawnRecord::getId, params.getId())
                 .update();
     }