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

[A端][修复]:增加订单列表详情接口

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
6482b3c8fd
5 измененных файлов: 81 добавлений и 22 удалений
  1. +14
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxCouponOrderController.java
  2. +2
    -3
      mallinkService/src/main/java/com/iformall/mapper/WxCouponOrderMapper.java
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponOrderService.java
  4. +11
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  5. +51
    -16
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

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

@@ -55,13 +55,26 @@ public class WxCouponOrderController extends BaseController {
logger.debug("[" + getIpAddr() + "] WxCouponOrderController::list");
if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrderBVo();
wxCouponOrder.setTenantId(getTenantId());
if (wxCouponOrder.getMerchantName().isEmpty()) {
if (wxCouponOrder.getMerchantName() != null &&
wxCouponOrder.getMerchantName().isEmpty()) {
wxCouponOrder.setMerchantName(null);
}
wxCouponOrder.setSortColumns(WxCouponOrder.Field.Id_DESC);
return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize);
}

@ApiOperation(value = "卡券详情接口")
@GetMapping("detail")
@ApiImplicitParams({
@ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "Long", paramType = "query", required = true)
})
public ResultData detail(@RequestParam("couponOrderId") Long couponOrderId) {
if(couponOrderId == null) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
return wxCouponOrderService.detailAdminVo(couponOrderId);
}

@RequestMapping("/exportData")
public void exportData(
@RequestParam("endDate") String endDate,


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

@@ -26,11 +26,10 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {
List<WxCouponOrderBVo> findListOfOrderedByDateForBUser(Map dateMap);
List<WxCouponOrderBVo> findListOfVerifiedByDateForBUser(Map dateMap);

WxCouponOrderCVo findDetail(@Param("id")Long id);

List<WxCouponOrderCVo> findListOfCUser(WxCouponOrder wxCouponOrder);
WxCouponOrderCVo findDetailOfCUser(@Param("id")Long id);
List<WxCouponOrderBVo> findListOfAdmin(WxCouponOrderBVo wxCouponOrder);
WxCouponOrderBVo findDetailOfAdmin(@Param("id")Long id);
/**
* 查询用户核销/领券数
* @param cUserId


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

@@ -138,6 +138,9 @@ public interface WxCouponOrderService {
*/
ResultData listAdminAsPage(WxCouponOrderBVo wxCouponOrder, Integer pageIndex, Integer pageSize);


ResultData detailAdminVo(Long couponOrderId);

void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponOrderBVo wxCouponOrder);



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

@@ -192,7 +192,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
throw new MallinkException(ErrorCode.USER_IS_EMPTY);
}

WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.findDetail(Long.valueOf(couponOrderId));
WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.findDetailOfCUser(Long.valueOf(couponOrderId));
if (wxCouponOrderCVo == null)
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
return new ResultData(wxCouponOrderCVo);
@@ -223,7 +223,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND);
}

WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.findDetail(Long.valueOf(couponOrderId));
WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.findDetailOfCUser(Long.valueOf(couponOrderId));
if (wxCouponOrderCVo == null)
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
return new ResultData(wxCouponOrderCVo);
@@ -235,6 +235,15 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
return new ResultData(pageInfo);
}

@Override
public ResultData detailAdminVo(Long couponOrderId) {

WxCouponOrderBVo wxCouponOrderBVo = wxCouponOrderMapper.findDetailOfAdmin(couponOrderId);
if (wxCouponOrderBVo == null)
return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL);
return new ResultData(wxCouponOrderBVo);
}

@Override
public void exportData(HttpServletRequest request, HttpServletResponse response, WxCouponOrderBVo wxCouponOrder) {



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

@@ -320,21 +320,36 @@
</collection>
</resultMap>

<sql id="allAdminCouponOrderColumns">
<sql id="allAdminCouponOrderListColumns">
co.id,co.tenant_id,co.coupon_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
c.title,c.sale_price,c.use_price,c.price,c.unit,
m.name as merchant_name
</sql>

<sql id="allAdminCouponOrderDetailColumns">
co.id,co.tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,
bu.name, bu.phone as bphone, cu.phone, m.name as merchant_name
bu.name, bu.phone as bphone,
cu.phone,
m.name as merchant_name
</sql>

<select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap">
select <include refid="allAdminCouponOrderColumns" />
from wx_coupon_order co
inner JOIN wx_coupon c on c.id = co.coupon_id
inner JOIN wx_c_user cu on cu.id = co.c_user_id
left JOIN wx_merchant_b_user bu on bu.id = co.b_user_id
left JOIN wx_merchant m on m.id = bu.merchant_id
where 1 = 1

select <include refid="allAdminCouponOrderListColumns" />
from wx_coupon_merchant cm,
(select tco.id as tcoid,
(select count(*) from wx_coupon_merchant tcm
where tcm.product_id = tco.coupon_id) as mc
from wx_coupon_order tco) com,
wx_coupon c,
wx_merchant m,
wx_coupon_order co
where com.mc = 1
and com.tcoid = co.id
and cm.product_id = c.id
and cm.status = 0
and c.id = co.coupon_id
and m.id = cm.merchant_id
<if test=" null != tenantId ">
and co.tenant_id = #{tenantId}
</if>
@@ -360,6 +375,28 @@
</select>


<select id="findDetailOfAdmin" parameterType="java.lang.Long" resultMap="BVoResultMap">
select <include refid="allAdminCouponOrderDetailColumns" />
from wx_coupon_merchant cm,
(select tco.id as tcoid,
(select count(*) from wx_coupon_merchant tcm
where tcm.product_id = tco.coupon_id) as mc
from wx_coupon_order tco) com,
wx_coupon c,
wx_c_user cu,
wx_merchant m,
wx_coupon_order co
left join wx_merchant_b_user bu on co.b_user_id = bu.id
where co.id = #{id}
and com.mc = 1
and com.tcoid = co.id
and cm.product_id = c.id
and cm.status = 0
and c.id = co.coupon_id
and cu.id = co.c_user_id
and m.id = cm.merchant_id
</select>

<sql id="allBUserVerifiedCouponOrderColumns">
co.id,co.tenant_id,co.coupon_id,co.c_user_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,
c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,
@@ -376,14 +413,13 @@

<select id="findListOfOrderedByDateForBUser" parameterType="map" resultMap="BVoResultMap">
select <include refid="allBUserOrderedCouponOrderColumns" />
from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_coupon_merchant cm,
from wx_coupon_order co,wx_coupon c,wx_c_user cu,wx_coupon_merchant cm,
(select tco.id as tcoid,
(select count(*) from wx_coupon_merchant tcm
where tcm.product_id = tco.coupon_id) as mc
from wx_coupon_order tco) com
where com.mc = 1
and com.tcoid = co.id
and o.id = co.order_id
and cm.merchant_id = #{merchantId}
and cm.product_id = c.id
and cm.status = 0
@@ -401,9 +437,8 @@

<select id="findListOfVerifiedByDateForBUser" parameterType="map" resultMap="BVoResultMap">
select <include refid="allBUserVerifiedCouponOrderColumns" />
from wx_coupon_order co,wx_order o,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu
where o.id = co.order_id
and co.coupon_id = c.id
from wx_coupon_order co,wx_coupon c,wx_c_user cu,wx_merchant_b_user bu
where co.coupon_id = c.id
and cu.id = co.c_user_id
and bu.id = co.b_user_id
and bu.merchant_id = #{merchantId}
@@ -518,7 +553,7 @@
</select>


<select id="findDetail" parameterType="java.lang.Long" resultMap="CVoResultMap">
<select id="findDetailOfCUser" parameterType="java.lang.Long" resultMap="CVoResultMap">
select <include refid="allCUserCouponOrderDetailColumns" />
from wx_coupon_order co,wx_coupon c
where co.coupon_id = c.id


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