xhxu 5 лет назад
Родитель
Сommit
3401ad3b3a
6 измененных файлов: 111 добавлений и 12 удалений
  1. +2
    -4
      mallinkService/src/main/java/com/iformall/domain/po/tt/TtOrder.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/TtOrderMapper.java
  3. +4
    -0
      mallinkService/src/main/java/com/iformall/service/tt/TtOrderService.java
  4. +9
    -0
      mallinkService/src/main/java/com/iformall/service/tt/impl/TtOrderServiceImpl.java
  5. +93
    -7
      mallinkService/src/main/resources/mapper/TtOrderMapper.xml
  6. +1
    -1
      mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java

+ 2
- 4
mallinkService/src/main/java/com/iformall/domain/po/tt/TtOrder.java Просмотреть файл

@@ -28,12 +28,10 @@ public class TtOrder extends TenantEntity {
private String phone;
@io.swagger.annotations.ApiModelProperty(value="产品ID(couponId)",name="productId")
private Long productId;
@TableField(exist = false)
private String productTitle;
@TableField(exist = false)
private String productPic;
@TableField(exist = false)
private Long authorId;
private Integer productSalePrice;
private Long merchantId;
@TableField(exist = false)
private String author;
@TableField(exist = false)


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/TtOrderMapper.java Просмотреть файл

@@ -16,5 +16,7 @@ public interface TtOrderMapper extends CommonMapper<TtOrder, Long> {

List<TtOrder> findList(TtOrder record);

List<TtOrder> findCList(TtOrder record);

Integer findListCount(TtOrder orderQ);
}

+ 4
- 0
mallinkService/src/main/java/com/iformall/service/tt/TtOrderService.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.service.tt;

import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
import com.iformall.common.ResultData;
import com.iformall.domain.dto.OrderSaveDto;
import com.iformall.domain.po.WxAppinfo;
@@ -20,6 +21,7 @@ public interface TtOrderService {
* @return
*/
PageInfo<TtOrder> listAsPage(TtOrder record, Integer pageIndex, Integer pageSize);
PageInfo<TtOrder> listCAsPage(TtOrder order, Integer pageNum, Integer pageSize);

ResultData saveOrder(Long couponId, Long memberId, EnumPayWay payWay, TenantEntity tenantInfo);

@@ -32,4 +34,6 @@ public interface TtOrderService {
ResultData updateOrderStatus(Long orderId, WxAppinfo cAppInfo, WxPayAccount payAccount);

boolean isByMember(Long memberId, Long id);


}

+ 9
- 0
mallinkService/src/main/java/com/iformall/service/tt/impl/TtOrderServiceImpl.java Просмотреть файл

@@ -61,6 +61,11 @@ public class TtOrderServiceImpl implements TtOrderService {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> ttOrderMapper.findList(record));
}

@Override
public PageInfo<TtOrder> listCAsPage(TtOrder record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> ttOrderMapper.findCList(record));
}

@Override
public ResultData saveOrder(Long couponId,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity) {
logger.info("OrderSave: couponId:" + couponId + "---cUserId:"+cUserId);
@@ -107,6 +112,10 @@ public class TtOrderServiceImpl implements TtOrderService {
order.updateTenantInfo(tenantEntity);
order.setCUserId(cUserId);
order.setProductId(coupon.getId());
order.setProductTitle(coupon.getTitle());
order.setProductPic(coupon.getCoverImg());
order.setProductSalePrice(coupon.getSalePrice());
order.setMerchantId(coupon.getMerchantId());
order.setType(payWay.getCode());
order.setPaymentType(EnumPayType.PAY_PAYMENT.getCode());
order.setPayment(coupon.getSalePrice());


+ 93
- 7
mallinkService/src/main/resources/mapper/TtOrderMapper.xml Просмотреть файл

@@ -7,6 +7,11 @@
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="c_user_id" jdbcType="BIGINT" property="cUserId"/>
<result column="product_id" jdbcType="BIGINT" property="productId"/>
<result column="product_title" jdbcType="VARCHAR" property="productTitle"/>
<result column="product_pic" jdbcType="VARCHAR" property="productPic"/>
<result column="product_sale_price" jdbcType="INTEGER" property="productSalePrice"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>

<result column="type" jdbcType="TINYINT" property="type"/>
<result column="way" jdbcType="TINYINT" property="way"/>
<result column="payment_type" jdbcType="INTEGER" property="paymentType"/>
@@ -18,8 +23,6 @@

<result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="product_title" jdbcType="VARCHAR" property="productTitle"/>
<result column="product_pic" jdbcType="VARCHAR" property="productPic"/>
<result column="author" jdbcType="VARCHAR" property="author"/>
<result column="author_pic" jdbcType="VARCHAR" property="authorPic"/>
</resultMap>
@@ -28,7 +31,7 @@
o.`id`,o.`tenant_id`,o.`parent_tenant_id`,o.`c_user_id`,o.`product_id`,o.`type`,o.`way`,o.`payment_type`,o.`payment`,
o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,
u.`nick_name`,u.`phone`,
c.`title` product_title,c.`cover_img` product_pic,
o.`product_title`,o.`product_pic`,o.`product_sale_price`,
m.`name` author,m.`img_url` author_pic
</sql>

@@ -86,11 +89,11 @@
</if>

<if test=" null != productTitle ">
and c.`title` like concat('%', #{productTitle},'%')
and o.`title` like concat('%', #{productTitle},'%')
</if>

<if test=" null != authorId ">
and c.merchant_id = #{authorId}
and o.merchant_id = #{authorId}
</if>

<if test=" null != author ">
@@ -118,11 +121,94 @@
<include refid="allColumns"/>
from tt_order o
left join tt_c_user u on o.c_user_id = u.id
left join tt_coupon c on o.product_id = c.id
left join wx_merchant m on c.merchant_id = m.id
left join wx_merchant m on o.merchant_id = m.id
<include refid="dynamicWhereConditions"/>
</select>

<select id="findCList" parameterType="com.iformall.domain.po.tt.TtOrder" resultMap="BaseResultMap">
select
<include refid="allColumnsC"/>
from tt_order o
left join wx_merchant m on o.merchant_id = m.id
<include refid="dynamicWhereConditionsC"/>
</select>

<sql id="allColumnsC">
o.`id`,o.`tenant_id`,o.`parent_tenant_id`,o.`c_user_id`,o.`product_id`,o.`type`,o.`way`,o.`payment_type`,o.`payment`,
o.`payment_time`,o.`order_status`,o.`create_date`,o.`update_date`,
o.`product_title`,o.`product_pic`,o.`product_sale_price`,
m.`name` author,m.`img_url` author_pic
</sql>

<sql id="dynamicWhereConditionsC">
where 1 = 1

<if test=" null != id ">
and o.`id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and o.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and o.`parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != cUserId ">
and o.`c_user_id` = #{cUserId}
</if>

<if test=" null != productId ">
and o.`product_id` = #{productId}
</if>

<if test=" null != type ">
and o.`type` = #{type}
</if>

<if test=" null != way ">
and o.`way` = #{way}
</if>

<if test=" null != paymentType ">
and o.`payment_type` = #{paymentType}
</if>

<if test="startdate != null">
and o.`payment_time` &gt;= #{startdate}
</if>
<if test="enddate != null">
and o.`payment_time` &lt;= #{enddate}
</if>

<if test=" null != orderStatus ">
and o.`order_status` = #{orderStatus}
</if>

<if test=" null != authorId ">
and o.merchant_id = #{authorId}
</if>

<if test=" null != author ">
and m.`name` like concat('%', #{author},'%')
</if>

<if test=" null != statusS ">
and o.`order_status` in
<foreach collection="statusS" index="index" item="sItem" open="(" separator="," close=")">
#{sItem}
</foreach>
</if>

<if test=" null != ids ">
and o.`id` in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
order by o.`update_date` desc
</sql>

<select id="findListCount" parameterType="com.iformall.domain.po.tt.TtOrder" resultType="Integer">
select count(1)
from tt_order


+ 1
- 1
mallinkTTCApi/src/main/java/com/iformall/controller/TtOrderController.java Просмотреть файл

@@ -57,7 +57,7 @@ public class TtOrderController extends BaseController {
return new ResultData(e.getErrorCode(), e.getMessage());
}
order.setCUserId(memberId);
return new ResultData(ttOrderService.listAsPage(order, pageNum, pageSize));
return new ResultData(ttOrderService.listCAsPage(order, pageNum, pageSize));
}

@ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}")


Загрузка…
Отмена
Сохранить