61个文件已修改
3个文件已删除
79个文件已添加
| | |
| | | @TableField("is_rotate") |
| | | private Integer isRotate; |
| | | |
| | | @ApiModelProperty("跳转服务内容") |
| | | @TableField(exist = false) |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("服务类型") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Agreement> operate() { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Agreement> agreementPolicy(Integer type) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Notices>> noticesList() { |
| | | return R.fail("获取通知公告列表失败" + cause.getMessage()); |
| | | } |
| | |
| | | R<Agreement> dataInfo(@RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 获取司机操作指南 |
| | | * |
| | | * @return 详情操作指南 |
| | | */ |
| | | @GetMapping(value = "/agreement/operate") |
| | | R<Agreement> operate(); |
| | | |
| | | /** |
| | | * 根据类型获取注册协议、隐私政策 |
| | | * -- 用户端远程调用 |
| | | * |
| | | * @param type 查询类型 |
| | | * @return 详情 |
| | | */ |
| | | @GetMapping(value = "/agreement/agreementPolicy") |
| | | R<Agreement> agreementPolicy(@RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 系统通知列表 |
| | | * |
| | | * @return 通知公告列表 |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | |
| | | @TableField("createBy") |
| | | private String createBy; |
| | | |
| | | @TableField("updateBy") |
| | | private String updateBy; |
| | | |
| | | @TableField("createTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @TableField("updateTime") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty("是否删除 0未删除;1已删除") |
| | | @TableField("is_delete") |
| | |
| | | import com.ruoyi.order.api.entity.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateVO; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import com.ruoyi.order.api.request.EvaluatePageRequest; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | public EvaluateClient create(Throwable cause) { |
| | | return new EvaluateClient() { |
| | | @Override |
| | | public R<Page<EvaluatePageVO>> queryPageList(String userNo, String orderNumber, String workerName, Integer pageNum, Integer pageSize) { |
| | | public R<Page<EvaluatePageVO>> queryPageList(EvaluatePageRequest request) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import com.ruoyi.order.api.request.ChangeDispatchRequest; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | public ExchangeDispatchClient create(Throwable cause) { |
| | | return new ExchangeDispatchClient() { |
| | | @Override |
| | | public R<Page<ChangeDispatch>> queryPageList(String workerName, String orderNumber, String userName, Integer pageNum, Integer pageSize) { |
| | | public R<Page<ChangeDispatch>> queryPageList(ChangeDispatchRequest request) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.request.OrderCountDataRequest; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<OrderCountVO>> orderCount(String name, String phone, Integer pageNum, Integer pageSize) { |
| | | public R<Page<OrderCountVO>> orderCount(OrderCountDataRequest request) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<String> oldData(Integer index, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> changeOrderState(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | |
| | | import com.ruoyi.order.api.entity.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateVO; |
| | | import com.ruoyi.order.api.factory.EvaluateFallbackFactory; |
| | | import com.ruoyi.order.api.request.EvaluatePageRequest; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param userNo 下单用户名称 |
| | | * @param workerName 师傅名称 |
| | | * @param orderNumber 订单编号 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @param request 查询参数 |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "/evaluate/page") |
| | | R<Page<EvaluatePageVO>> queryPageList(@RequestParam(value = "userNo", required = false) String userNo, |
| | | @RequestParam(value = "orderNumber", required = false) String orderNumber, |
| | | @RequestParam(value = "workerName", required = false) String workerName, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @PostMapping(value = "/evaluate/page") |
| | | R<Page<EvaluatePageVO>> queryPageList(@RequestBody EvaluatePageRequest request); |
| | | |
| | | /** |
| | | * 订单评价详情 |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.factory.ExchangeDispatchFallbackFactory; |
| | | import com.ruoyi.order.api.request.ChangeDispatchRequest; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | | * @param workerName 师傅姓名 |
| | | * @param userName 用户名称 |
| | | * @param orderNumber 订单编号 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @param request 查询参数 |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "changeDispatch/page") |
| | | R<Page<ChangeDispatch>> queryPageList(@RequestParam(value = "workerName", required = false) String workerName, |
| | | @RequestParam(value = "orderNumber", required = false) String orderNumber, |
| | | @RequestParam(value = "userName", required = false) String userName, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @PostMapping(value = "changeDispatch/page") |
| | | R<Page<ChangeDispatch>> queryPageList(@RequestBody ChangeDispatchRequest request); |
| | | |
| | | /** |
| | | * 订单改派 -远程调用 |
| | |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.factory.OrderFallbackFactory; |
| | | import com.ruoyi.order.api.request.OrderCountDataRequest; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | /** |
| | | * 订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页条数 |
| | | * @param request 查询参数 |
| | | * @return 分页 |
| | | */ |
| | | @GetMapping(value = "/order/orderCount") |
| | | R<Page<OrderCountVO>> orderCount(@RequestParam(value = "name", required = false) String name, |
| | | @RequestParam(value = "phone", required = false) String phone, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | @PostMapping(value = "/order/orderCount") |
| | | R<Page<OrderCountVO>> orderCount(@RequestBody OrderCountDataRequest request); |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | |
| | | R<Boolean> supplementAllowance(@RequestParam("orderId") String orderId, |
| | | @RequestParam("prizeName") String prizeName); |
| | | |
| | | @GetMapping("/oldData/order") |
| | | R<String> oldData(@RequestParam("index") Integer index, |
| | | @RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-19 14:05 |
| | | */ |
| | | @Data |
| | | public class ChangeDispatchRequest { |
| | | |
| | | private String workerName; |
| | | |
| | | private String orderNumber; |
| | | |
| | | private String userName; |
| | | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | private List<String> cityList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-19 14:34 |
| | | */ |
| | | @Data |
| | | public class EvaluatePageRequest { |
| | | |
| | | private String userNo; |
| | | |
| | | private String orderNumber; |
| | | |
| | | private String workerName; |
| | | |
| | | private List<String> cityList; |
| | | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-19 14:27 |
| | | */ |
| | | @Data |
| | | public class OrderCountDataRequest { |
| | | |
| | | private String workerName; |
| | | |
| | | private String workerPhone; |
| | | |
| | | private List<String> cityList; |
| | | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | } |
| | |
| | | public static final Integer EIGHTEEN = 18; |
| | | |
| | | /** |
| | | * 数字18 |
| | | * 数字8 |
| | | */ |
| | | public static final Integer EIGHT = 18; |
| | | public static final Integer EIGHT = 8; |
| | | |
| | | /** |
| | | * 数字 30 |
| | |
| | | /** |
| | | * 短信验证码错误 |
| | | */ |
| | | public static final int WORKER_PHONE_CODE_ERROR = 505; |
| | | public static final int WORKER_PHONE_CODE_ERROR = 511; |
| | | |
| | | /** |
| | | * 身份证号码不合法 |
| | |
| | | LoginUserInfo user = null; |
| | | if (StringUtils.isNotEmpty(token)) { |
| | | String userkey = JwtUtils.getUserKeyByWorker(token); |
| | | String tokenKeyByWorker = getTokenKeyByWorker(userkey); |
| | | user = redisService.getCacheObject(getTokenKeyByWorker(userkey)); |
| | | // 再次判断登录状态是否已过期 |
| | | if (null == user) { |
| | |
| | | } |
| | | // 优先判断当前账号是否已在其他设备登录 |
| | | if (!user.getIsCanLogin()) { |
| | | redisService.deleteObject(tokenKeyByWorker); |
| | | throw new GlobalException("当前登录账号在其他设备登录!", 505); |
| | | } |
| | | // 再次判断登录状态是否已过期 |
| | | if (System.currentTimeMillis() > user.getExpireTime()) { |
| | | redisService.deleteObject(tokenKeyByWorker); |
| | | throw new GlobalException("登录信息已过期,请重新登录!", 504); |
| | | } |
| | | return user; |
| | |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | | <groupId>io.netty</groupId> |
| | | <artifactId>netty-all</artifactId> |
| | | <version>4.1.101.Final</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springframework.boot</groupId>--> |
| | | <!-- <artifactId>spring-boot-starter-websocket</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.wechatpay-apiv3</groupId> |
| | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-security</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | package com.ruoyi.admin; |
| | | |
| | | import com.ruoyi.admin.netty.NettyServer0; |
| | | import com.ruoyi.common.security.annotation.EnableCustomConfig; |
| | | import com.ruoyi.common.security.annotation.EnableRyFeignClients; |
| | | import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(RuoYiAdminApplication.class, args); |
| | | NettyServer0 nettyServer0 = new NettyServer0(); |
| | | nettyServer0.bind(); |
| | | System.out.println("(♥◠‿◠)ノ゙ 后台管理模块启动成功 ლ(´ڡ`ლ)゙ \n" + |
| | | " .-------. ____ __ \n" + |
| | | " | _ _ \\ \\ \\ / / \n" + |
| | |
| | | /* |
| | | package com.ruoyi.admin.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
| | | |
| | | */ |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-28 16:35 |
| | | */ |
| | | *//* |
| | | |
| | | @Configuration |
| | | public class WebSocketConfig { |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | */ |
| | |
| | | |
| | | import com.ruoyi.admin.entity.Agreement; |
| | | import com.ruoyi.admin.service.AgreementService; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | * |
| | | * @param type 查询类型 |
| | | */ |
| | | @RequiresPermissions(value = {"system_agreement", "system_operate"}, logical = Logical.OR) |
| | | @ApiOperation(value = "根据类型获取注册协议、隐私政策、司机操作指南", tags = {"后台-隐私政策/司机操作指南"}) |
| | | @GetMapping(value = "/dataInfo") |
| | | @ApiImplicitParams({ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取司机操作指南 |
| | | */ |
| | | @GetMapping(value = "/operate") |
| | | public R<Agreement> operate() { |
| | | return agreementService.dataInfo(Constants.TWO); |
| | | } |
| | | |
| | | /** |
| | | * 根据类型获取注册协议、隐私政策 |
| | | * -- 用户端远程调用 |
| | | * |
| | | * @param type 查询类型 |
| | | */ |
| | | @GetMapping(value = "/agreementPolicy") |
| | | public R<Agreement> agreementPolicy(@RequestParam("type") Integer type) { |
| | | return agreementService.dataInfo(type); |
| | | } |
| | | |
| | | /** |
| | | * 保存政策协议 |
| | | * |
| | | * @param agreement 协议信息 |
| | | */ |
| | | @RequiresPermissions(value = {"system_agreement", "system_operate"}, logical = Logical.OR) |
| | | @RequiresPermissions(value = {"advantage_update", "operate_save"}, logical = Logical.OR) |
| | | @ApiOperation(value = "保存政策协议", tags = {"后台-隐私政策/司机操作指南"}) |
| | | @PostMapping(value = "/saveData") |
| | | public R<String> saveData(@RequestBody Agreement agreement) { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.sorcket.WebSocketServer; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import com.ruoyi.order.api.request.ChangeDispatchRequest; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private ExchangeDispatchClient dispatchClient; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 订单改派分页列表 |
| | |
| | | public R<Page<ChangeDispatch>> queryPageList(String workerName, String orderNumber, String userName, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return dispatchClient.queryPageList(workerName, orderNumber, userName, pageNum, pageSize); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | List<String> cityList = new ArrayList<>(); |
| | | if (loginUser.getIsFranchisee()) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | ChangeDispatchRequest changeDispatchRequest = new ChangeDispatchRequest(); |
| | | changeDispatchRequest.setWorkerName(workerName); |
| | | changeDispatchRequest.setOrderNumber(orderNumber); |
| | | changeDispatchRequest.setUserName(userName); |
| | | changeDispatchRequest.setPageNum(pageNum); |
| | | changeDispatchRequest.setPageSize(pageSize); |
| | | changeDispatchRequest.setCityList(cityList); |
| | | return dispatchClient.queryPageList(changeDispatchRequest); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param id 订单改派id |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @RequiresPermissions("reassignment_detail") |
| | | @ApiOperation(value = "订单改派详情", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param ids 订单改派多条id拼接 |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @RequiresPermissions("reassignment_delete") |
| | | @ApiOperation(value = "批量删除订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 改派申请记录id |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @RequiresPermissions("reassignment_reject") |
| | | @ApiOperation(value = "拒绝订单改派申请", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/refuse") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param changeId 改派订单id |
| | | * @param workerId 师傅id |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @RequiresPermissions("reassignment_reassignment") |
| | | @ApiOperation(value = "订单改派师傅", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/changeWorker") |
| | | @ApiImplicitParams({ |
| | |
| | | Boolean data = dispatchClient.changeWorker(changeId, workerId, masterWorker.getRealName(), |
| | | masterWorker.getPhone()).getData(); |
| | | if (null != data && data) { |
| | | try { |
| | | WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(workerId)); |
| | | return R.ok(); |
| | | } catch (IOException e) { |
| | | return R.fail("师傅不在线!"); |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(workerId)); |
| | | if (null != context) { |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | return R.ok(); |
| | | // try { |
| | | // WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(workerId)); |
| | | // } catch (IOException e) { |
| | | // return R.fail("师傅不在线!"); |
| | | // } |
| | | } |
| | | return R.fail("订单推送异常!"); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.Evaluate; |
| | | import com.ruoyi.order.api.entity.EvaluatePageVO; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import com.ruoyi.order.api.request.EvaluatePageRequest; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @Resource |
| | | private EvaluateClient evaluateClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 订单评价分页列表 |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @RequiresPermissions(value = {"user_detail", "order_evaluate"}, logical = Logical.OR) |
| | | @ApiOperation(value = "订单评价分页查询列表", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | public R<Page<EvaluatePageVO>> queryPageList(String userNo, String orderNumber, String workerName, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return evaluateClient.queryPageList(userNo, orderNumber, workerName, pageNum, pageSize); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<String> cityList = new ArrayList<>(); |
| | | if (loginUser.getIsFranchisee()) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | EvaluatePageRequest evaluatePageRequest = new EvaluatePageRequest(); |
| | | evaluatePageRequest.setUserNo(userNo); |
| | | evaluatePageRequest.setOrderNumber(orderNumber); |
| | | evaluatePageRequest.setWorkerName(workerName); |
| | | evaluatePageRequest.setCityList(cityList); |
| | | evaluatePageRequest.setPageNum(pageNum); |
| | | evaluatePageRequest.setPageSize(pageSize); |
| | | return evaluateClient.queryPageList(evaluatePageRequest); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param id 订单评价id |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @RequiresPermissions(value = {"user_detail", "evaluate_detail"}, logical = Logical.OR) |
| | | @ApiOperation(value = "订单评价详情", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param ids 订单评价多条id拼接 |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @RequiresPermissions(value = {"user_detail", "evaluate_delete"}, logical = Logical.OR) |
| | | @ApiOperation(value = "批量删除订单评价", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @RequiresPermissions("franchisee_list") |
| | | @ApiOperation(value = "加盟商信息分页查询列表", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 加盟商信息id |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @RequiresPermissions("franchisee_detail") |
| | | @ApiOperation(value = "加盟商信息详情", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param franchisee 加盟商信息信息 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @RequiresPermissions("franchisee_save") |
| | | @ApiOperation(value = "新增加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody @Validated Franchisee franchisee) { |
| | |
| | | * |
| | | * @param franchisee 加盟商信息信息 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @RequiresPermissions("franchisee_update") |
| | | @ApiOperation(value = "修改加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody @Validated Franchisee franchisee) { |
| | |
| | | * @param id 加盟商id |
| | | * @param enable 启用/关闭 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @RequiresPermissions("franchisee_enable") |
| | | @ApiOperation(value = "启用/关闭加盟商", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/enable") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param ids 加盟商信息多条id拼接 |
| | | */ |
| | | @RequiresPermissions("franchisee") |
| | | @RequiresPermissions("franchisee_delete") |
| | | @ApiOperation(value = "批量删除加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.request.UserDataCountRequest; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.UserService; |
| | |
| | | import com.ruoyi.admin.vo.UserTrendsVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.OrderCountRequest; |
| | | import com.ruoyi.order.api.entity.OrderResultVO; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | private UserService userService; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * netty测试 |
| | | * |
| | | * @param workerId 请求参数 |
| | | */ |
| | | @ApiOperation(value = "netty测试", tags = {"后台-首页"}) |
| | | @GetMapping(value = "/nettySend") |
| | | public R<?> nettySend(@RequestParam Integer workerId) { |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(workerId)); |
| | | if (null != context) { |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 用户数据统计 |
| | |
| | | @ApiOperation(value = "后台-用户数据统计", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/userDataCount") |
| | | public R<UserDataCountVO> userDataCount(@RequestBody UserDataCountRequest userDataCountRequest) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | if (loginUser.getIsFranchisee()) { |
| | | if (null == userDataCountRequest.getCityList() || userDataCountRequest.getCityList().isEmpty()) { |
| | | userDataCountRequest.setCityList(loginUser.getCityList()); |
| | | } else { |
| | | userDataCountRequest.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | return R.ok(userService.userDataCount(userDataCountRequest)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "后台-用户增量", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/userTrends") |
| | | public R<List<UserTrendsVO>> userTrends(@RequestBody List<String> cityList) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | if (loginUser.getIsFranchisee()) { |
| | | if (null == cityList || cityList.isEmpty()) { |
| | | cityList = loginUser.getCityList(); |
| | | } else { |
| | | cityList.addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | return R.ok(userService.userTrends(cityList)); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "后台-回收订单统计", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/orderCountHome") |
| | | public R<OrderResultVO> orderCountHome(@RequestBody OrderCountRequest orderCount) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | if (loginUser.getIsFranchisee()) { |
| | | if (null == orderCount.getCityList() || orderCount.getCityList().isEmpty()) { |
| | | orderCount.setCityList(loginUser.getCityList()); |
| | | } else { |
| | | orderCount.getCityList().addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | return orderClient.orderCountHome(orderCount); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "后台-师傅接单排行", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/workerRanking") |
| | | public R<List<MasterWorkerRankVO>> workerRanking(@RequestBody List<String> cityList) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | if (loginUser.getIsFranchisee()) { |
| | | if (null == cityList || cityList.isEmpty()) { |
| | | cityList = loginUser.getCityList(); |
| | | } else { |
| | | cityList.addAll(loginUser.getCityList()); |
| | | } |
| | | } |
| | | return R.ok(masterWorkerService.workerRanking(cityList)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.Evaluate; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | |
| | | /** |
| | | * 师傅列表分页查询 (添加订单-选择师傅列表) |
| | | */ |
| | | @RequiresPermissions("master_worker_list") |
| | | @ApiOperation(value = "师傅列表", tags = {"后台-师傅管理"}) |
| | | @GetMapping(value = "/selectServe") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param masterWorker 师傅详细信息 |
| | | */ |
| | | @RequiresPermissions("worker_save") |
| | | @ApiOperation(value = "新增师傅信息", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody MasterWorker masterWorker) { |
| | |
| | | * |
| | | * @param ids 账号id拼接 |
| | | */ |
| | | @RequiresPermissions("worker_delete") |
| | | @ApiOperation(value = "删除师傅信息", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param masterWorker 师傅信息 |
| | | */ |
| | | @RequiresPermissions("worker_update") |
| | | @ApiOperation(value = "修改师傅信息", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody @Validated MasterWorker masterWorker) { |
| | |
| | | * @param id 师傅信息id |
| | | * @param enable 启用/关闭 |
| | | */ |
| | | @RequiresPermissions("worker_enable") |
| | | @ApiOperation(value = "启用/关闭师傅账号", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @GetMapping(value = "/enable") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param workerId 师傅id |
| | | */ |
| | | @RequiresPermissions("worker_detail") |
| | | @ApiOperation(value = "师傅详细信息", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 系统通知id |
| | | */ |
| | | @RequiresPermissions("system_notice") |
| | | @RequiresPermissions("notice_detail") |
| | | @ApiOperation(value = "系统通知详情", tags = {"后台-系统设置-系统通知管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param notices 系统通知信息 |
| | | */ |
| | | @RequiresPermissions("system_notice") |
| | | @RequiresPermissions("notice_save") |
| | | @ApiOperation(value = "新增系统通知", tags = {"后台-系统设置-系统通知管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Notices notices) { |
| | |
| | | * |
| | | * @param notices 系统通知信息 |
| | | */ |
| | | @RequiresPermissions("system_notice") |
| | | @RequiresPermissions("notice_update") |
| | | @ApiOperation(value = "修改系统通知", tags = {"后台-系统设置-系统通知管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Notices notices) { |
| | |
| | | * |
| | | * @param ids 系统通知多条id拼接 |
| | | */ |
| | | @RequiresPermissions("system_notice") |
| | | @RequiresPermissions("notice_delete") |
| | | @ApiOperation(value = "批量删除系统通知", tags = {"后台-系统设置-系统通知管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.RecoveryServe; |
| | | import com.ruoyi.admin.entity.Site; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.sorcket.WebSocketServer; |
| | | 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.RecoveryServeService; |
| | | import com.ruoyi.admin.service.SiteService; |
| | | import com.ruoyi.admin.vo.OrderDetailVO; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.request.OrderCountDataRequest; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | private ExchangeDispatchClient dispatchClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | |
| | | /** |
| | | * 雪花算法类 |
| | |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @RequiresPermissions(value = {"user_detail", "order_detail"}, logical = Logical.OR) |
| | | @ApiOperation(value = "订单列表-查询订单详情(包含服务信息、师傅信息、服务记录、订单评价)", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/orderDetail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | */ |
| | | @RequiresPermissions("order_list") |
| | | @ApiOperation(value = "订单列表-分页", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/queryPage") |
| | | public R<Page<Order>> queryPage(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | |
| | | /** |
| | | * 订单列表 |
| | | */ |
| | | @RequiresPermissions("order_list") |
| | | @ApiOperation(value = "订单列表-各订单数量统计", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/orderPageCount") |
| | | public R<OrderPageCountVO> orderPageCount(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @RequiresPermissions("order_detail") |
| | | @ApiOperation(value = "订单列表-订单详情", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param order 站点信息 |
| | | */ |
| | | @RequiresPermissions("order_save") |
| | | @ApiOperation(value = "订单列表-新增订单", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody OrderRequest order) { |
| | |
| | | if (null == data) { |
| | | return R.fail(orderClient.save(order).getMsg()); |
| | | } |
| | | try { |
| | | WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(order.getServerId())); |
| | | } catch (IOException e) { |
| | | return R.fail("订单推送失败!"); |
| | | System.out.println("服务人员id:" + order.getServerId()); |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(order.getServerId())); |
| | | System.out.println("socket连接信息:" + context); |
| | | if (null != context) { |
| | | System.out.println("服务端发送消息到: " + order.getServerId()); |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | return data ? R.ok() : R.fail(); |
| | | } |
| | |
| | | * |
| | | * @param type 1:订单派单;2:订单改派 |
| | | */ |
| | | @RequiresPermissions("order_reassignment") |
| | | @ApiOperation(value = "订单列表-订单派单/改派", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/reassignment") |
| | | @ApiImplicitParams({ |
| | |
| | | changeDispatch.setIsDelete(Constants.ZERO); |
| | | result = dispatchClient.saveRecord(changeDispatch).getData(); |
| | | } |
| | | try { |
| | | WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(workerId)); |
| | | } catch (IOException e) { |
| | | return R.fail("订单推送失败!"); |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(workerId)); |
| | | if (null != context) { |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | // try { |
| | | // WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(workerId)); |
| | | // } catch (IOException e) { |
| | | // return R.fail("订单推送失败!"); |
| | | // } |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param ids 站点多条id拼接 |
| | | */ |
| | | @RequiresPermissions("order_delete") |
| | | @ApiOperation(value = "订单列表-批量删除订单", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | */ |
| | | @RequiresPermissions("order_export") |
| | | @ApiOperation(value = "订单列表-excel导出", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/excelExport") |
| | | public R<String> excelExport(@RequestBody OrderQueryRequest orderQueryRequest, HttpServletResponse response) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 旧数据迁移 |
| | | * |
| | | * @param index 权限 |
| | | */ |
| | | @ApiOperation(value = "旧数据迁移", tags = {"后台-首页"}) |
| | | @GetMapping(value = "/oldData") |
| | | public R<String> oldData(@RequestParam Integer index, @RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize) { |
| | | return orderClient.oldData(index, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | */ |
| | | @RequiresPermissions("order_count") |
| | | @ApiOperation(value = "订单统计", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/orderCount") |
| | | @ApiImplicitParams({ |
| | |
| | | public R<Page<OrderCountVO>> orderCount(String name, String phone, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<OrderCountVO> data = orderClient.orderCount(name, phone, pageNum, pageSize).getData(); |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<String> cityList = new ArrayList<>(); |
| | | if (loginUser.getIsFranchisee()) { |
| | | cityList = loginUser.getCityList(); |
| | | } |
| | | // 查询参数 |
| | | OrderCountDataRequest orderCountDataRequest = new OrderCountDataRequest(); |
| | | orderCountDataRequest.setWorkerName(name); |
| | | orderCountDataRequest.setWorkerPhone(phone); |
| | | orderCountDataRequest.setCityList(cityList); |
| | | orderCountDataRequest.setPageNum(pageNum); |
| | | orderCountDataRequest.setPageSize(pageSize); |
| | | // 远程调用 |
| | | Page<OrderCountVO> data = orderClient.orderCount(orderCountDataRequest).getData(); |
| | | List<Integer> idList = data.getRecords().stream().map(OrderCountVO::getWorkerId) |
| | | .collect(Collectors.toList()); |
| | | List<MasterWorker> masterWorkerList; |
| | |
| | | masterWorkerList = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getIsDelete, 0).list(); |
| | | } |
| | | // 师傅头像列表 |
| | | Map<Integer, String> profilePictureMap = masterWorkerList.stream().collect(Collectors.toMap(MasterWorker::getId, |
| | | mw -> Optional.ofNullable(mw.getProfilePicture()).orElse(""))); |
| | | // 师傅姓名 |
| | | Map<Integer, String> realNameMap = masterWorkerList.stream().collect(Collectors.toMap(MasterWorker::getId, |
| | | mw -> Optional.ofNullable(mw.getRealName()).orElse(""))); |
| | | for (OrderCountVO record : data.getRecords()) { |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("prize") |
| | | @RequiresPermissions("prize_list") |
| | | @ApiOperation(value = "奖品分页查询列表", tags = {"后台-系统设置-奖品管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 奖品id |
| | | */ |
| | | @RequiresPermissions("prize") |
| | | @RequiresPermissions("prize_detail") |
| | | @ApiOperation(value = "奖品详情", tags = {"后台-系统设置-奖品管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param prize 奖品信息 |
| | | */ |
| | | @RequiresPermissions("prize") |
| | | @RequiresPermissions("prize_save") |
| | | @ApiOperation(value = "新增奖品", tags = {"后台-系统设置-奖品管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Prize prize) { |
| | |
| | | * |
| | | * @param prize 奖品信息 |
| | | */ |
| | | @RequiresPermissions("prize") |
| | | @RequiresPermissions("prize_update") |
| | | @ApiOperation(value = "编辑奖品", tags = {"后台-系统设置-奖品管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Prize prize) { |
| | |
| | | * |
| | | * @param ids 奖品id拼接 |
| | | */ |
| | | @RequiresPermissions("prize") |
| | | @RequiresPermissions("prize_delete") |
| | | @ApiOperation(value = "批量删除奖品", tags = {"后台-系统设置-奖品管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 常见问题id |
| | | */ |
| | | @RequiresPermissions("system_problem") |
| | | @RequiresPermissions("problem_detail") |
| | | @ApiOperation(value = "常见问题详情", tags = {"后台-系统设置-常见问题管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param problem 常见问题信息 |
| | | */ |
| | | @RequiresPermissions("system_problem") |
| | | @RequiresPermissions("problem_save") |
| | | @ApiOperation(value = "新增常见问题", tags = {"后台-系统设置-常见问题管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Problem problem) { |
| | |
| | | * |
| | | * @param problem 常见问题信息 |
| | | */ |
| | | @RequiresPermissions("system_problem") |
| | | @RequiresPermissions("problem_update") |
| | | @ApiOperation(value = "修改常见问题", tags = {"后台-系统设置-常见问题管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Problem problem) { |
| | |
| | | * |
| | | * @param ids 常见问题多条id拼接 |
| | | */ |
| | | @RequiresPermissions("system_problem") |
| | | @RequiresPermissions("problem_delete") |
| | | @ApiOperation(value = "批量删除常见问题", tags = {"后台-系统设置-常见问题管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 回收分类id |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @RequiresPermissions("classification_detail") |
| | | @ApiOperation(value = "回收分类详情", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | /** |
| | | * 是否首页推荐 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @RequiresPermissions("classification_recommend") |
| | | @ApiOperation(value = "是否首页推荐", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/recommend") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param recoveryClassify 回收分类信息 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @RequiresPermissions("classification_save") |
| | | @ApiOperation(value = "新增回收分类", tags = {"后台-回收管理-回收分类管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody RecoveryClassify recoveryClassify) { |
| | |
| | | * |
| | | * @param recoveryClassify 回收分类信息 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @RequiresPermissions("classification_update") |
| | | @ApiOperation(value = "修改回收分类", tags = {"后台-回收管理-回收分类管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody RecoveryClassify recoveryClassify) { |
| | |
| | | * |
| | | * @param ids 回收分类多条id拼接 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @RequiresPermissions("classification_delete") |
| | | @ApiOperation(value = "批量删除回收分类", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 回收服务id |
| | | */ |
| | | @RequiresPermissions("serve_recycling_list") |
| | | @RequiresPermissions("serve_detail") |
| | | @ApiOperation(value = "回收服务详情", tags = {"后台-回收管理-回收服务管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param recoveryServeRequest 回收服务信息 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_list") |
| | | @RequiresPermissions("serve_save") |
| | | @ApiOperation(value = "新增回收服务", tags = {"后台-回收管理-回收服务管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody RecoveryServeRequest recoveryServeRequest) { |
| | |
| | | * |
| | | * @param recoveryServeRequest 回收服务信息 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_list") |
| | | @RequiresPermissions("serve_update") |
| | | @ApiOperation(value = "修改回收服务", tags = {"后台-回收管理-回收服务管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody RecoveryServeRequest recoveryServeRequest) { |
| | |
| | | * |
| | | * @param ids 回收服务多条id拼接 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_list") |
| | | @RequiresPermissions("serve_delete") |
| | | @ApiOperation(value = "批量删除回收服务", tags = {"后台-回收管理-回收服务管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.admin.entity.Menu; |
| | | import com.ruoyi.admin.entity.Role; |
| | | import com.ruoyi.admin.entity.RoleMenu; |
| | | import com.ruoyi.admin.entity.SysUser; |
| | | import com.ruoyi.admin.request.RoleRequest; |
| | | import com.ruoyi.admin.service.MenuService; |
| | | import com.ruoyi.admin.service.RoleMenuService; |
| | | import com.ruoyi.admin.service.RoleService; |
| | | import com.ruoyi.admin.service.SysUserService; |
| | | import com.ruoyi.admin.vo.RoleDetailVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | private RoleMenuService roleMenuService; |
| | | @Resource |
| | | private MenuService menuService; |
| | | @Resource |
| | | private SysUserService userService; |
| | | |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param id 角色id |
| | | */ |
| | | @RequiresPermissions("power_role") |
| | | @ApiOperation(value = "角色详情", tags = {"后台-权限管理-角色管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param roleRequest 角色信息 |
| | | */ |
| | | @RequiresPermissions("power_role") |
| | | @RequiresPermissions("role_update") |
| | | @ApiOperation(value = "编辑角色", tags = {"后台-权限管理-角色管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<RoleDetailVO> update(@RequestBody RoleRequest roleRequest) { |
| | |
| | | * |
| | | * @param roleRequest 角色信息 |
| | | */ |
| | | @RequiresPermissions("power_role") |
| | | @RequiresPermissions("role_save") |
| | | @ApiOperation(value = "新增角色", tags = {"后台-权限管理-角色管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody RoleRequest roleRequest) { |
| | |
| | | * |
| | | * @param ids 角色id拼接 |
| | | */ |
| | | @RequiresPermissions("power_role") |
| | | @RequiresPermissions("role_delete") |
| | | @ApiOperation(value = "批量删除角色", tags = {"后台-权限管理-角色管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | }) |
| | | public R<String> batchDelete(@RequestParam String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | // 判断角色是否已存在关联账号 |
| | | List<Role> list = roleService.lambdaQuery().in(Role::getRoleId, idList).list(); |
| | | list.forEach(data -> data.setDelFlag("2")); |
| | | // 删除角色需要删除角色所关联的菜单信息 |
| | | for (String id : idList) { |
| | | roleMenuService.remove(new QueryWrapper<RoleMenu>().eq("role_id", id)); |
| | | for (Role role : list) { |
| | | Long roleId = role.getRoleId(); |
| | | List<SysUser> sysUserList = userService.lambdaQuery() |
| | | .eq(SysUser::getRoleId, roleId) |
| | | .eq(SysUser::getIsDelete, 0).list(); |
| | | if (sysUserList.isEmpty()) { |
| | | role.setDelFlag("2"); |
| | | } |
| | | // 删除菜单关联信息 |
| | | roleMenuService.remove(new QueryWrapper<RoleMenu>().eq("role_id", roleId)); |
| | | } |
| | | return roleService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | |
| | | public R<List<Rotate>> bannerList() { |
| | | return R.ok(rotateService.lambdaQuery() |
| | | .eq(Rotate::getIsDelete, 0) |
| | | .orderByAsc(Rotate::getSort).list()); |
| | | .orderByDesc(Rotate::getSort).list()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param id 轮播图id |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @RequiresPermissions("rotate_detail") |
| | | @ApiOperation(value = "轮播图详情", tags = {"后台-系统设置-轮播图管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param rotate 轮播图信息 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @RequiresPermissions("rotate_save") |
| | | @ApiOperation(value = "新增轮播图", tags = {"后台-系统设置-轮播图管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Rotate rotate) { |
| | |
| | | * @param rotate 轮播图信息 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @RequiresPermissions("rotate_update") |
| | | @ApiOperation(value = "修改轮播图", tags = {"后台-系统设置-轮播图管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Rotate rotate) { |
| | |
| | | * @param ids 轮播图多条id拼接 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @RequiresPermissions("rotate_delete") |
| | | @ApiOperation(value = "批量删除轮播图", tags = {"后台-系统设置-轮播图管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.admin.entity.ServeAdvantage; |
| | | import com.ruoyi.admin.service.ServeAdvantageService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("system_advantage") |
| | | @ApiOperation(value = "服务优势分页查询列表", tags = {"后台-系统设置-服务优势管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增服务优势 |
| | | * |
| | | * @param serveAdvantage 服务优势信息 |
| | | */ |
| | | @ApiOperation(value = "新增服务优势", tags = {"后台-系统设置-服务优势管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody ServeAdvantage serveAdvantage) { |
| | | return serveAdvantageService.save(serveAdvantage) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 修改服务优势 |
| | | * |
| | | * @param serveAdvantage 服务优势信息 |
| | | */ |
| | | @RequiresPermissions("advantage_update") |
| | | @ApiOperation(value = "修改服务优势", tags = {"后台-系统设置-服务优势管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody ServeAdvantage serveAdvantage) { |
| | | return serveAdvantageService.updateById(serveAdvantage) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 根据id批量删除服务优势 |
| | | * |
| | | * @param ids 服务优势多条id拼接 |
| | | */ |
| | | @ApiOperation(value = "批量删除服务优势", tags = {"后台-系统设置-服务优势管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "多个id ',' 拼接", name = "ids", dataType = "String", required = true) |
| | | }) |
| | | public R<String> batchDelete(@RequestParam String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | List<ServeAdvantage> list = serveAdvantageService.lambdaQuery().in(ServeAdvantage::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return serveAdvantageService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.admin.entity.Site; |
| | | import com.ruoyi.admin.service.SiteService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("system_site") |
| | | @ApiOperation(value = "站点分页查询列表", tags = {"后台-系统设置-站点管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 站点id |
| | | */ |
| | | @RequiresPermissions("site_detail") |
| | | @ApiOperation(value = "站点详情", tags = {"后台-系统设置-站点管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param site 站点信息 |
| | | */ |
| | | @RequiresPermissions("site_save") |
| | | @ApiOperation(value = "新增站点", tags = {"后台-系统设置-站点管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Site site) { |
| | |
| | | * |
| | | * @param site 站点信息 |
| | | */ |
| | | @RequiresPermissions("site_update") |
| | | @ApiOperation(value = "修改站点", tags = {"后台-系统设置-站点管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Site site) { |
| | |
| | | * |
| | | * @param ids 站点多条id拼接 |
| | | */ |
| | | @RequiresPermissions("site_delete") |
| | | @ApiOperation(value = "批量删除站点", tags = {"后台-系统设置-站点管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.admin.service.UserRoleService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("power_account") |
| | | @ApiOperation(value = "账号分页查询列表", tags = {"后台-权限管理-账号管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param id 后台账号id |
| | | * @param enable 启用/关闭 |
| | | */ |
| | | @RequiresPermissions("power_enable") |
| | | @ApiOperation(value = "启用/关闭后台账号", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @GetMapping(value = "/enable") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 账号id |
| | | */ |
| | | @RequiresPermissions("power_detail") |
| | | @ApiOperation(value = "账号详情", tags = {"后台-权限管理-账号管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param sysUserRequest 账号信息 |
| | | */ |
| | | @RequiresPermissions("power_save") |
| | | @ApiOperation(value = "新增账号", tags = {"后台-权限管理-账号管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody @Validated SysUserRequest sysUserRequest) { |
| | |
| | | * |
| | | * @param sysUserRequest 账号信息 |
| | | */ |
| | | @RequiresPermissions("power_update") |
| | | @ApiOperation(value = "修改账号", tags = {"后台-权限管理-账号管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody SysUserRequest sysUserRequest) { |
| | |
| | | * |
| | | * @param ids 账号id拼接 |
| | | */ |
| | | @RequiresPermissions("power_delete") |
| | | @ApiOperation(value = "批量删除账号", tags = {"后台-权限管理-账号管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("user_list") |
| | | @ApiOperation(value = "用户列表", tags = {"用户管理-用户列表"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 前台用户id |
| | | */ |
| | | @RequiresPermissions("user_detail") |
| | | @ApiOperation(value = "用户详情", tags = {"用户管理-用户列表"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param id 后台账号id |
| | | * @param enable 启用/关闭 |
| | | */ |
| | | @RequiresPermissions("user_enable") |
| | | @ApiOperation(value = "启用/关闭用户账号", tags = {"用户管理-用户列表"}) |
| | | @GetMapping(value = "/enable") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param ids 前台用户多条id拼接 |
| | | */ |
| | | @RequiresPermissions("user_delete") |
| | | @ApiOperation(value = "批量删除用户", tags = {"用户管理-用户列表"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.EvaluatePageVO; |
| | | import com.ruoyi.order.api.entity.Order; |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("user_list") |
| | | @ApiOperation(value = "用户管理-用户分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 前台用户id |
| | | */ |
| | | @RequiresPermissions("user_detail") |
| | | @ApiOperation(value = "用户管理-用户详情", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param ids 前台用户多条id拼接 |
| | | */ |
| | | @RequiresPermissions("user_delete") |
| | | @ApiOperation(value = "用户管理-批量删除用户", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @RequiresPermissions("user_detail") |
| | | @ApiOperation(value = "用户详情-订单记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/orderList") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @RequiresPermissions("user_detail") |
| | | @ApiOperation(value = "用户详情-评价记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/evaluateList") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 评价记录id |
| | | */ |
| | | @RequiresPermissions("user_detail") |
| | | @ApiOperation(value = "用户详情-删除评价记录", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/deleteEvaluateRecord") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @return 操作结果 |
| | | */ |
| | | @RequiresPermissions("user_withdrawal_setting") |
| | | @ApiOperation(value = "关闭/开启审核", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/enableProcess") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @RequiresPermissions("user_detail") |
| | | @ApiOperation(value = "用户详情-提现记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/withdrawList") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 提现记录id |
| | | */ |
| | | @RequiresPermissions(value = {"user_detail", "user_withdrawal_delete"}, logical = Logical.OR) |
| | | @ApiOperation(value = "用户详情/用户提现管理-删除提现记录", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/deleteWithdrawRecord") |
| | | @ApiImplicitParams({ |
| | |
| | | * @param state 审批结果 |
| | | * @param opinion 审批意见 |
| | | */ |
| | | @RequiresPermissions(value = {"user_detail", "user_withdrawal_audit"}, logical = Logical.OR) |
| | | @ApiOperation(value = "用户详情/用户提现管理-提现审批", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/withdrawExamine") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 师傅入驻审核id |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @RequiresPermissions("worker_process_detail") |
| | | @ApiOperation(value = "师傅入驻审核详情", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param prize 师傅入驻审核信息 |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @RequiresPermissions("worker_process_delete") |
| | | @ApiOperation(value = "新增师傅入驻审核", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody WorkerProcess prize) { |
| | |
| | | * |
| | | * @param ids 师傅入驻审核id拼接 |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @RequiresPermissions("worker_process_delete") |
| | | @ApiOperation(value = "批量删除师傅入驻审核", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 师傅入驻审核id |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @RequiresPermissions("worker_process_audit") |
| | | @ApiOperation(value = "师傅入驻审核", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/examine") |
| | | @ApiImplicitParams({ |
| | |
| | | @TableField(exist = false) |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("服务类型") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | /** |
| | | * 缓存消息类型 |
| | | * |
| | | * @author TaoNingBo |
| | | * @data 2016年9月21日 |
| | | * @version 1.0 |
| | | */ |
| | | public class CacheType { |
| | | |
| | | /** |
| | | * 用户通讯通道标识 |
| | | */ |
| | | public static final String userCtx = "USER_CTX_"; |
| | | |
| | | /** |
| | | * 司机通讯通道标识 |
| | | */ |
| | | public static final String driverCtx = "DRIVER_CTX_"; |
| | | |
| | | /** |
| | | * 出行-快车/专车/代驾-订单消息队列-自营车辆 |
| | | */ |
| | | public static final String travelOrder1 = "TRAVEL_ORDER1_"; |
| | | |
| | | /** |
| | | * 出行-快车/专车/代驾-订单消息队列-外来车辆 |
| | | */ |
| | | public static final String travelOrder2 = "TRAVEL_ORDER2_"; |
| | | |
| | | /** |
| | | * 快车-司机位置-自营车辆 |
| | | */ |
| | | public static final String location1 = "_LOCATION1"; |
| | | |
| | | /** |
| | | * 快车-司机位置-外来车辆 |
| | | */ |
| | | public static final String location2 = "_LOCATION2"; |
| | | |
| | | /** |
| | | * 快车-司机抢单成功后的消息 |
| | | */ |
| | | public static final String travelOrder = "TRAVEL_ORDER_"; |
| | | |
| | | /** |
| | | * 开始服务时间 |
| | | */ |
| | | public static final String startServerT = "START_SERVER_TIME_"; |
| | | |
| | | /** |
| | | * 司机上一次的位置(经纬度) |
| | | */ |
| | | public static final String location = "LAST_DRIVER_LOCATION_"; |
| | | |
| | | /** |
| | | * 司机上一次总共行驶距离 |
| | | */ |
| | | public static final String triverd = "LAST_TRIVER_Distance_"; |
| | | |
| | | /** |
| | | * 记录订单数据 司机 异常处理 |
| | | */ |
| | | public static final String dreco = "DRIVER_DATA_RECO"; |
| | | |
| | | /** |
| | | * 记录订单数据 用户 异常处理 |
| | | */ |
| | | public static final String ureco = "USER_DATA_RECO"; |
| | | |
| | | /** |
| | | * 记录司机跟用户的关系ID |
| | | */ |
| | | public final static String udID = "USER_DRIVER_ID_"; |
| | | |
| | | /** |
| | | * 记录下单乘客的出发点位置坐标 |
| | | */ |
| | | public final static String userLoc = "USER_LOCATION_"; |
| | | |
| | | /** |
| | | * 记录计费规则【用订单号获取】 |
| | | */ |
| | | public final static String rules = "RULES_ORDER_"; |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import io.netty.channel.ChannelInitializer; |
| | | import io.netty.channel.socket.SocketChannel; |
| | | import io.netty.handler.codec.http.HttpObjectAggregator; |
| | | import io.netty.handler.codec.http.HttpServerCodec; |
| | | import io.netty.handler.stream.ChunkedWriteHandler; |
| | | |
| | | public class ChildChannelHandler extends ChannelInitializer<SocketChannel> { |
| | | @Override |
| | | protected void initChannel(SocketChannel socketChannel) throws Exception { |
| | | // String path = "C:\\Program Files\\Apache Software Foundation\\Tomcat 8.5\\cert\\SHA256withRSA_lzhyc.cn.pfx"; |
| | | // String path = "C:\\cert\\5084549_express.feimadache.com.pfx"; |
| | | // SSLContext sslContext = createSSLContext.createSSLContext("PKCS12" |
| | | // , path, "4zw2YVpF"); |
| | | // //SSLEngine 此类允许使用ssl安全套接层协议进行安全通信 |
| | | // SSLEngine engine = sslContext.createSSLEngine(); |
| | | // engine.setUseClientMode(false); |
| | | // socketChannel.pipeline().addLast("ssl", new SslHandler(engine)); |
| | | |
| | | // 设置30秒没有读到数据,则触发一个READER_IDLE事件。 |
| | | // pipeline.addLast(new IdleStateHandler(30, 0, 0)); |
| | | // HttpServerCodec:将请求和应答消息解码为HTTP消息 |
| | | socketChannel.pipeline().addLast("http-codec", new HttpServerCodec()); |
| | | // HttpObjectAggregator:将HTTP消息的多个部分合成一条完整的HTTP消息 |
| | | socketChannel.pipeline().addLast("aggregator", new HttpObjectAggregator(65536)); |
| | | // ChunkedWriteHandler:向客户端发送HTML5文件 |
| | | socketChannel.pipeline().addLast("http-chunked", new ChunkedWriteHandler()); |
| | | // 在管道中添加我们自己的接收数据实现方法 |
| | | socketChannel.pipeline().addLast("handler", new WebSocketHandler()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 客户端心跳消息处理 |
| | | * |
| | | * @author TaoNingBo |
| | | * @data 2016年7月26日 |
| | | * @version 1.0 |
| | | */ |
| | | public class ClientPingMessage implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -4953410803742767757L; |
| | | |
| | | /** |
| | | * 客户端标识ID |
| | | */ |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 角色【0:用户,1:司机】 |
| | | */ |
| | | private Integer role; |
| | | |
| | | /** |
| | | * 客户端单点登录标识TOKEN |
| | | */ |
| | | private String token; |
| | | |
| | | public ClientPingMessage() { |
| | | |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getRole() { |
| | | return role; |
| | | } |
| | | |
| | | public void setRole(Integer role) { |
| | | this.role = role != null ? role : 0; |
| | | } |
| | | |
| | | public String getToken() { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) { |
| | | this.token = token; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import io.netty.channel.group.ChannelGroup; |
| | | import io.netty.channel.group.DefaultChannelGroup; |
| | | import io.netty.util.concurrent.GlobalEventExecutor; |
| | | |
| | | public class Global { |
| | | public static ChannelGroup group = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | /** |
| | | * 即时通讯【通讯类型类】 |
| | | * |
| | | * @author TaoNingBo |
| | | * @createDate 2016年6月14日 |
| | | * @version 1.0 |
| | | */ |
| | | public class Method { |
| | | |
| | | /** 心跳【推送】 */ |
| | | public static final String ok = "OK"; |
| | | |
| | | /** 心跳【接收】 */ |
| | | public final static String ping = "PING"; |
| | | |
| | | /** 司机上传位置 */ |
| | | public static final String location = "LOCATION"; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | public class NettyChannelMap { |
| | | |
| | | protected static Map<String, ChannelHandlerContext> map = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * 单点登录存储的通道 |
| | | */ |
| | | public static Map<String, ChannelHandlerContext> ctxMap = new HashMap<>(); |
| | | |
| | | |
| | | private NettyChannelMap() { |
| | | // 放置外部实例化 |
| | | } |
| | | |
| | | /** |
| | | * Get data from source. |
| | | * |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public static ChannelHandlerContext getData(String key) { |
| | | if (map == null) { |
| | | map = new HashMap<String, ChannelHandlerContext>(); |
| | | } |
| | | return map.get(key); |
| | | } |
| | | |
| | | |
| | | public static ChannelHandlerContext getData_(String key) { |
| | | if (ctxMap == null) { |
| | | ctxMap = new HashMap<String, ChannelHandlerContext>(); |
| | | } |
| | | return ctxMap.get(key); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Save data from source. |
| | | * |
| | | * @param key |
| | | * @param val |
| | | */ |
| | | public static synchronized void saveData(String key, ChannelHandlerContext val) { |
| | | map.put(key, val); |
| | | } |
| | | |
| | | /** |
| | | * Determine whether the cache key contains the key. |
| | | * |
| | | * @param key |
| | | * @return true|false |
| | | * @author TaoNingBo |
| | | */ |
| | | public static synchronized boolean containsKey(String key) { |
| | | return map.containsKey(key); |
| | | } |
| | | |
| | | /** |
| | | * Determine whether the cache value contains the value. |
| | | * |
| | | * @param val |
| | | * @return |
| | | */ |
| | | public static synchronized boolean containsVal(ChannelHandlerContext val) { |
| | | return map.containsValue(val); |
| | | } |
| | | |
| | | /** |
| | | * Remove the data resources. |
| | | * |
| | | * @param value |
| | | */ |
| | | @SuppressWarnings("rawtypes") |
| | | public static synchronized void remove(ChannelHandlerContext value) { |
| | | Set<String> strings = map.keySet(); |
| | | for (String key : strings) { |
| | | ChannelHandlerContext channelHandlerContext = map.get(key); |
| | | String s = channelHandlerContext.channel().remoteAddress().toString(); |
| | | String s1 = value.channel().remoteAddress().toString(); |
| | | if (s.equals(s1)) { |
| | | channelHandlerContext.close();//关闭通道 |
| | | map.remove(key); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | public static synchronized void remove_(ChannelHandlerContext value) { |
| | | Set<String> strings = ctxMap.keySet(); |
| | | for (String key : strings) { |
| | | ChannelHandlerContext channelHandlerContext = ctxMap.get(key); |
| | | String s = channelHandlerContext.channel().remoteAddress().toString(); |
| | | String s1 = value.channel().remoteAddress().toString(); |
| | | if (s.equals(s1)) { |
| | | channelHandlerContext.close();//关闭通道 |
| | | ctxMap.remove(key); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Remove the data resources. |
| | | * |
| | | * @param key |
| | | * @author TaoNingBo |
| | | */ |
| | | public static synchronized void remove(String key) { |
| | | map.remove(key); |
| | | } |
| | | |
| | | /** |
| | | * Update the data resources. |
| | | * |
| | | * @param key |
| | | * @param value |
| | | */ |
| | | public static synchronized void update(String key, ChannelHandlerContext value) { |
| | | map.put(key, value); |
| | | } |
| | | |
| | | |
| | | public static synchronized void update_(String key, ChannelHandlerContext value) { |
| | | ctxMap.put(key, value); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import io.netty.channel.ChannelFuture; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | public class NettyMsg { |
| | | public static void main(String[] args) { |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | //用户信息 |
| | | map.put("imgUrl", "1"); |
| | | map.put("nickName", "1"); |
| | | map.put("licensePlate", "1"); |
| | | map.put("phone", 1); |
| | | map.put("driverId", 1); |
| | | map.put("carColor", "1"); |
| | | map.put("modelName", "1"); |
| | | map.put("brandName", "1"); |
| | | map.put("driverOrderNums", 1); |
| | | map.put("score", 1); |
| | | |
| | | |
| | | map.put("id", 1); |
| | | map.put("orderNum", "123456"); |
| | | map.put("startAddress", "测试"); |
| | | map.put("endAddress", "测试1"); |
| | | map.put("departureTime", 1533608196000L); |
| | | map.put("type", 1); |
| | | map.put("mileage", 1); |
| | | map.put("mileageMoney", 10); |
| | | map.put("duration", 10); |
| | | map.put("durationMoney", 10); |
| | | map.put("nightMoney", 1); |
| | | map.put("serverMoney", 1); |
| | | map.put("nightMileage", 10); |
| | | map.put("longMileage", 10); |
| | | map.put("longDurationMoney", 10); |
| | | map.put("orderMoney", 10); |
| | | map.put("payMoney", 10); |
| | | map.put("couponsMoney", 10); |
| | | System.out.println(setMsg(Method.ping, new HashMap<String, Object>())); |
| | | } |
| | | |
| | | /** |
| | | * 返回一个正确数据 |
| | | * |
| | | * @param method |
| | | * @param data |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static String setMsg(String method, Map<String, Object> data) { |
| | | StringBuffer json = new StringBuffer(); |
| | | json.append(getHeader(200, "SUCCESS", method)); |
| | | json.append(JSON.toJSONString(data)); |
| | | json.append("}"); |
| | | //return JSON.toJSONString(json); |
| | | return json.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 返回一个正确数据 |
| | | * |
| | | * @param method |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public static String setMsg(String method, List<Map<String, Object>> data) { |
| | | StringBuffer json = new StringBuffer(); |
| | | json.append(getHeader(200, "SUCCESS", method)); |
| | | List<JSONObject> jsonList = new ArrayList<JSONObject>(); |
| | | for (Map<String, Object> map : data) { |
| | | JSONObject dataJson = new JSONObject(map); |
| | | jsonList.add(dataJson); |
| | | } |
| | | json.append(jsonList); |
| | | json.append("}"); |
| | | |
| | | // return JSON.toJSONString(json); |
| | | return json.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 返回一个错误数据 |
| | | * |
| | | * @param method |
| | | * @param data |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static String setErrMsg(String method, String data) { |
| | | StringBuffer json = new StringBuffer(); |
| | | json.append(getHeader(-1, "FAILURE", method)); |
| | | json.append("\"" + data + "\""); |
| | | json.append("}"); |
| | | // return JSON.toJSONString(json); |
| | | return json.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 生成一个返回JSON的头 |
| | | * |
| | | * @param code |
| | | * @param msg |
| | | * @param method |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | private static String getHeader(int code, String msg, String method) { |
| | | StringBuffer header = new StringBuffer(); |
| | | header.append("{"); |
| | | header.append("\"code\":\"" + code); |
| | | header.append("\",\"msg\":\"" + msg); |
| | | header.append("\",\"method\":\"" + method); |
| | | header.append("\",\"data\":"); |
| | | return header.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 发送消息给客户端 |
| | | * |
| | | * @param cacheType |
| | | * @param id |
| | | * @param msg |
| | | * @author TaoNingBo |
| | | */ |
| | | public static void sendMsg(String cacheType, Integer id, String msg) { |
| | | //NettyServerController.sendMsgToClient(NettyChannelMap.getData(cacheType + id), setMsg(method, data)); |
| | | NettyWebSocketController.sendMsgToClient(cacheType, id, msg); |
| | | } |
| | | |
| | | |
| | | public static void resendMsg(String token) { |
| | | String msg = NettyWebSocketController.table.get(token); |
| | | ChannelHandlerContext ctx = NettyChannelMap.getData(token); |
| | | if (null != msg && !"".equals(msg) && ctx != null && ctx.channel().isActive()) { |
| | | ByteBuf buffer = Unpooled.copiedBuffer((msg).getBytes()); |
| | | ChannelFuture sync; |
| | | try { |
| | | sync = ctx.writeAndFlush(buffer).sync(); |
| | | System.err.println("重发异常推送状态" + sync.isSuccess() + ",位置:" + token + ",消息内容:" + msg); |
| | | if (!sync.isSuccess()) { |
| | | resendMsg(token); |
| | | System.err.println("重发异常推送不成功,将继续推送" + msg); |
| | | } |
| | | NettyWebSocketController.table.remove(token); |
| | | } catch (Exception e) { |
| | | resendMsg(token); |
| | | System.err.println("重发推送发生异常,记录:" + msg); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import io.netty.bootstrap.ServerBootstrap; |
| | | import io.netty.channel.Channel; |
| | | import io.netty.channel.EventLoopGroup; |
| | | import io.netty.channel.nio.NioEventLoopGroup; |
| | | import io.netty.channel.socket.nio.NioServerSocketChannel; |
| | | |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | |
| | | /** |
| | | * 即时通讯服务启动类 |
| | | * |
| | | * @date 2016年6月25日 |
| | | * @version 1.0 |
| | | */ |
| | | public class NettyServer0 { |
| | | |
| | | /** |
| | | * 延迟启动设置 |
| | | * |
| | | * NettyServer启动方法. |
| | | */ |
| | | public void bind() { |
| | | final Thread thread = new Thread(new NettyRunnable()); |
| | | Timer timer = new Timer(); |
| | | timer.schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | thread.start(); |
| | | } |
| | | }, 1000 * 2); |
| | | } |
| | | |
| | | /** |
| | | * 即时通讯服务启动 |
| | | * |
| | | * @date 2016年6月24日 |
| | | * @version 1.0 |
| | | */ |
| | | public class NettyRunnable implements Runnable { |
| | | |
| | | /** |
| | | * 获取即时通讯启动端口 |
| | | */ |
| | | @Override |
| | | public void run() { |
| | | System.out.println("===========================Netty端口启动========"); |
| | | // Boss线程:由这个线程池提供的线程是boss种类的,用于创建、连接、绑定socket, |
| | | // (有点像门卫)然后把这些socket传给worker线程池。 |
| | | // 在服务器端每个监听的socket都有一个boss线程来处理。在客户端,只有一个boss线程来处理所有的socket。 |
| | | EventLoopGroup bossGroup = new NioEventLoopGroup(); |
| | | // Worker线程:Worker线程执行所有的异步I/O,即处理操作 |
| | | EventLoopGroup workrGroup = new NioEventLoopGroup(); |
| | | try { |
| | | |
| | | // ServerBootstrap 启动NIO服务的辅助启动类,负责初始话netty服务器,并且开始监听端口的socket请求 |
| | | ServerBootstrap b = new ServerBootstrap(); |
| | | b.group(bossGroup, workrGroup); |
| | | // 设置非阻塞,用它来建立新accept的连接,用于构造serversocketchannel的工厂类 |
| | | b.channel(NioServerSocketChannel.class); |
| | | // ChildChannelHandler 对出入的数据进行的业务操作,其继承ChannelInitializer |
| | | b.childHandler(new ChildChannelHandler()); |
| | | System.out.println("服务端开启等待客户端连接 ... ..."); |
| | | Channel ch = b.bind(9595).sync().channel(); |
| | | ch.closeFuture().sync(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | bossGroup.shutdownGracefully(); |
| | | workrGroup.shutdownGracefully(); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | |
| | | import com.alibaba.csp.sentinel.util.StringUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import io.netty.channel.ChannelFuture; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; |
| | | |
| | | import java.util.Hashtable; |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | public class NettyWebSocketController { |
| | | |
| | | public static Hashtable<String, Hashtable<ChannelHandlerContext, String>> map = new Hashtable<String, Hashtable<ChannelHandlerContext, String>>(); |
| | | |
| | | public static Hashtable<String, String> table; |
| | | |
| | | static { |
| | | if (table == null) { |
| | | table = new Hashtable<>(); |
| | | } |
| | | } |
| | | |
| | | public static boolean isdebug = false; |
| | | public static int i = 0; |
| | | |
| | | |
| | | /** |
| | | * 判断客户端要执行什么操作 |
| | | * |
| | | * @param ctx |
| | | * @param msg |
| | | * @author TaoNingBo |
| | | */ |
| | | public void JudgeOperation(ChannelHandlerContext ctx, String msg) { |
| | | try { |
| | | // 验证即时通讯命令是否正确有效 |
| | | if (StringUtils.isEmpty(msg)) { |
| | | return; |
| | | } |
| | | String msgStr = msg.toString(); |
| | | if (msgStr.indexOf("{") == -1 || msgStr.indexOf("}") == -1 || msgStr.indexOf("code") == -1 || msgStr.indexOf("msg") == -1 || msgStr.indexOf("data") == -1 || msgStr.indexOf("method") == -1) { |
| | | return; |
| | | } |
| | | if (isdebug) { |
| | | // System.out.println("<<<--receive-->>>111" + msg); |
| | | } |
| | | |
| | | // 获取socket信息,保存相应的socket |
| | | JSONObject jsonMsg = JSONObject.parseObject(msg.toString()); |
| | | |
| | | System.out.println(jsonMsg); |
| | | |
| | | int code = jsonMsg.getIntValue("code"); |
| | | String message = jsonMsg.getString("msg"); |
| | | String method = jsonMsg.getString("method"); |
| | | if (code != 200 || !message.equals("SUCCESS")) { |
| | | return; |
| | | } |
| | | JSONObject jsonCon = JSONObject.parseObject(jsonMsg.get("data").toString()); |
| | | // ############################### 心跳 ############################ |
| | | // 心跳 |
| | | if (method.equals(Method.ping)) { |
| | | String token = jsonCon.getString("token"); |
| | | String userId1 = jsonCon.getString("userId"); |
| | | if (StringUtil.isNotEmpty(userId1)) { |
| | | //确保账号在单个设备上登录 |
| | | if (StringUtil.isNotEmpty(token)) { |
| | | //存储单点登录的通道 |
| | | NettyChannelMap.update_(token.substring(0, 23), ctx); |
| | | JSONObject msg_ = new JSONObject(); |
| | | msg_.put("code", 200); |
| | | msg_.put("msg", "SUCCESS"); |
| | | msg_.put("method", "OFFLINE"); |
| | | msg_.put("data", new Object()); |
| | | sendMsgToClient(ctx, msg_.toJSONString()); |
| | | TimerTask timerTask = new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | NettyChannelMap.remove_(ctx); |
| | | } |
| | | }; |
| | | Timer timer = new Timer(); |
| | | timer.schedule(timerTask, 3000); |
| | | timer.cancel(); |
| | | } |
| | | |
| | | //存储业务使用的通道 |
| | | if (null != ctx && ctx.channel().isActive()) { |
| | | NettyChannelMap.update("Applets" + userId1, ctx); |
| | | // String s = NettyMsg.setMsg(Method.ok, new HashMap<String, Object>()); |
| | | // ctx.writeAndFlush(Unpooled.copiedBuffer((s).getBytes())); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | if (isdebug) { |
| | | NettyWebSocketController.sendMsgToClient(ctx, "__error__" + msg.toString()); |
| | | } |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 向客户端发送消息 |
| | | * |
| | | * @param ctx |
| | | * @param msg |
| | | * @author TaoNingBo |
| | | */ |
| | | public static void sendMsgToClient(ChannelHandlerContext ctx, String msg) { |
| | | // System.out.println(ctx.channel().isActive()); |
| | | if (ctx != null && ctx.channel().isActive()) { |
| | | ByteBuf buffer = Unpooled.copiedBuffer((msg).getBytes()); |
| | | ChannelFuture sync; |
| | | try { |
| | | sync = ctx.channel().writeAndFlush(new TextWebSocketFrame(msg)).sync(); |
| | | if (!sync.isSuccess()) { |
| | | boolean b = true; |
| | | for (int i = 0; i < 10; i++) { |
| | | ctx.wait(3000); |
| | | sync = ctx.channel().write(new TextWebSocketFrame(msg)).sync(); |
| | | if (sync.isSuccess()) { |
| | | b = false; |
| | | break; |
| | | } |
| | | System.err.println("小程序-》推送不成功,将继续推送" + msg); |
| | | } |
| | | if (b) { |
| | | NettyChannelMap.remove(ctx); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | System.err.println("小程序-》推送发生异常,记录:" + msg); |
| | | NettyChannelMap.remove(ctx); |
| | | } |
| | | if (isdebug) { |
| | | System.err.println("小程序-》 <<<--send-->>>" + msg); |
| | | } |
| | | } else { |
| | | System.err.println("小程序-》推送失败,长连接不存在"); |
| | | NettyChannelMap.remove(ctx); |
| | | } |
| | | } |
| | | |
| | | // **链接断开 将推送消息记录 |
| | | public static void sendMsgToClient(String cacheType, Integer id, String msg) { |
| | | ChannelHandlerContext ctx = NettyChannelMap.getData(cacheType + id); |
| | | if (ctx != null) { |
| | | ChannelFuture sync; |
| | | try { |
| | | sync = ctx.channel().write(new TextWebSocketFrame(msg)).sync(); |
| | | if (!sync.isSuccess()) { |
| | | for (int i = 0; i < 10; i++) { |
| | | sync = ctx.channel().write(new TextWebSocketFrame(msg)).sync(); |
| | | ; |
| | | if (!sync.isSuccess()) { |
| | | sync = ctx.channel().write(new TextWebSocketFrame(msg)).sync(); |
| | | System.err.println("推送不成功,将继续推送" + msg); |
| | | if (i == 9) { |
| | | table.put(cacheType + id, msg); |
| | | ctx.close(); |
| | | System.err.println("推送发生异常,记录:" + msg); |
| | | } |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | table.put(cacheType + id, msg); |
| | | System.err.println("推送发生异常,记录:" + msg); |
| | | } |
| | | if (isdebug) { |
| | | System.err.println("<<<--send-->>>" + msg); |
| | | } |
| | | } else { |
| | | table.put(cacheType + id, msg); |
| | | System.err.println("链接断开,记录:id=" + cacheType + id + ",消息:" + msg); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.netty.buffer.ByteBuf; |
| | | import io.netty.buffer.Unpooled; |
| | | import io.netty.channel.*; |
| | | import io.netty.handler.codec.http.*; |
| | | import io.netty.handler.codec.http.websocketx.*; |
| | | import io.netty.handler.timeout.IdleState; |
| | | import io.netty.handler.timeout.IdleStateEvent; |
| | | import io.netty.util.CharsetUtil; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | public class WebSocketHandler extends SimpleChannelInboundHandler<Object> { |
| | | /** |
| | | * 用于websocket握手的处理类 |
| | | */ |
| | | private WebSocketServerHandshaker handshaker; |
| | | |
| | | private static final String WEB_SOCKET_URL = "ws://localhost:9595/websocket"; |
| | | |
| | | |
| | | // @Override |
| | | // protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception { |
| | | // if (msg instanceof FullHttpRequest) { |
| | | // // websocket连接请求 |
| | | // handleHttpRequest(ctx, (FullHttpRequest)msg); |
| | | // } else if (msg instanceof WebSocketFrame) { |
| | | // // websocket业务处理 |
| | | // handleWebSocketRequest(ctx, (WebSocketFrame)msg); |
| | | // } |
| | | // } |
| | | |
| | | @Override |
| | | public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { |
| | | ctx.flush(); |
| | | } |
| | | |
| | | /** |
| | | * 心跳 |
| | | */ |
| | | @Override |
| | | public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { |
| | | if (evt instanceof IdleStateEvent) { |
| | | IdleStateEvent event = (IdleStateEvent) evt; |
| | | if (event.state().equals(IdleState.READER_IDLE)) { |
| | | // |
| | | } else if (event.state().equals(IdleState.WRITER_IDLE)) { |
| | | // |
| | | } else if (event.state().equals(IdleState.ALL_IDLE)) { |
| | | String msg = NettyMsg.setMsg(Method.ok, new HashMap<String, Object>()); |
| | | if (ctx != null && ctx.channel().isActive()) { |
| | | ctx.writeAndFlush(Unpooled.copiedBuffer((msg).getBytes())); |
| | | } |
| | | } |
| | | } |
| | | // super.userEventTriggered(ctx, evt); |
| | | } |
| | | |
| | | @Override |
| | | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { |
| | | ctx.close(); |
| | | } |
| | | |
| | | private void handleHttpRequest(ChannelHandlerContext ctx, FullHttpRequest req) { |
| | | // Http解码失败,向服务器指定传输的协议为Upgrade:websocket |
| | | if (!req.getDecoderResult().isSuccess() || !("websocket").equals(req.headers().get("Upgrade"))) { |
| | | sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST)); |
| | | return; |
| | | } |
| | | // 客户端连接信息 |
| | | // String s = String.valueOf(ctx.channel().remoteAddress()); |
| | | // int i = s.indexOf(":"); |
| | | // String substring = s.substring(1, i); |
| | | // NettyChannelMap.map.put(substring, ctx); |
| | | // 握手相应处理,创建websocket握手的工厂类, |
| | | WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(WEB_SOCKET_URL, null, false); |
| | | // 根据工厂类和HTTP请求创建握手类 |
| | | handshaker = wsFactory.newHandshaker(req); |
| | | if (handshaker == null) { |
| | | // 不支持websocket |
| | | WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel()); |
| | | } else { |
| | | // 通过它构造握手响应消息返回给客户端 |
| | | handshaker.handshake(ctx.channel(), req); |
| | | } |
| | | } |
| | | |
| | | private void handleWebSocketRequest(ChannelHandlerContext ctx, WebSocketFrame req) throws Exception { |
| | | if (req instanceof CloseWebSocketFrame) { |
| | | // 关闭websocket连接 |
| | | handshaker.close(ctx.channel(), (CloseWebSocketFrame) req.retain()); |
| | | return; |
| | | } |
| | | if (req instanceof PingWebSocketFrame) { |
| | | ctx.channel().write(new PongWebSocketFrame(req.content().retain())); |
| | | return; |
| | | } |
| | | if (!(req instanceof TextWebSocketFrame)) { |
| | | throw new UnsupportedOperationException("当前只支持文本消息,不支持二进制消息"); |
| | | } |
| | | if (ctx == null || this.handshaker == null || ctx.isRemoved()) { |
| | | throw new Exception("尚未握手成功,无法向客户端发送WebSocket消息"); |
| | | } |
| | | String requestmsg = ((TextWebSocketFrame) req).text(); |
| | | |
| | | System.out.println("客户端消息解析:" + requestmsg); |
| | | if (NettyChannelMap.map.containsKey(requestmsg)) { |
| | | NettyChannelMap.map.remove(requestmsg); |
| | | NettyChannelMap.map.put(requestmsg, ctx); |
| | | } else { |
| | | NettyChannelMap.map.put(requestmsg, ctx); |
| | | } |
| | | //给连接的客户端返回数据 |
| | | //返回心跳 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("method", Method.ok); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("data", new JSONObject()); |
| | | // TextWebSocketFrame tws = new TextWebSocketFrame("您有一条新的订单,请及时处理!"); |
| | | TextWebSocketFrame tws = new TextWebSocketFrame(jsonObject.toJSONString()); |
| | | // ctx.channel().writeAndFlush(tws); |
| | | // 小程序心跳处理 |
| | | new NettyWebSocketController().JudgeOperation(ctx, requestmsg); |
| | | |
| | | // 群发服务端心跳响应 |
| | | // Global.group.writeAndFlush(new TextWebSocketFrame((tws).text())); |
| | | // Global.group.write(new TextWebSocketFrame((tws).text())); |
| | | } |
| | | |
| | | private void sendHttpResponse(ChannelHandlerContext ctx, FullHttpRequest req, FullHttpResponse res) { |
| | | // BAD_REQUEST(400) 客户端请求错误返回的应答消息 |
| | | if (res.getStatus().code() != 200) { |
| | | ByteBuf buf = Unpooled.copiedBuffer(res.getStatus().toString(), CharsetUtil.UTF_8); |
| | | res.content().writeBytes(buf); |
| | | buf.release(); |
| | | } |
| | | //服务端向客户端发送数据 |
| | | ChannelFuture f = ctx.channel().writeAndFlush(res); |
| | | // 非法连接直接关闭连接 |
| | | if (res.getStatus().code() != 200) { |
| | | f.addListener(ChannelFutureListener.CLOSE); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void channelActive(ChannelHandlerContext ctx) throws Exception { |
| | | Global.group.add(ctx.channel()); |
| | | // NettyChannelMap.map.put() |
| | | System.err.println("客户端与服务器端开启"); |
| | | } |
| | | |
| | | @Override |
| | | public void channelInactive(ChannelHandlerContext ctx) throws Exception { |
| | | Global.group.remove(ctx.channel()); |
| | | NettyChannelMap.remove(ctx); |
| | | System.err.println("客户端与服务器链接关闭"); |
| | | } |
| | | |
| | | @Override |
| | | public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { |
| | | if (msg instanceof FullHttpRequest) { |
| | | // websocket连接请求 |
| | | handleHttpRequest(ctx, (FullHttpRequest) msg); |
| | | } else if (msg instanceof WebSocketFrame) { |
| | | // websocket业务处理 |
| | | System.out.println("客户端发来消息:" + ctx.channel().remoteAddress()); |
| | | handleWebSocketRequest(ctx, (WebSocketFrame) msg); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { |
| | | System.out.println("客户端消息:" + msg); |
| | | if (msg instanceof FullHttpRequest) { |
| | | // websocket连接请求 |
| | | handleHttpRequest(ctx, (FullHttpRequest) msg); |
| | | } else if (msg instanceof WebSocketFrame) { |
| | | // websocket业务处理 |
| | | handleWebSocketRequest(ctx, (WebSocketFrame) msg); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void handlerAdded(ChannelHandlerContext ctx) throws Exception { |
| | | Channel channel = ctx.channel(); |
| | | System.err.println("有新的客户端与服务器发生连接。客户端地址:" + channel.remoteAddress()); |
| | | // channelGroup.add(channel); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.netty; |
| | | |
| | | import javax.net.ssl.KeyManagerFactory; |
| | | import javax.net.ssl.SSLContext; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.security.KeyStore; |
| | | |
| | | public class createSSLContext { |
| | | |
| | | /** |
| | | * 获取SSLContext |
| | | * @param type |
| | | * @param path |
| | | * @param password |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static SSLContext createSSLContext(String type , String path , String password) throws Exception { |
| | | KeyStore ks = KeyStore.getInstance(type); /// "JKS" |
| | | InputStream ksInputStream = new FileInputStream(path); /// 证书存放地址 |
| | | ks.load(ksInputStream, password.toCharArray()); |
| | | //KeyManagerFactory充当基于密钥内容源的密钥管理器的工厂。 |
| | | KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());//getDefaultAlgorithm:获取默认的 KeyManagerFactory 算法名称。 |
| | | kmf.init(ks, password.toCharArray()); |
| | | //SSLContext的实例表示安全套接字协议的实现,它充当用于安全套接字工厂或 SSLEngine 的工厂。 |
| | | SSLContext sslContext = SSLContext.getInstance("TLS"); |
| | | sslContext.init(kmf.getKeyManagers(), null, null); |
| | | return sslContext; |
| | | } |
| | | } |
| | |
| | | region.getChildren().add(e); |
| | | } |
| | | }); |
| | | for (Menu region : treeData) { |
| | | List<Menu> children = region.getChildren(); |
| | | for (Menu child : children) { |
| | | child.setChildren(new ArrayList<>()); |
| | | } |
| | | } |
| | | // for (Menu region : treeData) { |
| | | // List<Menu> children = region.getChildren(); |
| | | // for (Menu child : children) { |
| | | // child.setChildren(new ArrayList<>()); |
| | | // } |
| | | // } |
| | | return treeData; |
| | | } |
| | | |
| | |
| | | import com.ruoyi.admin.vo.*; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.order.api.entity.ServeRecord; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | |
| | | |
| | | private void workerInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | MasterWorker worker = masterWorkerService.getById(order.getServerId()); |
| | | OrderByWorkerVO orderByWorker = new OrderByWorkerVO(); |
| | | if (null != worker) { |
| | | OrderByWorkerVO orderByWorker = new OrderByWorkerVO(); |
| | | orderByWorker.setProfilePicture(worker.getProfilePicture()); |
| | | orderByWorker.setName(worker.getRealName()); |
| | | orderByWorker.setPhone(worker.getPhone()); |
| | | orderByWorker.setSex(worker.getSex()); |
| | | result.setWorkerInfo(orderByWorker); |
| | | } else { |
| | | orderByWorker.setName(order.getServerName()); |
| | | orderByWorker.setPhone(order.getServerPhone()); |
| | | } |
| | | result.setWorkerInfo(orderByWorker); |
| | | } |
| | | |
| | | private void serveInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | RecoveryServe recoveryServe = recoveryServeService.getById(order.getServeId()); |
| | | if (null == recoveryServe) { |
| | | throw new GlobalException("回收服务信息异常,请重试"); |
| | | } |
| | | RecoveryClassify recoveryClassify = recoveryClassifyService.getById(recoveryServe.getClassifyId()); |
| | | if (null == recoveryClassify) { |
| | | throw new GlobalException("回收服务分类信息异常,请重试"); |
| | | } |
| | | OrderByServeVO orderByServe = new OrderByServeVO(); |
| | | orderByServe.setServeName(recoveryServe.getServeName()); |
| | | orderByServe.setCover(recoveryServe.getCover()); |
| | | orderByServe.setSupClassify(recoveryClassify.getSupClassify()); |
| | | orderByServe.setSubClassify(recoveryClassify.getSubClassify()); |
| | | if (null != recoveryServe) { |
| | | RecoveryClassify recoveryClassify = recoveryClassifyService.getById(recoveryServe.getClassifyId()); |
| | | orderByServe.setServeName(recoveryServe.getServeName()); |
| | | orderByServe.setCover(recoveryServe.getCover()); |
| | | if (null != recoveryClassify) { |
| | | orderByServe.setSupClassify(recoveryClassify.getSupClassify()); |
| | | orderByServe.setSubClassify(recoveryClassify.getSubClassify()); |
| | | } |
| | | } else { |
| | | orderByServe.setServeName(order.getServeName()); |
| | | } |
| | | orderByServe.setPrice(order.getServePrice()); |
| | | result.setServeInfo(orderByServe); |
| | | } |
| | | |
| | | private void orderInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常,请重试"); |
| | | } |
| | | // 订单信息 |
| | | OrderInfoVO orderInfo = new OrderInfoVO(); |
| | | orderInfo.setOrderNumber(order.getOrderNumber()); |
| | | orderInfo.setPlaceOrderTime(order.getCreateTime()); |
| | | orderInfo.setState(order.getState()); |
| | | if (null != order) { |
| | | orderInfo.setOrderNumber(order.getOrderNumber()); |
| | | orderInfo.setPlaceOrderTime(order.getCreateTime()); |
| | | orderInfo.setState(order.getState()); |
| | | } |
| | | result.setOrderInfo(orderInfo); |
| | | } |
| | | |
| | |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | |
| | | /** |
| | | * @author hjl |
| | | */ |
| | | @ServerEndpoint(value = "/websocket/{workerId}") |
| | | //@ServerEndpoint(value = "/websocket/{workerId}") |
| | | @Component |
| | | public class WebSocketServer { |
| | | |
| | |
| | | /** |
| | | * 静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 |
| | | */ |
| | | private static int onlineCount = 0; |
| | | private static final AtomicInteger ONLINE_COUNT = new AtomicInteger(0); |
| | | |
| | | /** |
| | | * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象 |
| | |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session, @PathParam("workerId") String workerId) { |
| | | this.session = session; |
| | | this.userId = workerId; |
| | | if (WEB_SOCKET_MAP.containsKey(workerId)) { |
| | | WEB_SOCKET_MAP.remove(workerId); |
| | | WEB_SOCKET_MAP.put(workerId, new WebSocketClient(session, workerId)); |
| | | //加入set中 |
| | | if (null != workerId && !"".equals(workerId.trim())) { |
| | | this.session = session; |
| | | this.userId = workerId; |
| | | if (WEB_SOCKET_MAP.containsKey(workerId)) { |
| | | WEB_SOCKET_MAP.remove(workerId); |
| | | WEB_SOCKET_MAP.put(workerId, new WebSocketClient(session, workerId)); |
| | | //加入set中 |
| | | } else { |
| | | WEB_SOCKET_MAP.put(workerId, new WebSocketClient(session, workerId)); |
| | | //加入set中 |
| | | addOnlineCount(); |
| | | } |
| | | log.info("用户 " + workerId + " 已连接: 当前在线人数为:" + getOnlineCount()); |
| | | try { |
| | | sendMessage("socket连接成功!"); |
| | | } catch (IOException e) { |
| | | log.error("用户:" + workerId + ",网络异常!!!!!!"); |
| | | } |
| | | } else { |
| | | WEB_SOCKET_MAP.put(workerId, new WebSocketClient(session, workerId)); |
| | | //加入set中 |
| | | addOnlineCount(); |
| | | } |
| | | log.info("用户 " + workerId + " 已连接: 当前在线人数为:" + getOnlineCount()); |
| | | try { |
| | | sendMessage("socket连接成功!"); |
| | | } catch (IOException e) { |
| | | log.error("用户:" + workerId + ",网络异常!!!!!!"); |
| | | log.info("用户 " + workerId + " 已连接: 当前在线人数为:" + getOnlineCount()); |
| | | try { |
| | | sendMessage("socket连接失败!"); |
| | | } catch (IOException e) { |
| | | log.error("用户:" + workerId + ",网络异常!!!!!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public static synchronized int getOnlineCount() { |
| | | return onlineCount; |
| | | return ONLINE_COUNT.get(); |
| | | } |
| | | |
| | | public static synchronized void addOnlineCount() { |
| | | WebSocketServer.onlineCount++; |
| | | ONLINE_COUNT.incrementAndGet(); |
| | | } |
| | | |
| | | public static synchronized void subOnlineCount() { |
| | | WebSocketServer.onlineCount--; |
| | | ONLINE_COUNT.decrementAndGet(); |
| | | } |
| | | } |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | // 数据库连接url |
| | | String dbUrl = "jdbc:mysql://localhost:3306/secondary_recovery"; |
| | | String dbUrl = "jdbc:mysql://localhost:3306/secondary_recovery_order"; |
| | | // 数据库用户名 |
| | | String dbUsername = "root"; |
| | | // 数据库密码 |
| | |
| | | // 实体类中时间策略 |
| | | .dateType(DateType.ONLY_DATE) |
| | | // 生成日期 |
| | | .commentDate("yyyy-MM-dd") |
| | | .commentDate("yyyy-MM-dd HH:mm") |
| | | ) |
| | | |
| | | // 包配置 |
| | | .packageConfig(builder -> builder |
| | | // 父包名 |
| | | .parent("com.ruoyi.user") |
| | | .parent("com.ruoyi.order") |
| | | // 父包模块名 注释即为无 |
| | | // .moduleName(scanner("模块名")) |
| | | // Entity 包名 |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.request.ChangeDispatchRequest; |
| | | import com.ruoyi.order.service.ChangeDispatchService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @param request 查询参数 |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @ApiOperation(value = "订单改派分页查询列表", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/page") |
| | | @PostMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "师傅名称", name = "workerName", dataType = "String"), |
| | | @ApiImplicitParam(value = "订单编号", name = "orderNumber", dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<ChangeDispatch>> queryPageList(@RequestParam(value = "workerName", required = false) String workerName, |
| | | @RequestParam(value = "orderNumber", required = false) String orderNumber, |
| | | @RequestParam(value = "userName", required = false) String userName, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryChainWrapper<ChangeDispatch> wrapper = changeDispatchService.lambdaQuery(); |
| | | wrapper = StringUtils.isNotBlank(workerName) ? wrapper.like(ChangeDispatch::getWorkerName, workerName) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(orderNumber) ? wrapper.like(ChangeDispatch::getOrderNumber, orderNumber) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(userName) ? wrapper.like(ChangeDispatch::getUserName, userName) : wrapper; |
| | | Page<ChangeDispatch> page = wrapper.eq(ChangeDispatch::getIsDelete, 0) |
| | | .orderByDesc(ChangeDispatch::getCreateTime).page(Page.of(pageNum, pageSize)); |
| | | for (ChangeDispatch record : page.getRecords()) { |
| | | String orderId = record.getOrderId(); |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null != order) { |
| | | record.setOrderTime(order.getCreateTime()); |
| | | } |
| | | } |
| | | public R<Page<ChangeDispatch>> queryPageList(@RequestBody ChangeDispatchRequest request) { |
| | | Page<ChangeDispatch> page = changeDispatchService.queryPageList(request, Page.of(request.getPageNum(), |
| | | request.getPageSize())); |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | .eq(Order::getId, changeDispatch.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | order.setState(Constants.ONE); |
| | | Integer serverId = order.getServerId(); |
| | | return R.ok(update && orderService.updateById(order)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.request.EvaluatePageRequest; |
| | | import com.ruoyi.order.request.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.service.EvaluateService; |
| | | import com.ruoyi.order.service.OrderService; |
| | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @param request 筛选参数 |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @ApiOperation(value = "订单评价分页查询列表", tags = {"后台"}) |
| | | @GetMapping(value = "/page") |
| | | @PostMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "评价用户", name = "userNo", dataType = "String"), |
| | | @ApiImplicitParam(value = "订单编号", name = "orderNumber", dataType = "String"), |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<EvaluatePageVO>> queryPageList(@RequestParam(value = "userNo", required = false) String userNo, |
| | | @RequestParam(value = "orderNumber", required = false) String orderNumber, |
| | | @RequestParam(value = "workerName", required = false) String workerName, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(evaluateService.queryPageList(userNo, orderNumber, workerName, Page.of(pageNum, pageSize))); |
| | | public R<Page<EvaluatePageVO>> queryPageList(@RequestBody EvaluatePageRequest request) { |
| | | return R.ok(evaluateService.queryPageList(request, Page.of(request.getPageNum(), request.getPageSize()))); |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.entity.*; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.order.vo.OldDataPhotoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/oldData") |
| | | @Api(tags = {"数据迁移"}) |
| | | public class OldDataController { |
| | | |
| | | @Resource |
| | | private DataOrderService dataOrderService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | @Resource |
| | | private DataTechnicianService technicianService; |
| | | @Resource |
| | | private DataGoodsService goodsService; |
| | | |
| | | @GetMapping("/order") |
| | | @ApiOperation(value = "订单数据迁移", tags = {"数据迁移"}) |
| | | public R<String> oldData(@RequestParam("index") Integer index, |
| | | @RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize) { |
| | | if (null != index && index.equals(8080)) { |
| | | try { |
| | | List<Order> orderList = new ArrayList<>(); |
| | | List<Evaluate> evaluateList = new ArrayList<>(); |
| | | List<ServeRecord> serveRecordList = new ArrayList<>(); |
| | | List<DataOrder> list = dataOrderService.page(Page.of(pageNum, pageSize)).getRecords(); |
| | | for (DataOrder data : list) { |
| | | Long id = data.getId(); |
| | | Boolean orderType = data.getOrderType(); |
| | | String orderNo = data.getOrderNo(); |
| | | Long productId = data.getProductId(); |
| | | Long uid = data.getUid(); |
| | | Long serverUid = data.getServerUid(); |
| | | BigDecimal price = data.getPrice(); |
| | | BigDecimal btPrice = data.getBtPrice(); |
| | | String username = data.getUsername(); |
| | | String phone = data.getPhone(); |
| | | String city = data.getCity(); |
| | | String address = data.getAddress(); |
| | | BigDecimal latitude = data.getLatitude(); |
| | | BigDecimal longitude = data.getLongitude(); |
| | | Date smTime = data.getSmTime(); |
| | | String remark = data.getRemark(); |
| | | String cancelRemark = data.getCancelRemark(); |
| | | Integer pjLevel = data.getPjLevel(); |
| | | String pjRemark = data.getPjRemark(); |
| | | String completeTime = data.getCompleteTime(); |
| | | String yhqrtp = data.getYhqrtp(); |
| | | String jjmptp = data.getJjmptp(); |
| | | String njtp = data.getNjtp(); |
| | | String wjhqttp = data.getWjhqttp(); |
| | | Integer status = data.getStatus(); |
| | | Boolean pjStatus = data.getPjStatus(); |
| | | // 新订单信息 |
| | | Order order = new Order(); |
| | | order.setId(String.valueOf(id)); |
| | | order.setCity(city); |
| | | order.setOrderNumber(orderNo); |
| | | order.setServeId(serverUid.intValue()); |
| | | // 回收服务信息 |
| | | DataGoods dataGoods = goodsService.getById(productId); |
| | | if (null != dataGoods) { |
| | | order.setServeName(dataGoods.getName()); |
| | | order.setServePrice(new BigDecimal(dataGoods.getPgPrice())); |
| | | } |
| | | order.setReservationName(username); |
| | | order.setReservationPhone(phone); |
| | | order.setReservationAddress(address); |
| | | // 时间格式化 |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:ss"); |
| | | order.setTime(simpleDateFormat.format(smTime)); |
| | | DataTechnician technician = technicianService.getById(serverUid); |
| | | order.setServerId(serverUid.intValue()); |
| | | if (null != technician) { |
| | | order.setServerName(technician.getUsername()); |
| | | order.setServerPhone(technician.getPhone()); |
| | | } |
| | | order.setReservationRemark(remark); |
| | | if (null != btPrice) { |
| | | order.setOrderMoney(price.add(btPrice)); |
| | | } else { |
| | | order.setOrderMoney(price); |
| | | } |
| | | if (Constants.ONE.equals(status)) { |
| | | order.setState(Constants.ZERO); |
| | | } else if (Constants.TWO.equals(status)) { |
| | | order.setState(Constants.ONE); |
| | | } else if (Constants.THREE.equals(status)) { |
| | | order.setState(Constants.TWO); |
| | | } else if (Constants.FOUR.equals(status)) { |
| | | order.setState(Constants.THREE); |
| | | } else if (Constants.FIVE.equals(status)) { |
| | | order.setState(Constants.FOUR); |
| | | order.setCancelReason(cancelRemark); |
| | | } |
| | | order.setAcceptTime(new Date()); |
| | | if (orderType) { |
| | | order.setType(Constants.ZERO); |
| | | } else { |
| | | order.setType(Constants.ONE); |
| | | } |
| | | order.setLongitude(longitude.doubleValue()); |
| | | order.setLatitude(latitude.doubleValue()); |
| | | order.setArriveTime(new Date()); |
| | | // 时间转换 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | Date date = sdf.parse(completeTime); |
| | | order.setCompleteTime(date); |
| | | } catch (ParseException e) { |
| | | order.setCompleteTime(null); |
| | | } |
| | | order.setIsWithdrawal(Constants.ONE); |
| | | order.setSubsidy(btPrice); |
| | | order.setCreateTime(new Date()); |
| | | order.setUpdateTime(new Date()); |
| | | order.setIsDelete(Constants.ZERO); |
| | | orderList.add(order); |
| | | // 评价信息 |
| | | if (pjStatus) { |
| | | Evaluate evaluate = new Evaluate(); |
| | | evaluate.setUserId(uid.intValue()); |
| | | evaluate.setUserPhone(phone); |
| | | evaluate.setOrderId(order.getId()); |
| | | evaluate.setContent(pjRemark); |
| | | evaluate.setWorkerId(serverUid.intValue()); |
| | | evaluate.setStarRating(Double.valueOf(pjLevel)); |
| | | evaluate.setCreateTime(new Date()); |
| | | evaluate.setUpdateTime(new Date()); |
| | | evaluate.setIsDelete(Constants.ZERO); |
| | | evaluateList.add(evaluate); |
| | | } |
| | | // 服务记录信息(回收拍照) |
| | | if (Constants.FOUR.equals(status)) { |
| | | // json数据转换 |
| | | String photo; |
| | | try { |
| | | OldDataPhotoVO photo1 = JSONObject.parseObject(yhqrtp, OldDataPhotoVO.class); |
| | | OldDataPhotoVO photo2 = JSONObject.parseObject(jjmptp, OldDataPhotoVO.class); |
| | | OldDataPhotoVO photo3 = JSONObject.parseObject(njtp, OldDataPhotoVO.class); |
| | | OldDataPhotoVO photo4 = JSONObject.parseObject(wjhqttp, OldDataPhotoVO.class); |
| | | photo = photo1.getUrl() + "," + photo2.getUrl() + "," + photo3.getUrl() + "," + photo4.getUrl(); |
| | | } catch (Exception e) { |
| | | photo = null; |
| | | } |
| | | ServeRecord serveRecord = new ServeRecord(); |
| | | serveRecord.setOrderId(order.getId()); |
| | | serveRecord.setPhoto(photo); |
| | | serveRecord.setCreateTime(new Date()); |
| | | serveRecord.setUpdateTime(new Date()); |
| | | serveRecord.setIsDelete(Constants.ZERO); |
| | | serveRecordList.add(serveRecord); |
| | | } |
| | | } |
| | | if (!orderList.isEmpty()) { |
| | | orderService.saveBatch(orderList); |
| | | } |
| | | if (!evaluateList.isEmpty()) { |
| | | evaluateService.saveBatch(evaluateList); |
| | | } |
| | | if (!serveRecordList.isEmpty()) { |
| | | serveRecordService.saveBatch(serveRecordList); |
| | | } |
| | | } catch (Exception e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.entity.*; |
| | | import com.ruoyi.order.request.OrderCountDataRequest; |
| | | import com.ruoyi.order.request.OrderRequest; |
| | | import com.ruoyi.order.request.OrderSubmitRequest; |
| | | import com.ruoyi.order.request.UserOrderRequest; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * 订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param request 查询参数 |
| | | */ |
| | | @ApiOperation(value = "订单统计", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/orderCount") |
| | | @PostMapping(value = "/orderCount") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "师傅姓名", name = "name", dataType = "String"), |
| | | @ApiImplicitParam(value = "师傅电话", name = "phone", dataType = "String"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<OrderCountVO>> orderCount(@RequestParam(value = "name", required = false) String name, |
| | | @RequestParam(value = "phone", required = false) String phone, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.orderCount(name, phone, Page.of(pageNum, pageSize))); |
| | | public R<Page<OrderCountVO>> orderCount(@RequestBody OrderCountDataRequest request) { |
| | | return R.ok(orderService.orderCount(request.getWorkerName(), request.getWorkerPhone(), |
| | | Page.of(request.getPageNum(), request.getPageSize()))); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "已到达预约地点", tags = {"师傅端"}) |
| | | @GetMapping(value = "/reachPosition") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> reachPosition(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId) { |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getServerId, workerId) |
| | | .eq(Order::getIsDelete, 0).one(); |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_address") |
| | | @ApiModel(value = "DataAddress对象", description = "用户地址") |
| | | public class DataAddress { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户UID") |
| | | @TableField("uid") |
| | | private Long uid; |
| | | |
| | | @ApiModelProperty("地址类型(0普通,1默认)") |
| | | @TableField("type") |
| | | private Boolean type; |
| | | |
| | | @ApiModelProperty("收货姓名") |
| | | @TableField("username") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("收货手机") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("维度") |
| | | @TableField("latitude") |
| | | private BigDecimal latitude; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @TableField("longitude") |
| | | private BigDecimal longitude; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | @TableField("xxdz") |
| | | private String xxdz; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_advantage") |
| | | @ApiModel(value = "DataAdvantage对象", description = "服务优势") |
| | | public class DataAdvantage { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("消息名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("内容") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("排序权重") |
| | | @TableField("sort") |
| | | private Long sort; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_cate") |
| | | @ApiModel(value = "DataCate对象", description = "回收分类") |
| | | public class DataCate { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("上级分类") |
| | | @TableField("pid") |
| | | private Long pid; |
| | | |
| | | @ApiModelProperty("分类名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("首页分类名称") |
| | | @TableField("index_name") |
| | | private String indexName; |
| | | |
| | | @ApiModelProperty("分类图标") |
| | | @TableField("cover") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("分类描述") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("分类简介") |
| | | @TableField("remark_jj") |
| | | private String remarkJj; |
| | | |
| | | @ApiModelProperty("排序权重") |
| | | @TableField("sort") |
| | | private Long sort; |
| | | |
| | | @ApiModelProperty("是否首页推荐") |
| | | @TableField("index_status") |
| | | private Integer indexStatus; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_collect") |
| | | @ApiModel(value = "DataCollect对象", description = "收藏") |
| | | public class DataCollect { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | @TableField("uid") |
| | | private Long uid; |
| | | |
| | | @ApiModelProperty("产品ID") |
| | | @TableField("pid") |
| | | private Long pid; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_draw") |
| | | @ApiModel(value = "DataDraw对象", description = "奖品管理") |
| | | public class DataDraw { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("奖品名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("奖品图片") |
| | | @TableField("image") |
| | | private String image; |
| | | |
| | | @ApiModelProperty("中间几率") |
| | | @TableField("odds") |
| | | private String odds; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_goods") |
| | | @ApiModel(value = "DataGoods对象", description = "服务内容") |
| | | public class DataGoods { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("服务名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("服务描述") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("预估价格") |
| | | @TableField("price") |
| | | private String price; |
| | | |
| | | @ApiModelProperty("评估价格") |
| | | @TableField("pg_price") |
| | | private String pgPrice; |
| | | |
| | | @ApiModelProperty("上级分类") |
| | | @TableField("pid") |
| | | private Integer pid; |
| | | |
| | | @ApiModelProperty("分类编号") |
| | | @TableField("cateids") |
| | | private String cateids; |
| | | |
| | | @ApiModelProperty("服务封面") |
| | | @TableField("cover") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("轮播图片") |
| | | @TableField("slider") |
| | | private String slider; |
| | | |
| | | @ApiModelProperty("列表排序权重") |
| | | @TableField("sort") |
| | | private Long sort; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_message") |
| | | @ApiModel(value = "DataMessage对象", description = "通知") |
| | | public class DataMessage { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("消息名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("消息内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("排序权重") |
| | | @TableField("sort") |
| | | private Long sort; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_order") |
| | | @ApiModel(value = "DataOrder对象", description = "订单") |
| | | public class DataOrder { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("0用户订单1指定订单") |
| | | @TableField("order_type") |
| | | private Boolean orderType; |
| | | |
| | | @ApiModelProperty("商品订单单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("产品ID") |
| | | @TableField("product_id") |
| | | private Long productId; |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | @TableField("uid") |
| | | private Long uid; |
| | | |
| | | @ApiModelProperty("服务用户ID") |
| | | @TableField("server_uid") |
| | | private Long serverUid; |
| | | |
| | | @ApiModelProperty("实际金额") |
| | | @TableField("price") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty("分享补贴金额") |
| | | @TableField("bt_price") |
| | | private BigDecimal btPrice; |
| | | |
| | | @ApiModelProperty("用户姓名") |
| | | @TableField("username") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("用户手机") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("地址-省份") |
| | | @TableField("province") |
| | | private String province; |
| | | |
| | | @ApiModelProperty("地址-城市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("地址-区域") |
| | | @TableField("area") |
| | | private String area; |
| | | |
| | | @ApiModelProperty("收货地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | @TableField("xx_address") |
| | | private String xxAddress; |
| | | |
| | | @ApiModelProperty("维度") |
| | | @TableField("latitude") |
| | | private BigDecimal latitude; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @TableField("longitude") |
| | | private BigDecimal longitude; |
| | | |
| | | @ApiModelProperty("上门时间") |
| | | @TableField("sm_time") |
| | | private Date smTime; |
| | | |
| | | @ApiModelProperty("服务备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("取消订单描述") |
| | | @TableField("cancel_remark") |
| | | private String cancelRemark; |
| | | |
| | | @ApiModelProperty("评价等级") |
| | | @TableField("pj_level") |
| | | private Integer pjLevel; |
| | | |
| | | @ApiModelProperty("评价描述") |
| | | @TableField("pj_remark") |
| | | private String pjRemark; |
| | | |
| | | @ApiModelProperty("修改时间原因") |
| | | @TableField("reason") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty("完工时间") |
| | | @TableField("completeTime") |
| | | private String completeTime; |
| | | |
| | | @ApiModelProperty("用户确认图片") |
| | | @TableField("yhqrtp") |
| | | private String yhqrtp; |
| | | |
| | | @ApiModelProperty("旧机铭牌图片") |
| | | @TableField("jjmptp") |
| | | private String jjmptp; |
| | | |
| | | @ApiModelProperty("内机图片") |
| | | @TableField("njtp") |
| | | private String njtp; |
| | | |
| | | @ApiModelProperty("外机和其他图片") |
| | | @TableField("wjhqttp") |
| | | private String wjhqttp; |
| | | |
| | | @ApiModelProperty("抽奖次数") |
| | | @TableField("drawnum") |
| | | private Integer drawnum; |
| | | |
| | | @ApiModelProperty("订单流程状态(1待派单,2已派单,3已接单,4已完成,5已取消)") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("订单流程状态(0未接单1确定接单2取消接单)") |
| | | @TableField("jd_status") |
| | | private Boolean jdStatus; |
| | | |
| | | @ApiModelProperty("再投师傅ID") |
| | | @TableField("zt_server_uid") |
| | | private String ztServerUid; |
| | | |
| | | @ApiModelProperty("评价状态0未评价1已评价") |
| | | @TableField("pj_status") |
| | | private Boolean pjStatus; |
| | | |
| | | @ApiModelProperty("时间状态") |
| | | @TableField("time_status") |
| | | private Boolean timeStatus; |
| | | |
| | | @ApiModelProperty("订单创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | @TableField("server_sendnum") |
| | | private Integer serverSendnum; |
| | | |
| | | @TableField("user_sendnum") |
| | | private Integer userSendnum; |
| | | |
| | | @TableField("print") |
| | | private Integer print; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_question") |
| | | @ApiModel(value = "DataQuestion对象", description = "常见问题") |
| | | public class DataQuestion { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("消息名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("内容") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("排序权重") |
| | | @TableField("sort") |
| | | private Long sort; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_technician") |
| | | @ApiModel(value = "DataTechnician对象", description = "技师") |
| | | public class DataTechnician { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | @TableField("uid") |
| | | private String uid; |
| | | |
| | | @ApiModelProperty("城市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("用户姓名") |
| | | @TableField("username") |
| | | private String username; |
| | | |
| | | @ApiModelProperty("用户手机") |
| | | @TableField("phone") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("车辆类型") |
| | | @TableField("car_type") |
| | | private String carType; |
| | | |
| | | @ApiModelProperty("车牌号码") |
| | | @TableField("car_number") |
| | | private String carNumber; |
| | | |
| | | @ApiModelProperty("身份证号码") |
| | | @TableField("idcard") |
| | | private String idcard; |
| | | |
| | | @ApiModelProperty("身份证正面") |
| | | @TableField("idcard_z") |
| | | private String idcardZ; |
| | | |
| | | @ApiModelProperty("身份证反面") |
| | | @TableField("idcard_f") |
| | | private String idcardF; |
| | | |
| | | @ApiModelProperty("行驶证") |
| | | @TableField("xsz") |
| | | private String xsz; |
| | | |
| | | @ApiModelProperty("工作状态(1正常,0休息)") |
| | | @TableField("work_status") |
| | | private Boolean workStatus; |
| | | |
| | | @ApiModelProperty("用户状态(0审核中,1同意,2驳回)") |
| | | @TableField("status") |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty("注册时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_transfer") |
| | | @ApiModel(value = "DataTransfer对象", description = "提现") |
| | | public class DataTransfer { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("用户UID") |
| | | @TableField("uid") |
| | | private Long uid; |
| | | |
| | | @ApiModelProperty("提现单号") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("提现手续费金额") |
| | | @TableField("charge_amount") |
| | | private BigDecimal chargeAmount; |
| | | |
| | | @ApiModelProperty("提现转账金额") |
| | | @TableField("amount") |
| | | private BigDecimal amount; |
| | | |
| | | @ApiModelProperty("交易单号") |
| | | @TableField("trade_no") |
| | | private String tradeNo; |
| | | |
| | | @ApiModelProperty("打款时间") |
| | | @TableField("trade_time") |
| | | private String tradeTime; |
| | | |
| | | @ApiModelProperty("提现状态(0待审核,1同意,2驳回,3打款中,4已打款,5已收款)") |
| | | @TableField("status") |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("data_user") |
| | | @ApiModel(value = "DataUser对象", description = "用户") |
| | | public class DataUser { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("小程序OPENID") |
| | | @TableField("openid") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty("用户头像") |
| | | @TableField("avatar") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | @TableField("nickname") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("用户金额") |
| | | @TableField("price") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty("是否技师(1是0否)") |
| | | @TableField("status") |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty("是否提交审核(1是0否)") |
| | | @TableField("sh_status") |
| | | private Boolean shStatus; |
| | | |
| | | @ApiModelProperty("注册时间") |
| | | @TableField("create_at") |
| | | private Date createAt; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.request.ChangeDispatchRequest; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface ChangeDispatchMapper extends BaseMapper<ChangeDispatch> { |
| | | |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | | * @param request 查询参数 |
| | | * @param page 分页条件 |
| | | * @return 分页 |
| | | */ |
| | | Page<ChangeDispatch> queryPageList(@Param("data") ChangeDispatchRequest request, Page<ChangeDispatch> page); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataAddress; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataAddressMapper extends BaseMapper<DataAddress> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataAdvantage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataAdvantageMapper extends BaseMapper<DataAdvantage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataCate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataCateMapper extends BaseMapper<DataCate> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataCollect; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataCollectMapper extends BaseMapper<DataCollect> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataDraw; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataDrawMapper extends BaseMapper<DataDraw> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataGoods; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataGoodsMapper extends BaseMapper<DataGoods> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataMessage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataMessageMapper extends BaseMapper<DataMessage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataOrderMapper extends BaseMapper<DataOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataQuestion; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataQuestionMapper extends BaseMapper<DataQuestion> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataTechnician; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataTechnicianMapper extends BaseMapper<DataTechnician> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataTransfer; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataTransferMapper extends BaseMapper<DataTransfer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.DataUser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Mapper |
| | | public interface DataUserMapper extends BaseMapper<DataUser> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.request.EvaluatePageRequest; |
| | | import com.ruoyi.order.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param userName 评价用户 |
| | | * @param orderNumber 订单编号 |
| | | * @param workerName 师傅姓名 |
| | | * @param page 分页 |
| | | * @param request 查询参数 |
| | | * @param page 分页 |
| | | * @return 分页 |
| | | */ |
| | | Page<EvaluatePageVO> queryPageList(@Param("userName") String userName, @Param("orderNumber") String orderNumber, |
| | | @Param("workerName") String workerName, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> queryPageList(@Param("data") EvaluatePageRequest request, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 用户所关联评价记录分页列表 |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-19 14:05 |
| | | */ |
| | | @Data |
| | | public class ChangeDispatchRequest { |
| | | |
| | | private String workerName; |
| | | |
| | | private String orderNumber; |
| | | |
| | | private String userName; |
| | | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | private List<String> cityList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-19 14:34 |
| | | */ |
| | | @Data |
| | | public class EvaluatePageRequest { |
| | | |
| | | private String userNo; |
| | | |
| | | private String orderNumber; |
| | | |
| | | private String workerName; |
| | | |
| | | private List<String> cityList; |
| | | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-19 14:27 |
| | | */ |
| | | @Data |
| | | public class OrderCountDataRequest { |
| | | |
| | | private String workerName; |
| | | |
| | | private String workerPhone; |
| | | |
| | | private List<String> cityList; |
| | | |
| | | private Integer pageNum; |
| | | |
| | | private Integer pageSize; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.order.request.ChangeDispatchRequest; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ChangeDispatchService extends IService<ChangeDispatch> { |
| | | |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | | * @param request 查询参数 |
| | | * @param page 分页条件 |
| | | * @return 分页 |
| | | */ |
| | | Page<ChangeDispatch> queryPageList(ChangeDispatchRequest request, Page<ChangeDispatch> page); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataAddress; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataAddressService extends IService<DataAddress> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataAdvantage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataAdvantageService extends IService<DataAdvantage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataCate; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataCateService extends IService<DataCate> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataCollect; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataCollectService extends IService<DataCollect> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataDraw; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataDrawService extends IService<DataDraw> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataGoods; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataGoodsService extends IService<DataGoods> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataMessage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataMessageService extends IService<DataMessage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataOrder; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataOrderService extends IService<DataOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataQuestion; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataQuestionService extends IService<DataQuestion> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataTechnician; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataTechnicianService extends IService<DataTechnician> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataTransfer; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataTransferService extends IService<DataTransfer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.DataUser; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | public interface DataUserService extends IService<DataUser> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.request.EvaluatePageRequest; |
| | | import com.ruoyi.order.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | |
| | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param userName 评价用户 |
| | | * @param orderNumber 订单编号 |
| | | * @param workerName 师傅姓名 |
| | | * @param page 分页 |
| | | * @param request 查询参数 |
| | | * @param page 分页 |
| | | * @return 分页 |
| | | */ |
| | | Page<EvaluatePageVO> queryPageList(String userName, String orderNumber, String workerName, Page<EvaluatePageVO> page); |
| | | Page<EvaluatePageVO> queryPageList(EvaluatePageRequest request, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 用户所关联评价记录分页列表 |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.ruoyi.order.mapper.ChangeDispatchMapper; |
| | | import com.ruoyi.order.request.ChangeDispatchRequest; |
| | | import com.ruoyi.order.service.ChangeDispatchService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Service |
| | | public class ChangeDispatchServiceImpl extends ServiceImpl<ChangeDispatchMapper, ChangeDispatch> implements ChangeDispatchService { |
| | | |
| | | @Override |
| | | public Page<ChangeDispatch> queryPageList(ChangeDispatchRequest request, Page<ChangeDispatch> page) { |
| | | return baseMapper.queryPageList(request, page); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataAddress; |
| | | import com.ruoyi.order.mapper.DataAddressMapper; |
| | | import com.ruoyi.order.service.DataAddressService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataAddressServiceImpl extends ServiceImpl<DataAddressMapper, DataAddress> implements DataAddressService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataAdvantage; |
| | | import com.ruoyi.order.mapper.DataAdvantageMapper; |
| | | import com.ruoyi.order.service.DataAdvantageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataAdvantageServiceImpl extends ServiceImpl<DataAdvantageMapper, DataAdvantage> implements DataAdvantageService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataCate; |
| | | import com.ruoyi.order.mapper.DataCateMapper; |
| | | import com.ruoyi.order.service.DataCateService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataCateServiceImpl extends ServiceImpl<DataCateMapper, DataCate> implements DataCateService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataCollect; |
| | | import com.ruoyi.order.mapper.DataCollectMapper; |
| | | import com.ruoyi.order.service.DataCollectService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataCollectServiceImpl extends ServiceImpl<DataCollectMapper, DataCollect> implements DataCollectService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataDraw; |
| | | import com.ruoyi.order.mapper.DataDrawMapper; |
| | | import com.ruoyi.order.service.DataDrawService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataDrawServiceImpl extends ServiceImpl<DataDrawMapper, DataDraw> implements DataDrawService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataGoods; |
| | | import com.ruoyi.order.mapper.DataGoodsMapper; |
| | | import com.ruoyi.order.service.DataGoodsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataGoodsServiceImpl extends ServiceImpl<DataGoodsMapper, DataGoods> implements DataGoodsService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataMessage; |
| | | import com.ruoyi.order.mapper.DataMessageMapper; |
| | | import com.ruoyi.order.service.DataMessageService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataMessageServiceImpl extends ServiceImpl<DataMessageMapper, DataMessage> implements DataMessageService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataOrder; |
| | | import com.ruoyi.order.mapper.DataOrderMapper; |
| | | import com.ruoyi.order.service.DataOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataOrderServiceImpl extends ServiceImpl<DataOrderMapper, DataOrder> implements DataOrderService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataQuestion; |
| | | import com.ruoyi.order.mapper.DataQuestionMapper; |
| | | import com.ruoyi.order.service.DataQuestionService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataQuestionServiceImpl extends ServiceImpl<DataQuestionMapper, DataQuestion> implements DataQuestionService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataTechnician; |
| | | import com.ruoyi.order.mapper.DataTechnicianMapper; |
| | | import com.ruoyi.order.service.DataTechnicianService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataTechnicianServiceImpl extends ServiceImpl<DataTechnicianMapper, DataTechnician> implements DataTechnicianService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataTransfer; |
| | | import com.ruoyi.order.mapper.DataTransferMapper; |
| | | import com.ruoyi.order.service.DataTransferService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataTransferServiceImpl extends ServiceImpl<DataTransferMapper, DataTransfer> implements DataTransferService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.DataUser; |
| | | import com.ruoyi.order.mapper.DataUserMapper; |
| | | import com.ruoyi.order.service.DataUserService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-18 16:34 |
| | | */ |
| | | @Service |
| | | public class DataUserServiceImpl extends ServiceImpl<DataUserMapper, DataUser> implements DataUserService { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.mapper.EvaluateMapper; |
| | | import com.ruoyi.order.request.EvaluatePageRequest; |
| | | import com.ruoyi.order.service.EvaluateService; |
| | | import com.ruoyi.order.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | |
| | | public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> implements EvaluateService { |
| | | |
| | | @Override |
| | | public Page<EvaluatePageVO> queryPageList(String userName, String orderNumber, String workerName, Page<EvaluatePageVO> page) { |
| | | return baseMapper.queryPageList(userName, orderNumber, workerName, page); |
| | | public Page<EvaluatePageVO> queryPageList(EvaluatePageRequest request, Page<EvaluatePageVO> page) { |
| | | return baseMapper.queryPageList(request, page); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户ID(昵称)") |
| | | private String userNo; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("师傅姓名") |
| | | private String workerName; |
| | | |
| | | @ApiModelProperty("师傅电话") |
| | | private String workerPhone; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @TableField("star_rating") |
| | | private Double starRating; |
| | |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | |
| | | @TableField("createBy") |
| | | private String createBy; |
| | | |
| | | @TableField("updateBy") |
| | | private String updateBy; |
| | | |
| | | @TableField("createTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | @TableField("updateTime") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty("是否删除 0未删除;1已删除") |
| | | @TableField("is_delete") |
| | | private Integer isDelete; |
| | | |
| | | @ApiModelProperty("用户ID(昵称)") |
| | | private String userNo; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("师傅姓名") |
| | | private String workerName; |
| | | |
| | | @ApiModelProperty("师傅电话") |
| | | private String workerPhone; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-22 18:20 |
| | | */ |
| | | @Data |
| | | public class OldDataPhotoVO { |
| | | |
| | | private String size; |
| | | |
| | | private String type; |
| | | |
| | | private String url; |
| | | |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.ChangeDispatchMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.ChangeDispatch"> |
| | | <id column="id" property="id" /> |
| | | <result column="worker_id" property="workerId" /> |
| | | <result column="worker_name" property="workerName" /> |
| | | <result column="apply_reason" property="applyReason" /> |
| | | <result column="apply_time" property="applyTime" /> |
| | | <result column="state" property="state" /> |
| | | <result column="createBy" property="createBy" /> |
| | | <result column="updateBy" property="updateBy" /> |
| | | <result column="createTime" property="createTime" /> |
| | | <result column="updateTime" property="updateTime" /> |
| | | <result column="is_delete" property="isDelete" /> |
| | | <result column="order_id" property="orderId" /> |
| | | <result column="order_number" property="orderNumber" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="user_name" property="userName" /> |
| | | <id column="id" property="id"/> |
| | | <result column="worker_id" property="workerId"/> |
| | | <result column="worker_name" property="workerName"/> |
| | | <result column="apply_reason" property="applyReason"/> |
| | | <result column="apply_time" property="applyTime"/> |
| | | <result column="state" property="state"/> |
| | | <result column="createBy" property="createBy"/> |
| | | <result column="updateBy" property="updateBy"/> |
| | | <result column="createTime" property="createTime"/> |
| | | <result column="updateTime" property="updateTime"/> |
| | | <result column="is_delete" property="isDelete"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="user_name" property="userName"/> |
| | | <result column="orderTime" property="orderTime"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryPageList" resultMap="BaseResultMap"> |
| | | select c.*, o.createTime as orderTime |
| | | from sys_change_dispatch c |
| | | left join t_order o on c.order_id = o.id |
| | | <where> |
| | | c.is_delete = 0 |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and c.worker_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and c.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.userName != null and data.userName != ''"> |
| | | and c.user_name like concat('%', #{data.userName}, '%') |
| | | </if> |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | and o.city in |
| | | <foreach collection="data.cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by c.createTime desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataAddressMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataAddress"> |
| | | <id column="id" property="id" /> |
| | | <result column="uid" property="uid" /> |
| | | <result column="type" property="type" /> |
| | | <result column="username" property="username" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="address" property="address" /> |
| | | <result column="latitude" property="latitude" /> |
| | | <result column="longitude" property="longitude" /> |
| | | <result column="xxdz" property="xxdz" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataAdvantageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataAdvantage"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataCateMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataCate"> |
| | | <id column="id" property="id" /> |
| | | <result column="pid" property="pid" /> |
| | | <result column="name" property="name" /> |
| | | <result column="index_name" property="indexName" /> |
| | | <result column="cover" property="cover" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="remark_jj" property="remarkJj" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="index_status" property="indexStatus" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataCollectMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataCollect"> |
| | | <id column="id" property="id" /> |
| | | <result column="uid" property="uid" /> |
| | | <result column="pid" property="pid" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataDrawMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataDraw"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="image" property="image" /> |
| | | <result column="odds" property="odds" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataGoodsMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataGoods"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="price" property="price" /> |
| | | <result column="pg_price" property="pgPrice" /> |
| | | <result column="pid" property="pid" /> |
| | | <result column="cateids" property="cateids" /> |
| | | <result column="cover" property="cover" /> |
| | | <result column="slider" property="slider" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataMessageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataMessage"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="content" property="content" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataOrderMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataOrder"> |
| | | <id column="id" property="id" /> |
| | | <result column="order_type" property="orderType" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="product_id" property="productId" /> |
| | | <result column="uid" property="uid" /> |
| | | <result column="server_uid" property="serverUid" /> |
| | | <result column="price" property="price" /> |
| | | <result column="bt_price" property="btPrice" /> |
| | | <result column="username" property="username" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="province" property="province" /> |
| | | <result column="city" property="city" /> |
| | | <result column="area" property="area" /> |
| | | <result column="address" property="address" /> |
| | | <result column="xx_address" property="xxAddress" /> |
| | | <result column="latitude" property="latitude" /> |
| | | <result column="longitude" property="longitude" /> |
| | | <result column="sm_time" property="smTime" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="cancel_remark" property="cancelRemark" /> |
| | | <result column="pj_level" property="pjLevel" /> |
| | | <result column="pj_remark" property="pjRemark" /> |
| | | <result column="reason" property="reason" /> |
| | | <result column="completeTime" property="completeTime" /> |
| | | <result column="yhqrtp" property="yhqrtp" /> |
| | | <result column="jjmptp" property="jjmptp" /> |
| | | <result column="njtp" property="njtp" /> |
| | | <result column="wjhqttp" property="wjhqttp" /> |
| | | <result column="drawnum" property="drawnum" /> |
| | | <result column="status" property="status" /> |
| | | <result column="jd_status" property="jdStatus" /> |
| | | <result column="zt_server_uid" property="ztServerUid" /> |
| | | <result column="pj_status" property="pjStatus" /> |
| | | <result column="time_status" property="timeStatus" /> |
| | | <result column="create_at" property="createAt" /> |
| | | <result column="server_sendnum" property="serverSendnum" /> |
| | | <result column="user_sendnum" property="userSendnum" /> |
| | | <result column="print" property="print" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataQuestionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataQuestion"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="sort" property="sort" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataTechnicianMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataTechnician"> |
| | | <id column="id" property="id" /> |
| | | <result column="uid" property="uid" /> |
| | | <result column="city" property="city" /> |
| | | <result column="username" property="username" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="car_type" property="carType" /> |
| | | <result column="car_number" property="carNumber" /> |
| | | <result column="idcard" property="idcard" /> |
| | | <result column="idcard_z" property="idcardZ" /> |
| | | <result column="idcard_f" property="idcardF" /> |
| | | <result column="xsz" property="xsz" /> |
| | | <result column="work_status" property="workStatus" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataTransferMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataTransfer"> |
| | | <id column="id" property="id" /> |
| | | <result column="uid" property="uid" /> |
| | | <result column="code" property="code" /> |
| | | <result column="charge_amount" property="chargeAmount" /> |
| | | <result column="amount" property="amount" /> |
| | | <result column="trade_no" property="tradeNo" /> |
| | | <result column="trade_time" property="tradeTime" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.DataUserMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.DataUser"> |
| | | <id column="id" property="id" /> |
| | | <result column="openid" property="openid" /> |
| | | <result column="avatar" property="avatar" /> |
| | | <result column="nickname" property="nickname" /> |
| | | <result column="price" property="price" /> |
| | | <result column="status" property="status" /> |
| | | <result column="sh_status" property="shStatus" /> |
| | | <result column="create_at" property="createAt" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <result column="is_delete" property="isDelete"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryPageList" resultType="com.ruoyi.order.vo.EvaluatePageVO"> |
| | | select e.*, |
| | | <resultMap id="evaluatePageVO" type="com.ruoyi.order.vo.EvaluatePageVO"> |
| | | <result column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="userNo" property="userNo"/> |
| | | <result column="user_phone" property="userPhone"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="content" property="content"/> |
| | | <result column="worker_id" property="workerId"/> |
| | | <result column="workerName" property="workerName"/> |
| | | <result column="workerPhone" property="workerPhone"/> |
| | | <result column="createTime" property="createTime"/> |
| | | <result column="serve_no" property="serveNo"/> |
| | | <result column="star_rating" property="starRating"/> |
| | | <result column="is_delete" property="isDelete"/> |
| | | </resultMap> |
| | | <select id="queryPageList" resultMap="evaluatePageVO"> |
| | | select e.id, |
| | | e.user_id, |
| | | e.user_phone, |
| | | e.order_id, |
| | | e.content, |
| | | e.worker_id, |
| | | e.createTime, |
| | | e.serve_no, |
| | | e.star_rating, |
| | | e.is_delete, |
| | | o.reservation_name as userNo, |
| | | o.order_number, |
| | | o.server_name as workerName, |
| | |
| | | <where> |
| | | e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | <if test="userName != null and userName != ''"> |
| | | and o.reservation_name like concat('%', #{userName}, '%') |
| | | <if test="data.userNo != null and data.userNo != ''"> |
| | | and o.reservation_name like concat('%', #{data.userNo}, '%') |
| | | </if> |
| | | <if test="orderNumber != null and orderNumber != ''"> |
| | | and o.order_number like concat('%', #{orderNumber}, '%') |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="workerName != null and workerName != ''"> |
| | | and o.server_name like concat('%', #{workerName}, '%') |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | and o.city in |
| | | <foreach collection="data.cityList" item="city" open="(" separator="," close=")"> |
| | | #{city} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | order by e.createTime desc |
| | |
| | | SUM(CASE WHEN o.state = 6 THEN 1 ELSE 0 END) AS reInvestment |
| | | FROM t_order o |
| | | WHERE o.is_delete = 0 |
| | | and o.server_id is not null |
| | | <if test="phone != null and phone != ''"> |
| | | and o.server_phone like concat('%', #{phone}, '%') |
| | | </if> |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.ruoyi.admin.api.entity.*; |
| | | import com.ruoyi.admin.api.feignClient.AdminClient; |
| | |
| | | // 手机验证码校验获取缓存验证码 |
| | | Object phoneCodeRedis = redisService.getCacheObject(RedisConstants.USER_LOGIN_PHONE_CODE + phone); |
| | | if (null == phoneCodeRedis) { |
| | | return R.errorCode("登录失败,验证码已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } else { |
| | | // redis 验证码的value 为 code:时间戳 |
| | | String rCodeAndTime = String.valueOf(phoneCodeRedis); |
| | | String rCode = rCodeAndTime.split(":")[0]; |
| | | if (!rCode.equalsIgnoreCase(phoneCode)) { |
| | | return R.errorCode("登录失败,验证码无效!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } else { |
| | | user = new User(); |
| | | // 随机编号 |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, StringUtils.getCharAndNum(Constants.SIX))); |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, RandomUtil.randomNumbers(Constants.EIGHT))); |
| | | user.setState(Constants.ONE); |
| | | user.setNickname(phone); |
| | | user.setNickname(String.format(Constants.USER_NO_PRE, StringUtils.getCharAndNum(Constants.SIX))); |
| | | user.setPhone(phone); |
| | | user.setCity(loginPhoneRequest.getCity()); |
| | | user.setOpenId(loginPhoneRequest.getOpenId()); |
| | |
| | | if (!Constants.ZERO.equals(type) && !Constants.ONE.equals(type)) { |
| | | throw new GlobalException("获取类型异常!"); |
| | | } |
| | | return R.ok(adminClient.dataInfo(type).getData()); |
| | | R<Agreement> r = adminClient.agreementPolicy(type); |
| | | if (500 == r.getCode()) { |
| | | return R.fail(r.getMsg()); |
| | | } |
| | | return R.ok(r.getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "轮播图列表", tags = {"用户端-首页"}) |
| | | @GetMapping(value = "/banner") |
| | | public R<List<Rotate>> banner() { |
| | | List<Rotate> data = adminClient.bannerList().getData(); |
| | | R<List<Rotate>> r = adminClient.bannerList(); |
| | | List<Rotate> data = r.getData(); |
| | | if (null == data) { |
| | | return R.fail(r.getMsg()); |
| | | } |
| | | for (Rotate datum : data) { |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, datum.getId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | Integer classifyId = recoveryServe.getClassifyId(); |
| | | RecoveryClassify classify = recoveryClassifyService.lambdaQuery() |
| | | .eq(RecoveryClassify::getId, classifyId) |
| | | .eq(RecoveryClassify::getIsDelete, 0).one(); |
| | | if (null != classify) { |
| | | String supClassify = classify.getSupClassify(); |
| | | if (Constants.RECOVERY.equals(supClassify)) { |
| | | datum.setType(Constants.ONE); |
| | | } else { |
| | | datum.setType(Constants.ZERO); |
| | | .eq(RecoveryServe::getId, datum.getRotateServeId()).one(); |
| | | if (null != recoveryServe) { |
| | | Integer classifyId = recoveryServe.getClassifyId(); |
| | | RecoveryClassify classify = recoveryClassifyService.lambdaQuery() |
| | | .eq(RecoveryClassify::getId, classifyId).one(); |
| | | if (null != classify) { |
| | | String supClassify = classify.getSupClassify(); |
| | | if (Constants.RECOVERY.equals(supClassify)) { |
| | | datum.setType(Constants.ONE); |
| | | } else { |
| | | datum.setType(Constants.ZERO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import cn.binarywang.wx.miniapp.api.WxMaUserService; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
| | | import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | .eq(User::getIsDelete, 0).one(); |
| | | if (null == user) { |
| | | user = new User(); |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, StringUtils.getCharAndNum(Constants.SIX))); |
| | | user.setPhone(phoneNumber); |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, RandomUtil.randomNumbers(Constants.EIGHT))); |
| | | user.setState(Constants.ONE); |
| | | user.setNickname(String.format(Constants.USER_NO_PRE, StringUtils.getCharAndNum(Constants.SIX))); |
| | | user.setState(Constants.ONE); |
| | | user.setOpenId(openid); |
| | | user.setIsDelete(Constants.ZERO); |
| | |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-admin</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Common Swagger --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | |
| | | public R<Object> passwordLogin(@RequestBody @Validated LoginPasswordRequest loginPasswordRequest) { |
| | | String phone = loginPasswordRequest.getPhone(); |
| | | String password = loginPasswordRequest.getPassword(); |
| | | MasterWorker worker = masterWorkerService.lambdaQuery().eq(MasterWorker::getPhone, phone).eq(MasterWorker::getIsDelete, 0).one(); |
| | | if (null == worker) { |
| | | return R.unregistered("当前手机号未注册!"); |
| | | } |
| | | if (!Constants.ONE.equals(worker.getIsEnable())) { |
| | | return R.notEnabled("当前手机号已禁用!"); |
| | | } |
| | | // 校验师傅是否已提交入驻申请 |
| | | WorkerProcess process = workerProcessService.lambdaQuery() |
| | | .eq(WorkerProcess::getPhone, phone) |
| | | .eq(WorkerProcess::getIsDelete, 0) |
| | | .orderByDesc(WorkerProcess::getCreateTime) |
| | | .last("limit 1").one(); |
| | | if (null != process) { |
| | | if (Constants.TWO.equals(process.getState())) { |
| | | return R.fail("入驻申请暂未审核通过,请耐心等待!"); |
| | | MasterWorker worker = masterWorkerService.lambdaQuery().eq(MasterWorker::getPhone, phone) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | if (null != worker) { |
| | | if (!Constants.ONE.equals(worker.getIsEnable())) { |
| | | return R.notEnabled("登录失败,当前账号未启用!"); |
| | | } |
| | | } else { |
| | | return R.registered("当前账号未提交入驻申请,无法登录!"); |
| | | // 校验师傅是否已提交入驻申请 |
| | | WorkerProcess process = workerProcessService.lambdaQuery() |
| | | .eq(WorkerProcess::getPhone, phone) |
| | | .eq(WorkerProcess::getIsDelete, 0) |
| | | .orderByDesc(WorkerProcess::getCreateTime) |
| | | .last("limit 1").one(); |
| | | if (null != process) { |
| | | if (Constants.ZERO.equals(process.getState())) { |
| | | return R.fail("入驻申请暂未审核通过,请耐心等待!"); |
| | | } else if (Constants.TWO.equals(process.getState())) { |
| | | // return R.fail("入驻申请已驳回,请重新提交入驻申请!"); |
| | | return R.fail("当前手机号未注册!"); |
| | | } else { |
| | | return R.registered("当前账号未提交入驻申请,无法登录!"); |
| | | } |
| | | } else { |
| | | return R.registered("当前账号未提交入驻申请,无法登录!"); |
| | | } |
| | | } |
| | | // MD5加密登录密码(新) |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | |
| | | * @return token |
| | | */ |
| | | private Map<String, Object> generateLoginToken(MasterWorker worker) { |
| | | // 通知其他师傅下线 |
| | | // Integer workerId = worker.getId(); |
| | | // Set redisCache = redisService.getKeysPrefix(CacheConstants.LOGIN_WORKER_TOKEN_KEY); |
| | | // for (Object key : redisCache) { |
| | | // String strKey = String.valueOf(key); |
| | | // // 根据 login_tokens:加密token 获取用户登录信息 |
| | | // Object redisCacheUserInfo = redisService.getCacheObject(strKey); |
| | | // LoginUserInfo redisUserInfo = JSONObject.parseObject(JSONObject.toJSONString(redisCacheUserInfo), LoginUserInfo.class); |
| | | // // 单点逻辑,如果当前用户已处于登录状态并再次登录,则清除该用户上一次登录token |
| | | // if (workerId.equals(redisUserInfo.getUserid())) { |
| | | // ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(workerId)); |
| | | // if (null != context) { |
| | | // NettyWebSocketController.sendMsgToClient(context, "当前登录账号在其他设备登录!"); |
| | | // } |
| | | // } |
| | | // } |
| | | // 校验通过,生成token及过期时间 |
| | | LoginUserInfo loginUserInfo = new LoginUserInfo(); |
| | | loginUserInfo.setName(worker.getRealName()); |
| | |
| | | // 手机验证码校验获取缓存验证码 |
| | | Object phoneCodeRedis = redisService.getCacheObject(RedisConstants.WORKER_APPLY_KEY + phone); |
| | | if (null == phoneCodeRedis) { |
| | | return R.errorCode("登录失败,验证码已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } else { |
| | | // redis 验证码的value 为 code:时间戳 |
| | | String rCodeAndTime = String.valueOf(phoneCodeRedis); |
| | | String rCode = rCodeAndTime.split(":")[0]; |
| | | if (!rCode.equalsIgnoreCase(phoneCode)) { |
| | | return R.errorCode("登录失败,验证码无效!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | String phoneCode = workerProcess.getCode(); |
| | | Object redisCodeObj = redisService.getCacheObject(RedisConstants.WORKER_SETTLE_KEY + phone); |
| | | if (null == redisCodeObj) { |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | String redisCodeStr = String.valueOf(redisCodeObj).split(":")[0]; |
| | | if (!String.valueOf(redisCodeStr).equalsIgnoreCase(phoneCode)) { |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | // 校验手机号是否已注册 |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery().eq(MasterWorker::getPhone, phone) |
| | |
| | | // 验证码是否一致 |
| | | Object redisCode = redisService.getCacheObject(RedisConstants.WORKER_APPLY_KEY + phone); |
| | | if (null == redisCode) { |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | String redisCodeStr = String.valueOf(redisCode).split(":")[0]; |
| | | if (!String.valueOf(redisCodeStr).equalsIgnoreCase(phoneCode)) { |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | // 手机号是否注册 |
| | | MasterWorker worker = masterWorkerService.lambdaQuery() |
| | |
| | | // 订单统计 |
| | | WorkerOrderCountVO orderCount = orderClient.orderStateCount(masterWorker.getId()).getData(); |
| | | // 操作指导详情 |
| | | Agreement agreement = adminClient.dataInfo(Constants.TWO).getData(); |
| | | return R.ok(new HomePageInfoVO(masterWorker, orderCount, |
| | | null == agreement ? null : agreement.getContent())); |
| | | Agreement agreement = adminClient.operate().getData(); |
| | | if (null == agreement) { |
| | | return R.fail(adminClient.operate().getMsg()); |
| | | } |
| | | return R.ok(new HomePageInfoVO(masterWorker, orderCount, agreement.getContent())); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录已失效!"); |
| | | } |
| | | return R.ok(adminClient.dataInfo(Constants.TWO).getData()); |
| | | // 操作指导详情 |
| | | Agreement agreement = adminClient.operate().getData(); |
| | | if (null == agreement) { |
| | | return R.fail(adminClient.operate().getMsg()); |
| | | } |
| | | return R.ok(agreement); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 验证码是否一致 |
| | | Object redisCode = redisService.getCacheObject(RedisConstants.WORKER_APPLY_KEY + phone); |
| | | if (null == redisCode) { |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | String redisCodeStr = String.valueOf(redisCode).split(":")[0]; |
| | | if (!String.valueOf(redisCodeStr).equalsIgnoreCase(code)) { |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | return R.errorCode("验证码错误!"); |
| | | } |
| | | } |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | |
| | | List<Integer> ids = orderList.stream().map(Order::getServeId).collect(Collectors.toList()); |
| | | if (!ids.isEmpty()) { |
| | | List<RecoveryServe> serveList = recoveryServeService.lambdaQuery() |
| | | .in(RecoveryServe::getId, ids).eq(RecoveryServe::getIsDelete, 0).list(); |
| | | .in(RecoveryServe::getId, ids).list(); |
| | | Map<Integer, String> map = serveList.stream().collect(Collectors.toMap(RecoveryServe::getId, |
| | | mw -> Optional.ofNullable(mw.getCover()).orElse(""))); |
| | | for (Order order : orderList) { |
| | |
| | | package com.ruoyi.worker.controller; |
| | | |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.worker.utils.TencentCosUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | }) |
| | | public R<Boolean> uploadPhoto(@RequestParam("file") MultipartFile file, @RequestParam String orderId, |
| | | @RequestParam String longitude, @RequestParam String latitude) { |
| | | // 校验经纬度 |
| | | Order order = orderClient.detail(orderId).getData(); |
| | | // 用户下单位置经纬度 |
| | | String orderPosition = order.getLongitude() + "," + order.getLatitude(); |
| | | // 师傅经纬度 |
| | | String workerPosition = longitude + "," + latitude; |
| | | // 师傅当前位置离用户下单位置具体距离 |
| | | Long distance = GaoDeMapUtil.getDistance(orderPosition, workerPosition).getDatas(); |
| | | // 上传时判断是否在下单位置附件,距离大于某个值则 不允许上传 |
| | | if (distance > Constants.THREE_THOUSAND) { |
| | | // throw new GlobalException("您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | return R.fail(Boolean.FALSE, "您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | } |
| | | return R.ok(tencentCosUtil.upLoadFile(file)); |
| | | } |
| | | |
| | |
| | | Long distance = result.getDatas(); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | .eq(RecoveryServe::getId, order.getServeId()).one(); |
| | | // vo类信息封装 |
| | | OrderListVO orderListVO = new OrderListVO(); |
| | | orderListVO.setOrderId(order.getId()); |
| | |
| | | for (OrderListVO orderListVO : resultList) { |
| | | Integer serveId = orderListVO.getServeId(); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId).one(); |
| | | if (null != recoveryServe) { |
| | | orderListVO.setServePicture(recoveryServe.getCover()); |
| | | } |
| | |
| | | Long distance = result.getDatas(); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | .eq(RecoveryServe::getId, order.getServeId()).one(); |
| | | // vo类信息封装 |
| | | OrderListVO orderListVO = new OrderListVO(); |
| | | orderListVO.setOrderId(order.getId()); |
| | |
| | | for (OrderListVO orderListVO : resultList) { |
| | | Integer serveId = orderListVO.getServeId(); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId).one(); |
| | | if (null != recoveryServe) { |
| | | orderListVO.setServePicture(recoveryServe.getCover()); |
| | | } |