licailing 5 лет назад
Родитель
Сommit
1503e8fa23

+ 6 - 2
src/main/java/com/izouma/dingdong/domain/BankCard.java

@@ -39,8 +39,12 @@ public class BankCard extends BaseEntity {
     @Column(nullable = false)
     private Boolean enabled = true;
 
-    public String userInfo(){
-        return bankName + " (" + cardNo.substring(cardNo.length() - 4) + ") " + realName;
+    public String userInfo() {
+        String substring = cardNo;
+        if (cardNo.length() > 4) {
+            substring = cardNo.substring(cardNo.length() - 4);
+        }
+        return bankName + " (" + substring + ") " + realName;
     }
 
 }

+ 2 - 0
src/main/java/com/izouma/dingdong/dto/ApDTO.java

@@ -63,4 +63,6 @@ public class ApDTO {
      */
     @ApiModelProperty(value = "骑手评分", name = "riderScore")
     private Integer riderLike;
+
+
 }

+ 1 - 1
src/main/java/com/izouma/dingdong/service/WithdrawApplyService.java

@@ -45,7 +45,7 @@ public class WithdrawApplyService {
         User user = userRepo.findById(userId).orElseThrow(new BusinessException("用户不存在"));
         BankCard bankCard = bankCardRepo.findById(bankCardId).orElseThrow(new BusinessException("银行卡信息不存在"));
 
-        if (BigDecimal.ZERO.compareTo(user.getMoney()) == 0) {
+        if (BigDecimal.ZERO.compareTo(user.getMoney()) >= 0) {
             throw new BusinessException("当前可提现金额0");
         }
         if (amount.compareTo(user.getMoney()) > 0) {

+ 10 - 4
src/main/vue/src/views/AppraisalEdit.vue

@@ -2,8 +2,11 @@
     <div class="edit-view">
         <el-form :model="formData" :rules="rules" ref="form" label-width="108px" label-position="right" size="small"
                  style="max-width: 500px;">
-            <el-form-item prop="orderInfoId" label="订单号">
+            <!--<el-form-item prop="orderInfoId" label="订单号">
                 <el-input v-model="formData.orderInfoId"></el-input>
+            </el-form-item>-->
+            <el-form-item prop="nickname" label="用户昵称">
+                <el-input v-model="formData.nickname"></el-input>
             </el-form-item>
             <el-form-item prop="img" label="图片">
                 <el-image
@@ -12,6 +15,9 @@
                         :preview-src-list="formData.img">
                 </el-image>
             </el-form-item>
+            <el-form-item prop="merShowName" label="商家名称">
+                <el-input v-model="formData.nickname"></el-input>
+            </el-form-item>
             <el-form-item prop="goodsLike" label="商品评分">
                 <el-input v-model="formData.goodsLike?'好评':'差评'"></el-input>
             </el-form-item>
@@ -24,8 +30,8 @@
             <el-form-item prop="riderAppraise" label="骑手评价">
                 <el-input type="textarea" v-model="formData.riderAppraise"></el-input>
             </el-form-item>
-            <el-form-item prop="fastIds" label="快捷评价">
-                <el-input v-model="formData.fastIds"></el-input>
+            <el-form-item prop="content" label="快捷评价">
+                <el-input v-model="formData.content"></el-input>
             </el-form-item>
             <el-form-item prop="merchantReply" label="商家回复评价">
                 <el-input type="textarea" v-model="formData.merchantReply"></el-input>
@@ -56,7 +62,7 @@
         created() {
             if (this.$route.query.id) {
                 this.$http
-                    .get('appraisal/get/' + this.$route.query.id)
+                    .get('appraisal/getDTO/' + this.$route.query.id)
                     .then(res => {
                         this.formData = res;
                     })

+ 22 - 0
src/test/java/com/izouma/dingdong/service/WithdrawApplyServiceTest.java

@@ -0,0 +1,22 @@
+package com.izouma.dingdong.service;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.math.BigDecimal;
+
+@SpringBootTest
+@RunWith(SpringRunner.class)
+public class WithdrawApplyServiceTest {
+    @Autowired
+    private WithdrawApplyService withdrawApplyService;
+
+    @Test
+    public void test(){
+        System.out.println(withdrawApplyService.apply(2105L, BigDecimal.valueOf(32), 2115L));
+
+    }
+}