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

[审批流][修改][修改varables返回类型]

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
47872a275c
4 измененных файлов: 34 добавлений и 33 удалений
  1. +27
    -29
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  2. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  3. +2
    -1
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml
  4. +4
    -2
      mallinkService/src/main/resources/mapper/WxOrderGroupMapper.xml

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

@@ -295,12 +295,12 @@ public class WxChartServiceImpl implements WxChartDataService {

//首页场景发券
if (chart.equals(EnumChart.INDEX_COUPON_SCENE.getCode())) {
return new ResultData(markingDataReportService.getSceneDataHistory(tenantId, paramsMap.get("startdate"), paramsMap.get("enddate")));
return new ResultData(markingDataReportService.getSceneDataHistory(tenantId, startdate, enddate));
}

//首页营销数据
if (chart.equals(EnumChart.INDEX_SALE_DATA.getCode())) {
return getSaleDataHistory(tenantId, startdate,enddate);
return getSaleDataHistory(tenantId, startdate, enddate);
}


@@ -2426,34 +2426,19 @@ public class WxChartServiceImpl implements WxChartDataService {
* @return
*/
private ResultData getSaleDataHistory(String tenantId, String startdate,String enddate) {
Date startDate = DateUtils.getDateFromString(startdate,"yyyy-MM-dd").getTime();
Date endDate = DateUtils.getDateFromString(enddate,"yyyy-MM-dd").getTime();
Date startDate = DateUtils.getDateFromString(startdate,"yyyy-MM-dd HH:mm:ss").getTime();
Date endDate = DateUtils.getDateFromString(enddate,"yyyy-MM-dd HH:mm:ss").getTime();

HashMap<String, Object> datamap = new HashMap<>();
//卷数据
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantId);
params.put("startTime", startDate);
params.put("endTime", endDate);
List<MarkingCouponDataReportVo> couponDatalist = wxCouponOrderMapper.couponDataMap(params);

List<String> days = DateUtils.getTjTimeList(startdate,enddate,"0");
TreeMap<String, Object> historyMap = new TreeMap<>();
Map<String, Integer> countMap = couponDatalist.stream().collect(Collectors.toMap(MarkingCouponDataReportVo::getCreateTime, p -> p.getCouponCount()));
for (String date:days) {
historyMap.put(date.substring(5,date.length()).replace("-","/"),"0");
}
for (String key : countMap.keySet()) {
String keySub = key.substring(5,key.length()).replace("-","/");
historyMap.put(keySub,countMap.get(key));
}
datamap.put("couponHistory",historyMap);

//卡数据
TreeMap<String, Object> historyMap;
Map<String, Integer> countMap;
WxCoupon couponQuery = new WxCoupon();
couponQuery.setTenantId(tenantId);
couponQuery.setStartdate(startDate);
couponQuery.setEnddate(endDate);

//卡数据
List<WxCouponStatisVo> couponStatisVoList = wxCouponService.findSaleCardCountHistory(couponQuery);
countMap = couponStatisVoList.stream().collect(Collectors.toMap(WxCouponStatisVo::getXtime, p -> Integer.parseInt(p.getXcount())));
historyMap = new TreeMap<>();
@@ -2467,15 +2452,28 @@ public class WxChartServiceImpl implements WxChartDataService {
datamap.put("cardHistory",historyMap);

//砍价数据
List<WxCouponStatisVo> pressSendHistory = wxCouponService.pressSendHistory(couponQuery);
Map<String,String> pressSendHistoryMap = getDateMap(startDate,endDate);
for (WxCouponStatisVo coupon:pressSendHistory){
pressSendHistoryMap.put(coupon.getXtime(),coupon.getXcount());
List<WxCouponStatisVo> wxCouponStatisVoList = wxCouponService.pressSendHistory(couponQuery);
Map<String,String> countHistoryMap = getDateMap(startDate,endDate);
for (WxCouponStatisVo coupon:wxCouponStatisVoList){
countHistoryMap.put(coupon.getXtime(),coupon.getXcount());
}
datamap.put("pressSendHistory",pressSendHistoryMap);
datamap.put("pressSendHistory",countHistoryMap);

//拼团
long groupCount = wxOrderGroupMapper.queryOrderGroupCount(params);
wxCouponStatisVoList = wxOrderGroupMapper.queryOrderGroupCountHistory(couponQuery);
countHistoryMap = getDateMap(startDate,endDate);
for (WxCouponStatisVo coupon:wxCouponStatisVoList){
countHistoryMap.put(coupon.getXtime(),coupon.getXcount());
}
datamap.put("groupHistory",countHistoryMap);

//卷数据
wxCouponStatisVoList = wxCouponService.findCouponOrderCount(couponQuery);
countHistoryMap = getDateMap(startDate,endDate);
for (WxCouponStatisVo coupon:wxCouponStatisVoList){
countHistoryMap.put(coupon.getXtime(),coupon.getXcount());
}
datamap.put("couponHistory",countHistoryMap);

return new ResultData(datamap);
}


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

@@ -534,7 +534,7 @@ public class WxFlowServiceImpl implements WxFlowService {
}
}
taskInfoMap.put("businessType",mapInfo.get("flowType"));
taskInfoMap.put("variables",variablesMap);
taskInfoMap.put("variables",JSONUtils.toJSONString(variablesMap));
result.add(taskInfoMap);
}
}


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

@@ -761,12 +761,13 @@
</select>

<select id="findSaleCardCountHistory" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.vo.WxCouponStatisVo">
select DATE_FORMAT(wco.create_date,'%Y-%m-%d') xtime,count(co.id) xcount
select DATE_FORMAT(co.create_date,'%Y-%m-%d') xtime,count(co.id) xcount
from wx_card_info ci
left join wx_coupon c on c.id = ci.coupon_id
left join wx_coupon_order co on co.id = ci.id
where c.type = 100
and c.create_date between #{startdate} and #{enddate}
group by xtime
</select>

</mapper>

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

@@ -166,8 +166,9 @@
</where>
</select>

<select id="queryOrderGroupCountHistory" parameterType="hashmap" resultType="long">
select count(*) total from wx_order_group
<select id="queryOrderGroupCountHistory" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.vo.WxCouponStatisVo">
select DATE_FORMAT(create_date,'%Y-%m-%d') xtime,count(*) xcount
from wx_order_group
<where>
<if test=" null != tenantId">
and tenant_id=#{tenantId}
@@ -176,6 +177,7 @@
and create_date BETWEEN #{startdate} and #{enddate}
</if>
</where>
group by xtime
</select>
<select id="queryOrderGroupSuccessCount" parameterType="hashmap" resultType="long">


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