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

[营销分析][添加][卡营销列表]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
5646746fb5
9 измененных файлов: 120 добавлений и 21 удалений
  1. +3
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/WxCouponController.java
  2. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/BaseMsg.java
  3. +13
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java
  4. +2
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxMsgRecordMapper.java
  5. +37
    -0
      mallinkService/src/main/java/com/iformall/service/WxCouponService.java
  6. +30
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java
  7. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java
  8. +17
    -15
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml
  9. +12
    -0
      mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml

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

@@ -122,12 +122,12 @@ public class WxCouponController extends BaseController {
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData findCountData(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) {
//默认时间本月第一天,截止到当天
Map<String,Object> result = new HashedMap();
if(wxCoupon.getStartdate() == null){
//获取当前月第一天
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH,1);//设置为1号,当前日期既为本月第一天
c.set(Calendar.DAY_OF_MONTH,1);
wxCoupon.setStartdate(c.getTime());
}
if(wxCoupon.getEnddate() == null){
@@ -182,7 +182,7 @@ public class WxCouponController extends BaseController {
for (WxCoupon coupon:paymentList){
payMentMap.put(coupon.getXtime(),coupon.getSumPayment());
}
result.put("list",wxCouponService.findCountData(wxCoupon,pageNum,pageSize));
result.put("list",wxCouponService.findCouponData(wxCoupon,pageNum,pageSize));
result.put("saleHistory",saleMap);
result.put("paymentHistory",payMentMap);
result.put("saleCardCount",wxCouponService.findSaleCardCount(wxCoupon));


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

@@ -11,15 +11,19 @@ public class BaseMsg implements Serializable {
private static final long serialVersionUID = 923764283764823L;

//唯一标识
@Transient
private String uuid;

//消息类型 1短信 2回调短信 3邮件 4微信小程序模板 5微信公众号模板 6系统通知
@Transient
private Integer msgType;

//消息状态 0默认1发送成功2消费成功3消费失败
@Transient
private Integer msgStatus;

//结果信息
@Transient
private String statusMessage;

//延迟消息1s,5s,10s,30s,1m,2m,3m,4m,5m,6m,7m,8m,9m,10m,20m,30m,1h,2h


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

@@ -41,4 +41,17 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {
Long findTranCardCount(WxCoupon wxCoupon);

Long findSubsidyMoney(WxCoupon wxCoupon);

//-------卷--------
Long findCouponSendCount(WxCoupon wxCoupon);

Long findCouponOrderCount(WxCoupon wxCoupon);

Long findCouponGetCount(WxCoupon wxCoupon);

Long findCouponPaymentCount(WxCoupon wxCoupon);

Long priceCouponSaleCount(WxCoupon wxCoupon);

Long priceCouponPaymentCount(WxCoupon wxCoupon);
}

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

@@ -13,5 +13,6 @@ public interface WxMsgRecordMapper extends CommonMapper<WxMsgRecord, String> {
List<WxMsgRecord> findList(WxMsgRecord record);

void update(WxMsgRecord record);

void save(WxMsgRecord record);
}

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

@@ -99,4 +99,41 @@ public interface WxCouponService {
* @return
*/
Long findSubsidyMoney(WxCoupon wxCoupon);

//----------------卷--------------
/**
* 卷发放数量
* @return
*/
Long findCouponSendCount(WxCoupon wxCoupon);

/**
* 卷购买数量
* @return
*/
Long findCouponOrderCount(WxCoupon wxCoupon);

/**
* 卷领取数量
* @return
*/
Long findCouponGetCount(WxCoupon wxCoupon);

/**
* 卷核销数量
* @return
*/
Long findCouponPaymentCount(WxCoupon wxCoupon);

/**
* 有价卷销售数量
* @return
*/
Long priceCouponSaleCount(WxCoupon wxCoupon);

/**
* 有价卷核销数量
* @return
*/
Long priceCouponPaymentCount(WxCoupon wxCoupon);
}

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

@@ -354,4 +354,34 @@ public class WxCouponServiceImpl implements WxCouponService {
public PageInfo<WxCoupon> findCouponData(WxCoupon record, Integer pageNum, Integer pageSize) {
return null;
}

@Override
public Long findCouponSendCount(WxCoupon wxCoupon) {
return null;
}

@Override
public Long findCouponOrderCount(WxCoupon wxCoupon) {
return null;
}

@Override
public Long findCouponGetCount(WxCoupon wxCoupon) {
return null;
}

@Override
public Long findCouponPaymentCount(WxCoupon wxCoupon) {
return null;
}

@Override
public Long priceCouponSaleCount(WxCoupon wxCoupon) {
return null;
}

@Override
public Long priceCouponPaymentCount(WxCoupon wxCoupon) {
return null;
}
}

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

@@ -24,11 +24,11 @@ public class WxMsgRecordServiceImpl implements WxMsgRecordService {
if(data instanceof WxMsgRecord){
WxMsgRecord msgRecord = (WxMsgRecord)data;
msgRecord.setMsgJson(JsonUtil.obj2Json(data));
wxMsgRecordMapper.insertSelective(msgRecord);
wxMsgRecordMapper.save(msgRecord);
}else if(data instanceof WxMsg || data instanceof MailMsg){
WxMsgRecord msgRecord = new WxMsgRecord();
msgRecord.setMsgJson(JsonUtil.obj2Json(data));
wxMsgRecordMapper.insertSelective(msgRecord);
wxMsgRecordMapper.save(msgRecord);
}
}



+ 17
- 15
mallinkService/src/main/resources/mapper/WxCouponMapper.xml Просмотреть файл

@@ -713,7 +713,7 @@
</select>

<select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select <include refid="allColumns"/>,
select c.*,
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(distinct wcs.coupon_order_id) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
@@ -728,29 +728,31 @@
where wc.id = c.id) as sum_payment
from wx_coupon c where 1=1
<if test=" null != title ">
and `title` like concat('%', #{title},'%')
and c.title like concat('%', #{title},'%')
</if>
order by status asc,create_date desc
</select>

<select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select <include refid="allColumns"/>,
select c.*,
(select count(distinct wco.owner_id) from wx_coupon_order wco where wco.coupon_id = c.id) as sale_count,
(select count(distinct wcs.coupon_order_id) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_transfer_info wcs on wcs.coupon_order_id = ci.id
where wc.id = c.id) as transfer_count,
(select sum(ci.sale_amount) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
where wc.id = c.id) as sale_amount,
(select sum(wcs.real_payment) from wx_card_info ci
left join wx_coupon wc on wc.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id
where wc.id = c.id) as sum_payment
(select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 1 and wc.id = c.id) as payment_count,
(select count(distinct wco.id) from wx_coupon wc,wx_coupon_order wco where wco.coupon_id = wc.id and wco.coupon_order_status = 3 and wc.id = c.id) as payment_count
from wx_coupon c where 1=1
<if test=" null != type ">
and c.type = #{type}
</if>
<if test=" null != title ">
and `title` like concat('%', #{title},'%')
and c.title like concat('%', #{title},'%')
</if>
order by status asc,create_date desc
</select>

<select id="findCouponSendCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Long">
select sum(subsidy_num) from wx_coupon c
where c.create_date between #{startdate} and #{enddate}
<if test="title != null">
and c.title like concat('%', #{title},'%')
</if>
</select>
</mapper>

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

@@ -77,5 +77,17 @@
<include refid="dynamicWhereConditions" />
</select>

<insert id="save" parameterType="com.iformall.domain.po.WxMsgRecord" >
INSERT INTO wx_msg_record( `uuid`, `msg_type`,
`domain`, `msg`, `send_time`, `model_id`, `model_type`,
`signature`, `sender`, `sender_user_id`, `sender_user_name`,
`receiver`, `receiver_user_id`, `receiver_user_name`,
`msg_status`, `status_message`, `msg_json`)
VALUES(#{uuid},#{msgType},
#{domain},#{msg},#{sendTime},#{modelId},#{modelType},#{signature},#{sender},
#{senderUserId},#{senderUserName},#{receiver},#{receiverUserId},#{receiverUserName},
#{msgStatus},#{statusMessage},#{msgJson});
</insert>


</mapper>

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