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

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

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
531d77ccb2
3 измененных файлов: 24 добавлений и 24 удалений
  1. +3
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  2. +19
    -19
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  3. +2
    -2
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

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

@@ -166,7 +166,7 @@ public class WxCoupon implements Serializable {
@Transient @Transient
private String xtime; private String xtime;
@Transient @Transient
private Long xcount;
private String xcount;
/**售出卡数量**/ /**售出卡数量**/
@io.swagger.annotations.ApiModelProperty(value="售出卡数量",name="saleCount") @io.swagger.annotations.ApiModelProperty(value="售出卡数量",name="saleCount")
@Transient @Transient
@@ -259,11 +259,11 @@ public class WxCoupon implements Serializable {
this.pressJoinCount = pressJoinCount; this.pressJoinCount = pressJoinCount;
} }


public Long getXcount() {
public String getXcount() {
return xcount; return xcount;
} }


public void setXcount(Long xcount) {
public void setXcount(String xcount) {
this.xcount = xcount; this.xcount = xcount;
} }




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

@@ -1492,8 +1492,8 @@ public class WxChartServiceImpl implements WxChartDataService {
Map<String,Object> result = new HashedMap(); Map<String,Object> result = new HashedMap();
List<WxCoupon> saleMoneyList = wxCouponService.findSaleMoneyByDate(wxCoupon); List<WxCoupon> saleMoneyList = wxCouponService.findSaleMoneyByDate(wxCoupon);
List<WxCoupon> paymentList = wxCouponService.findPaymentByDate(wxCoupon); List<WxCoupon> paymentList = wxCouponService.findPaymentByDate(wxCoupon);
Map<String,Long> saleMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,Long> payMentMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> saleMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> payMentMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());


for (WxCoupon coupon:saleMoneyList){ for (WxCoupon coupon:saleMoneyList){
saleMap.put(coupon.getXtime(),coupon.getXcount()); saleMap.put(coupon.getXtime(),coupon.getXcount());
@@ -1538,10 +1538,10 @@ public class WxChartServiceImpl implements WxChartDataService {
List<WxCoupon> priceCouponSaleCountList = wxCouponService.priceCouponSaleCount(wxCoupon); List<WxCoupon> priceCouponSaleCountList = wxCouponService.priceCouponSaleCount(wxCoupon);
List<WxCoupon> priceCouponPaymentCountList = wxCouponService.priceCouponPaymentCount(wxCoupon); List<WxCoupon> priceCouponPaymentCountList = wxCouponService.priceCouponPaymentCount(wxCoupon);


Map<String,Long> orderCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,Long> paymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,Long> priceCouponSaleCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,Long> priceCouponPaymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> orderCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> paymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> priceCouponSaleCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> priceCouponPaymentCountMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());


for (WxCoupon coupon:orderCountList){ for (WxCoupon coupon:orderCountList){
orderCountMap.put(coupon.getXtime(),coupon.getXcount()); orderCountMap.put(coupon.getXtime(),coupon.getXcount());
@@ -1594,9 +1594,9 @@ public class WxChartServiceImpl implements WxChartDataService {
List<WxCoupon> pressSuccHistory = wxCouponService.pressSuccHistory(wxCoupon); List<WxCoupon> pressSuccHistory = wxCouponService.pressSuccHistory(wxCoupon);
List<WxCoupon> pressPaymentHistory = wxCouponService.pressPaymentHistory(wxCoupon); List<WxCoupon> pressPaymentHistory = wxCouponService.pressPaymentHistory(wxCoupon);


Map<String,Long> pressSendHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,Long> pressSuccHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,Long> pressPaymentHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> pressSendHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> pressSuccHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());
Map<String,String> pressPaymentHistoryMap = getDateMap(wxCoupon.getStartdate(),wxCoupon.getEnddate());


for (WxCoupon coupon:pressSendHistory){ for (WxCoupon coupon:pressSendHistory){
pressSendHistoryMap.put(coupon.getXtime(),coupon.getXcount()); pressSendHistoryMap.put(coupon.getXtime(),coupon.getXcount());
@@ -1646,8 +1646,8 @@ public class WxChartServiceImpl implements WxChartDataService {
List<Map<String, Object>> successlist = wxOrderGroupMapper.queryOrderGroupSuccessCountAndTime(params); List<Map<String, Object>> successlist = wxOrderGroupMapper.queryOrderGroupSuccessCountAndTime(params);
List<Map<String, Object>> verifyList = wxOrderGroupMapper.queryOrderGroupVerifyCountAndTime(params); List<Map<String, Object>> verifyList = wxOrderGroupMapper.queryOrderGroupVerifyCountAndTime(params);


Map<String, Long> successMap = getDateMap(startTime, endTime);
Map<String, Long> verifyMap = getDateMap(startTime, endTime);
Map<String, String> successMap = getDateMap(startTime, endTime);
Map<String, String> verifyMap = getDateMap(startTime, endTime);


long successCount = wxOrderGroupMapper.queryOrderGroupSuccessCount(params); long successCount = wxOrderGroupMapper.queryOrderGroupSuccessCount(params);
long groupCount = wxOrderGroupMapper.queryOrderGroupCount(params); long groupCount = wxOrderGroupMapper.queryOrderGroupCount(params);
@@ -1658,16 +1658,16 @@ public class WxChartServiceImpl implements WxChartDataService {
transferRatio = new BigDecimal(transfer).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); transferRatio = new BigDecimal(transfer).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
} }


Map<String, Long> successListMap = successlist.parallelStream().collect(Collectors.toMap(x -> {
Map<String, String> successListMap = successlist.parallelStream().collect(Collectors.toMap(x -> {
return x.get("time").toString(); return x.get("time").toString();
}, x -> { }, x -> {
return (long) x.get("total");
return (String) x.get("total");
})); }));


Map<String, Long> verifyListMap = verifyList.parallelStream().collect(Collectors.toMap(x -> {
Map<String, String> verifyListMap = verifyList.parallelStream().collect(Collectors.toMap(x -> {
return x.get("time").toString(); return x.get("time").toString();
}, x -> { }, x -> {
return (long) x.get("total");
return (String) x.get("total");
})); }));


successMap.putAll(successListMap); successMap.putAll(successListMap);
@@ -1768,10 +1768,10 @@ public class WxChartServiceImpl implements WxChartDataService {
return vo; return vo;
} }


public static Map<String,Long> getDateMap(Date begin, Date end) {
public static Map<String,String> getDateMap(Date begin, Date end) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Long> map = new LinkedHashMap<>();
map.put(format.format(begin), 0L);
Map<String,String> map = new LinkedHashMap<>();
map.put(format.format(begin), "0");
Calendar calBegin = Calendar.getInstance(); Calendar calBegin = Calendar.getInstance();
calBegin.setTime(begin); calBegin.setTime(begin);
Calendar calEnd = Calendar.getInstance(); Calendar calEnd = Calendar.getInstance();
@@ -1780,7 +1780,7 @@ public class WxChartServiceImpl implements WxChartDataService {
end = calEnd.getTime(); end = calEnd.getTime();
while (calBegin.getTime().before(end)) { while (calBegin.getTime().before(end)) {
calBegin.add(Calendar.DAY_OF_MONTH, 1); calBegin.add(Calendar.DAY_OF_MONTH, 1);
map.put(format.format(calBegin.getTime()), 0L);
map.put(format.format(calBegin.getTime()), "0");
} }
return map; return map;
} }


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

@@ -680,7 +680,7 @@
</update> </update>


<select id="findSaleMoneyByDate" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> <select id="findSaleMoneyByDate" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon">
select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(ci.sale_amount/100) xcount from wx_card_info ci
select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(round(ci.sale_amount/100,2)) xcount from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id left join wx_coupon c on c.id = ci.coupon_id
where c.type = 100 where c.type = 100
and ci.create_date between #{startdate} and #{enddate} and ci.create_date between #{startdate} and #{enddate}
@@ -688,7 +688,7 @@
</select> </select>


<select id="findPaymentByDate" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> <select id="findPaymentByDate" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon">
select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(wcs.deduction_amount/100) xcount from wx_card_info ci
select DATE_FORMAT(ci.create_date,'%Y-%m-%d') xtime,sum(round(wcs.deduction_amount/100,2)) xcount from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id left join wx_coupon c on c.id = ci.coupon_id
left join wx_card_spend wcs on wcs.card_id = ci.id left join wx_card_spend wcs on wcs.card_id = ci.id
where c.type = 100 where c.type = 100


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