dcs 2 月之前
父節點
當前提交
e007446c50

+ 39 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/model/OrderInfo.java

@@ -74,6 +74,21 @@ public class OrderInfo {
      */
     private String contract;
 
+    /**
+     * 目录id
+     */
+    private long productLevelId;
+
+    /**
+     * 组织id
+     */
+    private long organizationId;
+
+    /**
+     * 购买组织id
+     */
+    private long payOrganizationId;
+
     public Long getId() {
         return id;
     }
@@ -177,4 +192,28 @@ public class OrderInfo {
     public void setContract(String contract) {
         this.contract = contract;
     }
+
+    public long getProductLevelId() {
+        return productLevelId;
+    }
+
+    public void setProductLevelId(long productLevelId) {
+        this.productLevelId = productLevelId;
+    }
+
+    public long getOrganizationId() {
+        return organizationId;
+    }
+
+    public void setOrganizationId(long organizationId) {
+        this.organizationId = organizationId;
+    }
+
+    public long getPayOrganizationId() {
+        return payOrganizationId;
+    }
+
+    public void setPayOrganizationId(long payOrganizationId) {
+        this.payOrganizationId = payOrganizationId;
+    }
 }

+ 2 - 0
virgo.api/src/main/java/com/bosshand/virgo/api/workark/service/OrderInfoService.java

@@ -102,6 +102,8 @@ public class OrderInfoService {
         orderInfo.setTotalFee(price); //元
         orderInfo.setOrderStatus(OrderStatus.NOTPAY.getType());
         orderInfo.setUserId(userId);
+        orderInfo.setOrganizationId(product.getOrganizationId());
+        orderInfo.setProductLevelId(product.getProductLevelId());
         orderInfoDao.save(orderInfo);
         return orderInfo;
     }

+ 47 - 2
virgo.api/src/main/resources/mapper/OrderInfoMapper.xml

@@ -18,6 +18,9 @@
         <result column="paymentType" property="paymentType"/>
         <result column="productCouponIds" property="productCouponIds"/>
         <result column="contract" property="contract"/>
+        <result column="productLevelId" property="productLevelId"/>
+        <result column="organizationId" property="organizationId"/>
+        <result column="payOrganizationId" property="payOrganizationId"/>
     </resultMap>
 
     <select id="get" resultMap="result">
@@ -39,9 +42,33 @@
     <select id="getList" resultMap="result">
         select * from workark_orderInfo
         <where>
+            <if test="title != null">
+                and title = #{title}
+            </if>
+            <if test="orderNo != null">
+                and orderNo = #{orderNo}
+            </if>
             <if test="userId != 0">
                 and userId = #{userId}
             </if>
+            <if test="productId != null">
+                and productId = #{productId}
+            </if>
+            <if test="orderStatus != null">
+                and orderStatus = #{orderStatus}
+            </if>
+            <if test="paymentType != null">
+                and paymentType = #{paymentType}
+            </if>
+            <if test="productLevelId != 0">
+                and productLevelId = #{productLevelId}
+            </if>
+            <if test="organizationId != 0">
+                and organizationId = #{organizationId}
+            </if>
+            <if test="payOrganizationId != 0">
+                and payOrganizationId = #{payOrganizationId}
+            </if>
         </where>
     </select>
 
@@ -66,6 +93,15 @@
             <if test="paymentType != null">
                 and paymentType = #{paymentType}
             </if>
+            <if test="productLevelId != 0">
+                and productLevelId = #{productLevelId}
+            </if>
+            <if test="organizationId != 0">
+                and organizationId = #{organizationId}
+            </if>
+            <if test="payOrganizationId != 0">
+                and payOrganizationId = #{payOrganizationId}
+            </if>
         </where>
     </select>
 
@@ -90,13 +126,22 @@
             <if test="p.paymentType != null">
                 and paymentType = #{p.paymentType}
             </if>
+            <if test="p.productLevelId != 0">
+                and productLevelId = #{p.productLevelId}
+            </if>
+            <if test="p.organizationId != 0">
+                and organizationId = #{p.organizationId}
+            </if>
+            <if test="p.payOrganizationId != 0">
+                and payOrganizationId = #{p.payOrganizationId}
+            </if>
         </where>
         order by createTime desc limit #{currIndex} , #{pageSize}
     </select>
 
     <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO workark_orderInfo (createTime, title, orderNo, userId, productId, totalFee, codeUrl, orderStatus, paymentType, productCouponIds) VALUES
-                            (now(), #{title}, #{orderNo}, #{userId}, #{productId}, #{totalFee}, #{codeUrl}, #{orderStatus}, #{paymentType}, #{productCouponIds})
+        INSERT INTO workark_orderInfo (createTime, title, orderNo, userId, productId, totalFee, codeUrl, orderStatus, paymentType, productCouponIds, productLevelId, organizationId, payOrganizationId) VALUES
+                            (now(), #{title}, #{orderNo}, #{userId}, #{productId}, #{totalFee}, #{codeUrl}, #{orderStatus}, #{paymentType}, #{productCouponIds}, #{productLevelId}, #{organizationId}, #{payOrganizationId})
     </insert>
 
     <update id="update" parameterType="com.bosshand.virgo.api.workark.model.OrderInfo">