| @@ -4,22 +4,15 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxOrderReportDto; | |||
| import com.iformall.domain.vo.WxMerchantMicroPayVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeDailyVo; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| import com.iformall.enums.EnumOrderType; | |||
| import com.iformall.service.MarkingDataReportService; | |||
| import com.iformall.service.WxMerchantTradeDailyService; | |||
| import com.iformall.service.WxOrderService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Calendar; | |||
| import java.util.Date; | |||
| @RestController | |||
| @RequestMapping("wxMerchantMicroPay") | |||
| @@ -36,6 +29,7 @@ public class WxMerchantMicroPayController extends BaseController { | |||
| WxOrderReportDto wxOrderReportDto = new WxOrderReportDto(); | |||
| wxOrderReportDto.setTenantId(getTenantId()); | |||
| wxOrderReportDto.setType(EnumOrderType.MICROPAY.getCode()); | |||
| wxOrderReportDto.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); | |||
| return new ResultData(markingDataReportService.listOrderReportByDate(wxOrderReportDto)); | |||
| } | |||
| @@ -1,10 +1,13 @@ | |||
| package com.iformall.domain.dto; | |||
| import lombok.Data; | |||
| import java.util.Date; | |||
| /** | |||
| * Created by syf on 2018/8/30. | |||
| */ | |||
| @Data | |||
| public class WxOrderReportDto { | |||
| private String tenantId; | |||
| private Long merchantId; | |||
| @@ -12,52 +15,5 @@ public class WxOrderReportDto { | |||
| private Date startTime; | |||
| private Date endTime; | |||
| private Integer type; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long merchantId) { | |||
| this.merchantId = merchantId; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String merchantName) { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public Date getStartTime() { | |||
| return startTime; | |||
| } | |||
| public void setStartTime(Date startTime) { | |||
| this.startTime = startTime; | |||
| } | |||
| public Date getEndTime() { | |||
| return endTime; | |||
| } | |||
| public void setEndTime(Date endTime) { | |||
| this.endTime = endTime; | |||
| } | |||
| private Integer orderStatus; | |||
| } | |||
| @@ -6,10 +6,7 @@ import com.iformall.domain.dto.MarkingCouponDataReportDto; | |||
| import com.iformall.domain.dto.WxOrderReportDto; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.vo.*; | |||
| import com.iformall.enums.EnumCarCmd; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| import com.iformall.enums.EnumCouponType; | |||
| import com.iformall.enums.EnumOrderType; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.MarkingDataReportService; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -428,6 +425,7 @@ public class MarkingDataReportServiceImpl implements MarkingDataReportService { | |||
| params.put("endTime", addDay(1)); | |||
| } | |||
| params.put("type", wxOrderReportDto.getType()); | |||
| params.put("orderStatus", wxOrderReportDto.getOrderStatus()); | |||
| List<WxOrderReportVo> list = wxOrderMapper.listOrderReportByDate(params); | |||
| String startdate = DateUtils.getTimeBefore(30, new Date()); | |||
| @@ -323,9 +323,20 @@ | |||
| </select> | |||
| <select id="listOrderReportByDate" resultType="com.iformall.domain.vo.WxOrderReportVo" parameterType="hashmap"> | |||
| select DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime, count(o.id) count, IFNULL (SUM(o.payment),0) amount | |||
| select DATE_FORMAT(o.create_date,'%Y-%m-%d') xTime, | |||
| count(o.id) count, | |||
| IFNULL (SUM(o.payment),0) amount | |||
| from wx_order o | |||
| where o.`tenant_id` = #{tenantId} and o.`type` = #{type} | |||
| where o.`tenant_id` = #{tenantId} | |||
| <if test=" null != tenantId"> | |||
| and o.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != type"> | |||
| and o.`type` = #{type} | |||
| </if> | |||
| <if test=" null != orderStatus"> | |||
| and o.`order_status` = #{orderStatus} | |||
| </if> | |||
| <if test=" null != startTime and null != endTime"> | |||
| and o.`create_date` BETWEEN #{startTime} and #{endTime} | |||
| </if> | |||