Ver Fonte

修改产品数据结构

杨六六 há 4 anos atrás
pai
commit
99dd47fe26

+ 0 - 2
common/fire-dto/src/main/java/com/fire/dto/CustomerProduct.java

@@ -27,8 +27,6 @@ public class CustomerProduct {
     @ApiModelProperty(value = "客户编号(前端不展示)")
     private Long customerId;
 
-    @ApiModelProperty(value = "产品(产品表对应的主键;前端不展示)")
-    private Integer productId;
 
     @ApiModelProperty(value = "产品id(前端不展示)")
     private String packageId;

+ 37 - 0
modules/admin/src/main/java/com/fire/admin/rest/CustomerProductInfoController.java

@@ -0,0 +1,37 @@
+package com.fire.admin.rest;
+
+import com.fire.admin.service.CustomerProductInfoService;
+import com.fire.dto.response.BaseRestResponse;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author: liuliu
+ * @ClassName: CustomerProductInfoController
+ * @Description: TODO 客户产品的控制层
+ * @date: 2021-05-28 10:06
+ */
+@Api(tags = "客户产品相关的接口")
+@RestController
+@RequestMapping("/customer/product")
+public class CustomerProductInfoController {
+
+
+    private CustomerProductInfoService customerProductInfoService;
+
+    @Autowired
+    public CustomerProductInfoController(CustomerProductInfoService service){
+        this.customerProductInfoService=service;
+    }
+
+
+    @ApiOperation("客户产品详情")
+    @GetMapping("/info")
+    public BaseRestResponse getCustomerProductInfo(Integer customerId, Integer type){
+        return new BaseRestResponse<>(customerProductInfoService.getCustomerProductByCustomerId(customerId,type));
+    }
+}

+ 0 - 7
modules/admin/src/main/java/com/fire/admin/vo/CustomerProductInfoVo.java

@@ -17,21 +17,14 @@ public class CustomerProductInfoVo {
     @ApiModelProperty(value = "客户ID")
     private Long customerId;
 
-    @ApiModelProperty(value = "产品id")
-    private BigInteger productId;
 
     @ApiModelProperty(value = "产品流量包ID")
     private String packageId;
 
-    @ApiModelProperty(value = "产品代码")
-    private String productCode;
-
 
     @ApiModelProperty(value = "产品名称(查询条件之一)")
     private String productName;
 
-    @ApiModelProperty(value = "产品描述")
-    private String productDesc;
 
     @ApiModelProperty(value = "产品类型(1:话费 2:流量)")
     private Integer type;

+ 1 - 9
modules/admin/src/main/resources/mapper/CustomerProductInfoMapper.xml

@@ -6,8 +6,6 @@
     <resultMap id="BaseResultMap" type="com.fire.dto.CustomerProduct">
         <id column="customer_product_id" property="customerProductId"/>
         <result column="customer_id" property="customerId"/>
-        <result column="product_id" property="productId"/>
-        <result column="product_id" property="productId"/>
         <result column="package_id" property="packageId"/>
         <result column="type" property="type"/>
         <result column="price" property="price"/>
@@ -18,11 +16,8 @@
 
     <resultMap id="ResultMap" type="com.fire.admin.vo.CustomerProductInfoVo">
         <result column="customer_id" property="customerId"/>
-        <result column="product_id" property="productId"/>
         <result column="package_id" property="packageId"/>
-        <result column="product_code" property="productCode"/>
         <result column="product_name" property="productName"/>
-        <result column="product_desc" property="productDesc"/>
         <result column="type" property="type"/>
         <result column="price" property="price"/>
         <result column="face_price" property="facePrice"/>
@@ -33,11 +28,8 @@
 
     <sql id="selectCustomerProductByCustomerId" >
         cp.customer_id,
-        p.product_id,
         p.package_id,
-        p.product_code,
         p.product_name,
-        p.product_desc,
         cp.type,
         cp.price,
         cp.face_price,
@@ -51,7 +43,7 @@
         <include refid="selectCustomerProductByCustomerId"/>
         FROM
         flow_product_info AS p
-        LEFT JOIN customer_product cp ON p.product_id = cp.product_id
+        LEFT JOIN customer_product cp ON p.package_id = cp.package_id
         <where>
             <if test="type !=null and type !=''">
                 AND cp.type=#{type}