licailing hace 4 años
padre
commit
6ee65c896b

+ 2 - 0
src/main/java/com/izouma/jiashanxia/domain/Package.java

@@ -8,6 +8,7 @@ import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.hibernate.annotations.Where;
 
 import javax.persistence.*;
 import java.math.BigDecimal;
@@ -19,6 +20,7 @@ import java.util.List;
 @AllArgsConstructor
 @NoArgsConstructor
 @ApiModel(value = "套餐信息")
+@Where(clause = "del = 0")
 public class Package extends BaseEntity {
 
     @ApiModelProperty(value = "套餐名称")

+ 2 - 2
src/main/java/com/izouma/jiashanxia/dto/WriteOffSaveVO.java

@@ -23,8 +23,8 @@ public class WriteOffSaveVO extends BaseEntity {
     @ApiModelProperty(value = "核销人")
     private Long writeOffUserId;
 
-    @ApiModelProperty(value = "类型")
-    private PackageType type;
+//    @ApiModelProperty(value = "类型")
+//    private PackageType type;
 
     /*
     存储内容

+ 2 - 3
src/main/java/com/izouma/jiashanxia/service/UserPackageFlowService.java

@@ -128,8 +128,7 @@ public class UserPackageFlowService {
         }
 
         // 用户已有套餐
-        Map<Long, UserPackage> userPackageMap = userPackageRepo.findAllByUserIdAndType(writeOffSaveVO.getUserId(), writeOffSaveVO
-                .getType())
+        Map<Long, UserPackage> userPackageMap = userPackageRepo.findAllByUserId(writeOffSaveVO.getUserId())
                 .stream()
                 .collect(Collectors.toMap(UserPackage::getGoodsInfoId, userPackage -> userPackage));
 
@@ -162,7 +161,7 @@ public class UserPackageFlowService {
                         .userId(writeOffSaveVO.getUserId())
                         .content(content)
                         .type(FlowType.WRITE_OFF)
-                        .packageType(writeOffSaveVO.getType())
+//                        .packageType(writeOffSaveVO.getType())
                         .writeOffUserId(writeOffSaveVO.getWriteOffUserId())
                         .build());
     }

+ 1 - 1
src/main/resources/application.yaml

@@ -61,7 +61,7 @@ wx:
         app_secret: 28e4829124860d9ef9e2f32aeefd1111
     ma:
         app_id: wxde386c1d6f9fc0c8
-        app_secret: uDusnGcUqYyWqsBdmvuioxDhtgZErwtu
+        app_secret: 58b9357b4fd72c2ab0b5ef6a7522e5ee
         msg_token: msgToken
         msg_aes_key: aesKey
         msg_format: JSON

+ 1 - 1
src/test/java/com/izouma/jiashanxia/service/UserPackageFlowServiceTest.java

@@ -33,7 +33,7 @@ public class UserPackageFlowServiceTest {
                 .userId(125L)
                 .writeOffUserId(1L)
                 .content("[{\"goodsInfoId\":27,\"num\":1}]")
-                .type(PackageType.TEAM)
+//                .type(PackageType.TEAM)
                 .build());
     }
 

+ 16 - 0
src/test/java/com/izouma/jiashanxia/web/AuthenticationControllerTest.java

@@ -0,0 +1,16 @@
+package com.izouma.jiashanxia.web;
+
+import com.izouma.jiashanxia.ApplicationTests;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+class AuthenticationControllerTest extends ApplicationTests {
+
+    @Autowired
+    private AuthenticationController controller;
+
+    @Test
+    void maLogin() {
+        controller.maLogin("023xlP000uv6GL1H6d100sylyA3xlP0C",null);
+    }
+}

+ 17 - 0
src/test/java/com/izouma/jiashanxia/web/PackageControllerTest.java

@@ -0,0 +1,17 @@
+package com.izouma.jiashanxia.web;
+
+import com.izouma.jiashanxia.ApplicationTests;
+import com.izouma.jiashanxia.dto.PageQuery;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+
+class PackageControllerTest extends ApplicationTests {
+
+    @Autowired
+    private PackageController controller;
+
+    @Test
+    void all() {
+        System.out.println(controller.all(new PageQuery()).getContent());
+    }
+}