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

wx_order_group添加分表

release_toaliyun_real
xiaohanzi 5 лет назад
Родитель
Сommit
1e4d07a911
4 измененных файлов: 19 добавлений и 11 удалений
  1. +4
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxOrderGroupMapper.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderGroupServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  4. +11
    -7
      mallinkService/src/main/resources/mapper/WxOrderGroupMapper.xml

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

@@ -10,11 +10,15 @@ import com.iformall.domain.vo.WxOrderGroupMarketing;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

/**
* @author gongbiao
*/
public interface WxOrderGroupMapper extends CommonMapper<WxOrderGroup, Long> {

WxOrderGroup selectById(@Param("id")Long id,@Param("tenantId")String tenantId);
Map<String, Object> queryRemainOne(WxOrderGroup group);

List<Map<String, Object>> queryOrderGroup(WxOrder wxOrder);


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

@@ -119,7 +119,7 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService {
if (!orderGroupId.equals(0L)) {
// 非首次拼团
// 参与拼团
WxOrderGroup wxOrderGroup = wxOrderGroupMapper.selectById(orderGroupId);
WxOrderGroup wxOrderGroup = wxOrderGroupMapper.selectById(orderGroupId,order.getTenantId());
if (null == wxOrderGroup) {
//错误,更新状态,定时任务会发起退款,回滚库存
order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode());
@@ -371,7 +371,7 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService {
return o.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode()) ||
o.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE.getCode());
}).count();
WxOrderGroup group = wxOrderGroupMapper.selectById(wxOrderGroup.getId());
WxOrderGroup group = wxOrderGroupMapper.selectById(wxOrderGroup.getId(),wxOrderGroup.getTenantId());
Map<String, Object> result = new HashMap<>(2);
result.put("attend", count > 0 ? true : false);
result.put("status", group.getStatus());
@@ -382,7 +382,7 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService {
@Override
public void updateGroupStatus(WxOrderGroup wxOrderGroup) {
Long id = wxOrderGroup.getId();
WxOrderGroup group = wxOrderGroupMapper.selectById(id);
WxOrderGroup group = wxOrderGroupMapper.selectById(id,wxOrderGroup.getTenantId());
if (group != null && group.getStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING.getCode())) {
WxCoupon wxCoupon = wxCouponMapper.selectById(wxOrderGroup.getCouponId(),group.getTenantId());
Integer status = wxCoupon.getStatus();


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

@@ -2322,7 +2322,7 @@ public class WxOrderServiceImpl implements WxOrderService {
}

private void checkOrderGroup(WxCUserBasicInfo user, Long orderGroupId,WxCoupon coupon) {
WxOrderGroup group = wxOrderGroupMapper.selectById(orderGroupId);
WxOrderGroup group = wxOrderGroupMapper.selectById(orderGroupId,coupon.getTenantId());
if (group.getStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_COMPLETE.getCode())) {
logger.error("下订单拼团人数已满>>>" + orderGroupId);
throw new MallinkException(ErrorCode.ORDER_GROUP_COOPERATING_FINISHED);


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

@@ -52,6 +52,10 @@
<if test=" null != sortColumns">order by ${sortColumns}</if>
</sql>
<select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
select <include refid="allColumns"/> from wx_order_group where id = #{id} and tenant_id = #{tenantId}
</select>
<select id="queryRemainOne" parameterType="com.iformall.domain.po.WxOrderGroup" resultType="hashmap">
select o.press_end_date expiredDate,o.order_group_id orderGroupId,c.nick_name nickName,
@@ -141,7 +145,7 @@
</select>
<select id="queryOrderGroupSuccessCountAndTime" parameterType="hashmap" resultType="hashmap">
select count(*) total,DATE_FORMAT(create_date,'%Y-%m-%d') time from wx_coupon_order
select count(1) total,DATE_FORMAT(create_date,'%Y-%m-%d') time from wx_coupon_order
where coupon_type=9
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -159,7 +163,7 @@
</select>
<select id="queryOrderGroupVerifyCountAndTime" parameterType="hashmap" resultType="hashmap">
select count(*) total,DATE_FORMAT(create_date,'%Y-%m-%d') time
select count(1) total,DATE_FORMAT(create_date,'%Y-%m-%d') time
from wx_coupon_order where coupon_type=9 and coupon_order_status=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -177,7 +181,7 @@
</select>
<select id="queryOrderGroupCount" parameterType="hashmap" resultType="long">
select count(*) total from wx_order_group
select count(1) total from wx_order_group
<where>
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
@@ -209,7 +213,7 @@
</select>
<select id="queryOrderGroupSuccessCount" parameterType="hashmap" resultType="long">
select count(*) total from wx_order_group where status=11
select count(1) total from wx_order_group where status=11
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
@@ -222,7 +226,7 @@
</select>
<select id="queryOrderGroupPeopleCount" parameterType="hashmap" resultType="long">
select count(*) from (select id from wx_order where order_group_id!=0
select count(1) from (select id from wx_order where order_group_id!=0
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
@@ -236,7 +240,7 @@
</select>
<select id="queryOrderGroupVerifyCount" parameterType="hashmap" resultType="long">
select count(*) total from wx_coupon_order where coupon_type=9 and coupon_order_status=1
select count(1) total from wx_coupon_order where coupon_type=9 and coupon_order_status=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
@@ -252,7 +256,7 @@
</select>
<select id="queryOrderGroupSuccessPeopleCount" parameterType="hashmap" resultType="long">
select count(*) from wx_order where order_status=11
select count(1) from wx_order where order_status=11
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>


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