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

Merge branch 'develop' of https://git.youlane.cn/server/formallProject into develop

release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
0892e3cd00
4 измененных файлов: 34 добавлений и 13 удалений
  1. +14
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserBasicInfoController.java
  2. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxMerchantMapper.java
  4. +16
    -12
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml

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

@@ -16,6 +16,7 @@ import com.iformall.enums.EnumAssignTagsTrigger;
import com.iformall.enums.EnumCouponOrderStatus;
import com.iformall.enums.EnumCouponStatus;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxMerchantMapper;
import com.iformall.service.*;
import com.iformall.utils.Constant;
import com.iformall.utils.DateUtils;
@@ -23,6 +24,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -39,6 +41,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -83,6 +86,9 @@ public class WxCUserBasicInfoController extends BaseController {
@Autowired
private ExcelService excelService;

@Autowired
private WxMerchantMapper wxMerchantMapper;

private void setUserInfoLevel(WxCUserBasicInfo info) {

if (info.getPoins() == null || info.getPoins() == 0) {
@@ -244,6 +250,14 @@ public class WxCUserBasicInfoController extends BaseController {
WxCoupon coupon = wxCouponService.getById(c.getCouponId());
c.setCouponName(coupon.getTitle());
c.setSalePrice(coupon.getPrice());

if(c.getCouponId() != null) {
HashMap<String, String> param = new HashMap<>();
param.put("id", c.getCouponId() + "");
WxMerchant w = wxMerchantMapper.findByTrade(param);
if (w != null)
c.setMerchantName(w.getName());
}
}
}
return new ResultData(Result.SUCCESS, "查询成功", page);


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

@@ -74,6 +74,9 @@ public class WxCouponOrder extends BaseEntity{
@TableField(exist = false)
private Integer subBusinessId;

@TableField(exist = false)
private String merchantName;

public String getCouponPriceStr() {
if(couponPrice!=null) {
DecimalFormat df=new DecimalFormat("0.00");


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

@@ -33,5 +33,5 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> {

List<WxMerchantTradeDetailVo> userTradeDetailList(WxMerchant wxMerchant);

WxMerchant findByTrade(HashMap<String, String> params);
}

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

@@ -428,8 +428,7 @@
(select count(*) from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
inner join wx_merchant_b_user mb on(mb.id=c.id)
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id)
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
@@ -439,11 +438,10 @@
</if>
) consumeCount,

(select count(distinct c.id) from wx_coupon_order o
(select count(distinct mb.id) from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
inner join wx_merchant_b_user mb on(mb.id=c.id)
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id)
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
@@ -456,8 +454,7 @@
IFNULL((select sum(co.price) from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
inner join wx_merchant_b_user mb on(mb.id=c.id)
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id)
where cm.`merchant_id`=m.id and o.coupon_order_status=1 and mb.merchant_id=m.id
<if test="starttime != null">
and o.create_date &gt;= #{starttime}
@@ -465,7 +462,6 @@
<if test="endtime != null">
and o.create_date &lt;= #{endtime}
</if>

),0) tradeAmt

from wx_merchant m where m.status=1
@@ -482,12 +478,13 @@
</select>

<select id="userTradeDetailList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeDetailVo">
select c.`nick_name` 'userName',c.`phone`,co.title couponName,co.`sale_price` couponSale ,co.price couponPrice, co.price tradeAmt,o.create_date tradeDate
from wx_coupon_order o
select mb.`name` 'userName',mb.`phone`,co.title couponName,co.`sale_price` couponSale ,co.price couponPrice, co.price tradeAmt,o.create_date tradeDate
from wx_coupon_order o
left join wx_coupon co on(o.`coupon_id`=co.id)
left join wx_coupon_merchant cm on(cm.product_id=co.id)
inner join wx_c_user_basic_info c on(o.c_user_id=c.id)
where o.coupon_order_status=1 and o.tenant_id=#{tenantId}
inner join wx_merchant_b_user mb on(mb.id=o.b_user_id)
where o.coupon_order_status=1
and o.tenant_id=#{tenantId}
<if test=" null != id ">
and cm.`merchant_id` = #{id}
</if>
@@ -510,5 +507,12 @@
order by o.create_date desc
</select>

<select id="findByTrade" parameterType="java.util.Map" resultMap="BaseResultMap">
select * from wx_merchant where id in(
select merchant_id from wx_coupon_merchant where product_id=#{id}
)limit 1
</select>



</mapper>

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