| | |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ExcelExportUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderTaxiService; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | @Resource |
| | | private ITOrderTaxiService orderTaxiService; |
| | | @Resource |
| | | private ITOrderCrossCityService orderCrossCityService; |
| | | |
| | | |
| | | /** |
| | |
| | | String driverPhone, String createTime, String paymentTime,Integer orderType){ |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> list = orderTaxiService.paymentOrderStatisticsList(page, paymentCode, orderCode, userPhone, driverPhone, createTime, paymentTime,orderType); |
| | | List<Map<String, Object>> list1 = orderCrossCityService.paymentOrderStatisticsList(page, paymentCode, orderCode, userPhone, driverPhone, createTime, paymentTime,orderType); |
| | | list.addAll(list1); |
| | | list.sort((o1, o2) -> { |
| | | String insertTime = o1.get("insertTime").toString(); |
| | | String insertTime1 = o2.get("insertTime").toString(); |
| | | Date o1Date = null; |
| | | Date o2Date = null; |
| | | try { |
| | | o1Date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(insertTime); |
| | | o2Date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(insertTime1); |
| | | return o2Date.compareTo(o1Date); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }); |
| | | return super.packForBT(page.setRecords(list)); |
| | | } |
| | | |
| | |
| | | |
| | | List<TOrderCrossCity> queryOrders(@Param("driverId") Integer driverId, @Param("lineShiftDriverId") Integer lineShiftDriverId, |
| | | @Param("state") List<Integer> state); |
| | | |
| | | List<Map<String, Object>> paymentOrderStatisticsList(Page<Map<String, Object>> page, @Param("paymentCode") String paymentCode, |
| | | @Param("orderCode") String orderCode, @Param("userPhone") String userPhone, |
| | | @Param("driverPhone") String driverPhone, @Param("createTimeStart") String createTimeStart, |
| | | @Param("createTimeEnd") String createTimeEnd, @Param("paymentTimeStart") String paymentTimeStart, |
| | | @Param("paymentTimeEnd") String paymentTimeEnd,@Param("orderType") Integer orderType); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="paymentOrderStatisticsList" resultType="map"> |
| | | select |
| | | a.id, |
| | | b.code as paymentCode, |
| | | a.orderNum, |
| | | c.phone as userPhone, |
| | | b.amount, |
| | | d.phone as driverPhone, |
| | | e.name as company, |
| | | f.money as income, |
| | | b.orderType as orderType, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i:%s') as insertTime, |
| | | DATE_FORMAT(b.insertTime, '%Y-%m-%d %H:%i:%s') as paymentTime |
| | | from t_order_cross_city a |
| | | left join t_payment_record b on (a.id = b.orderId and b.orderType = 3 and b.state = 2) |
| | | left join t_user c on (a.userId = c.id) |
| | | left join t_driver d on (a.driverId = d.id) |
| | | left join t_company e on (d.companyId = e.id) |
| | | left join t_pub_transaction_details f on (a.id = f.orderId and f.userType = 2 and f.state = 2) |
| | | where a.state in (8, 9) and a.isDelete = 1 and a.payManner = 1 |
| | | <if test="null != paymentCode and '' != paymentCode"> |
| | | and b.code like CONCAT('%', #{paymentCode}, '%') |
| | | </if> |
| | | <if test="null != orderCode and '' != orderCode"> |
| | | and a.orderNum like CONCAT('%', #{orderCode}, '%') |
| | | </if> |
| | | <if test="null != orderType"> |
| | | and b.orderType = #{orderType} |
| | | </if> |
| | | <if test="null != userPhone and '' != userPhone"> |
| | | and c.phone like CONCAT('%', #{userPhone}, '%') |
| | | </if> |
| | | <if test="null != driverPhone and '' != driverPhone"> |
| | | and d.phone like CONCAT('%', #{driverPhone}, '%') |
| | | </if> |
| | | <if test="null != createTimeStart and '' != createTimeStart and null != createTimeEnd and '' != createTimeEnd"> |
| | | and a.insertTime between #{createTimeStart} and #{createTimeEnd} |
| | | </if> |
| | | <if test="null != paymentTimeStart and '' != paymentTimeStart and null != paymentTimeEnd and '' != paymentTimeEnd"> |
| | | and b.insertTime between #{paymentTimeStart} and #{paymentTimeEnd} |
| | | </if> |
| | | order by a.insertTime desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | |
| | | String getOrderNum(Integer driverId, Integer lineShiftDriverId) throws Exception; |
| | | |
| | | List<Map<String, Object>> paymentOrderStatisticsList(Page<Map<String, Object>> page, String paymentCode, String orderCode, String userPhone, String driverPhone, String createTime, String paymentTime, Integer orderType); |
| | | |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TOrderCrossCity; |
| | | import com.stylefeng.guns.modular.system.dao.TOrderCrossCityMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderCrossCityService; |
| | |
| | | int size = this.selectCount(null); |
| | | return "CROSS" + String.valueOf(1000000 + size + 1).substring(1); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> paymentOrderStatisticsList(Page<Map<String, Object>> page, String paymentCode, String orderCode, String userPhone, String driverPhone, String createTime, String paymentTime, Integer orderType) { |
| | | String createTimeStart = null; |
| | | String createTimeEnd = null; |
| | | String paymentTimeStart = null; |
| | | String paymentTimeEnd = null; |
| | | if(ToolUtil.isNotEmpty(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | createTimeStart = split[0]; |
| | | createTimeEnd = split[1]; |
| | | } |
| | | if(ToolUtil.isNotEmpty(paymentTime)){ |
| | | String[] split = paymentTime.split(" - "); |
| | | paymentTimeStart = split[0]; |
| | | paymentTimeEnd = split[1]; |
| | | } |
| | | return this.baseMapper.paymentOrderStatisticsList(page, paymentCode, orderCode, userPhone, driverPhone, createTimeStart, createTimeEnd, paymentTimeStart, paymentTimeEnd,orderType); |
| | | } |
| | | } |