Просмотр исходного кода

goodsList

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
2157563fd1
5 измененных файлов: 99 добавлений и 0 удалений
  1. +14
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  3. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java
  4. +5
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  5. +76
    -0
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 14
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java Просмотреть файл

@@ -7,6 +7,7 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.vo.WxCouponCVo;
import com.iformall.domain.vo.WxCouponOrderBVo;
import com.iformall.domain.vo.WxCouponOrderCVo;
import com.iformall.enums.EnumCouponType;
import com.iformall.enums.EnumCouponValidType;
@@ -70,6 +71,19 @@ public class WxCouponOrderController extends BaseController {
return new ResultData(page);
}

@ApiOperation("分页列表接口")
@GetMapping("goodsList")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData goodsList(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) {
if (null == wxCouponOrder) wxCouponOrder = new WxCouponOrder();
wxCouponOrder.setMerchantId(getLoginBUser().getMerchantId());
wxCouponOrder.setCouponType(EnumCouponType.COUPON_DISTRIBUTION.getCode());
final PageInfo<WxCouponOrderBVo> page = wxCouponOrderService.goodsListAsPage(wxCouponOrder, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponOrder wxCouponOrder) {


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

@@ -94,4 +94,6 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
List<Long> cardDeferCouponOrderId(@Param("couponId")Long couponId,@Param("tenantId")String tenantId);

Integer findWriteOffCount(WxCouponOrder wxCouponOrder);

WxCouponOrderBVo findGoodsList(WxCouponOrder record);
}

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

@@ -228,4 +228,6 @@ public interface WxCouponOrderService {
void statisticsWriteOff(WxCouponOrder wxCouponOrder, Map<String, Object> resultMap);

Integer findCount(WxCouponOrder wxCouponOrder);

PageInfo<WxCouponOrderBVo> goodsListAsPage(WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize);
}

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

@@ -1742,4 +1742,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
return wxCouponOrderMapper.findCount(wxCouponOrder);
}

@Override
public PageInfo<WxCouponOrderBVo> goodsListAsPage(WxCouponOrder record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findGoodsList(record));
}

}

+ 76
- 0
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -993,6 +993,82 @@
</select>

<select id="findGoodsList" parameterType="com.iformall.domain.vo.WxCouponOrder" resultMap="AdminBVoResultMap">
select
co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,
co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark, co.pay_vendor,
co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,
c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,
cu.phone
FROM wx_coupon_order co
left join wx_coupon_merchant wcm on co.coupon_id = wcm.product_id and wcm.merchant_id = #{merchantId}
LEFT JOIN wx_c_user_basic_info cu ON cu.id=co.c_user_id
LEFT JOIN wx_coupon c ON c.id = co.coupon_id
where 1=1
<choose>
<when test=" null != couponType">
and co.coupon_type = #{couponType}
</when>
<otherwise>
and co.coupon_type &lt; 100
</otherwise>
</choose>
<if test=" null != tenantId and '' != tenantId">
and co.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and co.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != cUserPhone and '' != cUserPhone">
and cu.`phone` = #{cUserPhone}
</if>

<if test=" null != couponOrderStatus ">
and co.coupon_order_status = #{couponOrderStatus}
</if>

<if test="startDate != null">
AND co.create_date &gt; #{startDate,jdbcType=TIMESTAMP}
</if>

<if test="endDate != null">
AND co.create_date &lt; #{endDate,jdbcType=TIMESTAMP}
</if>

<if test="verifyStartDate != null">
AND co.update_date &gt; #{verifyStartDate,jdbcType=TIMESTAMP}
</if>

<if test="verifyEndDate != null">
AND co.update_date &lt; #{verifyEndDate,jdbcType=TIMESTAMP}
</if>

<if test=" null != id ">
and co.id = #{id}
</if>
<if test=" null != orderId ">
and co.order_id = #{orderId}
</if>
<if test=" null != couponId ">
and c.id = #{couponId}
</if>
<if test=" null != title ">
and c.title like concat('%', #{title},'%')
</if>
<if test=" null != type ">
and c.`type` = #{type}
</if>
<if test=" null != business ">
and c.business = #{business}
</if>
<if test=" null != sourceType ">
and c.`source_type` = #{sourceType}
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns">order by co.create_date desc,co.id desc</if>

</select>


<select id="findDetailOfAdmin" parameterType="java.util.HashMap" resultMap="BVoResultMap">
select <include refid="allAdminCouponOrderDetailColumns" />


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