| @@ -12,6 +12,7 @@ import java.util.Map; | |||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | import com.iformall.mapper.WxCUserBasicInfoMapper; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | import com.iformall.service.WxCUserBasicInfoService; | ||||
| @@ -165,7 +166,11 @@ public class WxCUserDataController extends BaseController { | |||||
| params.put("startTime", startTime); | params.put("startTime", startTime); | ||||
| params.put("endTime", endTime); | params.put("endTime", endTime); | ||||
| params.put("tenantId", getTenantId()); | params.put("tenantId", getTenantId()); | ||||
| List<TouchUsersReportVo> list = wxUserVisitService.touchUsersReportList(params); | |||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | |||||
| markingCouponDataReportDto.setTenantId(getTenantId()); | |||||
| markingCouponDataReportDto.setStartTime(startTime); | |||||
| markingCouponDataReportDto.setEndTime(endTime); | |||||
| List<TouchUsersReportVo> list = wxUserVisitService.touchUsersReportList(markingCouponDataReportDto); | |||||
| Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | ||||
| for (TouchUsersReportVo vo : list) { | for (TouchUsersReportVo vo : list) { | ||||
| dateMap.put(vo.getxTime(), vo); | dateMap.put(vo.getxTime(), vo); | ||||
| @@ -1,17 +1,27 @@ | |||||
| package com.iformall.domain.dto; | package com.iformall.domain.dto; | ||||
| import com.iformall.domain.po.BaseEntity; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| /** | /** | ||||
| * Created by syf on 2018/8/30. | * Created by syf on 2018/8/30. | ||||
| */ | */ | ||||
| public class MarkingCouponDataReportDto { | |||||
| public class MarkingCouponDataReportDto extends BaseEntity{ | |||||
| private Date startTime; | private Date startTime; | ||||
| private Date endTime; | private Date endTime; | ||||
| private Integer type; | private Integer type; | ||||
| private Integer couponType; | private Integer couponType; | ||||
| private String couponTitle; | private String couponTitle; | ||||
| private String tenantId; | |||||
| @Override | |||||
| public String getSortColumns() { | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | |||||
| public Integer getType() { | public Integer getType() { | ||||
| return type; | return type; | ||||
| @@ -50,4 +60,12 @@ public class MarkingCouponDataReportDto { | |||||
| public void setCouponTitle(String couponTitle) { | public void setCouponTitle(String couponTitle) { | ||||
| this.couponTitle = couponTitle; | this.couponTitle = couponTitle; | ||||
| } | } | ||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| } | } | ||||
| @@ -14,8 +14,7 @@ import java.util.UUID; | |||||
| @Table(name = "wx_c_user") | @Table(name = "wx_c_user") | ||||
| @JsonIgnoreProperties(ignoreUnknown = true) | @JsonIgnoreProperties(ignoreUnknown = true) | ||||
| public class WxCUser implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| public class WxCUser extends BaseEntity { | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -33,9 +32,11 @@ public class WxCUser implements Serializable { | |||||
| public void setId(Long id) { | public void setId(Long id) { | ||||
| this.id = id; | this.id = id; | ||||
| } | } | ||||
| @Override | |||||
| public String getSortColumns() { | public String getSortColumns() { | ||||
| return sortColumns; | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | } | ||||
| public List<Long> getIds() { | public List<Long> getIds() { | ||||
| @@ -13,9 +13,8 @@ import java.util.List; | |||||
| import java.util.Objects; | import java.util.Objects; | ||||
| @Table(name = "wx_c_user_basic_info") | @Table(name = "wx_c_user_basic_info") | ||||
| public class WxCUserBasicInfo implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| public class WxCUserBasicInfo extends BaseEntity { | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -31,11 +30,14 @@ public class WxCUserBasicInfo implements Serializable { | |||||
| public void setId(Long id) { | public void setId(Long id) { | ||||
| this.id = id; | this.id = id; | ||||
| } | } | ||||
| @Override | |||||
| public String getSortColumns() { | public String getSortColumns() { | ||||
| return sortColumns; | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | } | ||||
| public List<Long> getIds() { | public List<Long> getIds() { | ||||
| return ids; | return ids; | ||||
| } | } | ||||
| @@ -9,8 +9,7 @@ import java.io.Serializable; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| @Table(name = "wx_car_pay_record") | @Table(name = "wx_car_pay_record") | ||||
| public class WxCarPayRecord implements Serializable { | |||||
| private static final long serialVersionUID = 1243232432423L; | |||||
| public class WxCarPayRecord extends BaseEntity { | |||||
| @Id | @Id | ||||
| private Long id; | private Long id; | ||||
| @@ -57,6 +56,11 @@ public class WxCarPayRecord implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="是否缴费",name="isPay") | @io.swagger.annotations.ApiModelProperty(value="是否缴费",name="isPay") | ||||
| private Integer isPay; | private Integer isPay; | ||||
| @Override | |||||
| public String getSortColumns() { | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | |||||
| public Date getFeeTime() { | public Date getFeeTime() { | ||||
| return feeTime; | return feeTime; | ||||
| } | } | ||||
| @@ -12,9 +12,7 @@ import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| @Table(name = "wx_coupon") | @Table(name = "wx_coupon") | ||||
| public class WxCoupon implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| public class WxCoupon extends BaseEntity { | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -40,8 +38,10 @@ public class WxCoupon implements Serializable { | |||||
| this.id = id; | this.id = id; | ||||
| } | } | ||||
| @Override | |||||
| public String getSortColumns() { | public String getSortColumns() { | ||||
| return sortColumns; | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | } | ||||
| public List<Long> getIds() { | public List<Long> getIds() { | ||||
| @@ -202,10 +202,6 @@ public class WxCoupon implements Serializable { | |||||
| this.wxCouponStatisVo = wxCouponStatisVo; | this.wxCouponStatisVo = wxCouponStatisVo; | ||||
| } | } | ||||
| public static long getSerialVersionUID() { | |||||
| return serialVersionUID; | |||||
| } | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| @@ -3,14 +3,11 @@ package com.iformall.domain.po; | |||||
| import javax.persistence.Id; | import javax.persistence.Id; | ||||
| import javax.persistence.Table; | import javax.persistence.Table; | ||||
| import javax.persistence.Transient; | import javax.persistence.Transient; | ||||
| import java.io.Serializable; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| @Table(name = "wx_coupon_send") | @Table(name = "wx_coupon_send") | ||||
| public class WxCouponSend implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| public class WxCouponSend extends BaseEntity { | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -27,8 +24,10 @@ public class WxCouponSend implements Serializable { | |||||
| this.id = id; | this.id = id; | ||||
| } | } | ||||
| @Override | |||||
| public String getSortColumns() { | public String getSortColumns() { | ||||
| return sortColumns; | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | } | ||||
| public List<Long> getIds() { | public List<Long> getIds() { | ||||
| @@ -1,12 +1,12 @@ | |||||
| package com.iformall.domain.vo; | package com.iformall.domain.vo; | ||||
| import com.iformall.domain.po.BaseEntity; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| @Data | @Data | ||||
| public class WxOrderGroupMarketing implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| public class WxOrderGroupMarketing extends BaseEntity { | |||||
| private String tenantId; | private String tenantId; | ||||
| private String couponId; | private String couponId; | ||||
| @@ -22,4 +22,10 @@ public class WxOrderGroupMarketing implements Serializable { | |||||
| private String verifyRatio; | private String verifyRatio; | ||||
| private String totalPeople; | private String totalPeople; | ||||
| @Override | |||||
| public String getSortColumns() { | |||||
| super.setSortColumns(this.sortColumns); | |||||
| return super.getSortColumns(); | |||||
| } | |||||
| } | } | ||||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.vo.MarkingSceneDataReportVo; | import com.iformall.domain.vo.MarkingSceneDataReportVo; | ||||
| import com.iformall.domain.vo.MarkingSceneDataVo; | import com.iformall.domain.vo.MarkingSceneDataVo; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -15,7 +16,7 @@ public interface WxCouponActionLogMapper extends CommonMapper<WxCouponActionLog, | |||||
| List<MarkingSceneDataReportVo> sceneDataMapJoinCouponOrder(HashMap<String,Object> params); | List<MarkingSceneDataReportVo> sceneDataMapJoinCouponOrder(HashMap<String,Object> params); | ||||
| List<MarkingSceneDataVo> sceneDataList(HashMap<String,Object> params); | |||||
| List<MarkingSceneDataVo> sceneDataList(MarkingCouponDataReportDto markingCouponDataReportDto); | |||||
| List<MarkingSceneDataReportVo> sceneDataJoinCouponOrderList(HashMap<String,Object> params); | List<MarkingSceneDataReportVo> sceneDataJoinCouponOrderList(HashMap<String,Object> params); | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.iformall.mapper; | package com.iformall.mapper; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.po.WxUserVisit; | import com.iformall.domain.po.WxUserVisit; | ||||
| import com.iformall.domain.vo.TouchUsersReportVo; | import com.iformall.domain.vo.TouchUsersReportVo; | ||||
| @@ -11,7 +12,7 @@ public interface WxUserVisitMapper extends CommonMapper<WxUserVisit, Long> { | |||||
| List<WxUserVisit> findList(WxUserVisit wxUserVisit); | List<WxUserVisit> findList(WxUserVisit wxUserVisit); | ||||
| List<TouchUsersReportVo> touchUsersReportList(HashMap<String,Object> params); | |||||
| List<TouchUsersReportVo> touchUsersReportList(MarkingCouponDataReportDto markingCouponDataReportDto); | |||||
| List<TouchUsersReportVo> touchUsersReportData(HashMap<String,Object> params); | List<TouchUsersReportVo> touchUsersReportData(HashMap<String,Object> params); | ||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.po.WxUserVisit; | import com.iformall.domain.po.WxUserVisit; | ||||
| import com.iformall.domain.vo.TouchUsersReportVo; | import com.iformall.domain.vo.TouchUsersReportVo; | ||||
| @@ -48,7 +49,7 @@ public interface WxUserVisitService { | |||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| List<TouchUsersReportVo> touchUsersReportList(HashMap<String,Object> params); | |||||
| List<TouchUsersReportVo> touchUsersReportList(MarkingCouponDataReportDto markingCouponDataReportDto); | |||||
| Long queryVisitUv(HashMap<String,Object> params); | Long queryVisitUv(HashMap<String,Object> params); | ||||
| @@ -285,34 +285,41 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| @Override | @Override | ||||
| public PageInfo<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | public PageInfo<MarkingSceneDataVo> getSceneDataList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | ||||
| MarkingCouponDataReportDto queryDto = new MarkingCouponDataReportDto(); | |||||
| queryDto.setTenantId(tenantId); | |||||
| HashMap<String, Object> params = new HashMap<>(); | HashMap<String, Object> params = new HashMap<>(); | ||||
| params.put("tenantId", tenantId); | params.put("tenantId", tenantId); | ||||
| if (markingCouponDataReportDto.getStartTime() != null) | |||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | |||||
| if (markingCouponDataReportDto.getEndTime() != null) | |||||
| if (markingCouponDataReportDto.getStartTime() != null) { | |||||
| params.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | |||||
| queryDto.setStartTime(convertDateAndAdd(markingCouponDataReportDto.getStartTime(), 0)); | |||||
| } | |||||
| if (markingCouponDataReportDto.getEndTime() != null) { | |||||
| params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | params.put("endTime", convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | ||||
| queryDto.setEndTime(convertDateAndAdd(markingCouponDataReportDto.getEndTime(), 1)); | |||||
| } | |||||
| //停车发券数 停车发券被核销数, 核销发券数 核销发券被核销数, B端刷卡支付发券数 刷卡支付发券被核销数 | //停车发券数 停车发券被核销数, 核销发券数 核销发券被核销数, B端刷卡支付发券数 刷卡支付发券被核销数 | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<MarkingSceneDataVo> list; | List<MarkingSceneDataVo> list; | ||||
| if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())) { | if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())) { | ||||
| params.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode()); | params.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode()); | ||||
| list = wxCouponActionLogMapper.sceneDataList(params); | |||||
| list = wxCouponActionLogMapper.sceneDataList(queryDto); | |||||
| }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())) { | }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.B_MICROPAY.getCode())) { | ||||
| params.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode()); | params.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode()); | ||||
| list = wxCouponActionLogMapper.sceneDataList(params); | |||||
| list = wxCouponActionLogMapper.sceneDataList(queryDto); | |||||
| }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())){ | }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.COUPON_VERIFY.getCode())){ | ||||
| params.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode()); | params.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode()); | ||||
| list = wxCouponActionLogMapper.sceneDataList(params); | |||||
| list = wxCouponActionLogMapper.sceneDataList(queryDto); | |||||
| }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.C_ORDER.getCode())){ | }else if (markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.C_ORDER.getCode())){ | ||||
| params.put("channelType", EnumCouponSendSendType.C_ORDER.getCode()); | params.put("channelType", EnumCouponSendSendType.C_ORDER.getCode()); | ||||
| list = wxCouponActionLogMapper.sceneDataList(params); | |||||
| }else { | |||||
| list = wxCouponActionLogMapper.sceneDataList(queryDto); | |||||
| }else{ | |||||
| PageHelper.clearPage(); | PageHelper.clearPage(); | ||||
| list = new ArrayList<>(); | list = new ArrayList<>(); | ||||
| } | } | ||||
| Map<String, Integer> countMap = new HashMap<>(); | Map<String, Integer> countMap = new HashMap<>(); | ||||
| if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车 | if(markingCouponDataReportDto.getType().equals(EnumCouponSendSendType.CAR_STOP.getCode())){ //停车 | ||||
| @@ -425,19 +432,22 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| public Map<String, Object> getSceneDataHistory(String tenantId,String startDate, String endDate) { | public Map<String, Object> getSceneDataHistory(String tenantId,String startDate, String endDate) { | ||||
| Map<String ,Object> result = new HashedMap(); | Map<String ,Object> result = new HashedMap(); | ||||
| HashMap<String, Object> params = new HashMap<>(); | |||||
| params.put("tenantId", tenantId); | |||||
| if (StringUtils.isNotBlank(startDate)) | |||||
| params.put("startTime", startDate); | |||||
| if (StringUtils.isNotBlank(endDate)) | |||||
| params.put("endTime", endDate); | |||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | |||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| //if (StringUtils.isNotBlank(startDate)) | |||||
| //markingCouponDataReportDto.setStartTime(startDate); | |||||
| // if (StringUtils.isNotBlank(endDate)) | |||||
| //markingCouponDataReportDto.setEndTime(endDate); | |||||
| List<String> days = DateUtils.getTjTimeList(startDate.substring(0,10),endDate.substring(0,10),"0"); | List<String> days = DateUtils.getTjTimeList(startDate.substring(0,10),endDate.substring(0,10),"0"); | ||||
| TreeMap<String, Object> historyMap = new TreeMap<>(); | TreeMap<String, Object> historyMap = new TreeMap<>(); | ||||
| //停车发券 | //停车发券 | ||||
| params.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode()); | |||||
| List<MarkingSceneDataVo> carStopList = wxCouponActionLogMapper.sceneDataList(params); | |||||
| // params.put("channelType", EnumCouponSendSendType.CAR_STOP.getCode()); | |||||
| // markingCouponDataReportDto.setCouponType(); | |||||
| List<MarkingSceneDataVo> carStopList = wxCouponActionLogMapper.sceneDataList(markingCouponDataReportDto); | |||||
| Map<String, Integer> countMap = carStopList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | Map<String, Integer> countMap = carStopList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | ||||
| for (String date:days) { | for (String date:days) { | ||||
| historyMap.put(date.substring(5,date.length()).replace("-","/"),"0"); | historyMap.put(date.substring(5,date.length()).replace("-","/"),"0"); | ||||
| @@ -449,8 +459,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| result.put("carStopHistory",historyMap); | result.put("carStopHistory",historyMap); | ||||
| //核销发券 | //核销发券 | ||||
| params.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode()); | |||||
| List<MarkingSceneDataVo> couponVerifyList = wxCouponActionLogMapper.sceneDataList(params); | |||||
| // params.put("channelType", EnumCouponSendSendType.COUPON_VERIFY.getCode()); | |||||
| List<MarkingSceneDataVo> couponVerifyList = wxCouponActionLogMapper.sceneDataList(markingCouponDataReportDto); | |||||
| countMap = couponVerifyList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | countMap = couponVerifyList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | ||||
| historyMap = new TreeMap<>(); | historyMap = new TreeMap<>(); | ||||
| for (String date:days) { | for (String date:days) { | ||||
| @@ -463,8 +473,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| result.put("couponVerifyHistory",historyMap); | result.put("couponVerifyHistory",historyMap); | ||||
| //交易发券 | //交易发券 | ||||
| params.put("channelType", EnumCouponSendSendType.C_ORDER.getCode()); | |||||
| List<MarkingSceneDataVo> orderList = wxCouponActionLogMapper.sceneDataList(params); | |||||
| //params.put("channelType", EnumCouponSendSendType.C_ORDER.getCode()); | |||||
| List<MarkingSceneDataVo> orderList = wxCouponActionLogMapper.sceneDataList(markingCouponDataReportDto); | |||||
| countMap = orderList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | countMap = orderList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | ||||
| historyMap = new TreeMap<>(); | historyMap = new TreeMap<>(); | ||||
| for (String date:days) { | for (String date:days) { | ||||
| @@ -477,8 +487,8 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| result.put("orderHistory",historyMap); | result.put("orderHistory",historyMap); | ||||
| //收银台发券 | //收银台发券 | ||||
| params.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode()); | |||||
| List<MarkingSceneDataVo> micropayList = wxCouponActionLogMapper.sceneDataList(params); | |||||
| // params.put("channelType", EnumCouponSendSendType.B_MICROPAY.getCode()); | |||||
| List<MarkingSceneDataVo> micropayList = wxCouponActionLogMapper.sceneDataList(markingCouponDataReportDto); | |||||
| countMap = micropayList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | countMap = micropayList.stream().collect(Collectors.toMap(MarkingSceneDataVo::getxTime, p -> p.getSendCount())); | ||||
| historyMap = new TreeMap<>(); | historyMap = new TreeMap<>(); | ||||
| for (String date:days) { | for (String date:days) { | ||||
| @@ -638,17 +648,14 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||||
| @Override | @Override | ||||
| public PageInfo<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | public PageInfo<TouchUsersReportVo> getTouchUsersReportList(String tenantId, MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageIndex, Integer pageSize) { | ||||
| //查询UV PV | //查询UV PV | ||||
| HashMap<String, Object> params1 = new HashMap<>(); | |||||
| params1.put("tenantId", tenantId); | |||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| if (markingCouponDataReportDto.getStartTime() != null) | if (markingCouponDataReportDto.getStartTime() != null) | ||||
| params1.put("startTime", convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | |||||
| markingCouponDataReportDto.setStartTime(convertDateAndAdd(markingCouponDataReportDto.getStartTime(),0)); | |||||
| if (markingCouponDataReportDto.getEndTime() != null) | if (markingCouponDataReportDto.getEndTime() != null) | ||||
| params1.put("endTime", markingCouponDataReportDto.getEndTime()); | |||||
| markingCouponDataReportDto.setEndTime(markingCouponDataReportDto.getEndTime()); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(params1); | |||||
| List<TouchUsersReportVo> wxUserVisitList = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| //获取领取人数 | //获取领取人数 | ||||
| //获取领取量 | //获取领取量 | ||||
| @@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | import com.iformall.domain.dto.WxCUserBasicInfoDto; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.domain.vo.*; | import com.iformall.domain.vo.*; | ||||
| @@ -933,7 +934,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| */ | */ | ||||
| private ResultData getActiveMemberCount(String tenantId) { | private ResultData getActiveMemberCount(String tenantId) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| HashMap<String, Object> params = new HashMap<>(); | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -1); | c.add(Calendar.DAY_OF_YEAR, -1); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| @@ -942,10 +942,11 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| Date endTime = c.getTime(); | Date endTime = c.getTime(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -30); | c.add(Calendar.DAY_OF_YEAR, -30); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| params.put("startTime", startTime); | |||||
| params.put("endTime", endTime); | |||||
| params.put("tenantId", tenantId); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(params); | |||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | |||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| markingCouponDataReportDto.setStartTime(startTime); | |||||
| markingCouponDataReportDto.setEndTime(endTime); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| String yesterday = DateUtils.getTimeBefore(1, new Date()); | String yesterday = DateUtils.getTimeBefore(1, new Date()); | ||||
| List<TouchUsersReportVo> collect = list.parallelStream().filter(x -> x.getxTime().equals(yesterday)).collect(Collectors.toList()); | List<TouchUsersReportVo> collect = list.parallelStream().filter(x -> x.getxTime().equals(yesterday)).collect(Collectors.toList()); | ||||
| int yesterdayCount = 0; | int yesterdayCount = 0; | ||||
| @@ -1039,7 +1040,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| */ | */ | ||||
| private ResultData getActiveMemberCountInWeek(String tenantId) { | private ResultData getActiveMemberCountInWeek(String tenantId) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| HashMap<String, Object> params = new HashMap<>(); | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -1); | c.add(Calendar.DAY_OF_YEAR, -1); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| @@ -1048,10 +1048,11 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| Date endTime = c.getTime(); | Date endTime = c.getTime(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -7); | c.add(Calendar.DAY_OF_YEAR, -7); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| params.put("startTime", startTime); | |||||
| params.put("endTime", endTime); | |||||
| params.put("tenantId", tenantId); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(params); | |||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | |||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| markingCouponDataReportDto.setStartTime(startTime); | |||||
| markingCouponDataReportDto.setEndTime(endTime); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | ||||
| for (TouchUsersReportVo vo : list) { | for (TouchUsersReportVo vo : list) { | ||||
| dateMap.put(vo.getxTime(), vo); | dateMap.put(vo.getxTime(), vo); | ||||
| @@ -1167,7 +1168,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| private ResultData getActiveMemberAnalysis(String tenantId) { | private ResultData getActiveMemberAnalysis(String tenantId) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| HashMap<String, Object> params = new HashMap<>(); | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -1); | c.add(Calendar.DAY_OF_YEAR, -1); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| @@ -1176,10 +1176,11 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| Date endTime = c.getTime(); | Date endTime = c.getTime(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -30); | c.add(Calendar.DAY_OF_YEAR, -30); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| params.put("startTime", startTime); | |||||
| params.put("endTime", endTime); | |||||
| params.put("tenantId", tenantId); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(params); | |||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | |||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| markingCouponDataReportDto.setStartTime(startTime); | |||||
| markingCouponDataReportDto.setEndTime(endTime); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | ||||
| for (TouchUsersReportVo vo : list) { | for (TouchUsersReportVo vo : list) { | ||||
| dateMap.put(vo.getxTime(), vo); | dateMap.put(vo.getxTime(), vo); | ||||
| @@ -1222,7 +1223,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| */ | */ | ||||
| private ResultData getActiveMemberTrade(String tenantId) { | private ResultData getActiveMemberTrade(String tenantId) { | ||||
| HashMap<String, Object> datamap = new HashMap<>(); | HashMap<String, Object> datamap = new HashMap<>(); | ||||
| HashMap<String, Object> params = new HashMap<>(); | |||||
| Calendar c = Calendar.getInstance(); | Calendar c = Calendar.getInstance(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -1); | c.add(Calendar.DAY_OF_YEAR, -1); | ||||
| c.set(Calendar.HOUR_OF_DAY, 0); | c.set(Calendar.HOUR_OF_DAY, 0); | ||||
| @@ -1231,10 +1231,11 @@ public class WxChartServiceImpl implements WxChartDataService { | |||||
| Date endTime = c.getTime(); | Date endTime = c.getTime(); | ||||
| c.add(Calendar.DAY_OF_YEAR, -30); | c.add(Calendar.DAY_OF_YEAR, -30); | ||||
| Date startTime = c.getTime(); | Date startTime = c.getTime(); | ||||
| params.put("startTime", startTime); | |||||
| params.put("endTime", endTime); | |||||
| params.put("tenantId", tenantId); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(params); | |||||
| MarkingCouponDataReportDto markingCouponDataReportDto = new MarkingCouponDataReportDto(); | |||||
| markingCouponDataReportDto.setTenantId(tenantId); | |||||
| markingCouponDataReportDto.setStartTime(startTime); | |||||
| markingCouponDataReportDto.setEndTime(endTime); | |||||
| List<TouchUsersReportVo> list = wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | Map<String, TouchUsersReportVo> dateMap = new HashMap<>(); | ||||
| for (TouchUsersReportVo vo : list) { | for (TouchUsersReportVo vo : list) { | ||||
| dateMap.put(vo.getxTime(), vo); | dateMap.put(vo.getxTime(), vo); | ||||
| @@ -3,6 +3,7 @@ package com.iformall.service.impl; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||||
| import com.iformall.domain.po.WxUserVisit; | import com.iformall.domain.po.WxUserVisit; | ||||
| import com.iformall.domain.vo.TouchUsersReportVo; | import com.iformall.domain.vo.TouchUsersReportVo; | ||||
| import com.iformall.mapper.WxUserVisitMapper; | import com.iformall.mapper.WxUserVisitMapper; | ||||
| @@ -54,8 +55,8 @@ public class WxUserVisitServiceImpl implements WxUserVisitService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public List<TouchUsersReportVo> touchUsersReportList(HashMap<String, Object> params) { | |||||
| return wxUserVisitMapper.touchUsersReportList(params); | |||||
| public List<TouchUsersReportVo> touchUsersReportList(MarkingCouponDataReportDto markingCouponDataReportDto) { | |||||
| return wxUserVisitMapper.touchUsersReportList(markingCouponDataReportDto); | |||||
| } | } | ||||
| @@ -84,6 +84,11 @@ | |||||
| <if test=" null != name "> | <if test=" null != name "> | ||||
| and `name` like concat('%', #{name},'%') | and `name` like concat('%', #{name},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != level "> | |||||
| <if test=" '' != level "> | |||||
| and `level` like concat('%', #{level},'%') | |||||
| </if> | |||||
| </if> | |||||
| <if test=" null != startTime and null!=endTime"> | <if test=" null != startTime and null!=endTime"> | ||||
| and `create_date` between #{startTime} and #{endTime} | and `create_date` between #{startTime} and #{endTime} | ||||
| </if> | </if> | ||||
| @@ -270,7 +270,8 @@ | |||||
| #{scene} | #{scene} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| order by create_date desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by create_date desc </if> | |||||
| </select> | </select> | ||||
| <select id="countByChannel" resultType="java.lang.Long" > | <select id="countByChannel" resultType="java.lang.Long" > | ||||
| @@ -61,7 +61,10 @@ | |||||
| and fee is not null | and fee is not null | ||||
| and fee != '' | and fee != '' | ||||
| </if> | </if> | ||||
| order by create_date desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns}</if> | |||||
| <if test=" null == sortColumns"> order by create_date desc </if> | |||||
| </sql> | </sql> | ||||
| @@ -126,7 +126,8 @@ | |||||
| and create_time <= #{endTime} | and create_time <= #{endTime} | ||||
| </if> | </if> | ||||
| group by xTime | group by xTime | ||||
| order by xTime desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by xTime desc </if> | |||||
| </select> | </select> | ||||
| <select id="sceneDataJoinCouponOrderList" resultType="com.iformall.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> | <select id="sceneDataJoinCouponOrderList" resultType="com.iformall.domain.vo.MarkingSceneDataReportVo" parameterType="hashmap"> | ||||
| @@ -527,6 +527,7 @@ | |||||
| </select> | </select> | ||||
| <select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | <select id="findCountData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | ||||
| select res.*, round(sum_payment/sale_amount*100,2) paymentRate from ( | |||||
| select c.*, | select c.*, | ||||
| (select count(wco.id) from wx_coupon wc | (select count(wco.id) from wx_coupon wc | ||||
| left join wx_coupon_order wco on wc.id = wco.coupon_id | left join wx_coupon_order wco on wc.id = wco.coupon_id | ||||
| @@ -552,13 +553,17 @@ | |||||
| where wc.id = c.id) as sum_subsidy | where wc.id = c.id) as sum_subsidy | ||||
| from wx_coupon c where c.type = 100 | from wx_coupon c where c.type = 100 | ||||
| ) res | |||||
| <if test="title != null and title !=''"> | <if test="title != null and title !=''"> | ||||
| and c.title like concat('%', #{title},'%') | |||||
| and res.title like concat('%', #{title},'%') | |||||
| </if> | </if> | ||||
| <if test="id != null"> | <if test="id != null"> | ||||
| and c.id = #{id} | |||||
| and res.id = #{id} | |||||
| </if> | </if> | ||||
| order by c.status asc,c.create_date desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by res.status asc,res.create_date desc </if> | |||||
| </select> | </select> | ||||
| <select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | <select id="findCouponData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | ||||
| @@ -584,7 +589,9 @@ | |||||
| <if test="id != null"> | <if test="id != null"> | ||||
| and c.id = #{id} | and c.id = #{id} | ||||
| </if> | </if> | ||||
| order by c.status asc,c.create_date desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns">order by c.status asc,c.create_date desc</if> | |||||
| </select> | </select> | ||||
| <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | <select id="findPressData" parameterType="com.iformall.domain.po.WxCoupon" resultMap="statisMap"> | ||||
| @@ -622,7 +629,8 @@ | |||||
| <if test="title != null and title != ''"> | <if test="title != null and title != ''"> | ||||
| and c.title like concat('%', #{title},'%') | and c.title like concat('%', #{title},'%') | ||||
| </if> | </if> | ||||
| order by c.status asc,c.create_date desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by c.status asc,c.create_date desc </if> | |||||
| </select> | </select> | ||||
| <!-- | <!-- | ||||
| @@ -140,7 +140,7 @@ | |||||
| </select> | </select> | ||||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap"> | |||||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | |||||
| SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as xTime | SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as xTime | ||||
| ,COUNT(DISTINCT c_user_id) as userCount,count(*) as couponCount | ,COUNT(DISTINCT c_user_id) as userCount,count(*) as couponCount | ||||
| ,(select Count(*) from wx_coupon_order c | ,(select Count(*) from wx_coupon_order c | ||||
| @@ -122,6 +122,7 @@ | |||||
| and c.title like concat('%',#{title},'%') | and c.title like concat('%',#{title},'%') | ||||
| </if> | </if> | ||||
| </where> | </where> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| </select> | </select> | ||||
| <select id="queryOrderGroupSuccessCountAndTime" parameterType="hashmap" resultType="hashmap"> | <select id="queryOrderGroupSuccessCountAndTime" parameterType="hashmap" resultType="hashmap"> | ||||
| @@ -150,7 +150,7 @@ | |||||
| <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | ||||
| select s.id,s.shop_number shopNumber,CONVERT(s.build_area,SIGNED) buildArea, | select s.id,s.shop_number shopNumber,CONVERT(s.build_area,SIGNED) buildArea, | ||||
| s.img_url imgUrl,CONVERT(s.build_area,SIGNED)s.operation_area operationArea, | |||||
| s.img_url imgUrl,CONVERT(s.operation_area,SIGNED) operationArea, | |||||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId, | s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId, | ||||
| m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone, | m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone, | ||||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay | s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay | ||||
| @@ -101,7 +101,7 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap"> | |||||
| <select id="touchUsersReportList" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="com.iformall.domain.dto.MarkingCouponDataReportDto"> | |||||
| SELECT DATE_FORMAT(day_date,'%Y-%m-%d') as xTime,visit_pv as pv,visit_uv as uv | SELECT DATE_FORMAT(day_date,'%Y-%m-%d') as xTime,visit_pv as pv,visit_uv as uv | ||||
| from wx_user_visit | from wx_user_visit | ||||
| where tenant_id=#{tenantId} | where tenant_id=#{tenantId} | ||||
| @@ -111,7 +111,9 @@ | |||||
| <if test="endTime != null"> | <if test="endTime != null"> | ||||
| and day_date <= #{endTime} | and day_date <= #{endTime} | ||||
| </if> | </if> | ||||
| order by day_date desc | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <if test=" null == sortColumns"> order by day_date desc </if> | |||||
| </select> | </select> | ||||
| <select id="touchUsersReportData" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap"> | <select id="touchUsersReportData" resultType="com.iformall.domain.vo.TouchUsersReportVo" parameterType="hashmap"> | ||||