| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.core.vo.AddressDto; |
| | | import com.ruoyi.common.core.vo.PaperInVo; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.ruoyi.order.entity.Order; |
| | |
| | | import com.ruoyi.order.request.UserOrderRequest; |
| | | import com.ruoyi.order.service.ChangeDispatchService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | | import com.ruoyi.order.vo.OrderCountRequest; |
| | | import com.ruoyi.order.vo.OrderCountVO; |
| | | import com.ruoyi.order.vo.OrderPageCountVO; |
| | | import com.ruoyi.order.vo.OrderQueryRequest; |
| | | import com.ruoyi.order.vo.OrderQueryVO; |
| | | import com.ruoyi.order.vo.OrderResultVO; |
| | | import com.ruoyi.order.vo.WorkerOrderCountVO; |
| | | import com.ruoyi.order.vo.WorkerOrderRankVO; |
| | | import com.ruoyi.user.api.feignClient.UserClient; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | import java.time.Month; |
| | | import java.time.Year; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | String countType = orderCount.getCountType(); |
| | | String startTime = orderCount.getStartTime(); |
| | | String endTime = orderCount.getEndTime(); |
| | | // String [] siteIds = orderCount.getSiteIds(); |
| | | List<OrderQueryVO> list; |
| | | // 根据查询类型查询订单信息 |
| | | if (OrderConstants.YEAR.equals(countType)) { |
| | | list = baseMapper.orderCountByYear(cityList, orderState); |
| | | list = baseMapper.orderCountByYear(cityList, orderState,orderCount.getSiteIds()); |
| | | } else if (OrderConstants.MONTH.equals(countType)) { |
| | | list = baseMapper.orderCountByMonth(cityList, orderState); |
| | | list = baseMapper.orderCountByMonth(cityList, orderState, orderCount.getSiteIds()); |
| | | } else if (OrderConstants.WEEK.equals(countType)) { |
| | | list = baseMapper.orderCountByWeek(cityList, orderState); |
| | | list = baseMapper.orderCountByWeek(cityList, orderState, orderCount.getSiteIds()); |
| | | } else if (OrderConstants.TODAY.equals(countType)) { |
| | | list = baseMapper.orderCountByToday(cityList, orderState); |
| | | list = baseMapper.orderCountByToday(cityList, orderState, orderCount.getSiteIds()); |
| | | } else { |
| | | try { |
| | | startTime = startTime + " 00:00:00"; |
| | |
| | | long diffInMillis = date2.getTime() - date1.getTime(); |
| | | long diffInDays = diffInMillis / (24 * 60 * 60 * 1000); |
| | | if (diffInDays > Constants.YEAR_DAY) { |
| | | list = baseMapper.orderCountByTimeRangeYear(cityList, startTime, endTime, orderState); |
| | | list = baseMapper.orderCountByTimeRangeYear(cityList, startTime, endTime, orderState, orderCount.getSiteIds()); |
| | | } else if (diffInDays > Constants.THIRTY) { |
| | | list = baseMapper.orderCountByTimeRangeMonth(cityList, startTime, endTime, orderState); |
| | | list = baseMapper.orderCountByTimeRangeMonth(cityList, startTime, endTime, orderState, orderCount.getSiteIds()); |
| | | } else { |
| | | list = baseMapper.orderCountByTimeRange(cityList, startTime, endTime, orderState); |
| | | list = baseMapper.orderCountByTimeRange(cityList, startTime, endTime, orderState, orderCount.getSiteIds()); |
| | | } |
| | | } catch (ParseException e) { |
| | | list = new ArrayList<>(); |
| | |
| | | return pageList; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> queryPage1(OrderQueryRequest orderQueryRequest) { |
| | | Page<Order> page = Page.of(orderQueryRequest.getPageNum(), orderQueryRequest.getPageSize()); |
| | | // 基础查询 |
| | | Page<Order> pageList = baseMapper.queryPage1(orderQueryRequest, page); |
| | | |
| | | return pageList.getRecords().stream().map(Order::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | @Override |
| | | public Page<OrderCountVO> orderCount(String name, String phone, List<String> cityList, Page<OrderCountVO> page) { |
| | | return baseMapper.orderCount(name, phone, cityList, page); |
| | | public Page<OrderCountVO> orderCount(String name, String phone, List<String> cityList, Page<OrderCountVO> page,List<String>siteIds) { |
| | | return baseMapper.orderCount(name, phone, cityList, page, siteIds); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public BigDecimal tradeMoney(MoneyQueryRequest moneyQueryRequest) { |
| | | if(moneyQueryRequest.getSiteIds()==null){ |
| | | moneyQueryRequest.setSiteIds(new ArrayList<>()); |
| | | } |
| | | List<String> cityList = moneyQueryRequest.getCityList(); |
| | | String type = moneyQueryRequest.getType(); |
| | | // 计算当前季度时间所包含时间 |
| | |
| | | return String.valueOf(order.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public List<PaperInVo> papercout(String workId,String date) { |
| | | return this.baseMapper.papercout(workId,date); |
| | | } |
| | | |
| | | /** |
| | | * 根据当前月份获取当前季度的开始月份 |
| | | */ |
| | |
| | | return Month.OCTOBER; |
| | | } |
| | | } |
| | | /** |
| | | * 增加发送短信次数 |
| | | * @param orderId 订单id |
| | | */ |
| | | @Override |
| | | public void messageCount(String orderId) { |
| | | Order byId = this.getById(orderId); |
| | | byId.setMsgCount(byId.getMsgCount()==null?1:byId.getMsgCount()+1); |
| | | this.updateById(byId); |
| | | } |
| | | } |