| | |
| | | private List<String> cityList; |
| | | |
| | | private String type; |
| | | private List<String> siteIds; |
| | | |
| | | public MoneyQueryRequest(List<String> cityList, String type) { |
| | | this.cityList = cityList; |
| | |
| | | @ApiModelProperty("打印次数") |
| | | @TableField("print_count") |
| | | private Integer printCount; |
| | | @TableField("msg_count") |
| | | private Integer msgCount; |
| | | |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | |
| | | |
| | | @ApiModelProperty("结束日期(yyyy-MM-dd格式)") |
| | | private String endTime; |
| | | private String[] siteIds; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("品类") |
| | | private Integer classNameId; |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | |
| | | |
| | | @ApiModelProperty("订单完成结束时间") |
| | | private String completeTimeEnd; |
| | | private String[] siteIds; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<EvaluatePageVO>> evaluateList1(List<String> cityList, Integer userId, Integer pageNum, Integer pageSize) { |
| | | public R<Page<EvaluatePageVO>> evaluateList1(List<String> cityList, Integer userId, Integer pageNum, Integer pageSize,List<String> siteIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R msgCount(String id) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R<Order> exchangeOrder(Integer type, String orderId, Integer workerId, String name, String phone) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> queryPage1(OrderQueryRequest orderQueryRequest) { |
| | | return R.fail(cause.getMessage()); } |
| | | |
| | | @Override |
| | | public R<OrderPageCountVO> orderPageCount(OrderQueryRequest orderQueryRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | @Override |
| | | public R<List<Integer>> queryIdsBycode(List<String> cityList) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Integer>> queryIdsBycodeAndSite(List<String> cityList, List<String> siteIds) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> orderList1(Integer userId, List<String> cityList, Integer pageNum, Integer pageSize) { |
| | | public R<Page<Order>> orderList1(Integer userId, List<String> cityList, Integer pageNum, Integer pageSize,List<String> siteIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> workOrderList(Integer workId, Integer pageNum, Integer pageSize) { |
| | | public R<Page<Order>> workOrderList(Integer workId, Integer pageNum, Integer pageSize,String [] siteIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage1(List<String> cityList, String nickname, String userPhone, String applyForTime, Integer state, Integer pageNum, Integer pageSize, List<Integer> userIds) { |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage1(List<String> cityList, String nickname, String userPhone, String applyForTime, Integer state, Integer pageNum, Integer pageSize, List<Integer> userIds,List<String> siteIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList1(List<String> cityList, Integer userId, Integer pageNum, Integer pageSize) { |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList1(List<String> cityList, Integer userId, Integer pageNum, Integer pageSize,List<String> siteIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | R<Page<EvaluatePageVO>> evaluateList1(@RequestParam(value = "cityList", required = false) List<String> cityList, |
| | | @RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds") List<String> siteIds); |
| | | /** |
| | | * 根据师傅id获取评价列表 |
| | | * |
| | |
| | | */ |
| | | @GetMapping(value = "/order/detail") |
| | | R<Order> detail(@RequestParam("id") String id); |
| | | @PostMapping(value = "/order/msgCount") |
| | | R msgCount(@RequestParam("orderId") String orderId); |
| | | |
| | | /** |
| | | * 更改订单信息 |
| | |
| | | @PostMapping(value = "/order/queryPage") |
| | | R<Page<Order>> queryPage(@RequestBody OrderQueryRequest orderQueryRequest); |
| | | |
| | | @PostMapping(value = "/order/queryPage1") |
| | | R<List<String>> queryPage1(@RequestBody OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | |
| | | |
| | | @PostMapping(value = "/order/queryIdsBycode") |
| | | R<List<Integer>> queryIdsBycode(@RequestBody List<String> cityList); |
| | | |
| | | @PostMapping(value = "/order/queryIdsBycodeAndSite") |
| | | R<List<Integer>> queryIdsBycodeAndSite(@RequestParam("cityList") List<String> cityList,@RequestParam("siteIds")List<String> siteIds); |
| | | |
| | | /** |
| | | * 更改订单状态且清空到达时间 |
| | |
| | | @GetMapping(value = "/order/orderList1") |
| | | R<Page<Order>> orderList1(@RequestParam("userId") Integer userId, @RequestParam("cityList") List<String> cityList, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds") List<String> siteIds); |
| | | @GetMapping(value = "/order/workOrderList") |
| | | R<Page<Order>> workOrderList(@RequestParam("workId") Integer workId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds") String [] siteIds); |
| | | |
| | | /** |
| | | * 更改订单提现状态 |
| | |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "userIds") List<Integer> userIds); |
| | | @RequestParam(name = "userIds") List<Integer> userIds, |
| | | @RequestParam("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 查看提现记录详情 |
| | |
| | | R<Page<UserWithdrawRecordVO>> withdrawList1(@RequestParam("cityList") List<String> cityList, |
| | | @RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds") List<String> siteIds); |
| | | |
| | | |
| | | /** |
| | |
| | | private Integer pageSize; |
| | | |
| | | private List<String> cityList; |
| | | private String [] siteIds; |
| | | |
| | | } |
| | |
| | | |
| | | private List<Integer> userIdList; |
| | | |
| | | |
| | | |
| | | |
| | | private List<String> siteIds; |
| | | } |
| | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | |
| | | changeDispatchRequest.setPageNum(pageNum); |
| | | changeDispatchRequest.setPageSize(pageSize); |
| | | changeDispatchRequest.setCityList(cityList); |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | String[] siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new Page<ChangeDispatch>()); |
| | | } |
| | | changeDispatchRequest.setSiteIds(siteIds); |
| | | } |
| | | return dispatchClient.queryPageList(changeDispatchRequest); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | |
| | | evaluatePageRequest.setPageNum(pageNum); |
| | | evaluatePageRequest.setPageSize(pageSize); |
| | | evaluatePageRequest.setUserIdList(userIdList); |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | evaluatePageRequest.setSiteIds(Arrays.asList(siteIds)); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new Page<>()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | R<Page<EvaluatePageVO>> r = evaluateClient.queryPageList(evaluatePageRequest); |
| | | if (!r.getData().getRecords().isEmpty()) { |
| | | for (EvaluatePageVO record : r.getData().getRecords()) { |
| | |
| | | private RegionService regionService; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private SiteService siteService; |
| | | |
| | | /** |
| | | * 加盟商信息分页列表 |
| | |
| | | wrapper = StringUtils.isNotBlank(head) ? wrapper.like(Franchisee::getHead, head) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(phone) ? wrapper.like(Franchisee::getHeadPhone, phone) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(city) ? wrapper.like(Franchisee::getCity, city) : wrapper; |
| | | return R.ok(wrapper.eq(Franchisee::getIsDelete, 0) |
| | | .orderByDesc(Franchisee::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | Page<Franchisee> page = wrapper.eq(Franchisee::getIsDelete, 0) |
| | | .orderByDesc(Franchisee::getCreateTime).page(Page.of(pageNum, pageSize)); |
| | | for (Franchisee record : page.getRecords()) { |
| | | if (record.getSiteIds()!=null){ |
| | | String[] split = record.getSiteIds().split(","); |
| | | List<Site> list = siteService.lambdaQuery().in(Site::getId, split).list(); |
| | | //用 , 拼接 |
| | | record.setSiteStr(list.stream().map(Site::getSiteName).collect(Collectors.joining(","))); |
| | | } |
| | | |
| | | |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.request.UserDataCountRequest; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.admin.vo.MasterWorkerRankVO; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null){ |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee()&&siteIds.length==0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | userDataCountRequest.setSiteIds(Arrays.asList(siteIds)); |
| | | |
| | | |
| | | if (loginUser.getIsFranchisee()||!userDataCountRequest.getCityList().isEmpty()) { |
| | | if (null == userDataCountRequest.getCityList() || userDataCountRequest.getCityList().isEmpty()) { |
| | | userDataCountRequest.setCityList(loginUser.getCityList()); |
| | |
| | | // else { |
| | | //// userDataCountRequest.getCityList().addAll(loginUser.getCityList()); |
| | | // } |
| | | R<List<Integer>> listR = orderClient.queryIdsBycode(userDataCountRequest.getCityList()); |
| | | R<List<Integer>> listR = orderClient.queryIdsBycodeAndSite(userDataCountRequest.getCityList(),userDataCountRequest.getSiteIds()); |
| | | |
| | | return R.ok(userService.userDataCount1(userDataCountRequest, listR.getData())); |
| | | return R.ok(userService.userDataCount1(userDataCountRequest, listR.getData(),userDataCountRequest.getSiteIds())); |
| | | |
| | | } |
| | | return R.ok(userService.userDataCount(userDataCountRequest)); |
| | |
| | | return R.ok(userService.userTrends(cityList)); |
| | | } |
| | | |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | /** |
| | | * 回收订单统计 |
| | | * |
| | |
| | | // orderCount.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | orderCount.setSiteIds(siteIds); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new OrderResultVO()); |
| | | } |
| | | } |
| | | orderCount.setSiteIds(siteIds); |
| | | return orderClient.orderCountHome(orderCount); |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.RecoveryClassify; |
| | | import com.ruoyi.admin.entity.RecoveryServe; |
| | | import com.ruoyi.admin.entity.RecoveryServePrice; |
| | | import com.ruoyi.admin.entity.Region; |
| | | import com.ruoyi.admin.entity.Site; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.service.RecoveryClassifyService; |
| | | import com.ruoyi.admin.service.RecoveryServePriceService; |
| | | import com.ruoyi.admin.service.RecoveryServeService; |
| | | import com.ruoyi.admin.service.RegionService; |
| | | import com.ruoyi.admin.service.SiteService; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.utils.DescribeInstances; |
| | | import com.ruoyi.admin.vo.OrderByServeRecordVO; |
| | | import com.ruoyi.admin.vo.OrderDetailVO; |
| | |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @Resource |
| | | private RecoveryClassifyService recoveryClassifyService; |
| | | |
| | | |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | /** |
| | | * 订单列表 |
| | | * |
| | |
| | | List<Integer> classIds = recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getId, orderQueryRequest.getClassNameId()).list().stream().map(RecoveryClassify::getId).collect(Collectors.toList()); |
| | | servIds = recoveryServeService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(RecoveryServe::getClassifyId, classIds).list().stream().map(RecoveryServe::getId).collect(Collectors.toList()); |
| | | } |
| | | if(orderQueryRequest.getServeId()!=null){ |
| | | servIds.add(orderQueryRequest.getServeId()); |
| | | } |
| | | orderQueryRequest.setServIds(servIds); |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | String[] siteIds = byId.getSiteIds().split(","); |
| | | orderQueryRequest.setSiteIds(siteIds); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new Page<Order>()); |
| | | } |
| | | } |
| | | |
| | | |
| | | Page<Order> data = orderClient.queryPage(orderQueryRequest).getData(); |
| | | if (null != data) { |
| | | for (Order record : data.getRecords()) { |
| | |
| | | List<Integer> classIds = recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getId, orderQueryRequest.getClassNameId()).list().stream().map(RecoveryClassify::getId).collect(Collectors.toList()); |
| | | servIds = recoveryServeService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(RecoveryServe::getClassifyId, classIds).list().stream().map(RecoveryServe::getId).collect(Collectors.toList()); |
| | | } |
| | | if (orderQueryRequest.getServeId()!=null){ |
| | | servIds.add(orderQueryRequest.getServeId()); |
| | | } |
| | | orderQueryRequest.setServIds(servIds); |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | String[] siteIds = byId.getSiteIds().split(","); |
| | | orderQueryRequest.setSiteIds(siteIds); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.ok(orderClient.orderPageCount(orderQueryRequest).getData()); |
| | | } |
| | | |
| | |
| | | orderCountDataRequest.setCityList(cityList); |
| | | orderCountDataRequest.setPageNum(pageNum); |
| | | orderCountDataRequest.setPageSize(pageSize); |
| | | |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | orderCountDataRequest.setSiteIds(Arrays.asList(siteIds)); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new Page<>()); |
| | | } |
| | | } |
| | | // 远程调用 |
| | | Page<OrderCountVO> data = orderClient.orderCount(orderCountDataRequest).getData(); |
| | | |
| | | |
| | | |
| | | List<Integer> idList = data.getRecords().stream().map(OrderCountVO::getWorkerId) |
| | | .collect(Collectors.toList()); |
| | | List<MasterWorker> masterWorkerList; |
| | |
| | | OrderByServeRecordVO orderByServeRecord = new OrderByServeRecordVO(); |
| | | |
| | | String masterFolderPath = "/usr/local/coordinate/" + id; |
| | | // String masterFolderPath = "F:/DeskTop/coordinate/" + id; |
| | | File masterFolder = new File(masterFolderPath); |
| | | // 检查师傅ID的文件夹是否存在,存在就读取轨迹数据 |
| | | System.out.println("文件是否存在:" + masterFolder.exists()); |
| | |
| | | orderByServeRecord.setCoordinate(coordinateList); |
| | | //获取轨迹标点 |
| | | String baseMarkerPath = "/usr/local/marker/" + id; |
| | | // String baseMarkerPath = "F:/DeskTop/marker/" + id; |
| | | //标点根目录 |
| | | File markerMasterFolder = new File(baseMarkerPath); |
| | | if (markerMasterFolder.exists()) { |
| | |
| | | }) |
| | | public R<Object> dispatchSms(@RequestParam String orderId) { |
| | | com.ruoyi.order.api.entity.Order order = orderClient.detail(orderId).getData(); |
| | | orderClient.msgCount(orderId); |
| | | if (null == order) { |
| | | return R.fail("订单不存在或已删除!"); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | |
| | | return userService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | /** |
| | | * 用户所关联订单记录分页列表 |
| | | * |
| | |
| | | if (loginUser.getCityList()!=null) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | R<Page<Order>> iPageR = orderClient.orderList1(userId,cityList, pageNum, pageSize); |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null){ |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee()&&siteIds.length==0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | |
| | | R<Page<Order>> iPageR = orderClient.orderList1(userId,cityList, pageNum, pageSize, Arrays.asList(siteIds)); |
| | | Page<Order> data = iPageR.getData(); |
| | | |
| | | List<Order> records = data.getRecords(); |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | R<Page<Order>> iPageR = orderClient.workOrderList(workId, pageNum, pageSize); |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String [] siteIds = new String[0]; |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new Page<Order>()); |
| | | } |
| | | } |
| | | R<Page<Order>> iPageR = orderClient.workOrderList(workId, pageNum, pageSize,siteIds); |
| | | Page<Order> data = iPageR.getData(); |
| | | List<Order> records = data.getRecords(); |
| | | for (Order record : records) { |
| | | if (record.getAddress()!=null) { |
| | | record.setReservationAddress(record.getReservationAddress() + record.getAddress()); |
| | | } |
| | | |
| | | } |
| | | return R.ok(data); |
| | | } |
| | |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | List<String> cityList = loginUser.getCityList(); |
| | | return evaluateClient.evaluateList1(cityList,userId, pageNum, pageSize); |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null) { |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee() && siteIds.length == 0) { |
| | | return R.ok(new Page<>()); |
| | | } |
| | | } |
| | | return evaluateClient.evaluateList1(cityList,userId, pageNum, pageSize,Arrays.asList(siteIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (loginUser.getCityList()!=null) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | return withdrawClient.withdrawList1(cityList,userId, pageNum, pageSize); |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null){ |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee()&&siteIds.length==0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | return withdrawClient.withdrawList1(cityList,userId, pageNum, pageSize,Arrays.asList(siteIds)); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.admin.service.WithdrawService; |
| | | import com.ruoyi.common.core.domain.R; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Array; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | |
| | | List<String> cityList = loginUser.getCityList(); |
| | | |
| | | |
| | | Integer franchiseeId = loginUser.getSysUser().getFranchiseeId(); |
| | | String[] siteIds = new String[0]; |
| | | if (franchiseeId!=null){ |
| | | Franchisee byId = franchiseeService.getById(franchiseeId); |
| | | siteIds = byId.getSiteIds().split(","); |
| | | if (loginUser.getIsFranchisee()&&siteIds.length==0){ |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | |
| | | Page<UserWithdrawRecordVO> page = withdrawClient.withdrawPage1(cityList,nickname, userPhone, applyForTime, |
| | | state, pageNum, pageSize,userIds).getData(); |
| | | state, pageNum, pageSize,userIds, Arrays.asList(siteIds)).getData(); |
| | | if (null != page) { |
| | | for (UserWithdrawRecordVO record : page.getRecords()) { |
| | | Integer userId = record.getUserId(); |
| | |
| | | @TableField("city_code") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty("管辖城市二维数组") |
| | | @TableField("site_ids") |
| | | private String siteIds; |
| | | @TableField(exist = false) |
| | | private String siteStr; |
| | | } |
| | |
| | | @ApiModelProperty("统计类型(月度:month;季度:quarter;年度:year)") |
| | | @NotBlank(message = "请选择:统计类型!") |
| | | private String countType; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | * @return 统计数据信息 |
| | | */ |
| | | UserDataCountVO userDataCount(UserDataCountRequest userDataCountRequest); |
| | | UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds); |
| | | UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds,List<String> siteIds); |
| | | } |
| | |
| | | orderInfo.setOrderNumber(order.getOrderNumber()); |
| | | orderInfo.setPlaceOrderTime(order.getCreateTime()); |
| | | orderInfo.setState(order.getState()); |
| | | orderInfo.setCompleteTime(order.getCompleteTime()); |
| | | orderInfo.setReservationRemark(order.getReservationRemark()); |
| | | } |
| | | result.setOrderInfo(orderInfo); |
| | |
| | | */ |
| | | @Override |
| | | public List<String> queryIdList(OrderQueryRequest orderQueryRequest) { |
| | | // 基础查询 |
| | | Page<com.ruoyi.order.api.entity.Order> pageList = orderClient.queryPage(orderQueryRequest).getData(); |
| | | return pageList.getRecords().stream().map(com.ruoyi.order.api.entity.Order::getId).collect(Collectors.toList()); |
| | | List<String> data = orderClient.queryPage1(orderQueryRequest).getData(); |
| | | return data; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds) { |
| | | public UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds,List<String> siteIds) { |
| | | List<String> cityList = userDataCountRequest.getCityList(); |
| | | String type = userDataCountRequest.getCountType(); |
| | | if (userIds.isEmpty()){ |
| | |
| | | // 结果数据封装 |
| | | Long increaseNumber; |
| | | // 交易额 |
| | | BigDecimal totalMoney = orderClient.tradeMoney(new MoneyQueryRequest(cityList,userDataCountRequest.getCountType())).getData(); |
| | | BigDecimal withdrawalTotalMoney = withdrawClient.withdrawalTotalMoney(new MoneyQueryRequest(cityList, type)) |
| | | MoneyQueryRequest moneyQueryRequest1 = new MoneyQueryRequest(cityList, userDataCountRequest.getCountType()); |
| | | moneyQueryRequest1.setSiteIds(siteIds); |
| | | BigDecimal totalMoney = orderClient.tradeMoney(moneyQueryRequest1).getData(); |
| | | MoneyQueryRequest moneyQueryRequest = new MoneyQueryRequest(cityList, type); |
| | | moneyQueryRequest.setSiteIds(siteIds); |
| | | BigDecimal withdrawalTotalMoney = withdrawClient.withdrawalTotalMoney(moneyQueryRequest) |
| | | .getData(); |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户增长数 |
| | |
| | | @ApiModelProperty("下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date placeOrderTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | |
| | | public R<Page<EvaluatePageVO>> evaluateList1(@RequestParam(value = "cityList", required = false) List<String> cityList, |
| | | @RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<EvaluatePageVO> evaluatePageVOPage = evaluateService.evaluateList1(cityList,userId, Page.of(pageNum, pageSize)); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds")List<String> siteIds) { |
| | | Page<EvaluatePageVO> evaluatePageVOPage = evaluateService.evaluateList1(cityList,userId, Page.of(pageNum, pageSize),siteIds); |
| | | return R.ok(evaluatePageVOPage); |
| | | } |
| | | |
| | |
| | | return R.ok(orderService.queryPage(orderQueryRequest)); |
| | | } |
| | | |
| | | @PostMapping(value = "/queryPage1") |
| | | public R<List<String>> queryPage1(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | return R.ok(orderService.queryPage1(orderQueryRequest)); |
| | | } |
| | | /** |
| | | * 订单列表 |
| | | */ |
| | |
| | | */ |
| | | @ApiOperation(value = "订单列表-增加发送短信次数", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/msgCount") |
| | | public R<?> messageCount(@RequestParam("orderId") String orderId) { |
| | | public R messageCount(@RequestParam("orderId") String orderId) { |
| | | orderService.messageCount(orderId); |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.ok(collect); |
| | | } |
| | | |
| | | @PostMapping(value = "/queryIdsBycodeAndSite") |
| | | public R<List<Integer>> queryIdsBycodeAndSite(@RequestParam("cityList") List<String> cityList,@RequestParam("siteIds")List<String> siteIds) { |
| | | List<Integer> collect = orderService.lambdaQuery().eq(BaseEntity::getIsDelete,0).in(!siteIds.isEmpty(),Order::getSiteId,siteIds).in(Order::getCityCode, cityList).list().stream().map(Order::getUserId).collect(Collectors.toList()); |
| | | return R.ok(collect); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 更改订单信息 |
| | |
| | | order.setServerPhone(phone); |
| | | orderService.updateById(order); |
| | | } |
| | | List<ChangeDispatch> list = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getOrderId, orderId).list(); |
| | | changeDispatchService.removeBatchByIds(list); |
| | | return R.ok(order); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | Order order = orderService.getById(orderRequest.getOrderId()); |
| | | if (order.getState()!=6) { |
| | | // if (order.getState()!=6) { |
| | | if ((!Objects.equals(order.getServerId(), orderRequest.getServerId())) || (!Objects.equals(order.getTime(), orderRequest.getTime()))) { |
| | | order.setState(1); |
| | | order.setArriveTime(null); |
| | |
| | | .eq(Order::getId, order.getId() |
| | | ).set(Order::getArriveTime, null).update(); |
| | | |
| | | //删除改派管理的订单 |
| | | List<ChangeDispatch> list = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getOrderId, order.getId()).list(); |
| | | changeDispatchService.removeBatchByIds(list); |
| | | |
| | | } |
| | | } |
| | | // } |
| | | |
| | | order.setId(orderRequest.getOrderId()); |
| | | order.setCity(orderRequest.getCity()); |
| | |
| | | }) |
| | | public R<Page<OrderCountVO>> orderCount(@RequestBody OrderCountDataRequest request) { |
| | | return R.ok(orderService.orderCount(request.getWorkerName(), request.getWorkerPhone(), request.getCityList(), |
| | | Page.of(request.getPageNum(), request.getPageSize()))); |
| | | Page.of(request.getPageNum(), request.getPageSize()),request.getSiteIds())); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping(value = "/orderList1") |
| | | public R<Page<Order>> orderList1(@RequestParam("userId") Integer userId, @RequestParam("cityList") List<String> cityList, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds") List<String> siteIds |
| | | ) { |
| | | Page<Order> page = orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).in(!cityList.isEmpty(),Order::getCityCode, cityList).page(Page.of(pageNum, pageSize)); |
| | | .eq(Order::getIsDelete, 0).in(!siteIds.isEmpty(),Order::getSiteId, siteIds).in(!cityList.isEmpty(),Order::getCityCode, cityList).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | }) |
| | | public R<Page<Order>> workOrderList(@RequestParam("workId") Integer workId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,@RequestParam("siteIds") String [] siteIds) { |
| | | Page<Order> page = orderService.lambdaQuery().eq(Order::getServerId, workId) |
| | | .eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize)); |
| | | .in(siteIds.length>0,Order::getSiteId, siteIds).eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam(name = "userIds") List<Integer> userIds) { |
| | | return R.ok(withdrawService.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); |
| | | @RequestParam(name = "userIds") List<Integer> userIds, |
| | | @RequestParam("siteIds") List<String> siteIds) { |
| | | return R.ok(withdrawService.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize),siteIds)); |
| | | } |
| | | /** |
| | | * 查看提现记录详情 |
| | |
| | | @GetMapping(value = "/withdrawList1") |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList1(@RequestParam("cityList") List<String> cityList,@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawList1(cityList,userId, Page.of(pageNum, pageSize))); |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | @RequestParam("siteIds") List<String> siteIds) { |
| | | return R.ok(withdrawService.withdrawList1(cityList,userId, Page.of(pageNum, pageSize),siteIds)); |
| | | } |
| | | |
| | | |
| | |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<EvaluatePageVO> evaluateList(@Param("userId") Integer userId, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> evaluateList1(@Param("cityList") List<String> cityList,@Param("userId") Integer userId, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> evaluateList1(@Param("cityList") List<String> cityList, @Param("userId") Integer userId, @Param("siteIds") List<String> siteIds, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 订单与评价列表 |
| | |
| | | * @param orderState 订单状态 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByYear(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState); |
| | | List<OrderQueryVO> orderCountByYear(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 查询本月订单数量 |
| | |
| | | * @param orderState 订单状态 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByMonth(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState); |
| | | List<OrderQueryVO> orderCountByMonth(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 查询本周订单数量 |
| | |
| | | * @param orderState 订单状态 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByWeek(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState); |
| | | List<OrderQueryVO> orderCountByWeek(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 查询当天订单数量 |
| | |
| | | * @param orderState 订单状态 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByToday(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState); |
| | | List<OrderQueryVO> orderCountByToday(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 查询整个季度的交易额(订单状态为:已完工) |
| | |
| | | * @return 分页统计 |
| | | */ |
| | | Page<OrderCountVO> orderCount(@Param("name") String name, @Param("phone") String phone, |
| | | @Param("cityList") List<String> cityList, Page<OrderCountVO> page); |
| | | @Param("cityList") List<String> cityList, Page<OrderCountVO> page, |
| | | @Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 订单列表 |
| | |
| | | * @return 分页 |
| | | */ |
| | | Page<Order> queryPage(@Param("data") OrderQueryRequest orderQueryRequest, Page<Order> page); |
| | | Page<Order> queryPage1(@Param("data") OrderQueryRequest orderQueryRequest, Page<Order> page); |
| | | |
| | | /** |
| | | * 订单管理分页模块,订单数量统计 |
| | |
| | | * @return 列表 |
| | | */ |
| | | List<OrderQueryVO> orderCountByTimeRange(@Param("cityList") List<String> cityList, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("orderState") Integer orderState); |
| | | @Param("endTime") String endTime, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 根据时间范围筛选订单 |
| | |
| | | * @return 列表 |
| | | */ |
| | | List<OrderQueryVO> orderCountByTimeRangeYear(@Param("cityList") List<String> cityList, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("orderState") Integer orderState); |
| | | @Param("endTime") String endTime, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | /** |
| | | * 根据时间范围筛选订单 |
| | |
| | | * @return 列表 |
| | | */ |
| | | List<OrderQueryVO> orderCountByTimeRangeMonth(@Param("cityList") List<String> cityList, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("orderState") Integer orderState); |
| | | @Param("endTime") String endTime, @Param("orderState") Integer orderState,@Param("siteIds") List<String> siteIds); |
| | | |
| | | List<PaperInVo> papercout(@Param("workId")String workId,@Param("date")String date); |
| | | } |
| | |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | |
| | | |
| | | Page<UserWithdrawRecordVO> withdrawPage1(@Param("cityList") List<String> cityList,@Param("userIds") List<Integer> userIds,@Param("name") String nickname, @Param("phone") String userPhone, |
| | | @Param("time") String applyForTime, |
| | | @Param("state") Integer state, Page<UserWithdrawRecordVO> page); |
| | | @Param("state") Integer state, Page<UserWithdrawRecordVO> page, @Param("siteIds")List<String> siteIds); |
| | | |
| | | /** |
| | | * 根据所选id导出 |
| | |
| | | * @param endDateStr 季度结束时间 |
| | | * @return 总金额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoney(@Param("cityList") List<String> cityList, @Param("start") String startDateStr, @Param("end") String endDateStr); |
| | | BigDecimal withdrawalTotalMoney(@Param("cityList") List<String> cityList, @Param("start") String startDateStr, @Param("end") String endDateStr,@Param("siteIds")List<String> siteIds); |
| | | |
| | | /** |
| | | * 年度查询 |
| | |
| | | * @param cityList 城市列表 |
| | | * @return 年度提现总额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoneyByYear(@Param("cityList") List<String> cityList); |
| | | BigDecimal withdrawalTotalMoneyByYear(@Param("cityList") List<String> cityList,@Param("siteIds")List<String> siteIds); |
| | | |
| | | /** |
| | | * 月度查询 |
| | |
| | | * @param cityList 城市列表 |
| | | * @return 年度提现总额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoneyByMonth(@Param("cityList") List<String> cityList); |
| | | BigDecimal withdrawalTotalMoneyByMonth(@Param("cityList") List<String> cityList,@Param("siteIds")List<String> siteIds); |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawList(@Param("userId") Integer userId, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawList1(@Param("cityList") List<String> cityList,@Param("userId") Integer userId, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawList1(@Param("cityList") List<String> cityList,@Param("userId") Integer userId, Page<UserWithdrawRecordVO> page,@Param("siteIds")List<String> siteIds); |
| | | } |
| | |
| | | private Integer pageSize; |
| | | |
| | | private List<String> cityList; |
| | | private String [] siteIds; |
| | | |
| | | } |
| | |
| | | private Integer pageSize; |
| | | |
| | | private List<Integer> userIdList; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<EvaluatePageVO> evaluateList(Integer userId, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> evaluateList1(List<String> cityList,Integer userId, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> evaluateList1(List<String> cityList,Integer userId, Page<EvaluatePageVO> page,List<String> siteIds); |
| | | |
| | | /** |
| | | * 订单评价列表 |
| | |
| | | * @return 分页 |
| | | */ |
| | | Page<Order> queryPage(OrderQueryRequest orderQueryRequest); |
| | | List<String> queryPage1(OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 订单管理-订单统计 |
| | |
| | | * @param page 分页 |
| | | * @return 分页统计 |
| | | */ |
| | | Page<OrderCountVO> orderCount(String name, String phone, List<String> cityList, Page<OrderCountVO> page); |
| | | Page<OrderCountVO> orderCount(String name, String phone, List<String> cityList, Page<OrderCountVO> page,List<String> siteIds); |
| | | |
| | | /** |
| | | * 订单管理分页模块,订单数量统计 |
| | |
| | | Page<UserWithdrawRecordVO> withdrawPage(List<Integer> userIds,String nickname, String userPhone, String applyForTime, |
| | | Integer state, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawPage1(List<String> cityList,List<Integer> userIds,String nickname, String userPhone, String applyForTime, |
| | | Integer state, Page<UserWithdrawRecordVO> page); |
| | | Integer state, Page<UserWithdrawRecordVO> page,List<String> siteIds); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawList1(List<String> cityList,Integer userId, Page<UserWithdrawRecordVO> page); |
| | | Page<UserWithdrawRecordVO> withdrawList1(List<String> cityList,Integer userId, Page<UserWithdrawRecordVO> page,List<String> siteIds); |
| | | |
| | | /** |
| | | * 用户端-提交提现申请 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<EvaluatePageVO> evaluateList1(List<String> cityList,Integer userId, Page<EvaluatePageVO> page) { |
| | | return baseMapper.evaluateList1(cityList,userId, page); |
| | | public Page<EvaluatePageVO> evaluateList1(List<String> cityList,Integer userId, Page<EvaluatePageVO> page,List<String> siteIds) { |
| | | return baseMapper.evaluateList1(cityList,userId,siteIds, page); |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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; |
| | |
| | | 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 userWithdrawRecordVOPage; |
| | | } |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawPage1(List<String> cityList,List<Integer> userIds,String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, page); |
| | | public Page<UserWithdrawRecordVO> withdrawPage1(List<String> cityList,List<Integer> userIds,String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page,List<String> siteIds) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawPage1(cityList,userIds,nickname, userPhone, applyForTime, state, page,siteIds); |
| | | |
| | | return userWithdrawRecordVOPage; |
| | | } |
| | |
| | | String startDateStr = String.valueOf(startDate); |
| | | String endDateStr = String.valueOf(endDate); |
| | | BigDecimal withdrawalTotalMoney; |
| | | if (request.getSiteIds()==null){ |
| | | request.setSiteIds(new ArrayList<>()); |
| | | } |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoney(cityList, startDateStr, endDateStr); |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoney(cityList, startDateStr, endDateStr,request.getSiteIds()); |
| | | } else if (OrderConstants.YEAR.equals(type)) { |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoneyByYear(cityList); |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoneyByYear(cityList,request.getSiteIds()); |
| | | } else if (OrderConstants.MONTH.equals(type)) { |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoneyByMonth(cityList); |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoneyByMonth(cityList,request.getSiteIds()); |
| | | } else { |
| | | // 数量初始化 |
| | | withdrawalTotalMoney = BigDecimal.ZERO; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawList1(List<String> cityList,Integer userId, Page<UserWithdrawRecordVO> page) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawList1(cityList,userId, page); |
| | | public Page<UserWithdrawRecordVO> withdrawList1(List<String> cityList,Integer userId, Page<UserWithdrawRecordVO> page,List<String> siteIds) { |
| | | Page<UserWithdrawRecordVO> userWithdrawRecordVOPage = baseMapper.withdrawList1(cityList,userId, page,siteIds); |
| | | for (UserWithdrawRecordVO record : userWithdrawRecordVOPage.getRecords()) { |
| | | R<UserDto> user = userClient.getUser(record.getUserId()); |
| | | System.err.println("==="+user.getData()); |
| | |
| | | private List<String> cityList; |
| | | |
| | | private String type; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("结束日期(yyyy-MM-dd格式)") |
| | | private String endTime; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("订单完成结束时间") |
| | | private String completeTimeEnd; |
| | | private List<String> siteIds; |
| | | |
| | | } |
| | |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.siteIds != null and data.siteIds.length != 0"> |
| | | and o.site_id in |
| | | <foreach collection="data.siteIds" item="siteId" open="(" separator="," close=")"> |
| | | #{siteId} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by c.createTime desc |
| | | </select> |
| | |
| | | #{userId} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="data.siteIds != null and data.siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="data.siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by e.createTime desc |
| | | </select> |
| | |
| | | left join t_order o on e.order_id = o.id |
| | | where e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and o.city_code in |
| | | <foreach collection="cityList" item="city" open="(" separator="," close=")"> |
| | |
| | | <if test="userId != null"> |
| | | and e.user_id = #{userId} |
| | | </if> |
| | | |
| | | order by e.createTime desc |
| | | </select> |
| | | |
| | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.Order"> |
| | | <id column="id" property="id"/> |
| | | <result column="site_id" property="siteId"/> |
| | | <result column="msg_count" property="msgCount"/> |
| | | <result column="complete_time" property="completeTime"/> |
| | | <result column="accept_time" property="acceptTime"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="order_money" property="orderMoney"/> |
| | |
| | | <if test="orderState != null"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | |
| | | </if> |
| | | <if test="orderState != null"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | |
| | | <if test="orderState != null"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | |
| | | </if> |
| | | <if test="orderState != null"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | |
| | | <if test="name != null and name != ''"> |
| | | and o.server_name like concat('%', #{name}, '%') |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY o.server_id |
| | | </select> |
| | | |
| | | <select id="queryPage" resultMap="BaseResultMap"> |
| | | select * |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.fake != null "> |
| | | and o.fake = #{data.fake} |
| | | </if> |
| | | <if test="data.address != null and data.address != ''"> |
| | | and o.reservation_address like concat('%', #{data.address}, '%') |
| | | </if> |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | and o.city_code in |
| | | <foreach collection="data.cityList" item="c" open="(" separator="," close=")"> |
| | | #{c} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.servIds != null and data.servIds.size() != 0"> |
| | | and o.serve_id in |
| | | <foreach collection="data.servIds" item="c" open="(" separator="," close=")"> |
| | | #{c} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.type != null"> |
| | | and o.type = #{data.type} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.site_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', 1), '%Y-%m-%d %H:%i') <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | AND STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', -1), '%Y-%m-%d %H:%i') <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | <if test="data.completeTimeStart != null and data.completeTimeStart != ''"> |
| | | and DATE(o.complete_time) <![CDATA[ >= ]]> #{data.completeTimeStart} |
| | | </if> |
| | | <if test="data.completeTimeEnd != null and data.completeTimeEnd != ''"> |
| | | and DATE(o.complete_time) <![CDATA[ <= ]]> #{data.completeTimeEnd} |
| | | </if> |
| | | <if test="data.siteIds != null and data.siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="data.siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | |
| | | <select id="queryPage1" resultMap="BaseResultMap"> |
| | | select * |
| | | from t_order o |
| | | <where> |
| | |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | AND STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', -1), '%Y-%m-%d %H:%i') <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | <if test="data.siteIds != null and data.siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="data.siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.completeTimeStart != null and data.completeTimeStart != ''"> |
| | | and DATE(o.complete_time) <![CDATA[ >= ]]> #{data.completeTimeStart} |
| | | </if> |
| | | <if test="data.completeTimeEnd != null and data.completeTimeEnd != ''"> |
| | | and DATE(o.complete_time) <![CDATA[ <= ]]> #{data.completeTimeEnd} |
| | | </if> |
| | | </where> |
| | | </select> |
| | |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | |
| | | <select id="withdrawPage1" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | left join t_order o on w.order_id = o.id |
| | | <where> |
| | | w.is_delete = 0 |
| | | |
| | |
| | | </if> |
| | | <if test="state != null"> |
| | | and w.state = #{state} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by w.apply_for_time desc |
| | |
| | | <select id="withdrawalTotalMoney" resultType="java.math.BigDecimal"> |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | left join t_order o on w.order_id = o.id |
| | | <where> |
| | | w.is_delete = 0 and w.state = 1 |
| | | <if test="start != null and start != ''"> |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="withdrawalTotalMoneyByYear" resultType="java.math.BigDecimal"> |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | left join t_order o on w.order_id = o.id |
| | | <where> |
| | | YEAR(w.createTime) = YEAR(NOW()) |
| | | and w.is_delete = 0 and w.state = 1 |
| | |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="withdrawalTotalMoneyByMonth" resultType="java.math.BigDecimal"> |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | left join t_order o on w.order_id = o.id |
| | | <where> |
| | | YEAR(w.createTime) = YEAR(NOW()) |
| | | AND MONTH(w.createTime) = MONTH(NOW()) |
| | |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and w.city_code in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | |
| | | <select id="withdrawList1" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | left join t_order o on w.order_id = o.id |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | |
| | | <if test="userId != null and userId != ''"> |
| | | and w.user_id = #{userId} |
| | | </if> |
| | | <if test="siteIds != null and siteIds.size() != 0"> |
| | | and o.site_id in |
| | | <foreach collection="siteIds" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by w.apply_for_time desc |
| | | </select> |
| | |
| | | import java.io.IOException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.time.Duration; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | |
| | | /** |
| | | * linux服务器保存订单轨迹文件夹 |
| | | */ |
| | | // private static final String BASE_PATH = "/usr/local/coordinate/"; |
| | | private static final String BASE_PATH = "F:/DeskTop/coordinate/"; |
| | | // private static final String BASE_MARKER_PATH = "/usr/local/marker/"; |
| | | private static final String BASE_PATH = "/usr/local/coordinate/"; |
| | | // private static final String BASE_PATH = "F:/DeskTop/coordinate/"; |
| | | private static final String BASE_MARKER_PATH = "/usr/local/marker/"; |
| | | // private static final String BASE_PATH = "D:/Desktop/coordinate/"; |
| | | private static final String BASE_MARKER_PATH = "F:/DeskTop/marker/"; |
| | | // private static final String BASE_MARKER_PATH = "F:/DeskTop/marker/"; |
| | | /** |
| | | * 师傅端-获取订单列表 |
| | | * |
| | |
| | | } |
| | | return orderClient.orderSubmit(orderSubmitRequest); |
| | | } |
| | | |
| | | private static final double EARTH_RADIUS_METERS = 6371000.0; |
| | | /** |
| | | * 师傅端-定时调度记录师傅所走路线经纬度 |
| | | * |
| | |
| | | @ApiImplicitParam(value = "纬度", name = "latitude", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> coordinate(@RequestParam Double longitude, @RequestParam Double latitude) { |
| | | |
| | | System.err.println("调用记录经纬度"+ LocalDateTime.now()); |
| | | |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | //拿到三十分钟之前的时间,并已 yyyy-MM-dd HH:mm格式存储 |
| | | // 当前时间 |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | |
| | | // 减去三十分钟 |
| | | LocalDateTime thirtyMinutesAgo = now.minusMinutes(10); |
| | | |
| | | // 定义日期时间格式 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); |
| | | |
| | | // 格式化时间 |
| | | String formattedTime = thirtyMinutesAgo.format(formatter); |
| | | String nowStr = now.format(formatter); |
| | | |
| | | |
| | | redisService.setCacheObject("MARK:"+workerId+":"+nowStr,longitude + "," + latitude); |
| | | |
| | | String cacheObject = redisService.getCacheObject("MARK:" + workerId + ":" + formattedTime); |
| | | if (cacheObject!=null){ |
| | | |
| | | String cacheObject1 = redisService.getCacheObject("TIME:" + workerId); |
| | | if (cacheObject1==null){ |
| | | cacheObject1 = "2000-09-06 20:24:10.740"; |
| | | } |
| | | // 定义日期时间格式 |
| | | DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | |
| | | // 解析字符串为 LocalDateTime |
| | | LocalDateTime localDateTime = LocalDateTime.parse(cacheObject1, formatter1); |
| | | if (isWithinTwoMinutes(localDateTime, now)){ |
| | | //计算两点之间的距离 |
| | | String[] split = cacheObject.split(","); |
| | | String longitude1 = split[0]; |
| | | String latitude1 = split[1]; |
| | | double longitude1Double = Double.parseDouble(longitude1); |
| | | double latitude1Double = Double.parseDouble(latitude1); |
| | | double lat1Rad = Math.toRadians(latitude); |
| | | double lon1Rad = Math.toRadians(longitude); |
| | | double lat2Rad = Math.toRadians(latitude1Double); |
| | | double lon2Rad = Math.toRadians(longitude1Double); |
| | | |
| | | // 计算经纬度差值 |
| | | double dlon = lon2Rad - lon1Rad; |
| | | double dlat = lat2Rad - lat1Rad; |
| | | |
| | | // Haversine 公式 |
| | | double a = Math.pow(Math.sin(dlat / 2), 2) + |
| | | Math.cos(lat1Rad) * Math.cos(lat2Rad) * |
| | | Math.pow(Math.sin(dlon / 2), 2); |
| | | double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); |
| | | // 计算距离 |
| | | double distance = EARTH_RADIUS_METERS * c; |
| | | System.err.println("-----当前距离"+distance); |
| | | //如果超出一定范围,存入Mark文件 |
| | | if (distance<50){ |
| | | redisService.setCacheObject("TIME:"+workerId,LocalDateTime.now()); |
| | | marker(longitude,latitude); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | public static boolean isWithinTwoMinutes(LocalDateTime dateTime1, LocalDateTime dateTime2) { |
| | | // 计算两个时间之间的差值 |
| | | Duration duration = Duration.between(dateTime1, dateTime2); |
| | | |
| | | // 检查差值是否小于等于2分钟 |
| | | long minutes = Math.abs(duration.toMinutes()); |
| | | return minutes >= 10; |
| | | } |
| | | /** |
| | | * 师傅端-定时调度记录师傅当天的轨迹标点 |
| | |
| | | @ApiImplicitParam(value = "纬度", name = "latitude", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> marker(@RequestParam Double longitude, @RequestParam Double latitude) { |
| | | System.err.println("调用标点"+ LocalDateTime.now()); |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // 获取当天时间 |
| | | String today = DateUtils.dateTimeNow("yyyy-MM-dd"); |
| | | Integer workerId = 1; |
| | | // Integer workerId = loginWorker.getUserid(); |
| | | // Integer workerId = 1; |
| | | Integer workerId = loginWorker.getUserid(); |
| | | ServeCoordinate serveCoordinate = new ServeCoordinate(); |
| | | serveCoordinate.setWorkerId(workerId); |
| | | serveCoordinate.setDate(today); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | // @ApiOperation(value = "算经纬度", tags = {"师傅端-订单列表"}) |
| | | // @GetMapping(value = "/distance") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(value = "经度", name = "longitude", dataType = "Integer", required = true), |
| | | // @ApiImplicitParam(value = "纬度", name = "latitude", dataType = "Integer", required = true) |
| | | // }) |
| | | // public R<Boolean> distance(@RequestParam Double longitude1, @RequestParam Double latitude1,@RequestParam Double longitude2, @RequestParam Double latitude2) { |
| | | // |
| | | // |
| | | // } |
| | | |
| | | @ApiOperation(value = "上传经纬度", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/putLocation") |