Commit 4097aee6 authored by zuoyh's avatar zuoyh

Merge remote-tracking branch 'origin/order_received_statistics' into order_received_statistics

parents d942f839 3495649d
......@@ -627,8 +627,8 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
* @param endDate
* @return
*/
public List<OrderAccountBo> selectByDate(Date startDate, Date endDate) {
List<OrderAccountBo> accountBos = mapper.selectOrderAccountByStartTimeAndEndTime(startDate.getTime(),endDate.getTime());
public List<OrderAccountBo> selectByTypeAndDate(Integer orderType,Date startDate, Date endDate) {
List<OrderAccountBo> accountBos = mapper.selectOrderAccountByOrderTypeAndStartTimeAndEndTime(orderType,startDate.getTime(),endDate.getTime());
return CollectionUtils.isEmpty(accountBos)? Collections.EMPTY_LIST:accountBos;
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ public class OrderRentVehicleReceivedStatisticsBiz extends BaseBiz<OrderRentVehi
.collect(Collectors.partitioningBy(x -> Objects.nonNull(x.getPayWay()), Collectors.groupingBy(OrderDTO::getStateGroup, Collectors.toList())));
//订单账目信息
List<OrderAccountBo> orderAccountBoList = orderAccountBiz.selectByDate(startDate, endDate);
List<OrderAccountBo> orderAccountBoList = orderAccountBiz.selectByTypeAndDate(StatisticsStatusEnum.ORDER_RENT_VEHICLE_TYPE,startDate, endDate);
//账目数据处理 状态组合
Map<String, List<OrderAccountBo>> ordersMap = orderAccountBoList.stream().peek(x -> {
x.setStateGroup(String.format("%d-%d-%d-%d", x.getCompanyId(), x.getOrderOrigin(), x.getPayWay() == null ? StatisticsStatusEnum.NO_PAY_WAY : x.getPayWay(),x.getHasPay()));
......
package com.xxfc.platform.order.mapper;
import com.xxfc.platform.order.entity.OrderAccount;
import com.xxfc.platform.order.pojo.Term;
import com.xxfc.platform.order.pojo.account.OrderAccountBo;
import com.xxfc.platform.order.pojo.account.OrderAccountDTO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import com.xxfc.platform.order.entity.OrderAccount;
import com.xxfc.platform.order.pojo.Term;
import com.xxfc.platform.order.pojo.account.OrderAccountBo;
import com.xxfc.platform.order.pojo.account.OrderAccountDTO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
import java.util.List;
/**
......@@ -21,6 +21,7 @@ public interface OrderAccountMapper extends Mapper<OrderAccount> {
List<OrderAccountDTO> getOrderAccountByOrderType(Term term);
List<OrderAccountBo> selectOrderAccountByStartTimeAndEndTime(@Param("startTime") long startTime,
List<OrderAccountBo> selectOrderAccountByOrderTypeAndStartTimeAndEndTime(@Param("orderType") Integer orderType,
@Param("startTime") long startTime,
@Param("endTime") long endTime);
}
......@@ -53,7 +53,7 @@
</select>
<select id="selectOrderAccountByStartTimeAndEndTime"
<select id="selectOrderAccountByOrderTypeAndStartTimeAndEndTime"
resultType="com.xxfc.platform.order.pojo.account.OrderAccountBo">
SELECT
oa.*,
......@@ -67,6 +67,6 @@
`order_account` AS `oa`
INNER JOIN `base_order` AS `bo` ON bo.id = oa.order_id
INNER JOIN `order_rent_vehicle_detail` AS `brvd` ON brvd.order_id=oa.order_id
WHERE oa.`crt_time` BETWEEN #{startTime} AND #{endTime}
WHERE bo.type=#{orderType} AND oa.`crt_time` BETWEEN #{startTime} AND #{endTime}
</select>
</mapper>
\ No newline at end of file
......@@ -46,13 +46,13 @@ public class ServiceTest {
@Test
public void testMemberStatisticsInsert(){
Date date = cn.hutool.core.date.DateTime.of("2019-11-17", "yyyy-MM-dd").toJdkDate();
Date date = cn.hutool.core.date.DateTime.of("2019-11-16", "yyyy-MM-dd").toJdkDate();
//orderMemberReceivedStatisticsBiz.orderMemberReceivedStatistics(date);
}
@Test
public void testRentvehicleStatistics(){
Date date = cn.hutool.core.date.DateTime.of("2019-11-18", "yyyy-MM-dd").toJdkDate();
Date date = cn.hutool.core.date.DateTime.of("2019-11-15", "yyyy-MM-dd").toJdkDate();
Date startDate = DateUtil.beginOfDay(date).toJdkDate();
Date endDate = DateUtil.endOfDay(date).toJdkDate();
orderRentVehicleReceivedStatisticsBiz.orderRentVehicleReceivedStatistics(startDate,endDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment