126个文件已修改
42个文件已删除
207个文件已添加
| | |
| | | <module>ruoyi-api-user</module> |
| | | <module>ruoyi-api-worker</module> |
| | | <module>ruoyi-api-admin</module> |
| | | <module>ruoyi-api-order</module> |
| | | </modules> |
| | | |
| | | <artifactId>ruoyi-api</artifactId> |
| | |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | @TableField("order_number") |
| | |
| | | @TableField("is_rotate") |
| | | private Integer isRotate; |
| | | |
| | | @ApiModelProperty("服务类型") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> changeDispatchSave(ChangeDispatch changeDispatch) { |
| | | return R.fail(Boolean.FALSE); |
| | | } |
| | | |
| | | @Override |
| | | public R<ChangeDispatch> changeDispatchOne(Integer id) { |
| | | return R.fail("获取订单改派详情失败" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Notices>> noticesList() { |
| | | return R.fail("获取通知公告列表失败" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Notices> noticesDetail(Integer id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Prize> prizeDetail(String id) { |
| | | return R.fail("获取奖品详情失败" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<WithdrawalSetting> withdrawProcess() { |
| | | return R.fail("获取系统审核设置失败" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<String>> cityDetail(Integer id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.admin.api.factory.AdminFallbackFactory; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | |
| | | R<Agreement> dataInfo(@RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 新增订单改派 |
| | | * |
| | | * @param changeDispatch 改派信息 |
| | | * @return 详细数据 |
| | | */ |
| | | @PostMapping(value = "/changeDispatch/changeDispatchSave") |
| | | R<Boolean> changeDispatchSave(@RequestBody ChangeDispatch changeDispatch); |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param id 订单id |
| | | * @return 改派订单 |
| | | */ |
| | | @GetMapping(value = "/changeDispatch/changeDispatchOne") |
| | | R<ChangeDispatch> changeDispatchOne(@RequestParam("id") Integer id); |
| | | |
| | | /** |
| | | * 系统通知列表 |
| | | * |
| | | * @return 通知公告列表 |
| | | */ |
| | | @GetMapping(value = "/notices/list") |
| | | @GetMapping(value = "/notices/noticesList") |
| | | R<List<Notices>> noticesList(); |
| | | |
| | | /** |
| | | * 系统通知详情 |
| | | * -- 远程调用 |
| | | * |
| | | * @param id 主键id |
| | | * @return 详情 |
| | | */ |
| | | @ApiOperation(value = "系统通知详情", tags = {"后台-系统设置-系统通知管理"}) |
| | | @GetMapping(value = "/notices/noticesDetail") |
| | | R<Notices> noticesDetail(@RequestParam("id") Integer id); |
| | | |
| | | /** |
| | | * 轮播图列表 |
| | |
| | | R<List<Prize>> prizeList(); |
| | | |
| | | /** |
| | | * 奖品详情 -- 远程调用 |
| | | * |
| | | * @param id 奖品id |
| | | * @return 详情 |
| | | */ |
| | | @GetMapping(value = "/prize/prizeDetail") |
| | | R<Prize> prizeDetail(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 修改系统设置-关闭/开启审核 |
| | | * |
| | | * @return 操作结果 |
| | |
| | | @GetMapping(value = "/userManage/withdrawProcess") |
| | | R<WithdrawalSetting> withdrawProcess(); |
| | | |
| | | /** |
| | | * 加盟商管辖城市详情 |
| | | * |
| | | * @param id 加盟商信息id |
| | | * @return 加盟商管辖城市详情 |
| | | */ |
| | | @GetMapping(value = "/franchisee/cityDetail") |
| | | R<List<String>> cityDetail(@RequestParam("id") Integer id); |
| | | |
| | | } |
New file |
| | |
| | | HELP.md |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | !**/src/main/**/target/ |
| | | !**/src/test/**/target/ |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | .sts4-cache |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### NetBeans ### |
| | | /nbproject/private/ |
| | | /nbbuild/ |
| | | /dist/ |
| | | /nbdist/ |
| | | /.nb-gradle/ |
| | | build/ |
| | | !**/src/main/**/build/ |
| | | !**/src/test/**/build/ |
| | | |
| | | ### VS Code ### |
| | | .vscode/ |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <version>3.6.4</version> |
| | | <relativePath>../../pom.xml</relativePath> |
| | | </parent> |
| | | |
| | | <artifactId>ruoyi-api-order</artifactId> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | </properties> |
| | | |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- RuoYi Common Core--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-core</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <groupId>com.github.pagehelper</groupId> |
| | | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.ruoyi.order.api; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | |
| | | @SpringBootApplication |
| | | public class RuoyiApiOrderApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(RuoyiApiOrderApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 改派管理 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_change_dispatch") |
| | | @ApiModel(value = "ChangeDispatch对象", description = "改派管理") |
| | | public class ChangeDispatch extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("申请师傅") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("申请师傅姓名") |
| | | @TableField("worker_name") |
| | | private String workerName; |
| | | |
| | | @ApiModelProperty("申请原因") |
| | | @TableField("apply_reason") |
| | | private String applyReason; |
| | | |
| | | @ApiModelProperty("申请改派时间") |
| | | @TableField("apply_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date applyTime; |
| | | |
| | | @ApiModelProperty("改派状态 (0:未改派 ;1:已改派 ;2:拒绝)") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | @TableField("order_number") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("下单用户名称") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_evaluate") |
| | | @ApiModel(value = "Evaluate对象", description = "用户评价表") |
| | | public class Evaluate extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @TableField("star_rating") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:59 |
| | | */ |
| | | @Data |
| | | public class EvaluateInfoVO { |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | private Integer starRating; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date evaluateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:54 |
| | | */ |
| | | @Data |
| | | public class EvaluateOrderInfoVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("服务描述") |
| | | private String serveDescribe; |
| | | |
| | | @ApiModelProperty("封面图片") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-01 12:57 |
| | | */ |
| | | @Data |
| | | public class EvaluatePageVO { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @TableField("star_rating") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | |
| | | @TableField("createBy") |
| | | private String createBy; |
| | | |
| | | @TableField("updateBy") |
| | | private String updateBy; |
| | | |
| | | @TableField("createTime") |
| | | 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.api.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-08 18:45 |
| | | */ |
| | | @Data |
| | | public class MoneyQueryRequest { |
| | | |
| | | private List<String> cityList; |
| | | |
| | | private String type; |
| | | |
| | | public MoneyQueryRequest(List<String> cityList, String type) { |
| | | this.cityList = cityList; |
| | | this.type = type; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | 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-05-29 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_order") |
| | | @ApiModel(value = "Order对象", description = "订单管理") |
| | | public class Order extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("下单城市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | @TableField("order_number") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty("站点名称") |
| | | @TableField("site_name") |
| | | private String siteName; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | @TableField("serve_id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | @TableField("serve_name") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("回收服务回收价") |
| | | @TableField("serve_price") |
| | | private BigDecimal servePrice; |
| | | |
| | | @ApiModelProperty("订单成交价(服务回收价 + 津贴)") |
| | | @TableField("order_money") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | @TableField("reservation_name") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | @TableField("reservation_phone") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | @TableField("reservation_address") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("上门时间段") |
| | | @TableField("time") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | @TableField("accept_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("服务人员id") |
| | | @TableField("server_id") |
| | | private Integer serverId; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | @TableField("server_name") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | @TableField("server_phone") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("预约备注") |
| | | @TableField("reservation_remark") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派,6:待改派)") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @TableField("arrive_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("下单用户经度") |
| | | @TableField("longitude") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("下单用户纬度") |
| | | @TableField("latitude") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @TableField("complete_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
| | | @TableField("subsidy") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | @TableField("is_withdrawal") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("订单取消原因") |
| | | @TableField("cancel_reason") |
| | | private String cancelReason; |
| | | |
| | | @ApiModelProperty("置顶顺序") |
| | | @TableField("top_sort") |
| | | private Integer topSort; |
| | | |
| | | @ApiModelProperty("回收服务封面图") |
| | | @TableField(exist = false) |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("再投原因") |
| | | @TableField(exist = false) |
| | | private String applyReason; |
| | | |
| | | @ApiModelProperty("是否为再投单") |
| | | @TableField("is_reinvest") |
| | | private Integer isReinvest; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-30 15:42 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "orderCount对象", description = "回收订单统计返回类") |
| | | public class OrderCountRequest { |
| | | |
| | | @ApiModelProperty("所选城市id集合") |
| | | private List<String> cityList; |
| | | |
| | | @ApiModelProperty("查询订单状态(全部订单:该字段不传值;其他状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派))") |
| | | private Integer orderState; |
| | | |
| | | @ApiModelProperty("统计类型(全年:year;本月:month;本周:week;今日:today)") |
| | | @NotBlank(message = "请选择:统计类型!") |
| | | private String countType; |
| | | |
| | | @ApiModelProperty("开始日期(yyyy-MM-dd格式)") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty("结束日期(yyyy-MM-dd格式)") |
| | | private String endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 17:37 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderCountVO对象", description = "订单统计返回类") |
| | | public class OrderCountVO { |
| | | |
| | | @ApiModelProperty("师傅id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("真实姓名") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | |
| | | @ApiModelProperty("待完工数量") |
| | | private Integer toBeCompletedNumber; |
| | | |
| | | @ApiModelProperty("已完工数量") |
| | | private Integer completedNumber; |
| | | |
| | | @ApiModelProperty("再投单数量") |
| | | private Integer reInvestment; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-06 14:16 |
| | | */ |
| | | @Data |
| | | public class OrderDetailVO { |
| | | |
| | | @ApiModelProperty("订单信息") |
| | | private Order orderInfo; |
| | | |
| | | @ApiModelProperty("服务信息") |
| | | private ServeRecord serveInfo; |
| | | |
| | | @ApiModelProperty("评价信息") |
| | | private Evaluate evaluateInfo; |
| | | |
| | | public OrderDetailVO() { |
| | | } |
| | | |
| | | public OrderDetailVO(Order orderInfo, ServeRecord serveInfo, Evaluate evaluateInfo) { |
| | | this.orderInfo = orderInfo; |
| | | this.serveInfo = serveInfo; |
| | | this.evaluateInfo = evaluateInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 11:14 |
| | | */ |
| | | @Data |
| | | public class OrderEvaluateSubmitRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @NotNull(message = "请选择评价订单!") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @NotNull(message = "请选择评价星级!") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | private String serveNo; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | | |
| | | public OrderEvaluateSubmitRequest(Long orderId, String content, Double starRating, String serveNo, Integer userId) { |
| | | this.orderId = orderId; |
| | | this.content = content; |
| | | this.starRating = starRating; |
| | | this.serveNo = serveNo; |
| | | this.userId = userId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:53 |
| | | */ |
| | | @Data |
| | | public class OrderEvaluateVO { |
| | | |
| | | @ApiModelProperty("订单信息") |
| | | private EvaluateOrderInfoVO orderInfo; |
| | | |
| | | @ApiModelProperty("评价信息") |
| | | private EvaluateInfoVO evaluateInfo; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("是否还未评价") |
| | | private Boolean evaluate; |
| | | |
| | | public Boolean getEvaluate() { |
| | | return null != evaluateInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-28 16:13 |
| | | */ |
| | | @Data |
| | | public class OrderPageCountVO { |
| | | |
| | | @ApiModelProperty("全部订单") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty("待派单") |
| | | private Integer toBeDispatched; |
| | | |
| | | @ApiModelProperty("待上门") |
| | | private Integer stayDoorstep; |
| | | |
| | | @ApiModelProperty("待完成") |
| | | private Integer toBeCompleted; |
| | | |
| | | @ApiModelProperty("已完成") |
| | | private Integer completed; |
| | | |
| | | @ApiModelProperty("已取消") |
| | | private Integer canceled; |
| | | |
| | | @ApiModelProperty("再投订单") |
| | | private Integer reInvestment; |
| | | |
| | | public OrderPageCountVO() { |
| | | } |
| | | |
| | | public OrderPageCountVO(Integer total, Integer toBeDispatched, Integer stayDoorstep, Integer toBeCompleted, |
| | | Integer completed, Integer canceled, Integer reInvestment) { |
| | | this.total = total; |
| | | this.toBeDispatched = toBeDispatched; |
| | | this.stayDoorstep = stayDoorstep; |
| | | this.toBeCompleted = toBeCompleted; |
| | | this.completed = completed; |
| | | this.canceled = canceled; |
| | | this.reInvestment = reInvestment; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 11:27 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderQueryRequest对象", description = "订单列表 请求参数") |
| | | public class OrderQueryRequest { |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("所属城市") |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派,6:待改派)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅名称") |
| | | private String workerName; |
| | | |
| | | @ApiModelProperty("师傅电话") |
| | | private String workerPhone; |
| | | |
| | | @ApiModelProperty("下单开始时间") |
| | | private String orderTimeStart; |
| | | |
| | | @ApiModelProperty("下单结束时间") |
| | | private String orderTimeEnd; |
| | | |
| | | @ApiModelProperty("预约上门开始时间") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty("预约上门结束时间") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty("站点名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty(value = "页码", required = true) |
| | | private Integer pageNum = 1; |
| | | |
| | | @ApiModelProperty(value = "每页显示条数", required = true) |
| | | private Integer pageSize = 10; |
| | | |
| | | @ApiModelProperty("导出ids集合") |
| | | private List<String> ids; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-30 16:30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderQuery对象", description = "回收订单统计查询类") |
| | | public class OrderQueryVO { |
| | | |
| | | @ApiModelProperty("对应总金额") |
| | | private BigDecimal totalPrice; |
| | | |
| | | @ApiModelProperty("时间日期") |
| | | private String dateTime; |
| | | |
| | | @ApiModelProperty("订单数量") |
| | | private Integer number; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-08 15:27 |
| | | */ |
| | | @Data |
| | | public class OrderRequest { |
| | | |
| | | @ApiModelProperty("下单城市") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("站点id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty("站点名称") |
| | | private String siteName; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("回收服务回收价") |
| | | private BigDecimal servePrice; |
| | | |
| | | @ApiModelProperty("订单成交价(服务回收价 + 津贴)") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("上门时间段") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("服务人员id") |
| | | private Integer serverId; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("预约备注") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("下单用户经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("下单用户纬度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("订单取消原因") |
| | | private String cancelReason; |
| | | |
| | | @ApiModelProperty("再投原因") |
| | | private String applyReason; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-30 16:30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderResultVO对象", description = "回收订单统计查询类") |
| | | public class OrderResultVO { |
| | | |
| | | @ApiModelProperty("订单总额") |
| | | private BigDecimal orderTotalMoney; |
| | | |
| | | @ApiModelProperty("订单总数量") |
| | | private Integer orderTotalNumber; |
| | | |
| | | @ApiModelProperty("柱状图数据") |
| | | private List<OrderQueryVO> orderList; |
| | | |
| | | public OrderResultVO() { |
| | | } |
| | | |
| | | public OrderResultVO(BigDecimal orderTotalMoney, Integer orderTotalNumber, List<OrderQueryVO> orderList) { |
| | | this.orderTotalMoney = orderTotalMoney; |
| | | this.orderTotalNumber = orderTotalNumber; |
| | | this.orderList = orderList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-06 14:25 |
| | | */ |
| | | @Data |
| | | public class OrderSubmitRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("现场照片") |
| | | private List<String> photo; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_serve_coordinate") |
| | | @ApiModel(value = "ServeCoordinate对象", description = "师傅路线经纬度信息") |
| | | public class ServeCoordinate { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("路线经纬度") |
| | | @TableField("coordinate") |
| | | private String coordinate; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @TableField("longitude") |
| | | private BigDecimal longitude; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | @TableField("latitude") |
| | | private BigDecimal latitude; |
| | | |
| | | @TableField("createBy") |
| | | private String createBy; |
| | | |
| | | @TableField("updateBy") |
| | | private String updateBy; |
| | | |
| | | @TableField("createTime") |
| | | private Date createTime; |
| | | |
| | | @TableField("updateTime") |
| | | private Date updateTime; |
| | | |
| | | @ApiModelProperty("是否删除 0未删除;1已删除") |
| | | @TableField("is_delete") |
| | | private Integer isDelete; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅服务记录 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_serve_record") |
| | | @ApiModel(value = "ServeRecord对象", description = "师傅服务记录") |
| | | public class ServeRecord extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("现场照片(多张照片 ','隔开)") |
| | | @TableField("photo") |
| | | private String photo; |
| | | |
| | | @ApiModelProperty("服务备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户下单请求参数对象 |
| | | * |
| | | * @author hjl |
| | | * @since 2024-06-17 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderRequest对象", description = "用户下单请求参数对象") |
| | | public class UserOrderRequest { |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址(收货地址id)") |
| | | private Integer addressId; |
| | | |
| | | @ApiModelProperty("上门时间") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("预约备注(服务备注)") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("下单用户经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("下单用户纬度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("订单津贴金额") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("回收服务价格") |
| | | private BigDecimal defaultPrice; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("预约下单地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String addressDetail; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | private Integer userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 10:40 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "UserWithdrawRecordVO对象", description = "用户提现记录信息") |
| | | public class UserWithdrawRecordVO { |
| | | |
| | | @TableId("id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | | private BigDecimal applyForMoney; |
| | | |
| | | @ApiModelProperty("申请状态 0待审核;1已通过;2已驳回") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("审批意见") |
| | | private String opinions; |
| | | |
| | | @ApiModelProperty("用户编号") |
| | | private String userNo; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | |
| | | /** |
| | | * 申请状态中文(导出用) 0待审核;1已通过;2已驳回 |
| | | * |
| | | * @return 中文状态 |
| | | */ |
| | | public String getStateStr() { |
| | | if (null == state) { |
| | | return "未知"; |
| | | } else { |
| | | if (Constants.AUDIT_NUMBER.equals(state)) { |
| | | return Constants.AUDIT_STR; |
| | | } else if (Constants.PASS_THROUGH_NUMBER.equals(state)) { |
| | | return Constants.PASS_THROUGH_STR; |
| | | } else if (Constants.REJECT_NUMBER.equals(state)) { |
| | | return Constants.REJECT_STR; |
| | | } else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | 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-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_withdraw") |
| | | @ApiModel(value = "Withdraw对象", description = "用户提现申请记录表") |
| | | public class Withdraw extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | @TableField("apply_for_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | | @TableField("apply_for_money") |
| | | private BigDecimal applyForMoney; |
| | | |
| | | @ApiModelProperty("申请状态 0待审核;1已通过;2已驳回") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("审批意见") |
| | | @TableField("opinion") |
| | | private String opinion; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-09 18:10 |
| | | */ |
| | | @Data |
| | | public class WithdrawDetailVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("回收服务回收价") |
| | | private BigDecimal servePrice; |
| | | |
| | | @ApiModelProperty("订单成交价(服务回收价 + 津贴)") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("上门时间段") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("服务人员id") |
| | | private Integer serverId; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("预约备注") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("提现申请状态(0待审核;1已通过;2已驳回)") |
| | | private Integer withdrawalState; |
| | | |
| | | @ApiModelProperty("提现申请时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date withdrawalTime; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("现场照片(多张照片 ','隔开)") |
| | | private String photo; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-28 11:31 |
| | | */ |
| | | @Data |
| | | public class WithdrawExportRequest { |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | private String applyForTime; |
| | | |
| | | @ApiModelProperty("提现状态") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("所选数据id") |
| | | private List<String> idList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-08 18:37 |
| | | */ |
| | | @Data |
| | | public class WithdrawReturnVO { |
| | | |
| | | private String orderId; |
| | | |
| | | private Integer userId; |
| | | |
| | | public WithdrawReturnVO(String orderId, Integer userId) { |
| | | this.orderId = orderId; |
| | | this.userId = userId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.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-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_withdrawal_setting") |
| | | @ApiModel(value = "WithdrawalSetting对象", description = "审核管理全局设置") |
| | | public class WithdrawalSetting { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("是否开启审核(0:未开启,1:已开启)") |
| | | @TableField("enable_process") |
| | | private Integer enableProcess; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-09 16:11 |
| | | */ |
| | | @Data |
| | | public class WorkerOrderCountVO { |
| | | |
| | | @ApiModelProperty("总订单数") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty("待上门订单数") |
| | | private Integer waitVisit; |
| | | |
| | | @ApiModelProperty("已完结订单数") |
| | | private Integer completed; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-09 10:12 |
| | | */ |
| | | @Data |
| | | public class WorkerOrderRankVO { |
| | | |
| | | private Integer workerId; |
| | | |
| | | private Integer orderNumber; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.Evaluate; |
| | | import com.ruoyi.order.api.entity.EvaluatePageVO; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateVO; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class EvaluateFallbackFactory implements FallbackFactory<EvaluateClient> { |
| | | |
| | | @Override |
| | | public EvaluateClient create(Throwable cause) { |
| | | return new EvaluateClient() { |
| | | @Override |
| | | public R<Page<EvaluatePageVO>> queryPageList(String userNo, String orderNumber, String workerName, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Evaluate> detail(Integer id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> batchDelete(String ids) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<EvaluatePageVO>> evaluateList(Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Evaluate>> evaluateByWorkerId(Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Evaluate> oneByOrderId(String orderId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<OrderEvaluateVO>> evaluateListByUser(Integer userId, Integer state, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> evaluateSave(OrderEvaluateSubmitRequest request) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class ExchangeDispatchFallbackFactory implements FallbackFactory<ExchangeDispatchClient> { |
| | | |
| | | @Override |
| | | public ExchangeDispatchClient create(Throwable cause) { |
| | | return new ExchangeDispatchClient() { |
| | | @Override |
| | | public R<Page<ChangeDispatch>> queryPageList(String workerName, String orderNumber, String userName, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> changeDispatchSave(ChangeDispatch changeDispatch) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<ChangeDispatch> changeDispatchOne(String id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<ChangeDispatch> detail(String id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> save(ChangeDispatch changeDispatch) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> saveRecord(ChangeDispatch changeDispatch) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> batchDelete(String ids) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> changeWorker(String changeId, Integer workerId, String name, String phone) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> refuseChangeDispatch(String id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class OrderFallbackFactory implements FallbackFactory<OrderClient> { |
| | | |
| | | @Override |
| | | public OrderClient create(Throwable cause) { |
| | | return new OrderClient() { |
| | | @Override |
| | | public R<Boolean> save(OrderRequest orderRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Order> detailByExchangeId(String id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Order> detail(String id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Order> exchangeOrder(Integer type, String orderId, Integer workerId, String name, String phone) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> batchDelete(String ids) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<OrderCountVO>> orderCount(String name, String phone, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Order>> excelExport(OrderQueryRequest orderQueryRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Order>> queryList(String phone) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> queryPage(OrderQueryRequest orderQueryRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<OrderPageCountVO> orderPageCount(OrderQueryRequest orderQueryRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateState(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> generateNewOrder(Order order) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<OrderResultVO> orderCountHome(OrderCountRequest orderCount) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<IPage<Order>> orderList(Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> updateWithdrawalState(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> tradeMoney(List<String> cityList, String type) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> orderListWorker(Integer userId, Integer state, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<WorkerOrderRankVO>> workerOrderRank(List<Integer> workerIds) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Path> orderNavigation(String orderId, Integer workerId, String longitude, String latitude) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> reachPosition(String orderId, Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<OrderDetailVO> orderDetail(String orderId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> orderSubmit(OrderSubmitRequest orderSubmitRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> coordinate(String orderId, Integer workerId, Double longitude, Double latitude) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Order>> orderNotHandle(Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Order>> orderTopListByWorkerId(Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> orderTop(String orderId, Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<WorkerOrderCountVO> orderStateCount(Integer workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> orderListByUser(Integer userId, Integer state, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> orderEstimate(UserOrderRequest userOrderRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<Boolean> placeOrder(UserOrderRequest userOrderRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> supplementAllowance(String orderId, String prizeName) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> changeOrderState(String orderId, Integer state) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ServeCoordinate; |
| | | import com.ruoyi.order.api.feignClient.ServeCoordinateClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class ServeCoordinateFallbackFactory implements FallbackFactory<ServeCoordinateClient> { |
| | | |
| | | @Override |
| | | public ServeCoordinateClient create(Throwable cause) { |
| | | return new ServeCoordinateClient() { |
| | | @Override |
| | | public R<List<ServeCoordinate>> serveCoordinateList(String orderId, String workerId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ServeRecord; |
| | | import com.ruoyi.order.api.feignClient.ServeRecordClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class ServeRecordFallbackFactory implements FallbackFactory<ServeRecordClient> { |
| | | |
| | | @Override |
| | | public ServeRecordClient create(Throwable cause) { |
| | | return new ServeRecordClient() { |
| | | @Override |
| | | public R<ServeRecord> serveRecordByOrderId(String orderId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.factory; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class WithdrawFallbackFactory implements FallbackFactory<WithdrawClient> { |
| | | |
| | | @Override |
| | | public WithdrawClient create(Throwable cause) { |
| | | return new WithdrawClient() { |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Withdraw> withdrawRecordDetail(Integer id) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<UserWithdrawRecordVO>> excelExport(WithdrawExportRequest exportRequest) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> batchDelete(String ids) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> withdrawExamine(Integer id, Integer state, String opinion, String openId, Integer userId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<BigDecimal> withdrawalTotalMoney(MoneyQueryRequest request) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> enableProcess(Integer enableProcess) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<WithdrawalSetting> withdrawProcess() { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<WithdrawalSetting> withdrawState() { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList(Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<Withdraw>> withdrawRecordByUser(String orderId, Integer userId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Boolean> confirmWithdrawByUser(String orderId, Integer userId, String openId, String userPhone) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Order>> withdrawListByUser(Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<Page<Withdraw>> withdrawRecordList(Integer userId, Integer pageNum, Integer pageSize) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<WithdrawDetailVO> withdrawDetailByUser(String orderId) { |
| | | return R.fail(cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.Evaluate; |
| | | import com.ruoyi.order.api.entity.EvaluatePageVO; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateVO; |
| | | import com.ruoyi.order.api.factory.EvaluateFallbackFactory; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = EvaluateFallbackFactory.class) |
| | | public interface EvaluateClient { |
| | | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param userNo 下单用户名称 |
| | | * @param workerName 师傅名称 |
| | | * @param orderNumber 订单编号 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @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); |
| | | |
| | | /** |
| | | * 订单评价详情 |
| | | * |
| | | * @param id 订单评价id |
| | | * @return 详情 |
| | | */ |
| | | @GetMapping(value = "/evaluate/detail") |
| | | R<Evaluate> detail(@RequestParam("id") Integer id); |
| | | |
| | | /** |
| | | * 根据id批量删除订单评价 |
| | | * |
| | | * @param ids 订单评价多条id拼接 |
| | | * @return 软删除结果 |
| | | */ |
| | | @GetMapping(value = "/evaluate/batchDelete") |
| | | R<String> batchDelete(@RequestParam("ids") String ids); |
| | | |
| | | /** |
| | | * 用户所关联评价记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "/evaluate/evaluateList") |
| | | R<Page<EvaluatePageVO>> evaluateList(@RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 根据师傅id获取评价列表 |
| | | * |
| | | * @param workerId 师傅id |
| | | * @return 评价列表 |
| | | */ |
| | | @GetMapping(value = "/evaluate/evaluateByWorkerId") |
| | | R<List<Evaluate>> evaluateByWorkerId(@RequestParam("workerId") Integer workerId); |
| | | |
| | | /** |
| | | * 根据订单id获取评价列表 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 评价详情 |
| | | */ |
| | | @ApiOperation(value = "根据订单id获取评价列表", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/evaluate/oneByOrderId") |
| | | R<Evaluate> oneByOrderId(@RequestParam("orderId") String orderId); |
| | | |
| | | /** |
| | | * 订单评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 订单评价列表 |
| | | */ |
| | | @GetMapping(value = "/evaluate/evaluateListByUser") |
| | | R<Page<OrderEvaluateVO>> evaluateListByUser(@RequestParam("userId") Integer userId, |
| | | @RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 提交评价 |
| | | * |
| | | * @param request 评价信息 |
| | | * @return 提交结果 |
| | | */ |
| | | @PostMapping(value = "/evaluate/evaluateSave") |
| | | R<Boolean> evaluateSave(@RequestBody OrderEvaluateSubmitRequest request); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.factory.ExchangeDispatchFallbackFactory; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ExchangeDispatchFallbackFactory.class) |
| | | public interface ExchangeDispatchClient { |
| | | |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | | * @param workerName 师傅姓名 |
| | | * @param userName 用户名称 |
| | | * @param orderNumber 订单编号 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @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); |
| | | |
| | | /** |
| | | * 订单改派 -远程调用 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "changeDispatch/changeDispatchSave") |
| | | R<Boolean> changeDispatchSave(@RequestBody ChangeDispatch changeDispatch); |
| | | |
| | | /** |
| | | * 订单改派详情 远程调用 |
| | | * |
| | | * @param id 订单id |
| | | * @return 改派详情 |
| | | */ |
| | | @GetMapping(value = "changeDispatch/changeDispatchOne") |
| | | R<ChangeDispatch> changeDispatchOne(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param id 订单改派id |
| | | * @return 改派详情 |
| | | */ |
| | | @GetMapping(value = "changeDispatch/detail") |
| | | R<ChangeDispatch> detail(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | * @return 保存结果 |
| | | */ |
| | | @ApiOperation(value = "新增订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "changeDispatch/save") |
| | | R<Boolean> save(@RequestBody ChangeDispatch changeDispatch); |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "订单改派新逻辑", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "changeDispatch/saveRecord") |
| | | R<Boolean> saveRecord(@RequestBody ChangeDispatch changeDispatch); |
| | | |
| | | /** |
| | | * 根据id批量删除订单改派 |
| | | * |
| | | * @param ids 订单改派多条id拼接 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping(value = "changeDispatch/batchDelete") |
| | | R<String> batchDelete(@RequestParam("ids") String ids); |
| | | |
| | | /** |
| | | * 订单改派师傅 |
| | | * |
| | | * @param changeId 改派订单id |
| | | * @param workerId 师傅id |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @return 改派结果 |
| | | */ |
| | | @GetMapping(value = "changeDispatch/changeWorker") |
| | | R<Boolean> changeWorker(@RequestParam("changeId") String changeId, @RequestParam("workerId") Integer workerId, |
| | | @RequestParam("name") String name, @RequestParam("phone") String phone); |
| | | |
| | | /** |
| | | * 拒绝订单改派申请 |
| | | * |
| | | * @param id 订单id |
| | | * @return 操作结果 |
| | | */ |
| | | @GetMapping(value = "changeDispatch/refuseChangeDispatch") |
| | | R<Boolean> refuseChangeDispatch(@RequestParam("id") String id); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.factory.OrderFallbackFactory; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = OrderFallbackFactory.class) |
| | | public interface OrderClient { |
| | | |
| | | /** |
| | | * 新增订单 |
| | | * 后台订单为指定订单,默认为待上门状态 |
| | | * |
| | | * @param orderRequest 站点信息 |
| | | * @return 返回结果 |
| | | */ |
| | | @PostMapping(value = "/order/save") |
| | | R<Boolean> save(@RequestBody OrderRequest orderRequest); |
| | | |
| | | /** |
| | | * 根据改派申请id获取订单详情 |
| | | * |
| | | * @param id 改派申请id |
| | | * @return 订单详情 |
| | | */ |
| | | @ApiOperation(value = "订单列表-订单详情", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/order/detailByExchangeId") |
| | | R<Order> detailByExchangeId(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 订单详情 |
| | | * |
| | | * @param id 订单id |
| | | * @return 订单信息 |
| | | */ |
| | | @GetMapping(value = "/order/detail") |
| | | R<Order> detail(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 更改订单信息 |
| | | * |
| | | * @param type 1:订单派单;2:订单改派 |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @param name 师傅名称 |
| | | * @param phone 师傅电话 |
| | | * @return 更改结果 |
| | | */ |
| | | @GetMapping(value = "/order/exchangeOrder") |
| | | R<Order> exchangeOrder(@RequestParam("type") Integer type, @RequestParam("orderId") String orderId, |
| | | @RequestParam("workerId") Integer workerId, @RequestParam("name") String name, |
| | | @RequestParam("phone") String phone); |
| | | |
| | | /** |
| | | * 根据id批量删除站点 |
| | | * |
| | | * @param ids 站点多条id拼接 |
| | | * @return 删除结果 |
| | | */ |
| | | @GetMapping(value = "/order/batchDelete") |
| | | R<Boolean> batchDelete(@RequestParam("ids") String ids); |
| | | |
| | | /** |
| | | * 订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页条数 |
| | | * @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); |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @return 查询参数 |
| | | */ |
| | | @PostMapping(value = "/order/excelExport") |
| | | R<List<Order>> excelExport(@RequestBody OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 根据前台用户id查询所有订单信息 |
| | | * |
| | | * @param phone 手机号 |
| | | * @return 订单列表 |
| | | */ |
| | | @GetMapping(value = "/order/queryList") |
| | | R<List<Order>> queryList(@RequestParam("phone") String phone); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | * @return 分页列表 |
| | | */ |
| | | @PostMapping(value = "/order/queryPage") |
| | | R<Page<Order>> queryPage(@RequestBody OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 查询参数 |
| | | * @return 统计 |
| | | */ |
| | | @PostMapping(value = "/order/orderPageCount") |
| | | R<OrderPageCountVO> orderPageCount(@RequestBody OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 更改订单状态 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param state 订单状态 |
| | | * @return 更改结果 |
| | | */ |
| | | @PostMapping(value = "/order/updateState") |
| | | R<Boolean> updateState(@RequestParam("orderId") String orderId, @RequestParam("state") Integer state); |
| | | |
| | | /** |
| | | * 申请改派审核通过后生成新订单 |
| | | * |
| | | * @param order 订单信息 |
| | | * @return 生成订单结果 |
| | | */ |
| | | @GetMapping(value = "/order/generateNewOrder") |
| | | R<Boolean> generateNewOrder(@RequestBody Order order); |
| | | |
| | | /** |
| | | * 回收订单统计 |
| | | * |
| | | * @param orderCount 查询所需参数 |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping(value = "/order/orderCountHome") |
| | | R<OrderResultVO> orderCountHome(@RequestBody OrderCountRequest orderCount); |
| | | |
| | | /** |
| | | * 用户所关联订单记录分页列表 |
| | | * |
| | | * @param userId 手机号 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "/order/orderList") |
| | | R<IPage<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 更改订单提现状态 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param state 提现状态 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping(value = "/order/updateWithdrawalState") |
| | | R<Boolean> updateWithdrawalState(@RequestParam("orderId") String orderId, |
| | | @RequestParam("state") Integer state); |
| | | |
| | | /** |
| | | * 根据类型获取交易额 |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @param type 查询类型 |
| | | * @return 交易额 |
| | | */ |
| | | @GetMapping(value = "/order/tradeMoney") |
| | | R<BigDecimal> tradeMoney(@RequestParam("cityList") List<String> cityList, |
| | | @RequestParam("type") String type); |
| | | |
| | | /** |
| | | * 师傅端-订单列表 |
| | | * |
| | | * @param userId 用户端 |
| | | * @param state 订单状态 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 条数 |
| | | * @return 交易额 |
| | | */ |
| | | @GetMapping(value = "/order/orderListWorker") |
| | | R<Page<Order>> orderListWorker(@RequestParam("userId") Integer userId, @RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 师傅端-根据师傅id获取订单数量 |
| | | * |
| | | * @param workerIds 师傅id集合 |
| | | * @return 接单列表 |
| | | */ |
| | | @PostMapping(value = "/order/workerOrderRank") |
| | | R<List<WorkerOrderRankVO>> workerOrderRank(@RequestBody List<Integer> workerIds); |
| | | |
| | | /** |
| | | * 师傅端-订单路线导航 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @param longitude 经度 |
| | | * @param latitude 纬度 |
| | | * @return 订单导航 |
| | | */ |
| | | @GetMapping(value = "/order/orderNavigation") |
| | | R<Path> orderNavigation(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId, |
| | | @RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude); |
| | | |
| | | /** |
| | | * 师傅端-已到达预约地点 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @return 修改订单状态 |
| | | */ |
| | | @GetMapping(value = "/order/reachPosition") |
| | | R<Boolean> reachPosition(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId); |
| | | |
| | | /** |
| | | * 师傅端-订单详情 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 订单详情 |
| | | */ |
| | | @GetMapping(value = "/order/orderDetail") |
| | | R<OrderDetailVO> orderDetail(@RequestParam("orderId") String orderId); |
| | | |
| | | /** |
| | | * 师傅端-提交订单 |
| | | * |
| | | * @param orderSubmitRequest 提交订单信息 |
| | | * @return 提交结果 |
| | | */ |
| | | @PostMapping(value = "/order/orderSubmit") |
| | | R<Boolean> orderSubmit(@RequestBody OrderSubmitRequest orderSubmitRequest); |
| | | |
| | | /** |
| | | * 师傅端-定时调度记录师傅所走路线经纬度 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @param longitude 经度 |
| | | * @param latitude 纬度 |
| | | * @return 保存记录结果 |
| | | */ |
| | | @ApiOperation(value = "订单进行-记录路线经纬度", tags = {"师傅端"}) |
| | | @GetMapping(value = "/order/coordinate") |
| | | R<Boolean> coordinate(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId, |
| | | @RequestParam("longitude") Double longitude, @RequestParam("latitude") Double latitude); |
| | | |
| | | /** |
| | | * 师傅端-代办列表 |
| | | * |
| | | * @param workerId 师傅id |
| | | * @return 订单列表 |
| | | */ |
| | | @ApiOperation(value = "根据师傅id查询订单", tags = {"师傅端"}) |
| | | @GetMapping(value = "/order/orderNotHandle") |
| | | R<List<Order>> orderNotHandle(@RequestParam("workerId") Integer workerId); |
| | | |
| | | /** |
| | | * 师傅端-根据师傅id查询订单并按照置顶顺序排序 |
| | | * |
| | | * @param workerId 师傅id |
| | | * @return 订单列表 |
| | | */ |
| | | @ApiOperation(value = "根据师傅id查询订单并按照置顶顺序排序", tags = {"师傅端"}) |
| | | @GetMapping(value = "/order/orderTopListByWorkerId") |
| | | R<List<Order>> orderTopListByWorkerId(@RequestParam("workerId") Integer workerId); |
| | | |
| | | /** |
| | | * 师傅端-订单代办列表 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @return 置顶结果 |
| | | */ |
| | | @ApiOperation(value = "订单置顶", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/order/orderTop") |
| | | R<Boolean> orderTop(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId); |
| | | |
| | | /** |
| | | * 师傅端-订单状态统计数量 |
| | | * |
| | | * @param workerId 师傅id |
| | | * @return 统计数量 |
| | | */ |
| | | @ApiOperation(value = "订单状态统计数量", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/order/orderStateCount") |
| | | R<WorkerOrderCountVO> orderStateCount(@RequestParam("workerId") Integer workerId); |
| | | |
| | | /** |
| | | * 更改订单状态 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param state 状态 |
| | | * @return 更改结果 |
| | | */ |
| | | @ApiOperation(value = "更改订单状态", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/order/changeOrderState") |
| | | R<Boolean> changeOrderState(@RequestParam("orderId") String orderId, @RequestParam("state") Integer state); |
| | | |
| | | /********************************* 用户端 ******************************************/ |
| | | |
| | | /** |
| | | * 师傅端-订单状态统计数量 |
| | | * |
| | | * @param userId 用户id |
| | | * @param state 订单状态 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 条数 |
| | | * @return 订单列表 |
| | | */ |
| | | @ApiOperation(value = "订单状态统计数量", tags = {"用户端"}) |
| | | @GetMapping(value = "/order/orderListByUser") |
| | | R<Page<Order>> orderListByUser(@RequestParam("userId") Integer userId, |
| | | @RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 用户端-生成预订单信息 |
| | | * |
| | | * @param userOrderRequest 下单参数 |
| | | * @return 下单结果 |
| | | */ |
| | | @ApiOperation(value = "生成预订单信息", tags = {"用户端"}) |
| | | @PostMapping(value = "/order/orderEstimate") |
| | | R<String> orderEstimate(@RequestBody UserOrderRequest userOrderRequest); |
| | | |
| | | /** |
| | | * 用户端-用户下单 |
| | | * |
| | | * @param userOrderRequest 下单参数 |
| | | * @return 下单结果 |
| | | */ |
| | | @ApiOperation(value = "下单", tags = {"用户端"}) |
| | | @PostMapping(value = "/order/placeOrder") |
| | | R<Boolean> placeOrder(@RequestBody UserOrderRequest userOrderRequest); |
| | | |
| | | /** |
| | | * 站点详情 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param prizeName 奖品名称 |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "补充订单津贴金额", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/order/supplementAllowance") |
| | | R<Boolean> supplementAllowance(@RequestParam("orderId") String orderId, |
| | | @RequestParam("prizeName") String prizeName); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ServeCoordinate; |
| | | import com.ruoyi.order.api.factory.ServeCoordinateFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ServeCoordinateFallbackFactory.class) |
| | | public interface ServeCoordinateClient { |
| | | |
| | | /** |
| | | * 根据订单id和师傅id获取订单路线轨迹 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @return 路线轨迹 |
| | | */ |
| | | @GetMapping(value = "/serveCoordinate/serveCoordinateList") |
| | | R<List<ServeCoordinate>> serveCoordinateList(@RequestParam("orderId") String orderId, |
| | | @RequestParam("workerId") String workerId); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.ServeRecord; |
| | | import com.ruoyi.order.api.factory.ServeRecordFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = ServeRecordFallbackFactory.class) |
| | | public interface ServeRecordClient { |
| | | |
| | | /** |
| | | * 根据订单id获取服务记录 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 服务记录 |
| | | */ |
| | | @GetMapping(value = "/serveRecord/serveRecordByOrderId") |
| | | R<ServeRecord> serveRecordByOrderId(@RequestParam("orderId") String orderId); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.api.feignClient; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.entity.*; |
| | | import com.ruoyi.order.api.factory.WithdrawFallbackFactory; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @since 2024.05.29 |
| | | */ |
| | | @FeignClient(contextId = "OrderClient", value = ServiceNameConstants.ORDER_SERVICE, fallbackFactory = WithdrawFallbackFactory.class) |
| | | public interface WithdrawClient { |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param nickname 用户昵称 |
| | | * @param userPhone 用户手机号 |
| | | * @param applyForTime 申请时间 |
| | | * @param state 状态 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawPage") |
| | | R<Page<UserWithdrawRecordVO>> withdrawPage(@RequestParam(value = "nickname", required = false) String nickname, |
| | | @RequestParam(value = "userPhone", required = false) String userPhone, |
| | | @RequestParam(value = "applyForTime", required = false) String applyForTime, |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 查看提现记录详情 |
| | | * |
| | | * @param id 提现记录id |
| | | * @return 提现详情 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawRecordDetail") |
| | | R<Withdraw> withdrawRecordDetail(@RequestParam("id") Integer id); |
| | | |
| | | /** |
| | | * 用户提现记录导出 |
| | | * |
| | | * @param exportRequest 提现记录 |
| | | * @return 筛选数据列表 |
| | | */ |
| | | @ApiOperation(value = "用户提现管理-excel导出用户提现记录", tags = {"后台-用户管理-提现列表"}) |
| | | @PostMapping(value = "/withdraw/excelExport") |
| | | R<List<UserWithdrawRecordVO>> excelExport(@RequestBody WithdrawExportRequest exportRequest); |
| | | |
| | | /** |
| | | * 批量删除提现记录 |
| | | * |
| | | * @param ids 提现记录多条id拼接 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @GetMapping(value = "/withdraw/batchDelete") |
| | | R<String> batchDelete(@RequestParam("ids") String ids); |
| | | |
| | | /** |
| | | * 提现管理-提现审批 |
| | | * |
| | | * @param id 提现记录id |
| | | * @param state 审批结果 |
| | | * @param opinion 审批意见 |
| | | * @param openId 微信用户openId |
| | | * @param userId 用户id |
| | | * @return 提现结果 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawExamine") |
| | | R<Boolean> withdrawExamine(@RequestParam("id") Integer id, @RequestParam("state") Integer state, |
| | | @RequestParam(value = "opinion", required = false) String opinion, |
| | | @RequestParam(value = "openId") String openId, |
| | | @RequestParam(value = "userId") Integer userId); |
| | | |
| | | /** |
| | | * 根据类型统计提现金额 |
| | | * |
| | | * @param request 根据类型统计提现金额 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @PostMapping(value = "/withdraw/withdrawalTotalMoney") |
| | | R<BigDecimal> withdrawalTotalMoney(@RequestBody MoneyQueryRequest request); |
| | | |
| | | /** |
| | | * 修改系统设置-关闭/开启审核 |
| | | * |
| | | * @param enableProcess 审核状态 |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "关闭/开启审核", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/withdraw/enableProcess") |
| | | R<Boolean> enableProcess(@RequestParam("enableProcess") Integer enableProcess); |
| | | |
| | | /** |
| | | * 获取系统设置-审核设置 |
| | | * --远程调用 |
| | | * |
| | | * @return 操作结果 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawProcess") |
| | | R<WithdrawalSetting> withdrawProcess(); |
| | | |
| | | /** |
| | | * 全局审核状态 |
| | | * |
| | | * @return 全局审核状态 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawState") |
| | | R<WithdrawalSetting> withdrawState(); |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawList") |
| | | R<Page<UserWithdrawRecordVO>> withdrawList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 根据订单获取用户提现申请记录 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param userId 用户id |
| | | * @return 提现记录 |
| | | */ |
| | | @GetMapping(value = "/withdraw/withdrawRecordByUser") |
| | | R<List<Withdraw>> withdrawRecordByUser(@RequestParam("orderId") String orderId, |
| | | @RequestParam("userId") Integer userId); |
| | | |
| | | /** |
| | | * 用户端-用户提交提现申请 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param userId 用户id |
| | | * @param openId 微信用户openId |
| | | * @param userPhone 用户手机号 |
| | | * @return 提现结果 |
| | | */ |
| | | @GetMapping(value = "/withdraw/confirmWithdrawByUser") |
| | | R<Boolean> confirmWithdrawByUser(@RequestParam("orderId") String orderId, |
| | | @RequestParam("userId") Integer userId, |
| | | @RequestParam("openId") String openId, |
| | | @RequestParam("userPhone") String userPhone); |
| | | |
| | | /** |
| | | * 用户订单列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param pageNum 页码 |
| | | * @param pageSize 条数 |
| | | * @return 订单列表 |
| | | */ |
| | | @GetMapping("/withdraw/withdrawListByUser") |
| | | R<Page<Order>> withdrawListByUser(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | @GetMapping("/withdraw/withdrawRecordList") |
| | | @ApiOperation(value = "用户提现申请记录", tags = {"用户端"}) |
| | | R<Page<Withdraw>> withdrawRecordList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize); |
| | | |
| | | /** |
| | | * 提现订单详情 |
| | | * |
| | | * @param orderId 订单id |
| | | * @return 订单详情 |
| | | */ |
| | | @GetMapping("/withdraw/withdrawDetailByUser") |
| | | R<WithdrawDetailVO> withdrawDetailByUser(@RequestParam("orderId") String orderId); |
| | | |
| | | } |
New file |
| | |
| | | com.ruoyi.order.api.factory.OrderFallbackFactory |
| | | com.ruoyi.order.api.factory.ExchangeDispatchFallbackFactory |
| | | com.ruoyi.order.api.factory.EvaluateFallbackFactory |
| | | com.ruoyi.order.api.factory.ServeCoordinateFallbackFactory |
| | | com.ruoyi.order.api.factory.ServeRecordFallbackFactory |
| | | com.ruoyi.order.api.factory.WithdrawFallbackFactory |
| | |
| | | @NotBlank(message = "请选择:账号所属角色") |
| | | private Long roleId; |
| | | |
| | | @ApiModelProperty("所属加盟商id") |
| | | @TableField("franchisee_id") |
| | | private Integer franchiseeId; |
| | | |
| | | public SysUser() { |
| | | } |
| | | |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * 登录账号是否为加盟商 |
| | | */ |
| | | private Boolean isFranchisee; |
| | | |
| | | /** |
| | | * 加盟商所管辖城市 |
| | | */ |
| | | private List<String> cityList; |
| | | |
| | | /** |
| | | * 用户信息 |
| | | */ |
| | | private SysUser sysUser; |
| | |
| | | */ |
| | | private String ipaddr; |
| | | |
| | | /** |
| | | * 是否可以登录 |
| | | * 该字段用于师傅端 - 互斥登录 |
| | | */ |
| | | private Boolean isCanLogin; |
| | | |
| | | public LoginUserInfo() { |
| | | this.isCanLogin = Boolean.TRUE; |
| | | } |
| | | } |
| | |
| | | |
| | | LoginUser userInfo = userResult.getData(); |
| | | SysUser user = userResult.getData().getSysUser(); |
| | | if (user.getFranchiseeId() == null) { |
| | | userInfo.setIsFranchisee(Boolean.FALSE); |
| | | }else { |
| | | userInfo.setIsFranchisee(Boolean.TRUE); |
| | | } |
| | | if (UserStatus.DELETED.getCode().equals(user.getIsDelete())) { |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); |
| | | throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: localhost:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: localhost:8848 |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | name: ${spring.application.name} |
| | | # 配置文件格式 |
| | | file-extension: yml |
| | |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>ruoyi-common-core</artifactId> |
| | | |
| | | |
| | | <description> |
| | | ruoyi-common-core核心模块 |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!--腾讯云文件上传--> |
| | | <dependency> |
| | | <groupId>com.qcloud</groupId> |
| | | <artifactId>cos_api</artifactId> |
| | | <version>5.6.89</version> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Openfeign --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | |
| | | |
| | | <!-- SpringCloud Loadbalancer --> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | |
| | | public final static long EXPIRATION = 720; |
| | | |
| | | /** |
| | | * 师傅端登录缓存 一个月 |
| | | */ |
| | | public final static long EXPIRE_TIME_WORKER = 43200; |
| | | |
| | | /** |
| | | * 缓存刷新时间,默认120(分钟) |
| | | */ |
| | | public final static long REFRESH_TIME = 120; |
| | |
| | | /** |
| | | * 微信获取授权openId地址 |
| | | */ |
| | | public static final String WX_OPENID_ADDRESS = "https://api.weixin.qq.com/sns/jscode2sess"; |
| | | public static final String WX_OPENID_ADDRESS = "https://api.weixin.qq.com/sns/jscode2session"; |
| | | |
| | | /** |
| | | * UTF-8 字符集 |
| | |
| | | public static final String REJECT_STR = "已驳回"; |
| | | |
| | | /** |
| | | * 家电以旧换新 |
| | | */ |
| | | public static final String TRADE_IN = "家电以旧换新"; |
| | | |
| | | /** |
| | | * 预约上门回收 |
| | | */ |
| | | public static final String RECOVERY = "预约上门回收"; |
| | | |
| | | /** |
| | | * 数字60 |
| | | */ |
| | | public static final Integer SIXTY = 60; |
| | |
| | | public static final Integer SIX = 6; |
| | | |
| | | /** |
| | | * 数字10 |
| | | */ |
| | | public static final Integer TEN = 10; |
| | | |
| | | /** |
| | | * 数字18 |
| | | */ |
| | | public static final Integer EIGHTEEN = 18; |
| | |
| | | */ |
| | | public final static String ADDRESS_TREE = "regin_tree"; |
| | | |
| | | /** |
| | | * 市区列表 |
| | | */ |
| | | public final static String URBAN_AREA = "urban_area"; |
| | | |
| | | |
| | | } |
| | |
| | | public static final String ADMIN_SERVICE = "ruoyi-admin"; |
| | | |
| | | /** |
| | | * 后台服务 |
| | | */ |
| | | public static final String ORDER_SERVICE = "ruoyi-order"; |
| | | |
| | | /** |
| | | * 师傅端服务 |
| | | */ |
| | | public static final String WORKER_SERVICE = "ruoyi-worker"; |
| | |
| | | return restResult(data, FAIL, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(T data, Integer code, String msg) { |
| | | return restResult(data, code, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(int code, String msg) { |
| | | return restResult(null, code, msg); |
| | | } |
| | |
| | | private String message; |
| | | |
| | | /** |
| | | * 错误码 |
| | | */ |
| | | private Integer code; |
| | | |
| | | /** |
| | | * 错误明细,内部调试错误 |
| | | * <p> |
| | | * 和 {@link CommonResult#getDetailMessage()} 一致的设计 |
| | |
| | | public GlobalException() { |
| | | } |
| | | |
| | | public GlobalException(Integer code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public GlobalException(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public GlobalException(String message, Integer code) { |
| | | this.message = message; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getDetailMessage() { |
| | |
| | | this.message = message; |
| | | return this; |
| | | } |
| | | |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(Integer code) { |
| | | this.code = code; |
| | | } |
| | | } |
| | |
| | | * @param destination 目的地经纬度 |
| | | * @return 路线规划信息 |
| | | */ |
| | | public static Object routing(String origin, String destination) { |
| | | public static Path routing(String origin, String destination) { |
| | | String baseUrl = "https://restapi.amap.com/v3/direction/driving?origin=%s&destination=%s" + |
| | | "&extensions=all&output=json&key=%s"; |
| | | String requestUrl = String.format(baseUrl, origin, destination, GAO_DE_KEY); |
| | |
| | | this.latitude = latitude; |
| | | } |
| | | |
| | | public PolylineData() { |
| | | } |
| | | } |
| | |
| | | public Collection<String> keys(final String pattern) { |
| | | return redisTemplate.keys(pattern); |
| | | } |
| | | |
| | | public Set getKeysPrefix(String accessToken) { |
| | | return redisTemplate.keys(accessToken + "*"); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @ExceptionHandler(GlobalException.class) |
| | | public R<String> handleDemoModeException(GlobalException g) { |
| | | return R.fail(g.getMessage()); |
| | | return R.fail(null, g.getCode(), g.getMessage()); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.common.security.service; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.JwtUtils; |
| | | import com.ruoyi.common.core.utils.ServletUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | |
| | | claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName); |
| | | |
| | | // 接口返回信息 |
| | | Map<String, Object> rspMap = new HashMap<String, Object>(); |
| | | Map<String, Object> rspMap = new HashMap<String, Object>(8); |
| | | rspMap.put("access_token", JwtUtils.createToken(claimsMap)); |
| | | rspMap.put("expires_in", expireTime); |
| | | rspMap.put("expires_in", CacheConstants.EXPIRE_TIME_WORKER); |
| | | return rspMap; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LoginUserInfo getLoginUserByWorker(String token) { |
| | | LoginUserInfo user = null; |
| | | try { |
| | | if (StringUtils.isNotEmpty(token)) { |
| | | String userkey = JwtUtils.getUserKeyByWorker(token); |
| | | user = redisService.getCacheObject(getTokenKeyByWorker(userkey)); |
| | | return user; |
| | | if (StringUtils.isNotEmpty(token)) { |
| | | String userkey = JwtUtils.getUserKeyByWorker(token); |
| | | user = redisService.getCacheObject(getTokenKeyByWorker(userkey)); |
| | | // 再次判断登录状态是否已过期 |
| | | if (null == user) { |
| | | throw new GlobalException("登录信息已过期,请重新登录!", 504); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("获取用户信息异常'{}'", e.getMessage()); |
| | | // 优先判断当前账号是否已在其他设备登录 |
| | | if (!user.getIsCanLogin()) { |
| | | throw new GlobalException("当前登录账号在其他设备登录!", 505); |
| | | } |
| | | // 再次判断登录状态是否已过期 |
| | | if (System.currentTimeMillis() > user.getExpireTime()) { |
| | | throw new GlobalException("登录信息已过期,请重新登录!", 504); |
| | | } |
| | | return user; |
| | | } |
| | | return user; |
| | | } |
| | |
| | | * @param loginUserInfo 登录信息 |
| | | */ |
| | | public void refreshTokenByWorker(LoginUserInfo loginUserInfo) { |
| | | // 获取所有 login_tokens_study: 前缀的登录缓存 |
| | | 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 (loginUserInfo.getUserid().equals(redisUserInfo.getUserid())) { |
| | | // 被挤账户 可登录状态 已经为 false时,跳出循环 |
| | | if (!redisUserInfo.getIsCanLogin()) { |
| | | continue; |
| | | } |
| | | // 设置能否登录字段为 否,当该token登录时,isCanLogin为false表示账号被挤 |
| | | redisUserInfo.setIsCanLogin(Boolean.FALSE); |
| | | redisService.setCacheObject(strKey, redisUserInfo, redisService.getExpire(strKey), TimeUnit.SECONDS); |
| | | } |
| | | } |
| | | loginUserInfo.setLoginTime(System.currentTimeMillis()); |
| | | loginUserInfo.setExpireTime(loginUserInfo.getLoginTime() + expireTime * MILLIS_MINUTE); |
| | | loginUserInfo.setExpireTime(loginUserInfo.getLoginTime() + CacheConstants.EXPIRE_TIME_WORKER * MILLIS_MINUTE); |
| | | // 根据uuid将loginUser缓存 |
| | | String userKey = getTokenKeyByWorker(loginUserInfo.getToken()); |
| | | redisService.setCacheObject(userKey, loginUserInfo, expireTime, TimeUnit.MINUTES); |
| | | redisService.setCacheObject(userKey, loginUserInfo, CacheConstants.EXPIRE_TIME_WORKER, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | private String getTokenKey(String token) { |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: localhost:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | # username: nacos |
| | | # password: jdhs_nacos! |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: localhost:8848 |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | name: ${spring.application.name} |
| | | # 线上nacos需要鉴权 |
| | | # username: nacos |
| | | # password: jdhs_nacos! |
| | | # 配置文件格式 |
| | | file-extension: yml |
| | | # 共享配置 |
| | |
| | | eager: true |
| | | transport: |
| | | # 控制台地址 |
| | | dashboard: 127.0.0.1:8718 |
| | | dashboard: localhost:8718 |
| | | # nacos配置持久化 |
| | | datasource: |
| | | ds1: |
| | | nacos: |
| | | server-addr: 127.0.0.1:8848 |
| | | server-addr: localhost:8848 |
| | | dataId: sentinel-ruoyi-gateway |
| | | groupId: DEFAULT_GROUP |
| | | data-type: json |
| | |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-admin</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.api.feignClient.AdminClient; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | @Autowired |
| | | private ISysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Resource |
| | | private AdminClient adminClient; |
| | | |
| | | @GetMapping("/page") |
| | | @ApiImplicitParams({ |
| | |
| | | sysUserVo.setRole(roles.getRoleName()); |
| | | sysUserVo.setRoleId(roles.getRoleId()); |
| | | sysUserVo.setPermissions(permissions); |
| | | if (null != sysUser.getFranchiseeId()) { |
| | | List<String> data = adminClient.cityDetail(sysUser.getFranchiseeId()).getData(); |
| | | sysUserVo.setCityList(data); |
| | | } |
| | | return R.ok(sysUserVo); |
| | | } |
| | | |
| | |
| | | # Tomcat |
| | | server: |
| | | port: 9201 |
| | | |
| | | # Spring |
| | | spring: |
| | | spring: |
| | | application: |
| | | # 应用名称 |
| | | name: ruoyi-system |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | |
| | | --- |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | name: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | name: ${spring.application.name} |
| | | # 配置文件格式 |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | |
| | | <module>ruoyi-user</module> |
| | | <module>ruoyi-admin</module> |
| | | <module>ruoyi-worker</module> |
| | | <module>ruoyi-order</module> |
| | | </modules> |
| | | |
| | | <dependencies> |
| | |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-system</artifactId> |
| | | <artifactId>ruoyi-api-user</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-user</artifactId> |
| | | <artifactId>ruoyi-api-order</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
New file |
| | |
| | | package com.ruoyi.admin.config; |
| | | |
| | | import com.qcloud.cos.COSClient; |
| | | import com.qcloud.cos.ClientConfig; |
| | | import com.qcloud.cos.auth.BasicCOSCredentials; |
| | | import com.qcloud.cos.auth.COSCredentials; |
| | | import com.qcloud.cos.region.Region; |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * 腾讯云对象存储客户端 |
| | | * @author HJL |
| | | */ |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "cos.client") |
| | | @Data |
| | | public class CosClientConfig { |
| | | |
| | | /** |
| | | * accessKey |
| | | */ |
| | | private String accessKey; |
| | | |
| | | /** |
| | | * secretKey |
| | | */ |
| | | private String secretKey; |
| | | |
| | | /** |
| | | * 区域 |
| | | */ |
| | | private String region; |
| | | |
| | | /** |
| | | * 桶名 |
| | | */ |
| | | private String bucket; |
| | | |
| | | @Bean |
| | | public COSClient cosClient() { |
| | | // 初始化用户身份信息(secretId, secretKey) |
| | | COSCredentials cred = new BasicCOSCredentials(accessKey, secretKey); |
| | | // 设置bucket的区域, COS地域的简称请参照 https://www.qcloud.com/document/product/436/6224 |
| | | ClientConfig clientConfig = new ClientConfig(new Region(region)); |
| | | // 生成cos客户端 |
| | | return new COSClient(cred, clientConfig); |
| | | } |
| | | } |
| | |
| | | // 是否软删除 |
| | | this.setFieldValByName("isDelete", 0, metaObject); |
| | | // 是否启用 默认启用 |
| | | this.setFieldValByName("delFlag", 0, metaObject); |
| | | this.setFieldValByName("delFlag", "0", metaObject); |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.ChangeDispatch; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.service.ChangeDispatchService; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.sorcket.WebSocketServer; |
| | | 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.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class ChangeDispatchController { |
| | | |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | private ExchangeDispatchClient dispatchClient; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<ChangeDispatch>> queryPageList(String workerName, String orderNumber, 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; |
| | | return R.ok(wrapper.eq(ChangeDispatch::getIsDelete, 0) |
| | | .orderByDesc(ChangeDispatch::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "新增订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<Boolean> save(@RequestBody ChangeDispatch changeDispatch) { |
| | | return R.ok(changeDispatchService.save(changeDispatch)); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派 -远程调用 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | */ |
| | | @ApiOperation(value = "新增订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "/changeDispatchSave") |
| | | public R<Boolean> changeDispatchSave(@RequestBody ChangeDispatch changeDispatch) { |
| | | return R.ok(changeDispatchService.save(changeDispatch)); |
| | | return R.ok(dispatchClient.save(changeDispatch).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<ChangeDispatch> detail(@RequestParam Integer id) { |
| | | return R.ok(changeDispatchService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 远程调用 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @GetMapping(value = "/one") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<ChangeDispatch> one(@RequestParam("id") Integer id) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, id) |
| | | .eq(ChangeDispatch::getState, Constants.ZERO) |
| | | .one(); |
| | | return R.ok(changeDispatch); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 远程调用 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @GetMapping(value = "/changeDispatchOne") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<ChangeDispatch> changeDispatchOne(@RequestParam("id") Integer id) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, id) |
| | | .eq(ChangeDispatch::getState, Constants.ZERO) |
| | | .one(); |
| | | return R.ok(changeDispatch); |
| | | public R<ChangeDispatch> detail(@RequestParam String id) { |
| | | return dispatchClient.detail(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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<ChangeDispatch> list = changeDispatchService.lambdaQuery().in(ChangeDispatch::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return changeDispatchService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | return dispatchClient.batchDelete(ids); |
| | | } |
| | | |
| | | /** |
| | | * 拒绝订单改派申请 |
| | | * |
| | | * @param id 改派申请记录id |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @ApiOperation(value = "拒绝订单改派申请", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/refuse") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "改派申请记录id", name = "id", dataType = "String", required = true) |
| | | }) |
| | | public R<Boolean> refuse(@RequestParam("id") String id) { |
| | | return dispatchClient.refuseChangeDispatch(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "改派订单id", name = "changeId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "师傅id", name = "workerId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> changeWorker(@RequestParam Integer changeId, @RequestParam Integer workerId) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getId, changeId) |
| | | .eq(ChangeDispatch::getIsDelete, 0).one(); |
| | | if (null == changeDispatch || Constants.ONE.equals(changeDispatch.getState())) { |
| | | throw new GlobalException("改派申请不存在或已改派!"); |
| | | } |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, changeDispatch.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单不存在!"); |
| | | } |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery().eq(MasterWorker::getId, workerId) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | // 师傅信息 |
| | | public R<String> changeWorker(@RequestParam String changeId, @RequestParam Integer workerId) { |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getId, workerId).eq(MasterWorker::getIsDelete, 0).one(); |
| | | if (null == masterWorker) { |
| | | throw new GlobalException("服务人员信息异常!"); |
| | | return R.fail("师傅信息异常!"); |
| | | } |
| | | // 原订单状态改为 5:已改派 |
| | | order.setState(Constants.FIVE); |
| | | boolean orderUpdate = orderService.updateById(order); |
| | | // 生成新订单信息 |
| | | Order newOrder = new Order(); |
| | | BeanUtils.copyProperties(order, newOrder); |
| | | newOrder.setId(null); |
| | | newOrder.setServerId(workerId); |
| | | newOrder.setServerName(masterWorker.getRealName()); |
| | | newOrder.setServerPhone(masterWorker.getPhone()); |
| | | newOrder.setState(Constants.ONE); |
| | | // 构建新订单 |
| | | boolean save = orderService.save(newOrder); |
| | | // 改派信息 |
| | | boolean update = changeDispatchService.lambdaUpdate().set(ChangeDispatch::getState, 1) |
| | | .eq(ChangeDispatch::getId, changeId).eq(ChangeDispatch::getIsDelete, 0).update(); |
| | | try { |
| | | WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(workerId)); |
| | | return orderUpdate && save && update ? R.ok() : R.fail(); |
| | | } catch (IOException e) { |
| | | return R.fail("师傅不在线!"); |
| | | 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("师傅不在线!"); |
| | | } |
| | | } |
| | | return R.fail("订单推送异常!"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Evaluate; |
| | | import com.ruoyi.admin.service.EvaluateService; |
| | | import com.ruoyi.admin.vo.EvaluatePageVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.entity.Evaluate; |
| | | import com.ruoyi.order.api.entity.EvaluatePageVO; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | 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.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class EvaluateController { |
| | | |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | private EvaluateClient evaluateClient; |
| | | |
| | | /** |
| | | * 订单评价分页列表 |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<EvaluatePageVO>> queryPageList(String userNo, String orderNumber, 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(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); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "订单评价id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Evaluate> detail(@RequestParam Integer id) { |
| | | return R.ok(evaluateService.getById(id)); |
| | | return evaluateClient.detail(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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<Evaluate> list = evaluateService.lambdaQuery().in(Evaluate::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return evaluateService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | return evaluateClient.batchDelete(ids); |
| | | } |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Franchisee; |
| | | import com.ruoyi.admin.entity.SysUser; |
| | | import com.ruoyi.admin.entity.UserRole; |
| | | import com.ruoyi.admin.service.FranchiseeService; |
| | | import com.ruoyi.admin.service.SysUserService; |
| | | import com.ruoyi.admin.service.UserRoleService; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | |
| | | |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | @Resource |
| | | private SysUserService sysUserService; |
| | | @Resource |
| | | private UserRoleService userRoleService; |
| | | |
| | | /** |
| | | * 加盟商信息分页列表 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "加盟商信息id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Franchisee> detail(@RequestParam Integer id) { |
| | | return R.ok(franchiseeService.getById(id)); |
| | | public R<Franchisee> detail(@RequestParam("id") Integer id) { |
| | | return R.ok(franchiseeService.lambdaQuery() |
| | | .eq(Franchisee::getId, id).eq(Franchisee::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 加盟商管辖城市详情 |
| | | * -- 远程调用 |
| | | * |
| | | * @param id 加盟商信息id |
| | | */ |
| | | @ApiOperation(value = "加盟商管辖城市详情", tags = {"后台-加盟商管理"}) |
| | | @GetMapping(value = "/cityDetail") |
| | | public R<List<String>> cityDetail(@RequestParam("id") Integer id) { |
| | | Franchisee franchisee = franchiseeService.lambdaQuery() |
| | | .eq(Franchisee::getId, id).eq(Franchisee::getIsDelete, 0).one(); |
| | | return R.ok(Arrays.stream(franchisee.getCity().split(",")).collect(Collectors.toList())); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "新增加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody @Validated Franchisee franchisee) { |
| | | checkFranchisee(franchisee); |
| | | if (null == franchisee.getAdminPassword() || StringUtils.isBlank(franchisee.getAdminPassword())) { |
| | | throw new GlobalException("请输入管理员初始密码!"); |
| | | } |
| | | String md5Password = checkFranchisee(franchisee); |
| | | boolean save = franchiseeService.save(franchisee); |
| | | // 生成sysUser账号 |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setFranchiseeId(franchisee.getId()); |
| | | sysUser.setNickName(franchisee.getName()); |
| | | sysUser.setAccount(franchisee.getAdminAccount()); |
| | | sysUser.setPassword(md5Password); |
| | | sysUser.setIsEnable(Constants.ONE); |
| | | sysUser.setIsDelete(Constants.ZERO); |
| | | save = save && sysUserService.save(sysUser); |
| | | // 添加账号与角色关联 |
| | | UserRole userRole = new UserRole(); |
| | | userRole.setUserId(sysUser.getUserId()); |
| | | userRole.setRoleId(franchisee.getRoleId().longValue()); |
| | | save = save && userRoleService.save(userRole); |
| | | //franchisee.setCityStr(String.valueOf(franchisee.getCityArr())); |
| | | return franchiseeService.save(franchisee) ? R.ok() : R.fail(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "修改加盟商信息", tags = {"后台-加盟商管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody @Validated Franchisee franchisee) { |
| | | checkFranchisee(franchisee); |
| | | String md5Password = checkFranchisee(franchisee); |
| | | SysUser sysUser = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getFranchiseeId, franchisee.getId()) |
| | | .eq(SysUser::getIsDelete, Constants.ZERO).one(); |
| | | if (null == sysUser) { |
| | | sysUser = new SysUser(); |
| | | sysUser.setNickName(franchisee.getName()); |
| | | sysUser.setAccount(franchisee.getAdminAccount()); |
| | | sysUser.setPassword(md5Password); |
| | | sysUser.setIsEnable(franchisee.getIsEnable()); |
| | | sysUser.setIsDelete(Constants.ZERO); |
| | | sysUserService.save(sysUser); |
| | | } else { |
| | | // 生成sysUser账号 |
| | | sysUser.setNickName(franchisee.getName()); |
| | | sysUser.setAccount(franchisee.getAdminAccount()); |
| | | sysUser.setPassword(md5Password); |
| | | sysUser.setIsEnable(franchisee.getIsEnable()); |
| | | sysUserService.updateById(sysUser); |
| | | } |
| | | |
| | | return franchiseeService.updateById(franchisee) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | public R<String> enable(@RequestParam Integer id, @RequestParam Integer enable) { |
| | | boolean update = franchiseeService.lambdaUpdate().set(Franchisee::getIsEnable, enable) |
| | | .eq(Franchisee::getId, id).update(); |
| | | // 启动/关闭后台账号 |
| | | sysUserService.lambdaUpdate() |
| | | .eq(SysUser::getFranchiseeId, id) |
| | | .set(SysUser::getIsEnable, enable).update(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param franchisee 加盟商信息 |
| | | */ |
| | | private void checkFranchisee(Franchisee franchisee) { |
| | | String city = franchisee.getCity(); |
| | | List<String> cityList = Arrays.stream(city.split(",")).collect(Collectors.toList()); |
| | | for (String c : cityList) { |
| | | Franchisee one = franchiseeService.lambdaQuery().like(Franchisee::getCity, c) |
| | | .eq(Franchisee::getIsDelete, 0).one(); |
| | | if (null != one) { |
| | | throw new GlobalException("当前所选城市中 " + c + " 已有加盟商所管辖!"); |
| | | } |
| | | private String checkFranchisee(Franchisee franchisee) { |
| | | LambdaQueryChainWrapper<Franchisee> wrapper = franchiseeService.lambdaQuery() |
| | | .eq(Franchisee::getAdminAccount, franchisee.getAdminAccount()) |
| | | .eq(Franchisee::getIsDelete, 0); |
| | | // 校验账号是否唯一 |
| | | Franchisee only; |
| | | if (null == franchisee.getId()) { |
| | | only = wrapper.one(); |
| | | } else { |
| | | only = wrapper.ne(Franchisee::getId, franchisee.getId()).one(); |
| | | } |
| | | // 校验后台账号是否存在当前账号 |
| | | SysUser user = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getAccount, franchisee.getAdminAccount()) |
| | | .eq(SysUser::getIsDelete, Constants.ZERO) |
| | | .eq(SysUser::getFranchiseeId, null).one(); |
| | | if (null != only || null != user) { |
| | | throw new GlobalException("该账号已存在!"); |
| | | } |
| | | // String city = franchisee.getCity(); |
| | | // List<String> cityList = Arrays.stream(city.split(",")).collect(Collectors.toList()); |
| | | // for (String c : cityList) { |
| | | // Franchisee one = franchiseeService.lambdaQuery().like(Franchisee::getCity, c) |
| | | // .eq(Franchisee::getIsDelete, 0).one(); |
| | | // if (null != one) { |
| | | // throw new GlobalException("当前所选城市中 " + c + " 已有加盟商所管辖!"); |
| | | // } |
| | | // } |
| | | // MD5加密登录密码(新) |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | String md5Password = passwordEncoder.encode(Constants.DEFAULT_PASSWORD); |
| | | String md5Password = passwordEncoder.encode(franchisee.getAdminPassword()); |
| | | franchisee.setAdminPassword(md5Password); |
| | | return md5Password; |
| | | } |
| | | |
| | | /** |
| | |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | List<Franchisee> list = franchiseeService.lambdaQuery().in(Franchisee::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | // 删除对应sysUser账号 |
| | | sysUserService.lambdaUpdate() |
| | | .in(SysUser::getFranchiseeId, idList) |
| | | .set(SysUser::getIsDelete, Constants.ONE).update(); |
| | | return franchiseeService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.request.OrderCountRequest; |
| | | import com.ruoyi.admin.request.UserDataCountRequest; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.admin.vo.MasterWorkerRankVO; |
| | | import com.ruoyi.admin.vo.OrderResultVO; |
| | | import com.ruoyi.admin.vo.UserDataCountVO; |
| | | import com.ruoyi.admin.vo.UserTrendsVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.entity.OrderCountRequest; |
| | | import com.ruoyi.order.api.entity.OrderResultVO; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | private OrderClient orderClient; |
| | | |
| | | /** |
| | | * 用户数据统计 |
| | | * |
| | | * @param userDataCountRequest 请求参数 |
| | | */ |
| | | @RequiresPermissions("homepage") |
| | | @ApiOperation(value = "后台-用户数据统计", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/userDataCount") |
| | | public R<UserDataCountVO> userDataCount(@RequestBody UserDataCountRequest userDataCountRequest) { |
| | |
| | | * |
| | | * @param cityList 城市列表 |
| | | */ |
| | | @RequiresPermissions("homepage") |
| | | @ApiOperation(value = "后台-用户增量", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/userTrends") |
| | | public R<List<UserTrendsVO>> userTrends(@RequestBody List<String> cityList) { |
| | |
| | | * |
| | | * @param orderCount 查询所需参数 |
| | | */ |
| | | @RequiresPermissions("homepage") |
| | | @ApiOperation(value = "后台-回收订单统计", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/orderCountHome") |
| | | public R<OrderResultVO> orderCountHome(@RequestBody OrderCountRequest orderCount) { |
| | | return R.ok(orderService.orderCountHome(orderCount)); |
| | | return orderClient.orderCountHome(orderCount); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param cityList 城市集合 |
| | | */ |
| | | @RequiresPermissions("homepage") |
| | | @ApiOperation(value = "后台-师傅接单排行", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/workerRanking") |
| | | public R<List<MasterWorkerRankVO>> workerRanking(@RequestBody List<String> cityList) { |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Evaluate; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.service.EvaluateService; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.vo.MasterWorkerDetailVO; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | 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.order.api.entity.Evaluate; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | private EvaluateClient evaluateClient; |
| | | |
| | | /** |
| | | * 师傅列表分页查询 (添加订单-选择师傅列表) |
| | |
| | | @ApiOperation(value = "师傅列表", tags = {"后台-师傅管理"}) |
| | | @GetMapping(value = "/selectServe") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "师傅姓名", name = "name", dataType = "String"), |
| | | @ApiImplicitParam(value = "师傅姓名", name = "workerName", dataType = "String"), |
| | | @ApiImplicitParam(value = "师傅电话", name = "phone", dataType = "String"), |
| | | @ApiImplicitParam(value = "服务城市", name = "city", dataType = "String"), |
| | | @ApiImplicitParam(value = "账号启用状态", name = "state", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页显示条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<MasterWorker>> selectServe(String name, String phone, String city, Integer state, |
| | | public R<IPage<MasterWorker>> selectServe(String workerName, String phone, String city, Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryChainWrapper<MasterWorker> wrapper = masterWorkerService.lambdaQuery(); |
| | | wrapper = StringUtils.isNotBlank(name) ? wrapper.like(MasterWorker::getRealName, name) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(workerName) ? wrapper.like(MasterWorker::getRealName, workerName) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(phone) ? wrapper.like(MasterWorker::getPhone, phone) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(city) ? wrapper.like(MasterWorker::getCity, city) : wrapper; |
| | | if (null != state) { |
| | |
| | | @ApiOperation(value = "新增师傅信息", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody MasterWorker masterWorker) { |
| | | boolean check = masterWorkerService.checkOnlyPhone(masterWorker.getPhone()); |
| | | boolean check = masterWorkerService.checkOnlyPhone(masterWorker.getPhone(), null); |
| | | if (check) { |
| | | // MD5加密登录密码(新) |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | |
| | | @ApiOperation(value = "修改师傅信息", tags = {"后台-师傅管理-师傅列表管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody @Validated MasterWorker masterWorker) { |
| | | boolean check = masterWorkerService.checkOnlyPhone(masterWorker.getPhone()); |
| | | boolean check = masterWorkerService.checkOnlyPhone(masterWorker.getPhone(), masterWorker.getId()); |
| | | if (check) { |
| | | return masterWorkerService.updateById(masterWorker) ? R.ok() : R.fail(); |
| | | } else { |
| | |
| | | MasterWorkerDetailVO workerDetail = new MasterWorkerDetailVO(); |
| | | BeanUtils.copyProperties(worker, workerDetail); |
| | | // 计算服务星级 |
| | | List<Evaluate> evaluateList = evaluateService.lambdaQuery().eq(Evaluate::getWorkerId, workerId) |
| | | .eq(Evaluate::getIsDelete, 0).list(); |
| | | List<BigDecimal> star = evaluateList.stream().map(Evaluate::getStarRating).collect(Collectors.toList()); |
| | | List<Evaluate> evaluateList = evaluateClient.evaluateByWorkerId(worker.getId()).getData(); |
| | | List<Double> star = evaluateList.stream().map(Evaluate::getStarRating).collect(Collectors.toList()); |
| | | if (!star.isEmpty()) { |
| | | // 总评分 / 评价数量 |
| | | BigDecimal starRating = star.stream().reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal result = starRating.divide(new BigDecimal(star.size()), 1, RoundingMode.HALF_UP); |
| | | workerDetail.setStarRating(result); |
| | | double sum = star.stream().mapToDouble(Double::doubleValue).sum(); |
| | | workerDetail.setStarRating(new BigDecimal(sum / star.size())); |
| | | } |
| | | return R.ok(workerDetail); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 系统通知列表 |
| | | * -- 远程调用 |
| | | */ |
| | | @RequiresPermissions("system_notice") |
| | | @ApiOperation(value = "系统通知列表(不分页)", tags = {"后台-系统设置-系统通知管理"}) |
| | | @GetMapping(value = "/noticesList") |
| | | public R<List<Notices>> noticesList() { |
| | |
| | | |
| | | /** |
| | | * 系统通知详情 |
| | | * -- 远程调用 |
| | | */ |
| | | @ApiOperation(value = "系统通知详情", tags = {"后台-系统设置-系统通知管理"}) |
| | | @GetMapping(value = "/noticesDetail") |
| | | public R<Notices> noticesDetail(@RequestParam("id") Integer id) { |
| | | return R.ok(noticesService.lambdaQuery().eq(Notices::getIsDelete, 0) |
| | | .eq(Notices::getId, id).one()); |
| | | } |
| | | |
| | | /** |
| | | * 系统通知详情 |
| | | * |
| | | * @param id 系统通知id |
| | | */ |
New file |
| | |
| | | /* |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | 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.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | */ |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-02 14:57 |
| | | *//* |
| | | |
| | | @RestController |
| | | @RequestMapping("/data") |
| | | @Api(tags = {"数据迁移"}) |
| | | public class OldDataController { |
| | | |
| | | @Resource |
| | | private DataOrderService dataOrderService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | @Resource |
| | | private DataUserService userService; |
| | | @Resource |
| | | private UserService newUserService; |
| | | @Resource |
| | | private DataTechnicianService technicianService; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private WorkerProcessService workerProcessService; |
| | | @Resource |
| | | private DataAddressService addressService; |
| | | @Resource |
| | | private UserRecipientService userRecipientService; |
| | | @Resource |
| | | private DataCateService cateService; |
| | | @Resource |
| | | private DataGoodsService goodsService; |
| | | @Resource |
| | | private RecoveryClassifyService classifyService; |
| | | |
| | | @GetMapping("/order") |
| | | @ApiOperation(value = "订单数据迁移", tags = {"数据迁移"}) |
| | | public R<String> oldData(Integer index) { |
| | | if (null != index && index.equals(8080)) { |
| | | List<Order> orderList = new ArrayList<>(); |
| | | List<Evaluate> evaluateList = new ArrayList<>(); |
| | | List<ServeRecord> serveRecordList = new ArrayList<>(); |
| | | List<DataOrder> list = dataOrderService.list(); |
| | | 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 province = data.getProvince(); |
| | | String city = data.getCity(); |
| | | String area = data.getArea(); |
| | | String address = data.getAddress(); |
| | | String xxAddress = data.getXxAddress(); |
| | | 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 reason = data.getReason(); |
| | | Date completeTime = data.getCompleteTime(); |
| | | String yhqrtp = data.getYhqrtp(); |
| | | String jjmptp = data.getJjmptp(); |
| | | String njtp = data.getNjtp(); |
| | | String wjhqttp = data.getWjhqttp(); |
| | | Integer drawnum = data.getDrawnum(); |
| | | Integer status = data.getStatus(); |
| | | Boolean jdStatus = data.getJdStatus(); |
| | | String ztServerUid = data.getZtServerUid(); |
| | | Boolean pjStatus = data.getPjStatus(); |
| | | Boolean timeStatus = data.getTimeStatus(); |
| | | Date createAt = data.getCreateAt(); |
| | | Integer serverSendnum = data.getServerSendnum(); |
| | | Integer userSendnum = data.getUserSendnum(); |
| | | Integer print = data.getPrint(); |
| | | // 新订单信息 |
| | | Order order = new Order(); |
| | | order.setId(id.intValue()); |
| | | order.setCity(city); |
| | | order.setOrderNumber(orderNo); |
| | | order.setServeId(serverUid.intValue()); |
| | | // 回收服务信息 |
| | | DataGoods dataGoods = goodsService.getById(productId); |
| | | order.setServeName(dataGoods.getName()); |
| | | order.setServePrice(new BigDecimal(dataGoods.getPgPrice())); |
| | | // order.setUserId(); |
| | | order.setReservationName(username); |
| | | order.setReservationPhone(phone); |
| | | order.setReservationAddress(address + xxAddress); |
| | | // 时间格式化 |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:ss"); |
| | | order.setTime(simpleDateFormat.format(smTime)); |
| | | DataTechnician technician = technicianService.getById(serverUid); |
| | | order.setServerId(serverUid.intValue()); |
| | | order.setServerName(technician.getUsername()); |
| | | order.setServerPhone(technician.getPhone()); |
| | | order.setReservationRemark(remark); |
| | | order.setOrderMoney(price.add(btPrice)); |
| | | 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()); |
| | | order.setCompleteTime(completeTime); |
| | | 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(BigDecimal.valueOf(pjLevel)); |
| | | evaluate.setCreateTime(new Date()); |
| | | evaluate.setUpdateTime(new Date()); |
| | | evaluate.setIsDelete(Constants.ZERO); |
| | | evaluateList.add(evaluate); |
| | | } |
| | | // 服务记录信息(回收拍照) |
| | | if (Constants.FOUR.equals(status)) { |
| | | ServeRecord serveRecord = new ServeRecord(); |
| | | serveRecord.setOrderId(order.getId()); |
| | | serveRecord.setPhoto(yhqrtp + "," + jjmptp + "," + njtp + "," + wjhqttp); |
| | | serveRecord.setCreateTime(new Date()); |
| | | serveRecord.setUpdateTime(new Date()); |
| | | serveRecord.setIsDelete(Constants.ZERO); |
| | | serveRecordList.add(serveRecord); |
| | | } |
| | | } |
| | | if (!orderList.isEmpty()) { |
| | | orderService.saveOrUpdateBatch(orderList); |
| | | } |
| | | if (!evaluateList.isEmpty()) { |
| | | evaluateService.saveOrUpdateBatch(evaluateList); |
| | | } |
| | | if (!serveRecordList.isEmpty()) { |
| | | serveRecordService.saveOrUpdateBatch(serveRecordList); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/user") |
| | | @ApiOperation(value = "用户数据迁移", tags = {"数据迁移"}) |
| | | public R<List<User>> user() { |
| | | */ |
| | | /*List<DataUser> list = userService.list(); |
| | | List<User> userList = new ArrayList<>(); |
| | | for (DataUser dataUser : list) { |
| | | Long id = dataUser.getId(); |
| | | String openid = dataUser.getOpenid(); |
| | | String avatar = dataUser.getAvatar(); |
| | | String nickname = dataUser.getNickname(); |
| | | Date createAt = dataUser.getCreateAt(); |
| | | // 新数据封装 |
| | | User user = new User(); |
| | | user.setId(id.intValue()); |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, RandomUtil.randomNumbers(Constants.EIGHT))); |
| | | user.setNickname(nickname); |
| | | user.setProfilePicture(avatar); |
| | | // todo 用户手机号无法拿到,后续验证码登录也无法登录 |
| | | // user.setPhone(""); |
| | | user.setState(Constants.ONE); |
| | | user.setOpenId(openid); |
| | | user.setCreateTime(createAt); |
| | | user.setUpdateTime(createAt); |
| | | user.setIsDelete(Constants.ZERO); |
| | | userList.add(user); |
| | | // 旧收货地址信息 |
| | | List<DataAddress> addressList = addressService.lambdaQuery() |
| | | .eq(DataAddress::getUid, id).list(); |
| | | if (!addressList.isEmpty()) { |
| | | List<UserRecipient> recipientList = new ArrayList<>(); |
| | | for (DataAddress dataAddress : addressList) { |
| | | Long uid = dataAddress.getUid(); |
| | | Boolean type = dataAddress.getType(); |
| | | String username = dataAddress.getUsername(); |
| | | String phone = dataAddress.getPhone(); |
| | | String address = dataAddress.getAddress(); |
| | | BigDecimal latitude = dataAddress.getLatitude(); |
| | | BigDecimal longitude = dataAddress.getLongitude(); |
| | | String xxdz = dataAddress.getXxdz(); |
| | | Date addressCreateAt = dataAddress.getCreateAt(); |
| | | // 新地址 |
| | | UserRecipient userRecipient = new UserRecipient(); |
| | | userRecipient.setUserId(uid.intValue()); |
| | | userRecipient.setRecipient(username); |
| | | userRecipient.setRecipientPhone(phone); |
| | | userRecipient.setAddress(address); |
| | | userRecipient.setAddressDetail(xxdz); |
| | | if (type) { |
| | | userRecipient.setIsDefault(Constants.ONE); |
| | | } else { |
| | | userRecipient.setIsDefault(Constants.ZERO); |
| | | } |
| | | userRecipient.setLongitude(longitude); |
| | | userRecipient.setLatitude(latitude); |
| | | userRecipient.setCreateTime(addressCreateAt); |
| | | userRecipient.setUpdateTime(addressCreateAt); |
| | | userRecipient.setIsDelete(Constants.ZERO); |
| | | recipientList.add(userRecipient); |
| | | } |
| | | userRecipientService.saveBatch(recipientList); |
| | | } |
| | | } |
| | | newUserService.saveBatch(userList); |
| | | return R.ok(userList);*//* |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/worker") |
| | | @ApiOperation(value = "师傅数据迁移", tags = {"数据迁移"}) |
| | | public R<Object> worker() { |
| | | */ |
| | | /*List<DataTechnician> list = technicianService.list(); |
| | | List<MasterWorker> workerList = new ArrayList<>(); |
| | | List<WorkerProcess> processList = new ArrayList<>(); |
| | | for (DataTechnician data : list) { |
| | | Long id = data.getId(); |
| | | String city = data.getCity(); |
| | | String username = data.getUsername(); |
| | | String phone = data.getPhone(); |
| | | String carType = data.getCarType(); |
| | | String carNumber = data.getCarNumber(); |
| | | String idcard = data.getIdcard(); |
| | | String idcardZ = data.getIdcardZ(); |
| | | String idcardF = data.getIdcardF(); |
| | | String xsz = data.getXsz(); |
| | | // 新师傅数据封装 |
| | | MasterWorker masterWorker = new MasterWorker(); |
| | | masterWorker.setId(id.intValue()); |
| | | masterWorker.setCity(city); |
| | | masterWorker.setUserNumber(username); |
| | | masterWorker.setRealName(username); |
| | | masterWorker.setIdNumber(idcard); |
| | | masterWorker.setVehicleType(carType); |
| | | masterWorker.setVehicleNumber(carNumber); |
| | | masterWorker.setPhone(phone); |
| | | // 默认密码 |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | String md5Password = passwordEncoder.encode(Constants.DEFAULT_PASSWORD); |
| | | masterWorker.setPassword(md5Password); |
| | | masterWorker.setIdentityPhoto(idcardZ + "," + idcardF); |
| | | masterWorker.setDrivingLicense(xsz); |
| | | masterWorker.setIsEnable(Constants.ONE); |
| | | masterWorker.setCreateTime(new Date()); |
| | | masterWorker.setUpdateTime(new Date()); |
| | | masterWorker.setIsDelete(Constants.ZERO); |
| | | workerList.add(masterWorker); |
| | | // 师傅入驻申请信息 |
| | | WorkerProcess workerProcess = new WorkerProcess(); |
| | | workerProcess.setCity(city); |
| | | workerProcess.setRealName(username); |
| | | workerProcess.setIdNumber(idcard); |
| | | workerProcess.setVehicleType(carType); |
| | | workerProcess.setVehicleNumber(carNumber); |
| | | workerProcess.setPhone(phone); |
| | | workerProcess.setIdentityPhoto(idcardZ + "," + idcardF); |
| | | workerProcess.setDrivingLicense(xsz); |
| | | workerProcess.setState(Constants.ONE); |
| | | workerProcess.setCreateTime(new Date()); |
| | | workerProcess.setUpdateTime(new Date()); |
| | | workerProcess.setIsDelete(Constants.ZERO); |
| | | processList.add(workerProcess); |
| | | } |
| | | boolean one = masterWorkerService.saveBatch(workerList); |
| | | boolean two = workerProcessService.saveBatch(processList); |
| | | return R.ok(one && two);*//* |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/serve") |
| | | @ApiOperation(value = "回收服务数据迁移", tags = {"数据迁移"}) |
| | | public R<Object> serve() { |
| | | */ |
| | | /*List<DataCate> list = cateService.list(); |
| | | Map<Long, DataCate> collect = list.stream().collect(Collectors.toMap(DataCate::getId, data -> data)); |
| | | List<DataGoods> goodList = goodsService.list(); |
| | | List<RecoveryClassify> serveList = new ArrayList<>(); |
| | | for (DataGoods dataGoods : goodList) { |
| | | DataCate dataCate = collect.get(Long.parseLong(dataGoods.getCateids())); |
| | | String cover = dataCate.getCover(); |
| | | String remark = dataCate.getRemark(); |
| | | String remarkJj = dataCate.getRemarkJj(); |
| | | Long sort = dataCate.getSort(); |
| | | Integer indexStatus = dataCate.getIndexStatus(); |
| | | // 新分类 |
| | | RecoveryClassify classify = new RecoveryClassify(); |
| | | classify.setId(dataGoods.getId().intValue()); |
| | | String item; |
| | | if (1L == dataCate.getPid()) { |
| | | item = "预约上门回收"; |
| | | }else { |
| | | item = "家电以旧换新"; |
| | | } |
| | | classify.setSupClassify(item); |
| | | classify.setSubClassify(dataGoods.getName()); |
| | | classify.setHomePageName(dataCate.getIndexName()); |
| | | classify.setClassificationPicture(cover); |
| | | classify.setTypeDescribe(remark); |
| | | classify.setSort(sort.intValue()); |
| | | classify.setBriefIntroduction(remarkJj); |
| | | classify.setIsRecommend(indexStatus); |
| | | classify.setCreateTime(new Date()); |
| | | classify.setUpdateTime(new Date()); |
| | | classify.setIsDelete(Constants.ZERO); |
| | | serveList.add(classify); |
| | | } |
| | | return R.ok(classifyService.saveBatch(serveList));*//* |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | */ |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.request.OrderQueryRequest; |
| | | 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.vo.OrderCountVO; |
| | | import com.ruoyi.admin.vo.OrderDetailVO; |
| | | import com.ruoyi.admin.vo.OrderPageCountVO; |
| | | 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.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.system.api.model.LoginUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private SiteService siteService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private RecoveryServePriceService recoveryServePriceService; |
| | | private SiteService siteService; |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private ExchangeDispatchClient dispatchClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private FranchiseeService franchiseeService; |
| | | |
| | | /** |
| | | * 雪花算法类 |
| | | */ |
| | | private static final SnowflakeIdWorker SNOW_FLAKE_ID_WORKER = new SnowflakeIdWorker(5, 5); |
| | | |
| | | /** |
| | | * socket测试 |
| | | */ |
| | | @ApiOperation(value = "socket测试", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/socketTest") |
| | | public R<String> socketTest(@RequestParam String msg, @RequestParam String id) { |
| | | try { |
| | | WebSocketServer.sendInfo(msg, id); |
| | | return R.ok("消息推送成功!"); |
| | | } catch (IOException e) { |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据前台用户id查询所有订单信息 |
| | |
| | | @ApiImplicitParam(value = "手机号", name = "phone", dataType = "String", required = true) |
| | | }) |
| | | public R<List<Order>> queryList(@RequestParam("phone") String phone) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getReservationPhone, phone).eq(Order::getIsDelete, 0).list()); |
| | | return R.ok(orderClient.queryList(phone).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<OrderDetailVO> detail(@RequestParam String id) { |
| | | public R<OrderDetailVO> orderDetail(@RequestParam String id) { |
| | | // 独立orderService |
| | | return R.ok(orderService.orderListDetail(id)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "订单列表-分页", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/queryPage") |
| | | public R<IPage<Order>> queryPage(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | return R.ok(orderService.queryPage(orderQueryRequest)); |
| | | public R<Page<Order>> queryPage(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<String> userCity = new ArrayList<>(); |
| | | if (loginUser.getIsFranchisee()) { |
| | | userCity = loginUser.getCityList(); |
| | | } |
| | | return R.ok(orderClient.queryPage(orderQueryRequest).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "订单列表-各订单数量统计", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/orderPageCount") |
| | | public R<OrderPageCountVO> orderPageCount(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | return R.ok(orderService.orderPageCount(orderQueryRequest)); |
| | | return R.ok(orderClient.orderPageCount(orderQueryRequest).getData()); |
| | | } |
| | | |
| | | /** |
| | | * 站点详情 |
| | | * |
| | | * @param id 站点id |
| | | * @param id 订单id |
| | | */ |
| | | @ApiOperation(value = "订单列表-订单详情", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataType = "Integer", required = true) |
| | | @ApiImplicitParam(value = "订单id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Order> detail(@RequestParam Integer id) { |
| | | return R.ok(orderService.getById(id)); |
| | | public R<Order> detail(@RequestParam String id) { |
| | | return R.ok(orderClient.detail(id).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "订单列表-新增订单", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Order order) { |
| | | public R<String> save(@RequestBody OrderRequest order) { |
| | | // 站点信息 |
| | | Site site = siteService.lambdaQuery() |
| | | .eq(Site::getId, order.getSiteId()) |
| | | .eq(Site::getIsDelete, 0).one(); |
| | | order.setSiteName(site.getSiteName()); |
| | | // 师傅信息 |
| | | if (null != order.getServerId()) { |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getId, order.getServerId()) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | order.setServerName(masterWorker.getRealName()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | // 待上门 |
| | | order.setState(Constants.ONE); |
| | | } else { |
| | | // 待派单状态 |
| | | order.setState(Constants.ZERO); |
| | | } |
| | | // 后台订单 |
| | | order.setType(Constants.ONE); |
| | | order.setSubsidy(BigDecimal.ZERO); |
| | | order.setOrderNumber(String.valueOf(SNOW_FLAKE_ID_WORKER.nextId())); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | order.setServeName(recoveryServe.getServeName()); |
| | | // 不同城市会有不同的回收价格 |
| | | RecoveryServePrice price = recoveryServePriceService.lambdaQuery() |
| | | .eq(RecoveryServePrice::getRecoveryServeId, recoveryServe.getId()) |
| | | .eq(RecoveryServePrice::getIsDelete, 0) |
| | | .eq(RecoveryServePrice::getCity, order.getCity()).one(); |
| | | if (null == price) { |
| | | order.setServePrice(recoveryServe.getDefaultPrice()); |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice()); |
| | | } else { |
| | | order.setServePrice(price.getRecoveryPrice()); |
| | | order.setOrderMoney(price.getRecoveryPrice()); |
| | | order.setServePrice(recoveryServe.getDefaultPrice()); |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice()); |
| | | Boolean data = orderClient.save(order).getData(); |
| | | if (null == data) { |
| | | return R.fail(orderClient.save(order).getMsg()); |
| | | } |
| | | // 师傅信息 |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getId, order.getServerId()) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | order.setServerName(masterWorker.getRealName()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | // 后台订单 |
| | | order.setType(Constants.ONE); |
| | | // 待派单状态 |
| | | order.setState(Constants.ONE); |
| | | order.setSubsidy(BigDecimal.ZERO); |
| | | order.setOrderNumber(String.valueOf(SNOW_FLAKE_ID_WORKER.nextId())); |
| | | return orderService.save(order) ? R.ok() : R.fail(); |
| | | try { |
| | | WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(order.getServerId())); |
| | | } catch (IOException e) { |
| | | return R.fail("订单推送失败!"); |
| | | } |
| | | return data ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "服务人员id", name = "workerId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "改派原因", name = "applyReason", dataType = "String") |
| | | }) |
| | | public R<String> reassignment(@RequestParam Integer type, @RequestParam Integer orderId, |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<String> reassignment(@RequestParam Integer type, @RequestParam String orderId, |
| | | @RequestParam Integer workerId, String applyReason) { |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getId, workerId) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | Order order = orderClient.exchangeOrder(type, orderId, workerId, |
| | | masterWorker.getRealName(), masterWorker.getPhone()).getData(); |
| | | // 订单派单 |
| | | boolean result = true; |
| | | if (Constants.ONE.equals(type)) { |
| | | order.setServerId(workerId); |
| | | order.setServerName(masterWorker.getRealName()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | order.setAcceptTime(new Date()); |
| | | order.setState(Constants.ONE); |
| | | result = orderService.updateById(order); |
| | | } else if (Constants.TWO.equals(type)) { |
| | | order.setServerId(workerId); |
| | | // 更新接单时间 |
| | | order.setAcceptTime(new Date()); |
| | | order.setServerName(masterWorker.getRealName()); |
| | | order.setServerPhone(masterWorker.getPhone()); |
| | | result = orderService.updateById(order); |
| | | if (Constants.TWO.equals(type)) { |
| | | if (order.getState().equals(Constants.SIX) || order.getState().equals(Constants.THREE)) { |
| | | orderClient.updateState(order.getId(), Constants.ONE); |
| | | } |
| | | // 生成改派信息 |
| | | ChangeDispatch changeDispatch = new ChangeDispatch(); |
| | | changeDispatch.setWorkerId(order.getServerId()); |
| | |
| | | changeDispatch.setApplyReason(applyReason); |
| | | changeDispatch.setApplyTime(new Date()); |
| | | changeDispatch.setState(Constants.ONE); |
| | | changeDispatch.setOrderId(String.valueOf(order.getId())); |
| | | changeDispatch.setOrderId(order.getId()); |
| | | changeDispatch.setOrderNumber(order.getOrderNumber()); |
| | | if (null != order.getUserId()) { |
| | | changeDispatch.setUserId(String.valueOf(order.getUserId())); |
| | | changeDispatch.setUserId(order.getUserId()); |
| | | } |
| | | changeDispatch.setUserName(order.getReservationName()); |
| | | changeDispatch.setIsDelete(Constants.ZERO); |
| | | changeDispatchService.save(changeDispatch); |
| | | result = dispatchClient.saveRecord(changeDispatch).getData(); |
| | | } |
| | | try { |
| | | WebSocketServer.sendInfo("您有一条新的订单,请注意查收!", String.valueOf(workerId)); |
| | |
| | | @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<Order> list = orderService.lambdaQuery().in(Order::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return orderService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | public R<Boolean> batchDelete(@RequestParam String ids) { |
| | | return R.ok(orderClient.batchDelete(ids).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "订单列表-excel导出", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/excelExport") |
| | | public R<String> excelExport(@RequestBody OrderQueryRequest orderQueryRequest, HttpServletResponse response) { |
| | | return orderService.excelExport(orderQueryRequest, response); |
| | | R<List<Order>> result = orderClient.excelExport(orderQueryRequest); |
| | | // 独立orderService |
| | | return orderService.excelExport(result.getData(), response); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<OrderCountVO>> orderCount(String name, 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(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(); |
| | | List<Integer> idList = data.getRecords().stream().map(OrderCountVO::getWorkerId) |
| | | .collect(Collectors.toList()); |
| | | List<MasterWorker> masterWorkerList; |
| | | if (!idList.isEmpty()) { |
| | | masterWorkerList = masterWorkerService.lambdaQuery() |
| | | .in(MasterWorker::getId, idList) |
| | | .eq(MasterWorker::getIsDelete, 0).list(); |
| | | } else { |
| | | masterWorkerList = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getIsDelete, 0).list(); |
| | | } |
| | | Map<Integer, String> map = masterWorkerList.stream().collect(Collectors.toMap(MasterWorker::getId, |
| | | mw -> Optional.ofNullable(mw.getProfilePicture()).orElse(""))); |
| | | for (OrderCountVO record : data.getRecords()) { |
| | | Integer workerId = record.getWorkerId(); |
| | | record.setProfilePicture(map.get(workerId)); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.utils.TencentCosUtil; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.ObsUploadUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author HJL |
| | |
| | | @Api(tags = "公共-文件上传") |
| | | public class OssController { |
| | | |
| | | @Resource |
| | | private TencentCosUtil tencentCosUtil; |
| | | |
| | | @PostMapping("/upload") |
| | | @ApiOperation(value = "文件上传", tags = "公共-文件上传") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "文件", name = "file", dataType = "MultipartFile", required = true) |
| | | }) |
| | | public R<String> upload(@RequestParam("file") MultipartFile file) { |
| | | try { |
| | | return R.ok(ObsUploadUtil.obsUpload(file), ""); |
| | | } catch (IOException e) { |
| | | return R.fail("文件上传失败!"); |
| | | } |
| | | String s = tencentCosUtil.upLoadFile(file); |
| | | return R.ok(s, s); |
| | | } |
| | | |
| | | } |
| | |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("system_site") |
| | | @RequiresPermissions("prize") |
| | | @ApiOperation(value = "奖品分页查询列表", tags = {"后台-系统设置-奖品管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 奖品id |
| | | */ |
| | | @RequiresPermissions("system_site") |
| | | @RequiresPermissions("prize") |
| | | @ApiOperation(value = "奖品详情", tags = {"后台-系统设置-奖品管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param prize 奖品信息 |
| | | */ |
| | | @RequiresPermissions("system_site") |
| | | @RequiresPermissions("prize") |
| | | @ApiOperation(value = "新增奖品", tags = {"后台-系统设置-奖品管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody Prize prize) { |
| | |
| | | * |
| | | * @param prize 奖品信息 |
| | | */ |
| | | @RequiresPermissions("system_site") |
| | | @RequiresPermissions("prize") |
| | | @ApiOperation(value = "编辑奖品", tags = {"后台-系统设置-奖品管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody Prize prize) { |
| | |
| | | * |
| | | * @param ids 奖品id拼接 |
| | | */ |
| | | @RequiresPermissions("system_site") |
| | | @RequiresPermissions("prize") |
| | | @ApiOperation(value = "批量删除奖品", tags = {"后台-系统设置-奖品管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | .orderByDesc(Prize::getCreateTime).list()); |
| | | } |
| | | |
| | | /** |
| | | * 奖品详情 -- 远程调用 |
| | | */ |
| | | @GetMapping(value = "/prizeDetail") |
| | | public R<Prize> prizeDetail(@RequestParam("id") String id) { |
| | | return R.ok(prizeService.lambdaQuery().eq(Prize::getIsDelete, 0) |
| | | .eq(Prize::getId, id).one()); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.admin.entity.RecoveryClassify; |
| | | import com.ruoyi.admin.service.RecoveryClassifyService; |
| | | 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("serve_recycling_classification") |
| | | @ApiOperation(value = "回收分类分页查询列表", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 回收分类id |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @ApiOperation(value = "回收分类详情", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | /** |
| | | * 是否首页推荐 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @ApiOperation(value = "是否首页推荐", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/recommend") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param recoveryClassify 回收分类信息 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @ApiOperation(value = "新增回收分类", tags = {"后台-回收管理-回收分类管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody RecoveryClassify recoveryClassify) { |
| | |
| | | * |
| | | * @param recoveryClassify 回收分类信息 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @ApiOperation(value = "修改回收分类", tags = {"后台-回收管理-回收分类管理"}) |
| | | @PostMapping(value = "/update") |
| | | public R<String> update(@RequestBody RecoveryClassify recoveryClassify) { |
| | |
| | | * |
| | | * @param ids 回收分类多条id拼接 |
| | | */ |
| | | @RequiresPermissions("serve_recycling_classification") |
| | | @ApiOperation(value = "批量删除回收分类", tags = {"后台-回收管理-回收分类管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.ruoyi.admin.service.RecoveryServePriceService; |
| | | import com.ruoyi.admin.service.RecoveryServeService; |
| | | import com.ruoyi.admin.vo.RecoveryServeResultVO; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | |
| | | @ApiOperation(value = "回收服务分页查询列表", tags = {"后台-回收管理-回收服务管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "服务名称", name = "serverName", dataType = "String"), |
| | | @ApiImplicitParam(value = "服务名称", name = "serveName", dataType = "String"), |
| | | @ApiImplicitParam(value = "回收价格起点", name = "startPrice", dataType = "String"), |
| | | @ApiImplicitParam(value = "回收价格终点", name = "endPrice", dataType = "String"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<RecoveryServe>> queryPageList(String serverName, String startPrice, String endPrice, |
| | | public R<IPage<RecoveryServe>> queryPageList(String serveName, String startPrice, String endPrice, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryChainWrapper<RecoveryServe> wrapper = recoveryServeService.lambdaQuery(); |
| | | // 服务名称模糊匹配 |
| | | wrapper = StringUtils.isNotBlank(serverName) ? wrapper.like(RecoveryServe::getServeName, serverName) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(serveName) ? wrapper.like(RecoveryServe::getServeName, serveName) : wrapper; |
| | | // 回收价格区间匹配 |
| | | wrapper = null != startPrice ? wrapper.ge(RecoveryServe::getDefaultPrice, startPrice) : wrapper; |
| | | wrapper = null != endPrice ? wrapper.le(RecoveryServe::getDefaultPrice, endPrice) : wrapper; |
| | |
| | | @GetMapping(value = "/typeList") |
| | | public R<List<RecoveryClassify>> typeList() { |
| | | return R.ok(recoveryClassifyService.lambdaQuery() |
| | | .orderByDesc(RecoveryClassify::getCreateTime).list()); |
| | | .eq(RecoveryClassify::getIsDelete, 0) |
| | | .orderByDesc(RecoveryClassify::getCreateTime) |
| | | .list()); |
| | | } |
| | | |
| | | /** |
| | |
| | | serve.setId(recoveryServeRequest.getId()); |
| | | boolean update = recoveryServeService.updateById(serve); |
| | | // 城市及对应回收价 |
| | | update = update && recoveryServePriceService.lambdaUpdate() |
| | | .set(RecoveryServePrice::getIsDelete, 1) |
| | | List<RecoveryServePrice> priceList = recoveryServePriceService.lambdaQuery() |
| | | .eq(RecoveryServePrice::getRecoveryServeId, recoveryServeRequest.getId()) |
| | | .update(); |
| | | .eq(RecoveryServePrice::getIsDelete, 0).list(); |
| | | if (!priceList.isEmpty()) { |
| | | for (RecoveryServePrice price : priceList) { |
| | | price.setIsDelete(Constants.ONE); |
| | | } |
| | | update = update && recoveryServePriceService.updateBatchById(priceList); |
| | | } |
| | | // 新增省市及回收价 |
| | | if (null != recoveryServeRequest.getPriceList()) { |
| | | for (RecoveryServePriceRequest data : recoveryServeRequest.getPriceList()) { |
| | |
| | | /** |
| | | * 轮播图列表 |
| | | */ |
| | | @RequiresPermissions("system_rotate") |
| | | @GetMapping(value = "/bannerList") |
| | | public R<List<Rotate>> bannerList() { |
| | | return R.ok(rotateService.lambdaQuery().eq(Rotate::getIsDelete, 0) |
| | | return R.ok(rotateService.lambdaQuery() |
| | | .eq(Rotate::getIsDelete, 0) |
| | | .orderByAsc(Rotate::getSort).list()); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.entity.WorkerProcess; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.SendSmsService; |
| | | import com.ruoyi.admin.service.WorkerProcessService; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @Resource |
| | | private SendSmsService sendSmsService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private WorkerProcessService workerProcessService; |
| | | |
| | | /** |
| | | * 发送派单短信给用户 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单记录id", name = "orderId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Object> dispatchSms(@RequestParam Integer orderId) { |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | public R<Object> dispatchSms(@RequestParam String orderId) { |
| | | com.ruoyi.order.api.entity.Order order = orderClient.detail(orderId).getData(); |
| | | if (null == order) { |
| | | return R.fail("订单不存在或已删除!"); |
| | | } |
| | |
| | | @ApiImplicitParam(value = "手机号", name = "phone", dataType = "String", required = true) |
| | | }) |
| | | public R<String> workerLoginSms(@RequestParam String phone) { |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getPhone, phone) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | if (null == masterWorker) { |
| | | return R.fail("当前手机号未注册!"); |
| | | } |
| | | return R.ok(sendSmsService.workerLoginSms(phone)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-找回密码/验证手机号/验证码登录 |
| | | * |
| | | * @param phone 订单记录id |
| | | */ |
| | | @ApiOperation(value = "师傅端-修改手机号时校验新手机号是否已注册", tags = {"发送短信"}) |
| | | @GetMapping(value = "/checkPhone") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号", name = "phone", dataType = "String", required = true) |
| | | }) |
| | | public R<String> checkPhone(@RequestParam String phone) { |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getPhone, phone) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | if (null != masterWorker) { |
| | | return R.fail("新手机号已注册!"); |
| | | } |
| | | return R.ok(sendSmsService.workerLoginSms(phone)); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(value = "手机号", name = "phone", dataType = "String", required = true) |
| | | }) |
| | | public R<String> workerSettleSms(@RequestParam String phone) { |
| | | // 校验该手机号是否已经生成账号 |
| | | MasterWorker masterWorker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getPhone, phone) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | WorkerProcess workerProcess = workerProcessService.lambdaQuery() |
| | | .eq(WorkerProcess::getPhone, phone) |
| | | .eq(WorkerProcess::getIsDelete, 0) |
| | | .orderByDesc(WorkerProcess::getCreateTime).last("limit 1").one(); |
| | | if (null != workerProcess) { |
| | | Integer state = workerProcess.getState(); |
| | | if (Constants.ZERO.equals(state)) { |
| | | return R.fail("该手机号已提交入驻申请,请等待审核!"); |
| | | } else if (Constants.ONE.equals(state) && null != masterWorker) { |
| | | return R.fail("该手机号入驻申请已通过,请前往登录!"); |
| | | } |
| | | } |
| | | return R.ok(sendSmsService.workerSettleSms(phone)); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.SysUser; |
| | | import com.ruoyi.admin.entity.UserRole; |
| | | import com.ruoyi.admin.request.PasswordRequest; |
| | | import com.ruoyi.admin.request.SysUserRequest; |
| | | import com.ruoyi.admin.service.SysUserService; |
| | | import com.ruoyi.admin.service.UserRoleService; |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "账号名称", name = "nickName", dataType = "String"), |
| | | @ApiImplicitParam(value = "账号", name = "account", dataType = "String"), |
| | | @ApiImplicitParam(value = "所属账号", name = "role", dataType = "String"), |
| | | @ApiImplicitParam(value = "所属账号", name = "roleId", dataType = "String"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<SysUser>> queryPageList(String nickName, String account, String role, |
| | | public R<IPage<SysUser>> queryPageList(String nickName, String account, String roleId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(sysUserService.queryPage(nickName, account, role, Page.of(pageNum, pageSize))); |
| | | return R.ok(sysUserService.queryPage(nickName, account, roleId, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | SysUser user = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getAccount, sysUserRequest.getAccount()) |
| | | .eq(SysUser::getIsDelete, 0).one(); |
| | | if (null != user) { |
| | | return R.fail("该账号已存在!"); |
| | | } |
| | | // 账号封装 |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setNickName(sysUserRequest.getNickName()); |
| | |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | SysUser user = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getAccount, sysUserRequest.getAccount()) |
| | | .eq(SysUser::getIsDelete, 0).one(); |
| | | if (null != user) { |
| | | return R.fail("该账号已存在!"); |
| | | } |
| | | // 修改账号信息 |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | LambdaUpdateChainWrapper<SysUser> wrapper = sysUserService.lambdaUpdate(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 修改密码 |
| | | * |
| | | * @param passwordRequest 账号信息 |
| | | */ |
| | | @ApiOperation(value = "修改密码", tags = {"后台-权限管理-账号管理"}) |
| | | @PostMapping(value = "/updatePassword") |
| | | public R<String> updatePassword(@RequestBody @Validated PasswordRequest passwordRequest) { |
| | | String account = passwordRequest.getAccount(); |
| | | String oldPassword = passwordRequest.getOldPassword(); |
| | | String newPassword = passwordRequest.getNewPassword(); |
| | | String confirmPassword = passwordRequest.getConfirmPassword(); |
| | | SysUser user = sysUserService.lambdaQuery() |
| | | .eq(SysUser::getAccount, account) |
| | | .eq(SysUser::getIsDelete, 0).one(); |
| | | if (null == user) { |
| | | return R.fail("账号不存在!"); |
| | | } else { |
| | | if (!newPassword.equals(confirmPassword)) { |
| | | return R.fail("新密码与二次确认密码不一致,请重新输入!"); |
| | | } |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | if (!passwordEncoder.matches(newPassword, oldPassword)) { |
| | | return R.fail("原密码错误,请重试!"); |
| | | } |
| | | // 校验通过,加密新的明文密码 |
| | | String encodeNewPassword = passwordEncoder.encode(newPassword); |
| | | user.setPassword(encodeNewPassword); |
| | | sysUserService.updateById(user); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 根据id批量删除账号 |
| | | * |
| | | * @param ids 账号id拼接 |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.vo.EvaluatePageVO; |
| | | import com.ruoyi.admin.vo.UserWithdrawRecordVO; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.order.api.entity.EvaluatePageVO; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import com.ruoyi.order.api.entity.UserWithdrawRecordVO; |
| | | import com.ruoyi.order.api.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | public class UserManageController { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private WithdrawService withdrawService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private WithdrawalSettingService withdrawalSettingService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private EvaluateClient evaluateClient; |
| | | @Resource |
| | | private WithdrawClient withdrawClient; |
| | | |
| | | /** |
| | | * 用户信息分页列表 |
| | |
| | | @ApiOperation(value = "用户详情-订单记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/orderList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户id", name = "userId", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "用户id", name = "userId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<Order>> orderList(Integer userId, |
| | | public R<IPage<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize))); |
| | | return R.ok(orderClient.orderList(userId, pageNum, pageSize).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<EvaluatePageVO>> evaluateList(Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(evaluateService.evaluateList(userId, Page.of(pageNum, pageSize))); |
| | | public R<Page<EvaluatePageVO>> evaluateList(Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return evaluateClient.evaluateList(userId, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "评价记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Void> deleteEvaluateRecord(@RequestParam Integer id) { |
| | | Evaluate evaluate = evaluateService.getById(id); |
| | | evaluate.setIsDelete(1); |
| | | return evaluateService.updateById(evaluate) ? R.ok() : R.fail(); |
| | | public R<String> deleteEvaluateRecord(@RequestParam Integer id) { |
| | | return evaluateClient.batchDelete(String.valueOf(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "审核状态(0:未开启,1:已开启)", name = "enableProcess", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> enableProcess(@RequestParam("enableProcess") Integer enableProcess) { |
| | | return R.ok(withdrawService.enableProcess(enableProcess)); |
| | | return withdrawClient.enableProcess(enableProcess); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @GetMapping(value = "/withdrawProcess") |
| | | public R<WithdrawalSetting> withdrawProcess() { |
| | | return R.ok(withdrawService.withdrawProcess()); |
| | | return withdrawClient.withdrawProcess(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "全局审核状态", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/withdrawState") |
| | | public R<WithdrawalSetting> withdrawState() { |
| | | // 全局审核设置 |
| | | WithdrawalSetting setting = withdrawalSettingService.lambdaQuery().one(); |
| | | return R.ok(setting); |
| | | return withdrawClient.withdrawProcess(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<UserWithdrawRecordVO>> withdrawList(@RequestParam Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawList(userId, Page.of(pageNum, pageSize))); |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList(@RequestParam Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return withdrawClient.withdrawList(userId, pageNum, pageSize); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Void> deleteWithdrawRecord(@RequestParam Integer id) { |
| | | Withdraw withdraw = withdrawService.getById(id); |
| | | withdraw.setIsDelete(1); |
| | | return withdrawService.updateById(withdraw) ? R.ok() : R.fail(); |
| | | public R<String> deleteWithdrawRecord(@RequestParam Integer id) { |
| | | return withdrawClient.batchDelete(String.valueOf(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> withdrawExamine(@RequestParam Integer id, @RequestParam Integer state, String opinion) { |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id).eq(Withdraw::getIsDelete, 0) |
| | | .eq(Withdraw::getState, 0).one(); |
| | | com.ruoyi.order.api.entity.Withdraw withdraw = withdrawClient.withdrawRecordDetail(id).getData(); |
| | | if (null == withdraw) { |
| | | return R.fail(503, "当前提现记录审批状态异常!"); |
| | | throw new GlobalException("提现记录不存在或已删除!"); |
| | | } |
| | | // 修改审批状态及审批意见 |
| | | withdraw.setState(state); |
| | | withdraw.setOpinion(opinion); |
| | | // 同意提现申请,更改订单提现状态 |
| | | boolean update = true; |
| | | if (Constants.ONE.equals(state)) { |
| | | update = orderService.lambdaUpdate().set(Order::getIsWithdrawal, Constants.ONE) |
| | | .eq(Order::getId, withdraw.getOrderId()).eq(Order::getIsDelete, 0).update(); |
| | | // 商家打款至用户微信零钱 |
| | | User user = userService.lambdaQuery().eq(User::getId, withdraw.getUserId()) |
| | | .eq(User::getIsDelete, 0).one(); |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, withdraw.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | } |
| | | Boolean b = withdrawService.confirmWithdraw(user, order); |
| | | User user = userService.lambdaQuery() |
| | | .eq(User::getId, withdraw.getUserId()) |
| | | .eq(User::getIsDelete, 0).one(); |
| | | if (null == user) { |
| | | throw new GlobalException("提交申请的用户信息不存在!"); |
| | | } |
| | | update = update && withdrawService.updateById(withdraw); |
| | | return update ? R.ok(null, "审批成功!") : R.fail("审批失败!"); |
| | | Boolean data = withdrawClient.withdrawExamine(id, state, opinion, user.getOpenId(), user.getId()).getData(); |
| | | if (null != data) { |
| | | return data ? R.ok(null, "审批成功!") : R.fail("审批失败!"); |
| | | } else { |
| | | return R.fail("审批失败!"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.entity.Withdraw; |
| | | import com.ruoyi.admin.request.WithdrawExportRequest; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.admin.service.WithdrawService; |
| | | import com.ruoyi.admin.vo.UserWithdrawRecordVO; |
| | | 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.UserWithdrawRecordVO; |
| | | import com.ruoyi.order.api.entity.Withdraw; |
| | | import com.ruoyi.order.api.entity.WithdrawExportRequest; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | 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.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private WithdrawService withdrawService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | private WithdrawClient withdrawClient; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<UserWithdrawRecordVO>> withdrawPage(String nickname, String userPhone, |
| | | String applyForTime, Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawPage(nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage(String nickname, String userPhone, |
| | | String applyForTime, Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<UserWithdrawRecordVO> page = withdrawClient.withdrawPage(nickname, userPhone, applyForTime, |
| | | state, pageNum, pageSize).getData(); |
| | | if (null != page) { |
| | | for (UserWithdrawRecordVO record : page.getRecords()) { |
| | | Integer userId = record.getUserId(); |
| | | User user = userService.lambdaQuery() |
| | | .eq(User::getId, userId) |
| | | .eq(User::getIsDelete, 0).one(); |
| | | if (null != user) { |
| | | record.setUserNo(user.getUserNo()); |
| | | record.setNickname(user.getNickname()); |
| | | record.setProfilePicture(user.getProfilePicture()); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Withdraw> withdrawRecordDetail(@RequestParam Integer id) { |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id) |
| | | .eq(Withdraw::getIsDelete, 0).one(); |
| | | return R.ok(withdraw); |
| | | return withdrawClient.withdrawRecordDetail(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> withdrawExamine(@RequestParam Integer id, @RequestParam Integer state, String opinion) { |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id).eq(Withdraw::getIsDelete, 0) |
| | | .eq(Withdraw::getState, 0).one(); |
| | | Withdraw withdraw = withdrawClient.withdrawRecordDetail(id).getData(); |
| | | if (null == withdraw) { |
| | | return R.fail(503, "当前提现记录审批状态异常!"); |
| | | throw new GlobalException("提现记录不存在或已删除!"); |
| | | } |
| | | // 修改审批状态及审批意见 |
| | | withdraw.setState(state); |
| | | withdraw.setOpinion(opinion); |
| | | // 同意提现申请,更改订单提现状态 |
| | | boolean update = true; |
| | | if (Constants.ONE.equals(state)) { |
| | | update = orderService.lambdaUpdate().set(Order::getIsWithdrawal, Constants.ONE) |
| | | .eq(Order::getId, withdraw.getOrderId()).eq(Order::getIsDelete, 0).update(); |
| | | // 商家打款至用户微信零钱 |
| | | User user = userService.lambdaQuery().eq(User::getId, withdraw.getUserId()) |
| | | .eq(User::getIsDelete, 0).one(); |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, withdraw.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | } |
| | | Boolean b = withdrawService.confirmWithdraw(user, order); |
| | | User user = userService.lambdaQuery() |
| | | .eq(User::getId, withdraw.getUserId()) |
| | | .eq(User::getIsDelete, 0).one(); |
| | | if (null == user) { |
| | | throw new GlobalException("提交申请的用户信息不存在!"); |
| | | } |
| | | update = update && withdrawService.updateById(withdraw); |
| | | return update ? R.ok(null, "审批成功!") : R.fail("审批失败!"); |
| | | Boolean data = withdrawClient.withdrawExamine(id, state, opinion, user.getOpenId(), user.getId()).getData(); |
| | | if (null != data) { |
| | | return data ? R.ok(null, "审批成功!") : R.fail("审批失败!"); |
| | | } else { |
| | | return R.fail("审批失败!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "用户提现管理-excel导出用户提现记录", tags = {"后台-用户管理-提现列表"}) |
| | | @PostMapping(value = "/excelExport") |
| | | public R<String> excelExport(@RequestBody WithdrawExportRequest exportRequest, HttpServletResponse response) { |
| | | return withdrawService.excelExport(exportRequest, response); |
| | | List<UserWithdrawRecordVO> data = withdrawClient.excelExport(exportRequest).getData(); |
| | | // 独立service |
| | | return withdrawService.excelExport(data, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | @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<Withdraw> list = withdrawService.lambdaQuery().in(Withdraw::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return withdrawService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | return withdrawClient.batchDelete(ids); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.WorkerProcess; |
| | | import com.ruoyi.admin.service.WorkerProcessService; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | 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("master_worker_process") |
| | | @ApiOperation(value = "师傅入驻审核分页查询列表", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户ID", name = "userNumber", dataType = "String"), |
| | | @ApiImplicitParam(value = "真实姓名", name = "workerName", dataType = "String"), |
| | | @ApiImplicitParam(value = "用户ID", name = "id", dataType = "String"), |
| | | @ApiImplicitParam(value = "真实姓名", name = "realName", dataType = "String"), |
| | | @ApiImplicitParam(value = "所属城市", name = "city", dataType = "String"), |
| | | @ApiImplicitParam(value = "当前状态(0:待审核 1:已通过 2:已驳回)", name = "state", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<WorkerProcess>> queryPageList(String userNumber, String workerName, String city, Integer state, |
| | | public R<IPage<WorkerProcess>> queryPageList(String id, String realName, String city, Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryChainWrapper<WorkerProcess> wrapper = workerProcessService.lambdaQuery(); |
| | | wrapper = StringUtils.isNotBlank(workerName) ? wrapper.like(WorkerProcess::getRealName, workerName) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(id) ? wrapper.like(WorkerProcess::getId, id) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(realName) ? wrapper.like(WorkerProcess::getRealName, realName) : wrapper; |
| | | wrapper = StringUtils.isNotBlank(city) ? wrapper.like(WorkerProcess::getCity, city) : wrapper; |
| | | wrapper = null != state ? wrapper.eq(WorkerProcess::getState, state) : wrapper; |
| | | return R.ok(wrapper.eq(WorkerProcess::getIsDelete, 0) |
| | |
| | | * |
| | | * @param id 师傅入驻审核id |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @ApiOperation(value = "师傅入驻审核详情", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param prize 师傅入驻审核信息 |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @ApiOperation(value = "新增师傅入驻审核", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<String> save(@RequestBody WorkerProcess prize) { |
| | | prize.setState(Constants.ZERO); |
| | | return workerProcessService.save(prize) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | * |
| | | * @param ids 师傅入驻审核id拼接 |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @ApiOperation(value = "批量删除师傅入驻审核", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | |
| | | * |
| | | * @param id 师傅入驻审核id |
| | | */ |
| | | @RequiresPermissions("master_worker_process") |
| | | @ApiOperation(value = "师傅入驻审核", tags = {"后台-师傅管理-师傅入驻审核管理"}) |
| | | @GetMapping(value = "/examine") |
| | | @ApiImplicitParams({ |
New file |
| | |
| | | package com.ruoyi.admin.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-02 |
| | | */ |
| | | @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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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-02 |
| | | */ |
| | | @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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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-01 |
| | | */ |
| | | @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 Date 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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @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.admin.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-02 |
| | | */ |
| | | @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.admin.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-02 |
| | | */ |
| | | @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; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("预估价格") |
| | | @TableField("estimate_price") |
| | | private BigDecimal estimatePrice; |
| | | private String estimatePrice; |
| | | |
| | | @ApiModelProperty("默认回收价") |
| | | @TableField("default_price") |
| | |
| | | package com.ruoyi.admin.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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-06-03 |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_serve_coordinate") |
| | | @ApiModel(value = "ServeCoordinate对象", description = "师傅路线经纬度信息") |
| | | public class ServeCoordinate extends BaseEntity { |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Integer id; |
| | | public class ServeCoordinate { |
| | | |
| | | @ApiModelProperty("师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("路线经纬度") |
| | | @TableField("coordinate") |
| | | private String coordinate; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @TableField("longitude") |
| | | private BigDecimal longitude; |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | @TableField("latitude") |
| | | private BigDecimal latitude; |
| | | private Double latitude; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private Integer roleId; |
| | | |
| | | @ApiModelProperty("所属加盟商id") |
| | | @TableField("franchisee_id") |
| | | private Integer franchiseeId; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | /** |
| | | * 申请状态中文(导出用) 0待审核;1已通过;2已驳回 |
| | |
| | | @TableField("opinion") |
| | | private String opinion; |
| | | |
| | | @ApiModelProperty("管辖城市二维数组") |
| | | @TableField("city_str") |
| | | private String cityStr; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataAddress; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataAddressMapper extends BaseMapper<DataAddress> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataAdvantage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataAdvantageMapper extends BaseMapper<DataAdvantage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataCate; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataCateMapper extends BaseMapper<DataCate> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataCollect; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataCollectMapper extends BaseMapper<DataCollect> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataDraw; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataDrawMapper extends BaseMapper<DataDraw> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataGoods; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataGoodsMapper extends BaseMapper<DataGoods> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataMessage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataMessageMapper extends BaseMapper<DataMessage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataOrder; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-01 |
| | | */ |
| | | @Mapper |
| | | public interface DataOrderMapper extends BaseMapper<DataOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataQuestion; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataQuestionMapper extends BaseMapper<DataQuestion> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataTechnician; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataTechnicianMapper extends BaseMapper<DataTechnician> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataTransfer; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataTransferMapper extends BaseMapper<DataTransfer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.DataUser; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Mapper |
| | | public interface DataUserMapper extends BaseMapper<DataUser> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.vo.MasterWorkerRankVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface MasterWorkerMapper extends BaseMapper<MasterWorker> { |
| | | |
| | | /** |
| | | * 师傅接单排行 |
| | | * |
| | | * @param workerIdList 师傅id集合 |
| | | * @return 排行信息 |
| | | */ |
| | | List<MasterWorkerRankVO> workerRanking(@Param("ids") List<Integer> workerIdList); |
| | | } |
| | |
| | | package com.ruoyi.admin.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.request.OrderQueryRequest; |
| | | import com.ruoyi.admin.vo.OrderCountVO; |
| | | import com.ruoyi.admin.vo.OrderQueryVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | /** |
| | | * 查询本年订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByYear(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询本月订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByMonth(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询本周订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByWeek(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询当天订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByToday(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询整个季度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param startDateStr 季度开始时间 |
| | | * @param endDateStr 季度结束时间 |
| | | * @param cityList 城市集合 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByQuarter(@Param("start") String startDateStr, @Param("end") String endDateStr, |
| | | @Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 查询整个年度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByYear(@Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 查询整个月度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByMonth(@Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 订单管理-订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param page 分页 |
| | | * @return 分页统计 |
| | | */ |
| | | IPage<OrderCountVO> orderCount(@Param("name") String name, @Param("phone") String phone, Page<OrderCountVO> page); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | * @param page 分页 |
| | | * @return 分页 |
| | | */ |
| | | IPage<Order> queryPage(@Param("data") OrderQueryRequest orderQueryRequest, Page<Order> page); |
| | | |
| | | /** |
| | | * 订单管理分页模块,订单数量统计 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @return 统计数量 |
| | | */ |
| | | List<Order> orderPageCount(@Param("data") OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 根据所选id查询 |
| | | * |
| | | * @param ids id集合 |
| | | * @return 返回列表 |
| | | */ |
| | | List<Order> exportByIdList(List<String> ids); |
| | | |
| | | /** |
| | | * 根据筛选条件查询 |
| | | * |
| | | * @param orderQueryRequest 筛选条件 |
| | | * @return 返回列表 |
| | | */ |
| | | List<Order> exportList(@Param("data") OrderQueryRequest orderQueryRequest); |
| | | // /** |
| | | // * 查询本年订单数量 |
| | | // * |
| | | // * @param cityList 城市集合 |
| | | // * @param orderState 订单状态 |
| | | // * @param startTime 开始日期 |
| | | // * @param endTime 结束日期 |
| | | // * @return 本年订单数量 |
| | | // List<OrderQueryVO> orderCountByYear(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | // @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | // |
| | | // * |
| | | // * 查询本月订单数量 |
| | | // * |
| | | // * @param cityList 城市集合 |
| | | // * @param orderState 订单状态 |
| | | // * @param startTime 开始日期 |
| | | // * @param endTime 结束日期 |
| | | // * @return 本年订单数量 |
| | | // |
| | | // List<OrderQueryVO> orderCountByMonth(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | // @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | // |
| | | // * |
| | | // * 查询本周订单数量 |
| | | // * |
| | | // * @param cityList 城市集合 |
| | | // * @param orderState 订单状态 |
| | | // * @param startTime 开始日期 |
| | | // * @param endTime 结束日期 |
| | | // * @return 本年订单数量 |
| | | // |
| | | // List<OrderQueryVO> orderCountByWeek(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | // @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | // |
| | | // * |
| | | // * 查询当天订单数量 |
| | | // * |
| | | // * @param cityList 城市集合 |
| | | // * @param orderState 订单状态 |
| | | // * @param startTime 开始日期 |
| | | // * @param endTime 结束日期 |
| | | // * @return 本年订单数量 |
| | | // |
| | | // List<OrderQueryVO> orderCountByToday(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | // @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | // |
| | | // * |
| | | // * 查询整个季度的交易额(订单状态为:已完工) |
| | | // * |
| | | // * @param startDateStr 季度开始时间 |
| | | // * @param endDateStr 季度结束时间 |
| | | // * @param cityList 城市集合 |
| | | // * @return 总交易额 |
| | | // |
| | | // BigDecimal totalMoneyByQuarter(@Param("start") String startDateStr, @Param("end") String endDateStr, |
| | | // @Param("cityList") List<String> cityList); |
| | | // |
| | | // * |
| | | // * 查询整个年度的交易额(订单状态为:已完工) |
| | | // * |
| | | // * @param cityList 城市集合 |
| | | // * @return 总交易额 |
| | | // |
| | | // BigDecimal totalMoneyByYear(@Param("cityList") List<String> cityList); |
| | | // |
| | | // * |
| | | // * 查询整个月度的交易额(订单状态为:已完工) |
| | | // * |
| | | // * @param cityList 城市列表 |
| | | // * @return 总交易额 |
| | | // |
| | | // BigDecimal totalMoneyByMonth(@Param("cityList") List<String> cityList); |
| | | // |
| | | // * |
| | | // * 订单管理-订单统计 |
| | | // * |
| | | // * @param name 师傅姓名 |
| | | // * @param phone 师傅电话 |
| | | // * @param page 分页 |
| | | // * @return 分页统计 |
| | | // |
| | | // IPage<OrderCountVO> orderCount(@Param("name") String name, @Param("phone") String phone, Page<OrderCountVO> page); |
| | | // |
| | | // * |
| | | // * 订单列表 |
| | | // * |
| | | // * @param orderQueryRequest 订单列表查询参数 |
| | | // * @param page 分页 |
| | | // * @return 分页 |
| | | // |
| | | // IPage<Order> queryPage(@Param("data") OrderQueryRequest orderQueryRequest, Page<Order> page); |
| | | // |
| | | // * |
| | | // * 订单管理分页模块,订单数量统计 |
| | | // * |
| | | // * @param orderQueryRequest 筛选参数 |
| | | // * @return 统计数量 |
| | | // |
| | | // List<Order> orderPageCount(@Param("data") OrderQueryRequest orderQueryRequest); |
| | | // |
| | | // * |
| | | // * 根据所选id查询 |
| | | // * |
| | | // * @param ids id集合 |
| | | // * @return 返回列表 |
| | | // |
| | | // List<Order> exportByIdList(List<String> ids); |
| | | // |
| | | // * |
| | | // * 根据筛选条件查询 |
| | | // * |
| | | // * @param orderQueryRequest 筛选条件 |
| | | // * @return 返回列表 |
| | | // |
| | | // List<Order> exportList(@Param("data") OrderQueryRequest orderQueryRequest);*/ |
| | | } |
| | |
| | | @ApiModelProperty("导出ids集合") |
| | | private List<String> ids; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.request; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * 用户信息表 |
| | | * |
| | | * @author hjl |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @ApiModel(value = "后台修改密码对象", description = "后台修改密码对象") |
| | | public class PasswordRequest { |
| | | |
| | | @ApiModelProperty("账号") |
| | | @NotBlank(message = "账号不能为空!") |
| | | private String account; |
| | | |
| | | @ApiModelProperty("原密码") |
| | | @NotBlank(message = "原密码不能为空!") |
| | | private String oldPassword; |
| | | |
| | | @ApiModelProperty("新密码") |
| | | @NotBlank(message = "新密码不能为空!") |
| | | private String newPassword; |
| | | |
| | | @ApiModelProperty("二次确认密码") |
| | | @NotNull(message = "二次确认密码不能为空!") |
| | | private String confirmPassword; |
| | | |
| | | } |
| | |
| | | private String serveDescribe; |
| | | |
| | | @ApiModelProperty("预估价格") |
| | | private BigDecimal estimatePrice; |
| | | private String estimatePrice; |
| | | |
| | | @ApiModelProperty("默认回收价") |
| | | private BigDecimal defaultPrice; |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataAddress; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataAddressService extends IService<DataAddress> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataAdvantage; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataAdvantageService extends IService<DataAdvantage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataCate; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataCateService extends IService<DataCate> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataCollect; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataCollectService extends IService<DataCollect> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataDraw; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataDrawService extends IService<DataDraw> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataGoods; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataGoodsService extends IService<DataGoods> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataMessage; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataMessageService extends IService<DataMessage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataOrder; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-01 |
| | | */ |
| | | public interface DataOrderService extends IService<DataOrder> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataQuestion; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataQuestionService extends IService<DataQuestion> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataTechnician; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataTechnicianService extends IService<DataTechnician> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataTransfer; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataTransferService extends IService<DataTransfer> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.DataUser; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | public interface DataUserService extends IService<DataUser> { |
| | | |
| | | } |
| | |
| | | * 校验师傅手机号是否唯一 |
| | | * |
| | | * @param phone 注册手机号 |
| | | * @param id 师傅id |
| | | * @return 是否唯一 |
| | | */ |
| | | boolean checkOnlyPhone(String phone); |
| | | boolean checkOnlyPhone(String phone, Integer id); |
| | | } |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.request.OrderCountRequest; |
| | | import com.ruoyi.admin.request.OrderQueryRequest; |
| | | import com.ruoyi.admin.vo.OrderCountVO; |
| | | import com.ruoyi.admin.vo.OrderDetailVO; |
| | | import com.ruoyi.admin.vo.OrderPageCountVO; |
| | | import com.ruoyi.admin.vo.OrderResultVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public interface OrderService extends IService<Order> { |
| | | |
| | | /** |
| | | * 回收订单统计 |
| | | * |
| | | * @param orderCount 查询所需参数 |
| | | * @return 柱状图数据 |
| | | */ |
| | | OrderResultVO orderCountHome(OrderCountRequest orderCount); |
| | | |
| | | /** |
| | | * 查询整个季度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param startDateStr 季度开始时间 |
| | | * @param endDateStr 季度结束时间 |
| | | * @param cityList 城市列表 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByQuarter(String startDateStr, String endDateStr, List<String> cityList); |
| | | |
| | | /** |
| | | * 查询整个年度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByYear(List<String> cityList); |
| | | |
| | | /** |
| | | * 查询整个月度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByMonth(List<String> cityList); |
| | | |
| | | /** |
| | | * excel模板导出 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @param response 响应体 |
| | | * @param orderList 订单列表 |
| | | * @param response 响应体 |
| | | * @return 导出结果 |
| | | */ |
| | | R<String> excelExport(OrderQueryRequest orderQueryRequest, HttpServletResponse response); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | * @return 分页 |
| | | */ |
| | | IPage<Order> queryPage(OrderQueryRequest orderQueryRequest); |
| | | R<String> excelExport(List<com.ruoyi.order.api.entity.Order> orderList, HttpServletResponse response); |
| | | |
| | | /** |
| | | * 订单列表-查询订单详情(包含服务信息、师傅信息、服务记录、订单评价) |
| | |
| | | */ |
| | | OrderDetailVO orderListDetail(String id); |
| | | |
| | | /** |
| | | * 订单管理-订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param page 分页 |
| | | * @return 分页统计 |
| | | */ |
| | | IPage<OrderCountVO> orderCount(String name, String phone, Page<OrderCountVO> page); |
| | | |
| | | /** |
| | | * 订单管理分页模块,订单数量统计 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @return 统计数量 |
| | | */ |
| | | OrderPageCountVO orderPageCount(OrderQueryRequest orderQueryRequest); |
| | | } |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | |
| | | /** |
| | | * @author HJL |
| | |
| | | package com.ruoyi.admin.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.entity.Withdraw; |
| | | import com.ruoyi.admin.entity.WithdrawalSetting; |
| | | import com.ruoyi.admin.request.WithdrawExportRequest; |
| | | import com.ruoyi.admin.vo.UserWithdrawRecordVO; |
| | | import com.ruoyi.common.core.domain.R; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | public interface WithdrawService extends IService<Withdraw> { |
| | | public interface WithdrawService { |
| | | |
| | | /** |
| | | * excel模板导出 |
| | | * |
| | | * @param exportRequest 提现记录 |
| | | * @param response 响应体 |
| | | * @param data 提现记录 |
| | | * @param response 响应体 |
| | | * @return 导出结果 |
| | | */ |
| | | R<String> excelExport(WithdrawExportRequest exportRequest, HttpServletResponse response); |
| | | R<String> excelExport(List<com.ruoyi.order.api.entity.UserWithdrawRecordVO> data, HttpServletResponse response); |
| | | |
| | | /** |
| | | * 获取用户提现金额 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param startDateStr 季度开始时间 |
| | | * @param endDateStr 季度结束时间 |
| | | * @return 总金额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoney(List<String> cityList, String startDateStr, String endDateStr); |
| | | |
| | | /** |
| | | * 年度查询 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @return 年度提现总额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoneyByYear(List<String> cityList); |
| | | |
| | | /** |
| | | * 月度查询 |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 年度提现总额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoneyByMonth(List<String> cityList); |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param page 分页参数 |
| | | * @return 分页列表 |
| | | */ |
| | | IPage<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 关闭/开启审核 |
| | | * |
| | | * @param enableProcess 关闭/开启审核 |
| | | * @return 操作结果 |
| | | */ |
| | | Boolean enableProcess(Integer enableProcess); |
| | | |
| | | /** |
| | | * 获取全局审核设置 |
| | | * |
| | | * @return 审核设置 |
| | | */ |
| | | WithdrawalSetting withdrawProcess(); |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param nickname 用户名称 |
| | | * @param userPhone 用户手机号 |
| | | * @param applyForTime 申请开始时间 |
| | | * @param state 审核状态 |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | IPage<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, |
| | | Integer state, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 提现审批通过,微信打款 |
| | | * |
| | | * @param user 下单用户 |
| | | * @param order 订单信息 |
| | | * @return 打款结果 |
| | | */ |
| | | Boolean confirmWithdraw(User user, Order order); |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataAddress; |
| | | import com.ruoyi.admin.mapper.DataAddressMapper; |
| | | import com.ruoyi.admin.service.DataAddressService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户地址 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataAddressServiceImpl extends ServiceImpl<DataAddressMapper, DataAddress> implements DataAddressService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataAdvantage; |
| | | import com.ruoyi.admin.mapper.DataAdvantageMapper; |
| | | import com.ruoyi.admin.service.DataAdvantageService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务优势 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataAdvantageServiceImpl extends ServiceImpl<DataAdvantageMapper, DataAdvantage> implements DataAdvantageService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataCate; |
| | | import com.ruoyi.admin.mapper.DataCateMapper; |
| | | import com.ruoyi.admin.service.DataCateService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收分类 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataCateServiceImpl extends ServiceImpl<DataCateMapper, DataCate> implements DataCateService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataCollect; |
| | | import com.ruoyi.admin.mapper.DataCollectMapper; |
| | | import com.ruoyi.admin.service.DataCollectService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 收藏 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataCollectServiceImpl extends ServiceImpl<DataCollectMapper, DataCollect> implements DataCollectService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataDraw; |
| | | import com.ruoyi.admin.mapper.DataDrawMapper; |
| | | import com.ruoyi.admin.service.DataDrawService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 奖品管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataDrawServiceImpl extends ServiceImpl<DataDrawMapper, DataDraw> implements DataDrawService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataGoods; |
| | | import com.ruoyi.admin.mapper.DataGoodsMapper; |
| | | import com.ruoyi.admin.service.DataGoodsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务内容 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataGoodsServiceImpl extends ServiceImpl<DataGoodsMapper, DataGoods> implements DataGoodsService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataMessage; |
| | | import com.ruoyi.admin.mapper.DataMessageMapper; |
| | | import com.ruoyi.admin.service.DataMessageService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataMessageServiceImpl extends ServiceImpl<DataMessageMapper, DataMessage> implements DataMessageService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataOrder; |
| | | import com.ruoyi.admin.mapper.DataOrderMapper; |
| | | import com.ruoyi.admin.service.DataOrderService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-01 |
| | | */ |
| | | @Service |
| | | public class DataOrderServiceImpl extends ServiceImpl<DataOrderMapper, DataOrder> implements DataOrderService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataQuestion; |
| | | import com.ruoyi.admin.mapper.DataQuestionMapper; |
| | | import com.ruoyi.admin.service.DataQuestionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 常见问题 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataQuestionServiceImpl extends ServiceImpl<DataQuestionMapper, DataQuestion> implements DataQuestionService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataTechnician; |
| | | import com.ruoyi.admin.mapper.DataTechnicianMapper; |
| | | import com.ruoyi.admin.service.DataTechnicianService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 技师 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataTechnicianServiceImpl extends ServiceImpl<DataTechnicianMapper, DataTechnician> implements DataTechnicianService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataTransfer; |
| | | import com.ruoyi.admin.mapper.DataTransferMapper; |
| | | import com.ruoyi.admin.service.DataTransferService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 提现 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataTransferServiceImpl extends ServiceImpl<DataTransferMapper, DataTransfer> implements DataTransferService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.DataUser; |
| | | import com.ruoyi.admin.mapper.DataUserMapper; |
| | | import com.ruoyi.admin.service.DataUserService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-02 |
| | | */ |
| | | @Service |
| | | public class DataUserServiceImpl extends ServiceImpl<DataUserMapper, DataUser> implements DataUserService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.MasterWorker; |
| | | import com.ruoyi.admin.mapper.MasterWorkerMapper; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.vo.MasterWorkerRankVO; |
| | | import com.ruoyi.order.api.entity.WorkerOrderRankVO; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class MasterWorkerServiceImpl extends ServiceImpl<MasterWorkerMapper, MasterWorker> implements MasterWorkerService { |
| | | |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | @Override |
| | | public List<MasterWorkerRankVO> workerRanking(List<String> cityList) { |
| | | List<MasterWorker> masterWorkerList; |
| | | if (null == cityList || cityList.isEmpty()) { |
| | | masterWorkerList = lambdaQuery().eq(MasterWorker::getIsDelete, 0).list(); |
| | | } else { |
| | | masterWorkerList = lambdaQuery().in(MasterWorker::getCity, cityList).eq(MasterWorker::getIsDelete, 0).list(); |
| | | masterWorkerList = lambdaQuery().in(MasterWorker::getCity, cityList) |
| | | .eq(MasterWorker::getIsDelete, 0).list(); |
| | | } |
| | | if (null == masterWorkerList || masterWorkerList.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Integer> workerIdList = masterWorkerList.stream().map(MasterWorker::getId).collect(Collectors.toList()); |
| | | List<MasterWorkerRankVO> result = baseMapper.workerRanking(workerIdList); |
| | | return null == result ? new ArrayList<>() : result; |
| | | // 师傅id查询 |
| | | List<Integer> workerIds = masterWorkerList.stream().map(MasterWorker::getId).collect(Collectors.toList()); |
| | | List<WorkerOrderRankVO> data = orderClient.workerOrderRank(workerIds).getData(); |
| | | Map<Integer, Integer> map = data.stream().collect(Collectors.toMap(WorkerOrderRankVO::getWorkerId, |
| | | WorkerOrderRankVO::getOrderNumber)); |
| | | // 结果数据封装 |
| | | List<MasterWorkerRankVO> result = new ArrayList<>(); |
| | | for (MasterWorker masterWorker : masterWorkerList) { |
| | | Integer id = masterWorker.getId(); |
| | | Integer orderNumber = map.get(id); |
| | | if (null != orderNumber) { |
| | | // 展示数据 |
| | | MasterWorkerRankVO masterWorkerRankVO = new MasterWorkerRankVO(); |
| | | masterWorkerRankVO.setProfilePicture(masterWorker.getProfilePicture()); |
| | | masterWorkerRankVO.setRealName(masterWorker.getRealName()); |
| | | masterWorkerRankVO.setOrderNumber(orderNumber); |
| | | result.add(masterWorkerRankVO); |
| | | } |
| | | } |
| | | // 创建一个 Comparator |
| | | Comparator<MasterWorkerRankVO> comparator = Comparator |
| | | // 按照 orderNumber 字段排序 |
| | | .comparingInt(MasterWorkerRankVO::getOrderNumber) |
| | | // 倒序 |
| | | .reversed(); |
| | | // 使用 Collections.sort 方法进行排序 |
| | | result.sort(comparator); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkOnlyPhone(String phone) { |
| | | MasterWorker masterWorker = lambdaQuery().eq(MasterWorker::getPhone, phone).one(); |
| | | public boolean checkOnlyPhone(String phone, Integer id) { |
| | | LambdaQueryChainWrapper<MasterWorker> wrapper = lambdaQuery().eq(MasterWorker::getPhone, phone); |
| | | if (null != id) { |
| | | wrapper.ne(MasterWorker::getId, id); |
| | | } |
| | | MasterWorker masterWorker = wrapper.one(); |
| | | return masterWorker == null; |
| | | } |
| | | |
| | |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.*; |
| | | import com.ruoyi.admin.mapper.OrderMapper; |
| | | import com.ruoyi.admin.mapper.UserMapper; |
| | | import com.ruoyi.admin.request.OrderCountRequest; |
| | | import com.ruoyi.admin.request.OrderQueryRequest; |
| | | import com.ruoyi.admin.service.*; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.service.RecoveryClassifyService; |
| | | import com.ruoyi.admin.service.RecoveryServeService; |
| | | import com.ruoyi.admin.vo.*; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.OrderConstants; |
| | | 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; |
| | | import com.ruoyi.order.api.feignClient.ServeRecordClient; |
| | | import org.apache.commons.codec.CharEncoding; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private ServeCoordinateService serveCoordinateService; |
| | | private EvaluateClient evaluateClient; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | private ServeRecordClient serveRecordClient; |
| | | |
| | | /** |
| | | * linux服务器保存订单轨迹文件夹 |
| | | */ |
| | | private static final String BASE_PATH = "/usr/local/coordinate/"; |
| | | // private static final String BASE_PATH = "D:/Desktop/coordinate/"; |
| | | |
| | | @Override |
| | | public OrderResultVO orderCountHome(OrderCountRequest orderCount) { |
| | | List<String> cityList = orderCount.getCityList(); |
| | | Integer orderState = orderCount.getOrderState(); |
| | | String countType = orderCount.getCountType(); |
| | | String startTime = orderCount.getStartTime(); |
| | | String endTime = orderCount.getEndTime(); |
| | | List<OrderQueryVO> list; |
| | | // 根据查询类型查询订单信息 |
| | | if (OrderConstants.YEAR.equals(countType)) { |
| | | list = baseMapper.orderCountByYear(cityList, orderState, startTime, endTime); |
| | | } else if (OrderConstants.MONTH.equals(countType)) { |
| | | list = baseMapper.orderCountByMonth(cityList, orderState, startTime, endTime); |
| | | } else if (OrderConstants.WEEK.equals(countType)) { |
| | | list = baseMapper.orderCountByWeek(cityList, orderState, startTime, endTime); |
| | | } else if (OrderConstants.TODAY.equals(countType)) { |
| | | list = baseMapper.orderCountByToday(cityList, orderState, startTime, endTime); |
| | | } else { |
| | | list = new ArrayList<>(); |
| | | } |
| | | // 计算订单总额及总订单数量 |
| | | BigDecimal totalMoney; |
| | | int orderNumber; |
| | | if (list.isEmpty()) { |
| | | totalMoney = BigDecimal.ZERO; |
| | | orderNumber = 0; |
| | | } else { |
| | | totalMoney = list.stream().map(OrderQueryVO::getTotalPrice).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | orderNumber = list.stream().map(OrderQueryVO::getNumber).collect(Collectors.toList()).stream().mapToInt(Integer::intValue).sum(); |
| | | } |
| | | return new OrderResultVO(totalMoney, orderNumber, list); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal totalMoneyByQuarter(String startDateStr, String endDateStr, List<String> cityList) { |
| | | return baseMapper.totalMoneyByQuarter(startDateStr, endDateStr, cityList); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal totalMoneyByYear(List<String> cityList) { |
| | | return baseMapper.totalMoneyByYear(cityList); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal totalMoneyByMonth(List<String> cityList) { |
| | | return baseMapper.totalMoneyByMonth(cityList); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> excelExport(OrderQueryRequest orderQueryRequest, HttpServletResponse response) { |
| | | public R<String> excelExport(List<com.ruoyi.order.api.entity.Order> list, HttpServletResponse response) { |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | | try { |
| | | List<String> ids = orderQueryRequest.getIds(); |
| | | List<Order> list; |
| | | if (null != ids && !ids.isEmpty()) { |
| | | list = baseMapper.exportByIdList(ids); |
| | | } else { |
| | | list = baseMapper.exportList(orderQueryRequest); |
| | | } |
| | | // excel模板封装 |
| | | ExcelWriterBuilder excelWriterBuilder = EasyExcelFactory.write(response.getOutputStream()); |
| | | InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream("template/" + Constants.EXCEL_ORDER_FILE_NAME + ".xlsx"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Order> queryPage(OrderQueryRequest orderQueryRequest) { |
| | | Page<Order> page = Page.of(orderQueryRequest.getPageNum(), orderQueryRequest.getPageSize()); |
| | | // 基础查询 |
| | | IPage<Order> pageList = baseMapper.queryPage(orderQueryRequest, page); |
| | | for (Order order : pageList.getRecords()) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, order.getId()) |
| | | .eq(ChangeDispatch::getIsDelete, 0) |
| | | .orderByDesc(ChangeDispatch::getCreateTime) |
| | | .last("limit 1").one(); |
| | | if (null != changeDispatch) { |
| | | order.setApplyReason(changeDispatch.getApplyReason()); |
| | | } |
| | | } |
| | | return pageList; |
| | | } |
| | | |
| | | @Override |
| | | public OrderDetailVO orderListDetail(String id) { |
| | | OrderDetailVO result = new OrderDetailVO(); |
| | | Order order = this.getById(id); |
| | | com.ruoyi.order.api.entity.Order order = orderClient.detail(id).getData(); |
| | | orderInfo(result, order); |
| | | // 预约人信息 |
| | | userInfo(result, order); |
| | |
| | | return result; |
| | | } |
| | | |
| | | private void evaluateInfo(OrderDetailVO result, Order order) { |
| | | Evaluate evaluate = evaluateService.lambdaQuery().eq(Evaluate::getOrderId, order.getId()) |
| | | .eq(Evaluate::getIsDelete, 0).one(); |
| | | private void evaluateInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | com.ruoyi.order.api.entity.Evaluate evaluate = evaluateClient.oneByOrderId(order.getId()).getData(); |
| | | OrderByEvaluateVO orderByEvaluate = new OrderByEvaluateVO(); |
| | | if (null != evaluate) { |
| | | orderByEvaluate.setStarRating(evaluate.getStarRating()); |
| | | orderByEvaluate.setStarRating(BigDecimal.valueOf(evaluate.getStarRating())); |
| | | orderByEvaluate.setEvaluateTime(evaluate.getCreateTime()); |
| | | orderByEvaluate.setEvaluateContent(evaluate.getContent()); |
| | | } |
| | | result.setEvaluateInfo(orderByEvaluate); |
| | | } |
| | | |
| | | private void serveRecordInfo(OrderDetailVO result, Order order) { |
| | | ServeRecord serveRecord = serveRecordService.lambdaQuery().eq(ServeRecord::getOrderId, order.getId()) |
| | | .eq(ServeRecord::getIsDelete, 0).one(); |
| | | // 师傅路线轨迹 |
| | | List<ServeCoordinate> serveCoordinateList = serveCoordinateService.lambdaQuery() |
| | | .eq(ServeCoordinate::getWorkerId, order.getServerId()) |
| | | .eq(ServeCoordinate::getIsDelete, 0) |
| | | .eq(ServeCoordinate::getOrderId, order.getId()) |
| | | .orderByDesc(ServeCoordinate::getCreateTime).list(); |
| | | private void serveRecordInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | OrderByServeRecordVO orderByServeRecord = new OrderByServeRecordVO(); |
| | | orderByServeRecord.setAcceptOrderTime(order.getAcceptTime()); |
| | | orderByServeRecord.setReachTime(order.getTime()); |
| | | orderByServeRecord.setCoordinate(serveCoordinateList.stream().map(ServeCoordinate::getCoordinate).collect(Collectors.toList())); |
| | | // 服务记录 包含现场照片 |
| | | ServeRecord serveRecord = serveRecordClient.serveRecordByOrderId(order.getId()).getData(); |
| | | // 师傅路线轨迹 |
| | | String masterFolderPath = BASE_PATH + order.getServerId(); |
| | | File masterFolder = new File(masterFolderPath); |
| | | // 检查师傅ID的文件夹是否存在,存在就读取轨迹数据 |
| | | System.out.println("文件是否存在:" + masterFolder.exists()); |
| | | if (masterFolder.exists()) { |
| | | // 检查订单ID的JSON文件是否存在,不存在则创建 |
| | | String jsonFilePath = masterFolderPath + "/" + order.getId() + ".json"; |
| | | File jsonFile = new File(jsonFilePath); |
| | | System.out.println("订单Json文件是否存在:" + jsonFile.exists()); |
| | | if (jsonFile.exists()) { |
| | | try { |
| | | String jsonContent = new String(Files.readAllBytes(Paths.get(jsonFilePath))); |
| | | System.out.println("JSON 文件内容:" + jsonContent); |
| | | List<JSONObject> coordinate = JSONObject.parseObject(jsonContent, List.class); |
| | | List<String> coordinateList = new ArrayList<>(); |
| | | if (null != coordinate) { |
| | | for (JSONObject jsonObject : coordinate) { |
| | | Object s = jsonObject.get("coordinate"); |
| | | coordinateList.add(String.valueOf(s)); |
| | | } |
| | | orderByServeRecord.setCoordinate(coordinateList); |
| | | } |
| | | } catch (IOException e) { |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | if (null != serveRecord) { |
| | | orderByServeRecord.setPhoto(Arrays.stream(serveRecord.getPhoto().split(",")).collect(Collectors.toList())); |
| | | } |
| | | result.setServeRecordInfo(orderByServeRecord); |
| | | } |
| | | |
| | | private void workerInfo(OrderDetailVO result, Order order) { |
| | | private void workerInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | MasterWorker worker = masterWorkerService.getById(order.getServerId()); |
| | | if (null == worker) { |
| | | throw new GlobalException("服务人员信息异常,请重试"); |
| | | 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); |
| | | } |
| | | OrderByWorkerVO orderByWorker = new OrderByWorkerVO(); |
| | | orderByWorker.setProfilePicture(worker.getProfilePicture()); |
| | | orderByWorker.setName(worker.getRealName()); |
| | | orderByWorker.setPhone(worker.getPhone()); |
| | | orderByWorker.setSex(worker.getSex()); |
| | | result.setWorkerInfo(orderByWorker); |
| | | } |
| | | |
| | | private void serveInfo(OrderDetailVO result, Order order) { |
| | | private void serveInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | RecoveryServe recoveryServe = recoveryServeService.getById(order.getServeId()); |
| | | if (null == recoveryServe) { |
| | | throw new GlobalException("回收服务信息异常,请重试"); |
| | |
| | | result.setServeInfo(orderByServe); |
| | | } |
| | | |
| | | private void orderInfo(OrderDetailVO result, Order order) { |
| | | private void orderInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常,请重试"); |
| | | } |
| | |
| | | result.setOrderInfo(orderInfo); |
| | | } |
| | | |
| | | private void userInfo(OrderDetailVO result, Order order) { |
| | | private void userInfo(OrderDetailVO result, com.ruoyi.order.api.entity.Order order) { |
| | | Integer userId = order.getUserId(); |
| | | User user = userMapper.selectById(userId); |
| | | OrderByUserInfoVO orderByUserInfo = new OrderByUserInfoVO(); |
| | |
| | | result.setUserInfo(orderByUserInfo); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<OrderCountVO> orderCount(String name, String phone, Page<OrderCountVO> page) { |
| | | return baseMapper.orderCount(name, phone, page); |
| | | } |
| | | |
| | | @Override |
| | | public OrderPageCountVO orderPageCount(OrderQueryRequest orderQueryRequest) { |
| | | List<Order> orderList = baseMapper.orderPageCount(orderQueryRequest); |
| | | int total = 0; |
| | | int toBeDispatched = 0; |
| | | int stayDoorstep = 0; |
| | | int toBeCompleted = 0; |
| | | int completed = 0; |
| | | int canceled = 0; |
| | | int reInvestment = 0; |
| | | for (Order order : orderList) { |
| | | total++; |
| | | Integer state = order.getState(); |
| | | if (Constants.ZERO.equals(state)) { |
| | | toBeDispatched++; |
| | | } else if (Constants.ONE.equals(state)) { |
| | | stayDoorstep++; |
| | | } else if (Constants.TWO.equals(state)) { |
| | | toBeCompleted++; |
| | | } else if (Constants.THREE.equals(state)) { |
| | | completed++; |
| | | } else if (Constants.FOUR.equals(state)) { |
| | | canceled++; |
| | | } else if (Constants.FIVE.equals(state)) { |
| | | reInvestment++; |
| | | } |
| | | } |
| | | return new OrderPageCountVO(total, toBeDispatched, stayDoorstep, |
| | | toBeCompleted, completed, canceled, reInvestment); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | public boolean saveRoleAndMenu(RoleRequest roleRequest, LoginUser loginUser) { |
| | | Role role = roleRequest.getRole(); |
| | | role.setDelFlag("0"); |
| | | role.setCreateBy(loginUser.getUsername()); |
| | | boolean save = this.save(role); |
| | | List<String> menuIds = roleRequest.getMenuIds(); |
| | |
| | | package com.ruoyi.admin.service.impl; |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.service.SendSmsService; |
| | | import com.ruoyi.admin.utils.SendSmsUtil; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.RedisConstants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.mapper.UserMapper; |
| | | import com.ruoyi.admin.request.UserDataCountRequest; |
| | | import com.ruoyi.admin.service.OrderService; |
| | | import com.ruoyi.admin.service.UserService; |
| | | import com.ruoyi.admin.service.WithdrawService; |
| | | import com.ruoyi.admin.vo.UserDataCountVO; |
| | | import com.ruoyi.admin.vo.UserTrendsVO; |
| | | import com.ruoyi.common.core.constant.OrderConstants; |
| | | import com.ruoyi.order.api.entity.MoneyQueryRequest; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private WithdrawService withdrawService; |
| | | private WithdrawClient withdrawClient; |
| | | |
| | | @Override |
| | | public List<UserTrendsVO> userTrends(List<String> city) { |
| | |
| | | @Override |
| | | public UserDataCountVO userDataCount(UserDataCountRequest userDataCountRequest) { |
| | | List<String> cityList = userDataCountRequest.getCityList(); |
| | | String type = userDataCountRequest.getCountType(); |
| | | List<User> userList = lambdaQuery().eq(User::getIsDelete, 0).list(); |
| | | // 用户总量 |
| | | Integer userNumber = null == userList ? 0 : userList.size(); |
| | |
| | | String endDateStr = String.valueOf(endDate); |
| | | // 结果数据封装 |
| | | Long increaseNumber; |
| | | BigDecimal totalMoney; |
| | | BigDecimal withdrawalTotalMoney; |
| | | if (OrderConstants.QUARTER.equals(userDataCountRequest.getCountType())) { |
| | | // 交易额 |
| | | BigDecimal totalMoney = orderClient.tradeMoney(cityList, userDataCountRequest.getCountType()).getData(); |
| | | BigDecimal withdrawalTotalMoney = withdrawClient.withdrawalTotalMoney(new MoneyQueryRequest(cityList, type)) |
| | | .getData(); |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户增长数 |
| | | LambdaQueryChainWrapper<User> wrapper = lambdaQuery().ge(User::getCreateTime, startDateStr) |
| | | .le(User::getCreateTime, endDateStr); |
| | |
| | | wrapper.in(User::getCity, cityList); |
| | | } |
| | | increaseNumber = wrapper.eq(User::getIsDelete, 0).count(); |
| | | // 用户总交易额 |
| | | totalMoney = orderService.totalMoneyByQuarter(startDateStr, endDateStr, cityList); |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoney(cityList,startDateStr,endDateStr); |
| | | } else if (OrderConstants.YEAR.equals(userDataCountRequest.getCountType())) { |
| | | } else if (OrderConstants.YEAR.equals(type)) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByYear(cityList); |
| | | // 用户总交易额 |
| | | totalMoney = orderService.totalMoneyByYear(cityList); |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoneyByYear(cityList); |
| | | } else if (OrderConstants.MONTH.equals(userDataCountRequest.getCountType())) { |
| | | } else if (OrderConstants.MONTH.equals(type)) { |
| | | // 用户增长数 |
| | | increaseNumber = baseMapper.increaseNumberByMonth(cityList); |
| | | // 用户总交易额 |
| | | totalMoney = orderService.totalMoneyByMonth(cityList); |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = withdrawService.withdrawalTotalMoneyByMonth(cityList); |
| | | } else { |
| | | // 数量初始化 |
| | | increaseNumber = 0L; |
| | | totalMoney = BigDecimal.ZERO; |
| | | withdrawalTotalMoney = BigDecimal.ZERO; |
| | | } |
| | | // 查询结果判断 |
| | | increaseNumber = null == increaseNumber ? 0L : increaseNumber; |
| | |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.builder.ExcelWriterBuilder; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.entity.Order; |
| | | import com.ruoyi.admin.entity.User; |
| | | import com.ruoyi.admin.entity.Withdraw; |
| | | import com.ruoyi.admin.entity.WithdrawalSetting; |
| | | import com.ruoyi.admin.mapper.WithdrawMapper; |
| | | import com.ruoyi.admin.request.WithdrawExportRequest; |
| | | import com.ruoyi.admin.service.WithdrawService; |
| | | import com.ruoyi.admin.service.WithdrawalSettingService; |
| | | import com.ruoyi.admin.utils.vx.HttpUtil; |
| | | import com.ruoyi.admin.vo.UserWithdrawRecordVO; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.WechatConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import org.apache.commons.codec.CharEncoding; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @since 2024-05-29 |
| | | */ |
| | | @Service |
| | | public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> implements WithdrawService { |
| | | |
| | | @Resource |
| | | private WithdrawalSettingService withdrawalSettingService; |
| | | |
| | | /** |
| | | * 雪花算法类 |
| | | */ |
| | | private static final SnowflakeIdWorker SNOW_FLAKE_ID_WORKER = new SnowflakeIdWorker(5, 5); |
| | | |
| | | /** |
| | | * 小程序id |
| | | */ |
| | | @Value("wx.appid") |
| | | private String appId; |
| | | /** |
| | | * 转账名称 |
| | | */ |
| | | @Value("wx.batchName") |
| | | private String batchName; |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | @Value("wx.mchId") |
| | | private String mchId; |
| | | /** |
| | | * 支付证书序列号 |
| | | */ |
| | | @Value("wx.wechatPayserialNo") |
| | | private String wechatPayserialNo; |
| | | /** |
| | | * 转账备注 |
| | | */ |
| | | @Value("wx.transferRemark") |
| | | private String transferRemark; |
| | | public class WithdrawServiceImpl implements WithdrawService { |
| | | |
| | | @Override |
| | | public R<String> excelExport(WithdrawExportRequest exportRequest, HttpServletResponse response) { |
| | | public R<String> excelExport(List<com.ruoyi.order.api.entity.UserWithdrawRecordVO> data, HttpServletResponse response) { |
| | | try { |
| | | response.setCharacterEncoding(Constants.UTF8); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | |
| | | return R.fail("excel导出失败!"); |
| | | } |
| | | try { |
| | | String nickname = exportRequest.getNickname(); |
| | | String userPhone = exportRequest.getUserPhone(); |
| | | String applyForTime = exportRequest.getApplyForTime(); |
| | | Integer state = exportRequest.getState(); |
| | | List<String> ids = exportRequest.getIdList(); |
| | | List<UserWithdrawRecordVO> list; |
| | | if (null != ids && !ids.isEmpty()) { |
| | | list = baseMapper.exportByIdList(ids); |
| | | } else { |
| | | list = baseMapper.exportList(nickname, userPhone, applyForTime, state); |
| | | if (null == data) { |
| | | throw new GlobalException("excel导出失败,请检查所筛选数据是否正确!"); |
| | | } |
| | | // excel模板封装 |
| | | ExcelWriterBuilder excelWriterBuilder = EasyExcelFactory.write(response.getOutputStream()); |
| | |
| | | // 自动释放资源 |
| | | try (ExcelWriter excelWriter = excelWriterBuilder.withTemplate(stream).build()) { |
| | | WriteSheet writeSheet = EasyExcelFactory.writerSheet().build(); |
| | | excelWriter.fill(list, writeSheet); |
| | | excelWriter.fill(data, writeSheet); |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | return R.fail("excel导出失败!"); |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal withdrawalTotalMoney(List<String> cityList,String startDateStr, String endDateStr) { |
| | | return baseMapper.withdrawalTotalMoney(cityList,startDateStr,endDateStr); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal withdrawalTotalMoneyByYear(List<String> cityList) { |
| | | return baseMapper.withdrawalTotalMoneyByYear(cityList); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal withdrawalTotalMoneyByMonth(List<String> cityList) { |
| | | return baseMapper.withdrawalTotalMoneyByMonth(cityList); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page) { |
| | | return baseMapper.withdrawList(userId, page); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean enableProcess(Integer enableProcess) { |
| | | Integer[] state = {0, 1}; |
| | | boolean contains = Arrays.stream(state).collect(Collectors.toList()).contains(enableProcess); |
| | | if (!contains) { |
| | | throw new GlobalException("系统设置关闭/开启审核状态异常!"); |
| | | } |
| | | return withdrawalSettingService.lambdaUpdate().set(WithdrawalSetting::getEnableProcess, enableProcess).update(); |
| | | } |
| | | |
| | | @Override |
| | | public WithdrawalSetting withdrawProcess() { |
| | | return withdrawalSettingService.lambdaQuery().one(); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | return baseMapper.withdrawPage(nickname, userPhone, applyForTime, state, page); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean confirmWithdraw(User user, Order order) { |
| | | // 校验提现 |
| | | List<Withdraw> list = this.lambdaQuery().eq(Withdraw::getUserId, user.getId()) |
| | | .eq(Withdraw::getOrderId, order.getId()).list(); |
| | | List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList()); |
| | | if (stateList.contains(Constants.ONE)) { |
| | | throw new GlobalException("当前订单提现申请已通过!"); |
| | | } |
| | | return weChatPay(order.getOrderMoney(), user.getOpenId()); |
| | | } |
| | | |
| | | private boolean weChatPay(BigDecimal orderMoney, String openId) { |
| | | if (StringUtils.isBlank(openId)) { |
| | | return false; |
| | | } |
| | | Map<String, Object> postMap = new HashMap<>(8); |
| | | // 小程序 id |
| | | postMap.put(WechatConstants.APP_ID, appId); |
| | | postMap.put(WechatConstants.OUT_BATCH_NO, String.valueOf(UUID.randomUUID()).replaceAll("-", "")); |
| | | // 该笔批量转账的名称 |
| | | postMap.put(WechatConstants.BATCH_NAME, batchName); |
| | | // 转账说明,UTF8编码,最多允许32个字符 |
| | | postMap.put(WechatConstants.BATCH_REMARK, batchName); |
| | | // 转账金额单位为“分”。 总金额 |
| | | postMap.put(WechatConstants.TOTAL_AMOUNT, orderMoney.multiply(new BigDecimal(Constants.ONE_HUNDRED))); |
| | | // 转账总笔数 |
| | | postMap.put(WechatConstants.TOTAL_NUM, Constants.ONE); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> subMap = new HashMap<>(4); |
| | | // 商家明细单号 该商家下唯一 |
| | | // subMap.put("out_detail_no", RandomUtil.randomString(32)) |
| | | subMap.put(WechatConstants.OUT_DETAIL_NO, SNOW_FLAKE_ID_WORKER.nextId()); |
| | | // 转账金额 |
| | | subMap.put(WechatConstants.TRANSFER_AMOUNT, orderMoney); |
| | | // 转账备注 |
| | | subMap.put(WechatConstants.TRANSFER_REMARK, transferRemark); |
| | | // 用户在直连商户应用下的用户标示 |
| | | subMap.put(WechatConstants.OPEN_ID, openId); |
| | | // 大金额需要传入真实姓名 |
| | | /*subMap.put("user_name", |
| | | RsaCryptoUtil.encryptOAEP(userName,WechatPayV3Util.getSaveCertificates(privatekeypath)))*/ |
| | | list.add(subMap); |
| | | postMap.put(WechatConstants.TRANSFER_DETAIL_LIST, list); |
| | | // 使用类加载器获取资源 URL |
| | | ClassPathResource classPathResource = new ClassPathResource("vx/apiclient_key.pem"); |
| | | /*// 获取 resources 目录下的文件路径,假设文件路径为 "resources/data/example.txt" |
| | | String filePath = "resources/data/vx/apiclient_key.pem"; |
| | | File file = new File(filePath); |
| | | // 输出文件的绝对路径 |
| | | String absolutePath = file.getAbsolutePath();*/ |
| | | String result = HttpUtil.postTransBatRequest( |
| | | WechatConstants.WE_CHAT_URL_PRE, |
| | | JSONObject.toJSONString(postMap), |
| | | // 支付证书序列号 |
| | | wechatPayserialNo, |
| | | // 商户号 |
| | | mchId, |
| | | classPathResource.getPath(), WechatConstants.WE_CHAT_URL_SUF); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | /* |
| | | * 成功示例 |
| | | * { |
| | | * "out_batch_no": "plfk2020042013", |
| | | * "batch_id": "1030000071100999991182020050700019480001", |
| | | * "create_time": "2015-05-20T13:29:35.120+08:00" |
| | | * } |
| | | */ |
| | | if (null == jsonObject || null != jsonObject.get(WechatConstants.CREATE_TIME)) { |
| | | //转账成功 |
| | | return Boolean.TRUE; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | String encodePassword = passwordEncoder.encode(Constants.DEFAULT_PASSWORD); |
| | | masterWorker.setPassword(encodePassword); |
| | | masterWorker.setUserNumber(Constants.DEFAULT_USER_NUMBER_PRE + RandomUtil.randomNumbers(10)); |
| | | masterWorker.setCityStr(workerProcess.getCityStr()); |
| | | masterWorkerService.save(masterWorker); |
| | | } |
| | | return updateById(workerProcess) ? R.ok() : R.fail("当前入驻申请审核失败!"); |
| | |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("用户错误:" + this.userId + ",原因:" + error.getMessage()); |
| | | if (WEB_SOCKET_MAP.containsKey(userId)) { |
| | | WEB_SOCKET_MAP.remove(userId); |
| | | //从set中删除 |
| | | subOnlineCount(); |
| | | } |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | |
| | | // 包配置 |
| | | .packageConfig(builder -> builder |
| | | // 父包名 |
| | | .parent("com.ruoyi.worker") |
| | | .parent("com.ruoyi.user") |
| | | // 父包模块名 注释即为无 |
| | | // .moduleName(scanner("模块名")) |
| | | // Entity 包名 |
| | |
| | | // 开启跳过视图 |
| | | // .enableSkipView() |
| | | // 增加过滤表前缀 |
| | | .addTablePrefix("ot_", "b_", "iot_", "t_") |
| | | .addTablePrefix("ot_", "b_", "iot_", "t_", "sys_") |
| | | // 增加过滤表后缀 |
| | | .addTableSuffix("_n") |
| | | // 增加过滤字段前缀 |
New file |
| | |
| | | package com.ruoyi.admin.utils; |
| | | |
| | | import com.qcloud.cos.COSClient; |
| | | import com.qcloud.cos.ClientConfig; |
| | | import com.qcloud.cos.auth.BasicCOSCredentials; |
| | | import com.qcloud.cos.auth.COSCredentials; |
| | | import com.qcloud.cos.http.HttpProtocol; |
| | | import com.qcloud.cos.model.ObjectMetadata; |
| | | import com.qcloud.cos.model.PutObjectResult; |
| | | import com.qcloud.cos.region.Region; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class TencentCosUtil { |
| | | |
| | | /** |
| | | * COS的SecretId |
| | | */ |
| | | @Value("${cos.client.accessKey}") |
| | | private String secretId; |
| | | /** |
| | | * COS的SecretKey |
| | | */ |
| | | @Value("${cos.client.secretKey}") |
| | | private String secretKey; |
| | | /** |
| | | * 文件上传后访问路径的根路径,后面要最佳文件名字与类型 |
| | | */ |
| | | @Value("${cos.client.rootSrc}") |
| | | private String rootSrc; |
| | | /** |
| | | * 上传的存储桶的地域 |
| | | */ |
| | | @Value("${cos.client.bucketAddr}") |
| | | private String bucketAddr; |
| | | /** |
| | | * 存储桶的名字,是自己在存储空间自己创建的,我创建的名字是:qq-test-1303****** |
| | | */ |
| | | @Value("${cos.client.bucket}") |
| | | private String bucketName; |
| | | |
| | | /** |
| | | * 1.调用静态方法getCosClient()就会获得COSClient实例 |
| | | * 2.本方法根据永久密钥初始化 COSClient的,官方是不推荐,官方推荐使用临时密钥,是可以限制密钥使用权限,创建cred时有些区别 |
| | | * |
| | | * @return COSClient实例 |
| | | */ |
| | | private COSClient getCosClient() { |
| | | // 1 初始化用户身份信息(secretId, secretKey)。 |
| | | COSCredentials cred = new BasicCOSCredentials(secretId, secretKey); |
| | | // 2.1 设置存储桶的地域(上文获得) |
| | | Region region = new Region(bucketAddr); |
| | | ClientConfig clientConfig = new ClientConfig(region); |
| | | // 2.2 使用https协议传输 |
| | | clientConfig.setHttpProtocol(HttpProtocol.https); |
| | | // 生成 cos 客户端 |
| | | return new COSClient(cred, clientConfig); |
| | | } |
| | | |
| | | /** |
| | | * 只要调用静态方法upLoadFile(MultipartFile multipartFile)就可以获取上传后文件的全路径 |
| | | * |
| | | * @param file |
| | | * @return 返回文件的浏览全路径 |
| | | */ |
| | | public String upLoadFile(MultipartFile file) { |
| | | try { |
| | | // 获取上传的文件的输入流 |
| | | InputStream inputStream = file.getInputStream(); |
| | | // 避免文件覆盖,获取文件的原始名称,如123.jpg,然后通过截取获得文件的后缀,也就是文件的类型 |
| | | String originalFilename = file.getOriginalFilename(); |
| | | //获取文件的类型 |
| | | String fileType = originalFilename.substring(originalFilename.lastIndexOf(".")); |
| | | //使用UUID工具 创建唯一名称,放置文件重名被覆盖,在拼接上上命令获取的文件类型 |
| | | String fileName = UUID.randomUUID() + fileType; |
| | | // 指定文件上传到 COS 上的路径,即对象键。最终文件会传到存储桶名字中的images文件夹下的fileName名字 |
| | | String key = "images/" + fileName; |
| | | // 创建上传Object的Metadata |
| | | ObjectMetadata objectMetadata = new ObjectMetadata(); |
| | | // - 使用输入流存储,需要设置请求长度 |
| | | objectMetadata.setContentLength(inputStream.available()); |
| | | // - 设置缓存 |
| | | objectMetadata.setCacheControl("no-cache"); |
| | | // - 设置Content-Type |
| | | objectMetadata.setContentType(fileType); |
| | | //上传文件 |
| | | PutObjectResult putResult = getCosClient().putObject(bucketName, key, inputStream, objectMetadata); |
| | | // 创建文件的网络访问路径 |
| | | String url = rootSrc + key; |
| | | //关闭 cosClient,并释放 HTTP 连接的后台管理线程 |
| | | getCosClient().shutdown(); |
| | | return url; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | // 发生IO异常、COS连接异常等,返回空 |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public class OrderByServeRecordVO { |
| | | |
| | | @ApiModelProperty("接单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date acceptOrderTime; |
| | | |
| | | @ApiModelProperty("上门时间") |
| | |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date placeOrderTime; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | name: ${spring.application.name} |
| | | # 配置文件格式 |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | knife4j: |
| | | enable-aggregation: true |
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.admin.mapper.DataAddressMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataAdvantageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataCateMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataCollectMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataDrawMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataGoodsMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataMessageMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataOrderMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataQuestionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataTechnicianMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataTransferMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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.admin.mapper.DataUserMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.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> |
| | |
| | | <?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.admin.mapper.MasterWorkerMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.admin.entity.MasterWorker"> |
| | | <id column="id" property="id" /> |
| | | <result column="city" property="city" /> |
| | | <result column="sex" property="sex" /> |
| | | <result column="birthday" property="birthday" /> |
| | | <result column="id_number" property="idNumber" /> |
| | | <result column="vehicle_type" property="vehicleType" /> |
| | | <result column="vehicle_number" property="vehicleNumber" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="profile_picture" property="profilePicture" /> |
| | | <result column="identity_photo" property="identityPhoto" /> |
| | | <result column="driving_license" property="drivingLicense" /> |
| | | <result column="is_enable" property="isEnable" /> |
| | | <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" /> |
| | | <id column="id" property="id"/> |
| | | <result column="city" property="city"/> |
| | | <result column="sex" property="sex"/> |
| | | <result column="birthday" property="birthday"/> |
| | | <result column="id_number" property="idNumber"/> |
| | | <result column="vehicle_type" property="vehicleType"/> |
| | | <result column="vehicle_number" property="vehicleNumber"/> |
| | | <result column="phone" property="phone"/> |
| | | <result column="profile_picture" property="profilePicture"/> |
| | | <result column="identity_photo" property="identityPhoto"/> |
| | | <result column="driving_license" property="drivingLicense"/> |
| | | <result column="is_enable" property="isEnable"/> |
| | | <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"/> |
| | | </resultMap> |
| | | |
| | | <select id="workerRanking" resultType="com.ruoyi.admin.vo.MasterWorkerRankVO"> |
| | | SELECT u.real_name, u.profile_picture, COUNT(o.serve_id) AS orderNumber |
| | | FROM sys_master_worker u |
| | | LEFT JOIN t_order o ON u.id = o.serve_id |
| | | <where> |
| | | <if test="ids != null and ids.size() != 0"> |
| | | u.id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | and o.is_delete = 0 |
| | | and u.is_delete = 0 |
| | | and u.is_enable = 1 |
| | | </where> |
| | | GROUP BY u.id |
| | | ORDER BY orderNumber DESC; |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="apply_reason" property="applyReason"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="orderCountByYear" resultType="com.ruoyi.admin.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | YEAR(createTime) = YEAR(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(createTime, '%Y-%m') |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="orderCountByWeek" resultType="com.ruoyi.admin.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | YEARWEEK(DATE_FORMAT(createTime, '%Y-%m-%d')) = YEARWEEK(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(createTime, '%Y-%m-%d') |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="orderCountByMonth" resultType="com.ruoyi.admin.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(createTime, '%Y-%m-%d') |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="orderCountByToday" resultType="com.ruoyi.admin.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d %H') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | DATE(createTime) = CURDATE() |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY DATE_FORMAT(createTime, '%Y-%m-%d %H') |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="totalMoneyByQuarter" resultType="java.math.BigDecimal"> |
| | | select sum(order_money) |
| | | from t_order |
| | | <where> |
| | | is_delete = 0 |
| | | and state = 4 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="start != null and start != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{start} |
| | | </if> |
| | | <if test="end != null and end != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="totalMoneyByYear" resultType="java.math.BigDecimal"> |
| | | SELECT sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | where YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and state = 4 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="totalMoneyByMonth" resultType="java.math.BigDecimal"> |
| | | SELECT sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | where MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and state = 4 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="orderCount" resultType="com.ruoyi.admin.vo.OrderCountVO"> |
| | | SELECT w.real_name AS realName, |
| | | w.profile_picture as profilePicture, |
| | | SUM(CASE WHEN o.state = 2 THEN 1 ELSE 0 END) AS toBeCompletedNumber, |
| | | SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END) AS completedNumber, |
| | | SUM(CASE WHEN o.state = 4 THEN 1 ELSE 0 END) AS reInvestment |
| | | FROM t_order o |
| | | LEFT JOIN sys_master_worker w ON o.server_id = w.id |
| | | WHERE w.is_delete = 0 |
| | | AND o.is_delete = 0 |
| | | <if test="phone != null and phone != ''"> |
| | | and w.phone like concat('%', #{phone}, '%') |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and w.real_name like concat('%', #{name}, '%') |
| | | </if> |
| | | GROUP BY w.real_name, w.profile_picture |
| | | </select> |
| | | |
| | | <select id="queryPage" resultMap="BaseResultMap"> |
| | | select * |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.serve_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and DATE(o.time) <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | and DATE(o.time) <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | </where> |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | <select id="orderPageCount" resultMap="BaseResultMap"> |
| | | select o.* |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.serve_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and DATE(o.time) <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | and DATE(o.time) <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="exportByIdList" resultMap="BaseResultMap"> |
| | | select reservation_name, |
| | | reservation_phone, |
| | | reservation_address, |
| | | time, |
| | | serve_name, |
| | | server_name, |
| | | server_phone |
| | | from t_order |
| | | <where> |
| | | id in |
| | | <foreach collection="list" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="exportList" resultMap="BaseResultMap"> |
| | | select o.reservation_name, |
| | | o.reservation_phone, |
| | | o.reservation_address, |
| | | o.time, |
| | | o.serve_name, |
| | | o.server_name, |
| | | o.server_phone |
| | | from t_order o |
| | | left join sys_change_dispatch c on o.id = c.order_id |
| | | <where> |
| | | o.is_delete = 0 |
| | | AND (c.is_delete = 0 OR c.is_delete IS NULL) |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.serve_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and DATE(o.time) <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | and DATE(o.time) <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="queryPage" resultMap="BaseResultMap"> |
| | | select u.*, r.role_name,r.role_id |
| | | select u.*, r.role_name, r.role_id |
| | | from sys_user u |
| | | left join sys_user_role ur on u.user_id = ur.user_id |
| | | left join sys_role r on ur.role_id = r.role_id |
| | | <where> |
| | | u.is_delete = 0 |
| | | and u.franchisee_id is null |
| | | <if test="nickName != null and nickName != ''"> |
| | | and u.nick_name like CONCAT('%', #{nickName}, '%') |
| | | </if> |
| | |
| | | and u.account like CONCAT('%', #{account}, '%') |
| | | </if> |
| | | <if test="role != null and role != ''"> |
| | | and r.role_name like CONCAT('%', #{role}, '%') |
| | | and r.role_id = #{role} |
| | | </if> |
| | | </where> |
| | | order by u.create_time desc |
New file |
| | |
| | | HELP.md |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | !**/src/main/**/target/ |
| | | !**/src/test/**/target/ |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | .sts4-cache |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### NetBeans ### |
| | | /nbproject/private/ |
| | | /nbbuild/ |
| | | /dist/ |
| | | /nbdist/ |
| | | /.nb-gradle/ |
| | | build/ |
| | | !**/src/main/**/build/ |
| | | !**/src/test/**/build/ |
| | | |
| | | ### VS Code ### |
| | | .vscode/ |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-service</artifactId> |
| | | <version>3.6.4</version> |
| | | </parent> |
| | | |
| | | <groupId>org.example</groupId> |
| | | <artifactId>ruoyi-order</artifactId> |
| | | |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | | <maven.compiler.target>8</maven.compiler.target> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-websocket</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.wechatpay-apiv3</groupId> |
| | | <artifactId>wechatpay-apache-httpclient</artifactId> |
| | | <version>0.4.7</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>easyexcel</artifactId> |
| | | <version>3.3.0</version> |
| | | <type>pom</type> |
| | | </dependency> |
| | | |
| | | <!-- mybatis-plus --> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>3.5.1</version> |
| | | </dependency> |
| | | <!-- 代码生成器 --> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.5.1</version> |
| | | </dependency> |
| | | <!--MYSQL 依赖--> |
| | | <dependency> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | <scope>runtime</scope> |
| | | </dependency> |
| | | <!--模板引擎freemarker依赖--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-freemarker</artifactId> |
| | | </dependency> |
| | | <!-- 雪花ID的依赖--> |
| | | <dependency> |
| | | <groupId>com.github.yitter</groupId> |
| | | <artifactId>yitter-idgenerator</artifactId> |
| | | <version>1.0.6</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>redis.clients</groupId> |
| | | <artifactId>jedis</artifactId> |
| | | <version>2.9.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>dom4j</groupId> |
| | | <artifactId>dom4j</artifactId> |
| | | <version>1.6.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alipay.sdk</groupId> |
| | | <artifactId>alipay-sdk-java</artifactId> |
| | | <version>4.8.10.ALL</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-system</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-user</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Alibaba Nacos Config --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Alibaba Sentinel --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- SpringBoot Actuator --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- Swagger UI --> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>${swagger.fox.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Common DataSource --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-datasource</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Common DataScope --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-datascope</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Common Log --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-log</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Common Swagger --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-swagger</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 引入Druid依赖,阿里巴巴所提供的数据源 --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.47</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common-security</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <finalName>${project.artifactId}</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.ruoyi.order; |
| | | |
| | | import com.ruoyi.common.security.annotation.EnableCustomConfig; |
| | | import com.ruoyi.common.security.annotation.EnableRyFeignClients; |
| | | import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @EnableCustomConfig |
| | | @MapperScan({"com.ruoyi.order.mapper"}) |
| | | @EnableCustomSwagger2 |
| | | @EnableRyFeignClients |
| | | @SpringBootApplication |
| | | @EnableScheduling |
| | | public class RuoyiOrderApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(RuoyiOrderApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 自动生成时间 |
| | | * |
| | | * @author HJL |
| | | */ |
| | | @Component |
| | | public class MyDateObjectHandler implements MetaObjectHandler { |
| | | |
| | | /** |
| | | * mybatisPlus新增修改自动插入当前时间 |
| | | * |
| | | * @author hjl |
| | | */ |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 创建时间 |
| | | this.setFieldValByName("createTime", new Date(), metaObject); |
| | | // 更新时间 |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | // 创建人 |
| | | this.setFieldValByName("createBy", "", metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | // 是否软删除 |
| | | this.setFieldValByName("isDelete", 0, metaObject); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 修改时间为当前时间 |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.core.config.GlobalConfig; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Configuration |
| | | public class MybatisPlusConfig { |
| | | |
| | | private final MyDateObjectHandler dataUpdateHandler; |
| | | |
| | | @Autowired |
| | | public MybatisPlusConfig(MyDateObjectHandler dataUpdateHandler) { |
| | | this.dataUpdateHandler = dataUpdateHandler; |
| | | } |
| | | |
| | | /** |
| | | * 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题 |
| | | */ |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | |
| | | /** |
| | | * 自动填充功能 |
| | | */ |
| | | @Bean |
| | | public GlobalConfig globalConfig() { |
| | | GlobalConfig globalConfig = new GlobalConfig(); |
| | | globalConfig.setMetaObjectHandler(dataUpdateHandler); |
| | | return globalConfig; |
| | | } |
| | | } |
New file |
| | |
| | | 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.service.ChangeDispatchService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 改派管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-31 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/changeDispatch") |
| | | @Api(tags = {"后台-系统设置-订单改派管理"}) |
| | | public class ChangeDispatchController { |
| | | |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | /** |
| | | * 订单改派分页列表 |
| | | * |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @ApiOperation(value = "订单改派分页查询列表", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "师傅名称", name = "workerName", dataType = "String"), |
| | | @ApiImplicitParam(value = "订单编号", name = "orderNumber", dataType = "String"), |
| | | @ApiImplicitParam(value = "下单用户名称", name = "userName", 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; |
| | | return R.ok(wrapper.eq(ChangeDispatch::getIsDelete, 0) |
| | | .orderByDesc(ChangeDispatch::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | */ |
| | | @ApiOperation(value = "新增订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<Boolean> save(@RequestBody ChangeDispatch changeDispatch) { |
| | | return R.ok(changeDispatchService.save(changeDispatch)); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | */ |
| | | @ApiOperation(value = "订单改派新逻辑", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "/saveRecord") |
| | | public R<Boolean> saveRecord(@RequestBody ChangeDispatch changeDispatch) { |
| | | String orderId = changeDispatch.getOrderId(); |
| | | ChangeDispatch record = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, orderId) |
| | | .orderByDesc(ChangeDispatch::getCreateTime) |
| | | .last("limit 1").one(); |
| | | boolean result = true; |
| | | if (null == record || record.getState() == 1 || record.getState() == 2) { |
| | | result = changeDispatchService.save(changeDispatch); |
| | | } else { |
| | | changeDispatchService.lambdaUpdate() |
| | | .set(ChangeDispatch::getState, Constants.ONE) |
| | | .eq(ChangeDispatch::getId, record.getId()).update(); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派 -远程调用 |
| | | * |
| | | * @param changeDispatch 订单改派信息 |
| | | */ |
| | | @ApiOperation(value = "新增订单改派", tags = {"后台-系统设置-订单改派管理"}) |
| | | @PostMapping(value = "/changeDispatchSave") |
| | | public R<Boolean> changeDispatchSave(@RequestBody ChangeDispatch changeDispatch) { |
| | | return R.ok(changeDispatchService.save(changeDispatch)); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 |
| | | * |
| | | * @param id 订单改派id |
| | | */ |
| | | @ApiOperation(value = "订单改派详情", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<ChangeDispatch> detail(@RequestParam("id") String id) { |
| | | return R.ok(changeDispatchService.lambdaQuery().eq(ChangeDispatch::getId, id) |
| | | .eq(ChangeDispatch::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 远程调用 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @GetMapping(value = "/one") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<ChangeDispatch> one(@RequestParam("id") Integer id) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, id) |
| | | .eq(ChangeDispatch::getState, Constants.ZERO) |
| | | .one(); |
| | | return R.ok(changeDispatch); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派详情 远程调用 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @GetMapping(value = "/changeDispatchOne") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "String", required = true) |
| | | }) |
| | | public R<ChangeDispatch> changeDispatchOne(@RequestParam("id") String id) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, id) |
| | | .eq(ChangeDispatch::getState, Constants.ZERO) |
| | | .orderByDesc(ChangeDispatch::getCreateTime) |
| | | .last("limit 1") |
| | | .one(); |
| | | return R.ok(changeDispatch); |
| | | } |
| | | |
| | | /** |
| | | * 拒绝订单改派申请 |
| | | * |
| | | * @param id 订单id |
| | | */ |
| | | @GetMapping(value = "/refuseChangeDispatch") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单改派id", name = "id", dataType = "String", required = true) |
| | | }) |
| | | public R<Boolean> refuseChangeDispatch(@RequestParam("id") String id) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getId, id) |
| | | .eq(ChangeDispatch::getIsDelete, Constants.ZERO) |
| | | .one(); |
| | | if (null == changeDispatch) { |
| | | throw new GlobalException("改派申请不存在或已删除!"); |
| | | } |
| | | changeDispatch.setState(Constants.TWO); |
| | | boolean update = changeDispatchService.updateById(changeDispatch); |
| | | // 订单重新派给提交申请的师傅 |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, changeDispatch.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | order.setState(Constants.ONE); |
| | | return R.ok(update && orderService.updateById(order)); |
| | | } |
| | | |
| | | /** |
| | | * 根据id批量删除订单改派 |
| | | * |
| | | * @param ids 订单改派多条id拼接 |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @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<ChangeDispatch> list = changeDispatchService.lambdaQuery().in(ChangeDispatch::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return changeDispatchService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 订单改派师傅 |
| | | * |
| | | * @param changeId 改派订单id |
| | | * @param workerId 师傅id |
| | | */ |
| | | @RequiresPermissions("reassignment_apply") |
| | | @ApiOperation(value = "订单改派师傅", tags = {"后台-系统设置-订单改派管理"}) |
| | | @GetMapping(value = "/changeWorker") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "改派订单id", name = "changeId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "师傅id", name = "workerId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "师傅姓名", name = "name", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅电话", name = "phone", dataType = "String", required = true) |
| | | }) |
| | | public R<Boolean> changeWorker(@RequestParam("changeId") String changeId, @RequestParam("workerId") Integer workerId, |
| | | @RequestParam("name") String name, @RequestParam("phone") String phone) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery().eq(ChangeDispatch::getId, changeId) |
| | | .eq(ChangeDispatch::getIsDelete, 0).one(); |
| | | if (null == changeDispatch || Constants.ONE.equals(changeDispatch.getState())) { |
| | | throw new GlobalException("改派申请不存在或已改派!"); |
| | | } |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, changeDispatch.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单不存在!"); |
| | | } |
| | | // 原订单状态改为 1:待上门,已选择师傅 |
| | | order.setState(Constants.ONE); |
| | | // 更改订单信息为再投单 |
| | | boolean orderUpdate = orderService.lambdaUpdate().set(Order::getIsReinvest, Constants.ONE) |
| | | .set(Order::getAcceptTime, new Date()) |
| | | .set(Order::getArriveTime, null) |
| | | .set(Order::getCompleteTime, null) |
| | | .eq(Order::getId, order.getId()).update(); |
| | | // 生成新订单信息 |
| | | // Order newOrder = new Order(); |
| | | // BeanUtils.copyProperties(order, newOrder); |
| | | // newOrder.setId(null); |
| | | // newOrder.setServerId(workerId); |
| | | // newOrder.setServerName(name); |
| | | // newOrder.setServerPhone(phone); |
| | | // newOrder.setState(Constants.ONE); |
| | | // // 构建新订单 |
| | | // boolean save = orderService.save(newOrder); |
| | | // 改派信息 |
| | | boolean update = changeDispatchService.lambdaUpdate().set(ChangeDispatch::getState, 1) |
| | | .eq(ChangeDispatch::getId, changeId).eq(ChangeDispatch::getIsDelete, 0).update(); |
| | | return R.ok(orderUpdate && update); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | 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.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.request.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.service.EvaluateService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/evaluate") |
| | | @Api(tags = {"后台-系统设置-订单评价管理"}) |
| | | public class EvaluateController { |
| | | |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @ApiOperation(value = "订单评价分页查询列表", tags = {"后台"}) |
| | | @GetMapping(value = "/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "评价用户", name = "userNo", dataType = "String"), |
| | | @ApiImplicitParam(value = "订单编号", name = "orderNumber", dataType = "String"), |
| | | @ApiImplicitParam(value = "师傅姓名", name = "workerName", 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))); |
| | | } |
| | | |
| | | /** |
| | | * 订单评价详情 |
| | | * |
| | | * @param id 订单评价id |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @ApiOperation(value = "订单评价详情", tags = {"后台"}) |
| | | @GetMapping(value = "/detail") |
| | | public R<Evaluate> detail(@RequestParam("id") Integer id) { |
| | | return R.ok(evaluateService.lambdaQuery() |
| | | .eq(Evaluate::getId, id) |
| | | .eq(Evaluate::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id批量删除订单评价 |
| | | * |
| | | * @param ids 订单评价多条id拼接 |
| | | */ |
| | | @RequiresPermissions("order_evaluate") |
| | | @ApiOperation(value = "批量删除订单评价", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | public R<String> batchDelete(@RequestParam("ids") String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | List<Evaluate> list = evaluateService.lambdaQuery().in(Evaluate::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | List<String> orderIds = list.stream().map(Evaluate::getOrderId).collect(Collectors.toList()); |
| | | if (!orderIds.isEmpty()) { |
| | | orderService.lambdaUpdate() |
| | | .set(Order::getIsEvaluate, Constants.ZERO) |
| | | .in(Order::getId, orderIds).update(); |
| | | } |
| | | return evaluateService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 用户所关联评价记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @ApiOperation(value = "用户详情-评价记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/evaluateList") |
| | | public R<Page<EvaluatePageVO>> evaluateList(@RequestParam(value = "userId", required = false) Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(evaluateService.evaluateList(userId, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 根据师傅id获取评价列表 |
| | | * |
| | | * @param workerId 师傅id |
| | | */ |
| | | @ApiOperation(value = "根据师傅id获取评价列表", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/evaluateByWorkerId") |
| | | public R<List<Evaluate>> evaluateByWorkerId(@RequestParam("workerId") Integer workerId) { |
| | | List<Evaluate> evaluateList = evaluateService.lambdaQuery().eq(Evaluate::getWorkerId, workerId) |
| | | .eq(Evaluate::getIsDelete, 0).list(); |
| | | return R.ok(evaluateList); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id获取评价列表 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "根据订单id获取评价列表", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/oneByOrderId") |
| | | public R<Evaluate> oneByOrderId(@RequestParam("orderId") String orderId) { |
| | | return R.ok(evaluateService.lambdaQuery().eq(Evaluate::getOrderId, orderId) |
| | | .eq(Evaluate::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 订单评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | */ |
| | | @ApiOperation(value = "订单评价列表", tags = {"用户端"}) |
| | | @GetMapping(value = "/evaluateListByUser") |
| | | public R<Page<OrderEvaluateVO>> evaluateListByUser(@RequestParam("userId") Integer userId, |
| | | @RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(evaluateService.evaluateListByUser(userId, state, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 提交评价 |
| | | * |
| | | * @param request 评价信息 |
| | | */ |
| | | @ApiOperation(value = "提交评价", tags = {"用户端"}) |
| | | @PostMapping(value = "/evaluateSave") |
| | | public R<Boolean> evaluateSave(@RequestBody OrderEvaluateSubmitRequest request) { |
| | | String orderId = request.getOrderId(); |
| | | String content = request.getContent(); |
| | | Double starRating = request.getStarRating(); |
| | | String serveNo = request.getServeNo(); |
| | | Integer userId = request.getUserId(); |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单不存在或已删除!"); |
| | | } |
| | | order.setIsEvaluate(Constants.ONE); |
| | | orderService.updateById(order); |
| | | Evaluate evaluate = new Evaluate(); |
| | | evaluate.setUserId(userId); |
| | | evaluate.setOrderId(orderId); |
| | | evaluate.setContent(content); |
| | | evaluate.setWorkerId(order.getServerId()); |
| | | evaluate.setStarRating(starRating); |
| | | evaluate.setServeNo(serveNo); |
| | | return R.ok(evaluateService.save(evaluate)); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.entity.*; |
| | | import com.ruoyi.order.request.OrderRequest; |
| | | import com.ruoyi.order.request.OrderSubmitRequest; |
| | | import com.ruoyi.order.request.UserOrderRequest; |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.order.vo.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @Api(tags = {"后台-订单管理"}) |
| | | public class OrderController { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private ServeCoordinateService serveCoordinateService; |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | |
| | | /** |
| | | * 根据前台用户id查询所有订单信息 |
| | | * |
| | | * @param phone 手机号 |
| | | */ |
| | | @ApiOperation(value = "查询用户所有订单", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/queryList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号", name = "phone", dataType = "String", required = true) |
| | | }) |
| | | public R<List<Order>> queryList(@RequestParam("phone") String phone) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getReservationPhone, phone) |
| | | .eq(Order::getIsDelete, 0).list()); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | */ |
| | | @ApiOperation(value = "订单列表-分页", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/queryPage") |
| | | public R<Page<Order>> queryPage(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | return R.ok(orderService.queryPage(orderQueryRequest)); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表 |
| | | */ |
| | | @ApiOperation(value = "订单列表-各订单数量统计", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/orderPageCount") |
| | | public R<OrderPageCountVO> orderPageCount(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | return R.ok(orderService.orderPageCount(orderQueryRequest)); |
| | | } |
| | | |
| | | /** |
| | | * 更改订单状态 |
| | | */ |
| | | @ApiOperation(value = "订单列表-更改订单状态", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/updateState") |
| | | public R<Boolean> updateState(@RequestParam("orderId") String orderId, |
| | | @RequestParam("state") Integer state) { |
| | | return R.ok(orderService.lambdaUpdate() |
| | | .eq(Order::getId, orderId).set(Order::getState, state).update()); |
| | | } |
| | | |
| | | /** |
| | | * 更改订单提现状态 |
| | | */ |
| | | @ApiOperation(value = "订单列表-更改订单提现状态", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/updateWithdrawalState") |
| | | public R<Boolean> updateWithdrawalState(@RequestParam("orderId") String orderId, |
| | | @RequestParam("state") Integer state) { |
| | | return R.ok(orderService.lambdaUpdate() |
| | | .eq(Order::getId, orderId).set(Order::getIsWithdrawal, state).update()); |
| | | } |
| | | |
| | | /** |
| | | * 站点详情 |
| | | * |
| | | * @param id 站点id |
| | | */ |
| | | @ApiOperation(value = "订单列表-订单详情", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/detailByExchangeId") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "改派申请id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Order> detailByExchangeId(@RequestParam("id") String id) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, id) |
| | | .eq(ChangeDispatch::getIsDelete, 0).one(); |
| | | if (null == changeDispatch) { |
| | | throw new GlobalException("改派申请信息不存在!"); |
| | | } |
| | | return R.ok(orderService.lambdaQuery() |
| | | .eq(Order::getId, changeDispatch.getOrderId()).eq(Order::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 站点详情 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param prizeName 奖品名称 |
| | | */ |
| | | @ApiOperation(value = "补充订单津贴金额", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/supplementAllowance") |
| | | public R<Boolean> supplementAllowance(@RequestParam("orderId") String orderId, |
| | | @RequestParam("prizeName") String prizeName) { |
| | | BigDecimal bigDecimal; |
| | | try { |
| | | bigDecimal = new BigDecimal(prizeName); |
| | | } catch (Exception e) { |
| | | bigDecimal = BigDecimal.ZERO; |
| | | } |
| | | return R.ok(orderService.lambdaUpdate() |
| | | .eq(Order::getId, orderId).set(Order::getSubsidy, bigDecimal).update()); |
| | | } |
| | | |
| | | /** |
| | | * 更改订单状态 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param state 状态 |
| | | */ |
| | | @ApiOperation(value = "更改订单状态", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/changeOrderState") |
| | | public R<Boolean> changeOrderState(@RequestParam("orderId") String orderId, @RequestParam("state") Integer state) { |
| | | return R.ok(orderService.lambdaUpdate() |
| | | .eq(Order::getId, orderId).eq(Order::getIsDelete, 0) |
| | | .set(Order::getState, state).update()); |
| | | } |
| | | |
| | | /** |
| | | * 站点详情 |
| | | * |
| | | * @param id 站点id |
| | | */ |
| | | @ApiOperation(value = "订单列表-订单详情", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/detail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "站点id", name = "id", dataType = "String", required = true) |
| | | }) |
| | | public R<Order> detail(@RequestParam("id") String id) { |
| | | return R.ok(orderService.lambdaQuery() |
| | | .eq(Order::getId, id).eq(Order::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 申请改派审核通过后生成新订单 |
| | | * |
| | | * @param order 订单信息 |
| | | */ |
| | | @GetMapping(value = "/generateNewOrder") |
| | | public R<Boolean> generateNewOrder(@RequestBody Order order) { |
| | | return R.ok(orderService.save(order)); |
| | | } |
| | | |
| | | /** |
| | | * 更改订单信息 |
| | | * |
| | | * @param type 1:订单派单;2:订单改派 |
| | | */ |
| | | @GetMapping(value = "/exchangeOrder") |
| | | public R<Order> exchangeOrder(@RequestParam("type") Integer type, @RequestParam("orderId") String orderId, |
| | | @RequestParam("workerId") Integer workerId, @RequestParam("name") String name, |
| | | @RequestParam("phone") String phone) { |
| | | Order order = orderService.getById(orderId); |
| | | // 订单派单 |
| | | if (Constants.ONE.equals(type)) { |
| | | order.setServerId(workerId); |
| | | order.setServerName(name); |
| | | order.setServerPhone(phone); |
| | | order.setAcceptTime(new Date()); |
| | | order.setState(Constants.ONE); |
| | | orderService.updateById(order); |
| | | } else if (Constants.TWO.equals(type)) { |
| | | order.setServerId(workerId); |
| | | // 更新接单时间 |
| | | order.setAcceptTime(new Date()); |
| | | order.setServerName(name); |
| | | order.setServerPhone(phone); |
| | | orderService.updateById(order); |
| | | } |
| | | return R.ok(order); |
| | | } |
| | | |
| | | /** |
| | | * 新增订单 |
| | | * 后台订单为指定订单,默认为待上门状态 |
| | | * |
| | | * @param orderRequest 订单信息 |
| | | */ |
| | | @ApiOperation(value = "订单列表-新增订单", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/save") |
| | | public R<Boolean> save(@RequestBody OrderRequest orderRequest) { |
| | | Order order = new Order(); |
| | | order.setCity(orderRequest.getCity()); |
| | | order.setOrderNumber(orderRequest.getOrderNumber()); |
| | | order.setUserId(orderRequest.getUserId()); |
| | | order.setSiteId(orderRequest.getSiteId()); |
| | | order.setSiteName(orderRequest.getSiteName()); |
| | | order.setServeId(orderRequest.getServeId()); |
| | | order.setServeName(orderRequest.getServeName()); |
| | | order.setSiteName(orderRequest.getSiteName()); |
| | | // 预约信息 |
| | | order.setReservationName(orderRequest.getReservationName()); |
| | | order.setReservationPhone(orderRequest.getReservationPhone()); |
| | | order.setReservationAddress(orderRequest.getReservationAddress()); |
| | | order.setTime(orderRequest.getTime()); |
| | | order.setAcceptTime(orderRequest.getAcceptTime()); |
| | | // 师傅信息 |
| | | order.setServerId(orderRequest.getServerId()); |
| | | order.setServerName(orderRequest.getServerName()); |
| | | order.setServerPhone(orderRequest.getServerPhone()); |
| | | order.setReservationRemark(orderRequest.getReservationRemark()); |
| | | order.setState(orderRequest.getState()); |
| | | order.setArriveTime(orderRequest.getArriveTime()); |
| | | order.setType(orderRequest.getType()); |
| | | order.setLongitude(orderRequest.getLongitude()); |
| | | order.setLatitude(orderRequest.getLatitude()); |
| | | order.setCompleteTime(orderRequest.getCompleteTime()); |
| | | order.setSubsidy(orderRequest.getSubsidy()); |
| | | order.setIsWithdrawal(orderRequest.getIsWithdrawal()); |
| | | order.setAddress(orderRequest.getAddress()); |
| | | order.setCancelReason(orderRequest.getCancelReason()); |
| | | order.setApplyReason(orderRequest.getApplyReason()); |
| | | order.setIsEvaluate(Constants.ZERO); |
| | | return R.ok(orderService.save(order)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据id批量删除站点 |
| | | * |
| | | * @param ids 站点多条id拼接 |
| | | */ |
| | | @ApiOperation(value = "订单列表-批量删除订单", tags = {"后台-订单管理"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "多个id ',' 拼接", name = "ids", dataType = "String", required = true) |
| | | }) |
| | | public R<Boolean> batchDelete(@RequestParam("ids") String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | List<Order> list = orderService.lambdaQuery().in(Order::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return R.ok(orderService.updateBatchById(list)); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | */ |
| | | @ApiOperation(value = "订单列表-excel导出", tags = {"后台-订单管理"}) |
| | | @PostMapping(value = "/excelExport") |
| | | public R<List<Order>> excelExport(@RequestBody OrderQueryRequest orderQueryRequest) { |
| | | return R.ok(orderService.excelExport(orderQueryRequest)); |
| | | } |
| | | |
| | | /** |
| | | * 订单列表-excel导出 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | */ |
| | | @ApiOperation(value = "订单统计", tags = {"后台-订单管理"}) |
| | | @GetMapping(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))); |
| | | } |
| | | |
| | | /** |
| | | * 回收订单统计 |
| | | * |
| | | * @param orderCount 查询所需参数 |
| | | */ |
| | | @ApiOperation(value = "后台-回收订单统计", tags = {"后台-首页"}) |
| | | @PostMapping(value = "/orderCountHome") |
| | | public R<OrderResultVO> orderCountHome(@RequestBody OrderCountRequest orderCount) { |
| | | return R.ok(orderService.orderCountHome(orderCount)); |
| | | } |
| | | |
| | | /** |
| | | * 用户所关联订单记录分页列表 |
| | | * |
| | | * @param userId 手机号 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @ApiOperation(value = "用户详情-订单记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/orderList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户id", name = "userId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<Order>> orderList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 根据类型获取交易额 |
| | | * |
| | | * @param moneyQueryRequest 筛选参数 |
| | | * @return 交易额 |
| | | */ |
| | | @ApiOperation(value = "根据类型获取交易额", tags = {"后台-用户管理-用户列表"}) |
| | | @PostMapping(value = "/tradeMoney") |
| | | public R<BigDecimal> tradeMoney(@RequestBody MoneyQueryRequest moneyQueryRequest) { |
| | | return R.ok(orderService.tradeMoney(moneyQueryRequest)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单列表 |
| | | * |
| | | * @param userId 用户端 |
| | | * @param state 订单状态 |
| | | * @return 交易额 |
| | | */ |
| | | @ApiOperation(value = "师傅端-订单列表", tags = {"师傅端"}) |
| | | @GetMapping(value = "/orderListWorker") |
| | | public R<Page<Order>> orderListWorker(@RequestParam("userId") Integer userId, @RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.orderListWorker(userId, state, pageNum, pageSize)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-根据师傅id获取订单数量 |
| | | * |
| | | * @param workerIds 师傅id集合 |
| | | * @return 接单列表 |
| | | */ |
| | | @ApiOperation(value = "根据师傅id获取订单数量", tags = {"师傅端"}) |
| | | @PostMapping(value = "/workerOrderRank") |
| | | public R<List<WorkerOrderRankVO>> workerOrderRank(@RequestBody List<Integer> workerIds) { |
| | | return R.ok(orderService.workerOrderRank(workerIds)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单路线导航 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "订单路线导航", tags = {"师傅端"}) |
| | | @GetMapping(value = "/orderNavigation") |
| | | public R<Path> orderNavigation(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId, |
| | | @RequestParam("longitude") String longitude, @RequestParam("latitude") String latitude) { |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId) |
| | | .eq(Order::getServerId, workerId) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("请确认当前订单所派单师傅是否是您!"); |
| | | } |
| | | // 用户下单经纬度 |
| | | Double userLongitude = order.getLongitude(); |
| | | Double userLatitude = order.getLatitude(); |
| | | String userPosition = userLongitude + "," + userLatitude; |
| | | // 师傅当前位置 经纬度 |
| | | String workerPosition = longitude + "," + latitude; |
| | | return R.ok(orderService.orderNavigation(userPosition, workerPosition)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-已到达预约地点 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @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(); |
| | | if (null == order) { |
| | | throw new GlobalException("请确认当前订单所派单师傅是否是您!"); |
| | | } |
| | | // 待完工状态 |
| | | order.setState(Constants.TWO); |
| | | order.setArriveTime(new Date()); |
| | | return R.ok(orderService.updateById(order)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单详情 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "订单详情", tags = {"师傅端-订单列表"}) |
| | | @GetMapping(value = "/orderDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true) |
| | | }) |
| | | public R<OrderDetailVO> orderDetail(@RequestParam("orderId") String orderId) { |
| | | // 订单信息 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | // 获取回收服务封面 |
| | | |
| | | // 服务信息(服务备注、上门时间、完成时间、完成所拍现场照片) |
| | | ServeRecord serveRecord = serveRecordService.lambdaQuery().eq(ServeRecord::getOrderId, orderId) |
| | | .eq(ServeRecord::getIsDelete, 0).one(); |
| | | // 评价信息 |
| | | Evaluate evaluate = evaluateService.lambdaQuery().eq(Evaluate::getOrderId, orderId) |
| | | .eq(Evaluate::getIsDelete, 0).one(); |
| | | return R.ok(new OrderDetailVO(order, serveRecord, evaluate)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单详情 |
| | | * |
| | | * @param orderSubmitRequest 提交订单信息 |
| | | */ |
| | | @ApiOperation(value = "订单完工-提交订单", tags = {"师傅端-订单列表"}) |
| | | @PostMapping(value = "/orderSubmit") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> orderSubmit(@RequestBody OrderSubmitRequest orderSubmitRequest) { |
| | | // 订单信息 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderSubmitRequest.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | // 订单不存在,或订单状态异常(订单状态为2才可提交) |
| | | if (null == order || !Constants.TWO.equals(order.getState())) { |
| | | throw new GlobalException("订单不存在或订单状态异常!"); |
| | | } |
| | | order.setCompleteTime(new Date()); |
| | | order.setState(Constants.THREE); |
| | | boolean update = orderService.updateById(order); |
| | | // 服务记录 |
| | | ServeRecord serveRecord = new ServeRecord(); |
| | | serveRecord.setOrderId(order.getId()); |
| | | serveRecord.setPhoto(String.join(",", orderSubmitRequest.getPhoto())); |
| | | boolean save = serveRecordService.save(serveRecord); |
| | | return R.ok(update && save); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-定时调度记录师傅所走路线经纬度 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param longitude 经度 |
| | | * @param latitude 纬度 |
| | | */ |
| | | @ApiOperation(value = "订单进行-记录路线经纬度", tags = {"师傅端"}) |
| | | @GetMapping(value = "/coordinate") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> coordinate(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId, |
| | | @RequestParam("longitude") Double longitude, @RequestParam("latitude") Double latitude) { |
| | | ServeCoordinate serveCoordinate = new ServeCoordinate(); |
| | | serveCoordinate.setWorkerId(workerId); |
| | | serveCoordinate.setOrderId(orderId); |
| | | serveCoordinate.setCoordinate(longitude + "," + latitude); |
| | | serveCoordinate.setLongitude(BigDecimal.valueOf(longitude)); |
| | | serveCoordinate.setLatitude(BigDecimal.valueOf(latitude)); |
| | | return R.ok(serveCoordinateService.save(serveCoordinate)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-代办列表 |
| | | * |
| | | * @param workerId 师傅id |
| | | */ |
| | | @ApiOperation(value = "代办列表", tags = {"师傅端"}) |
| | | @GetMapping(value = "/orderNotHandle") |
| | | public R<List<Order>> orderNotHandle(@RequestParam("workerId") Integer workerId) { |
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("server_id", workerId) |
| | | .in("state", 1, 2) |
| | | .eq("is_delete", Constants.ZERO) |
| | | .orderByAsc("CASE WHEN topSort IS NULL THEN 1 ELSE 0 END") |
| | | .orderByAsc("topSort"); |
| | | return R.ok(orderService.list(wrapper)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单代办列表 |
| | | */ |
| | | @ApiOperation(value = "订单置顶", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/orderTop") |
| | | public R<Boolean> orderTop(@RequestParam("orderId") String orderId, @RequestParam("workerId") Integer workerId) { |
| | | return R.ok(orderService.orderTop(orderId, workerId)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单状态统计数量 |
| | | */ |
| | | @ApiOperation(value = "订单状态统计数量", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/orderStateCount") |
| | | public R<WorkerOrderCountVO> orderStateCount(@RequestParam("workerId") Integer workerId) { |
| | | return R.ok(orderService.orderStateCount(workerId)); |
| | | } |
| | | |
| | | /************************************** 用户端远程调用接口 ***************************************/ |
| | | |
| | | /** |
| | | * 用户端-订单状态统计数量 |
| | | */ |
| | | @ApiOperation(value = "订单状态统计数量", tags = {"用户端"}) |
| | | @GetMapping(value = "/orderListByUser") |
| | | public R<Page<Order>> orderListByUser(@RequestParam("userId") Integer userId, |
| | | @RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LambdaQueryChainWrapper<Order> wrapper = orderService.lambdaQuery() |
| | | .eq(Order::getIsDelete, 0).eq(Order::getUserId, userId); |
| | | if (state != -1) { |
| | | wrapper.eq(Order::getState, state); |
| | | } |
| | | return R.ok(wrapper.orderByDesc(Order::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 用户端-生成预订单信息 |
| | | */ |
| | | @ApiOperation(value = "生成预订单信息", tags = {"用户端"}) |
| | | @PostMapping(value = "/orderEstimate") |
| | | public R<String> orderEstimate(@RequestBody UserOrderRequest userOrderRequest) { |
| | | return R.ok(orderService.orderEstimate(userOrderRequest), ""); |
| | | } |
| | | |
| | | /** |
| | | * 用户端-用户下单 |
| | | */ |
| | | @ApiOperation(value = "下单", tags = {"用户端"}) |
| | | @PostMapping(value = "/placeOrder") |
| | | public R<Boolean> placeOrder(@RequestBody UserOrderRequest userOrderRequest) { |
| | | return R.ok(orderService.placeOrder(userOrderRequest)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.entity.ServeCoordinate; |
| | | import com.ruoyi.order.service.ServeCoordinateService; |
| | | 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.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/serveCoordinate") |
| | | @Api(tags = {"后台-系统设置-订单评价管理"}) |
| | | public class ServeCoordinateController { |
| | | |
| | | @Resource |
| | | private ServeCoordinateService serveCoordinateService; |
| | | |
| | | /** |
| | | * 根据订单id和师傅id获取订单路线轨迹 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "根据订单id和师傅id获取订单路线轨迹", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/serveCoordinateList") |
| | | public R<List<ServeCoordinate>> serveCoordinateList(@RequestParam("orderId") String orderId, |
| | | @RequestParam("workerId") String workerId) { |
| | | return R.ok(serveCoordinateService.lambdaQuery() |
| | | .eq(ServeCoordinate::getWorkerId, workerId) |
| | | .eq(ServeCoordinate::getIsDelete, 0) |
| | | .eq(ServeCoordinate::getOrderId, orderId) |
| | | .orderByDesc(ServeCoordinate::getCreateTime).list()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.entity.ServeRecord; |
| | | import com.ruoyi.order.service.ServeRecordService; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/serveRecord") |
| | | @Api(tags = {"后台-系统设置-订单评价管理"}) |
| | | public class ServeRecordController { |
| | | |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | |
| | | /** |
| | | * 根据订单id获取服务记录 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "根据订单id获取服务记录", tags = {"后台-系统设置-订单评价管理"}) |
| | | @GetMapping(value = "/serveRecordByOrderId") |
| | | public R<ServeRecord> serveRecordByOrderId(@RequestParam("orderId") String orderId) { |
| | | return R.ok(serveRecordService.lambdaQuery().eq(ServeRecord::getOrderId, orderId) |
| | | .eq(ServeRecord::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | 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.order.entity.Order; |
| | | import com.ruoyi.order.entity.ServeRecord; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.request.WithdrawExportRequest; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.ServeRecordService; |
| | | import com.ruoyi.order.service.WithdrawService; |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | import com.ruoyi.order.vo.WithdrawDetailVO; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/withdraw") |
| | | public class WithdrawController { |
| | | |
| | | @Resource |
| | | private WithdrawService withdrawService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @ApiOperation(value = "用户提现管理-提现记录分页列表", tags = {"后台-用户管理-提现列表"}) |
| | | @GetMapping(value = "/withdrawPage") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户昵称", name = "nickname", dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号", name = "userPhone", dataType = "String"), |
| | | @ApiImplicitParam(value = "申请时间", name = "applyForTime", dataType = "String"), |
| | | @ApiImplicitParam(value = "审核状态(0待审核;1已通过;2已驳回)", name = "state", dataType = "Integer"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<UserWithdrawRecordVO>> withdrawPage(@RequestParam(value = "nickname", required = false) String nickname, |
| | | @RequestParam(value = "userPhone", required = false) String userPhone, |
| | | @RequestParam(value = "applyForTime", required = false) String applyForTime, |
| | | @RequestParam(value = "state", required = false) Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawPage(nickname, userPhone, applyForTime, state, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | | * 查看提现记录详情 |
| | | * |
| | | * @param id 提现记录id |
| | | */ |
| | | @ApiOperation(value = "提现记录详情", tags = {"后台-用户管理-提现列表"}) |
| | | @GetMapping(value = "/withdrawRecordDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Withdraw> withdrawRecordDetail(@RequestParam("id") Integer id) { |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id) |
| | | .eq(Withdraw::getIsDelete, 0).one(); |
| | | return R.ok(withdraw); |
| | | } |
| | | |
| | | /** |
| | | * 提现管理-提现审批 |
| | | * |
| | | * @param id 提现记录id |
| | | * @param state 审批结果 |
| | | * @param opinion 审批意见 |
| | | */ |
| | | @ApiOperation(value = "提现管理-提现审批", tags = {"后台-用户管理-提现列表"}) |
| | | @GetMapping(value = "/withdrawExamine") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现记录id", name = "id", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "审批意见", name = "opinion", dataType = "String"), |
| | | @ApiImplicitParam(value = "审批同意/不同意(1同意;2驳回)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> withdrawExamine(@RequestParam("id") Integer id, @RequestParam("state") Integer state, |
| | | @RequestParam(value = "opinion", required = false) String opinion, |
| | | @RequestParam(value = "openId") String openId, |
| | | @RequestParam(value = "userId") Integer userId) { |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getId, id).eq(Withdraw::getIsDelete, 0) |
| | | .eq(Withdraw::getState, 0).one(); |
| | | if (null == withdraw) { |
| | | return R.fail(503, "当前提现记录审批状态异常!"); |
| | | } |
| | | // 修改审批状态及审批意见 |
| | | withdraw.setState(state); |
| | | withdraw.setOpinion(opinion); |
| | | // 同意提现申请,更改订单提现状态 |
| | | boolean update = true; |
| | | if (Constants.ONE.equals(state)) { |
| | | update = orderService.lambdaUpdate() |
| | | .set(Order::getIsWithdrawal, Constants.ONE) |
| | | .eq(Order::getId, withdraw.getOrderId()).update(); |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, withdraw.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | } |
| | | Boolean b = withdrawService.confirmWithdraw(openId, userId, order); |
| | | if (!b) { |
| | | throw new GlobalException("提现失败!"); |
| | | } |
| | | } |
| | | update = update && withdrawService.updateById(withdraw); |
| | | return R.ok(update); |
| | | } |
| | | |
| | | /** |
| | | * 用户提现记录导出 |
| | | * |
| | | * @param exportRequest 提现记录 |
| | | */ |
| | | @ApiOperation(value = "用户提现管理-excel导出用户提现记录", tags = {"后台-用户管理-提现列表"}) |
| | | @PostMapping(value = "/excelExport") |
| | | public R<List<UserWithdrawRecordVO>> excelExport(@RequestBody WithdrawExportRequest exportRequest) { |
| | | return R.ok(withdrawService.excelExport(exportRequest)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除提现记录 |
| | | * |
| | | * @param ids 轮播图多条id拼接 |
| | | * @return 封装分页数据 |
| | | */ |
| | | @ApiOperation(value = "批量删除提现记录", tags = {"后台-用户管理-提现列表"}) |
| | | @GetMapping(value = "/batchDelete") |
| | | public R<String> batchDelete(@RequestParam("ids") String ids) { |
| | | List<String> idList = Arrays.stream(ids.split(",")).collect(Collectors.toList()); |
| | | List<Withdraw> list = withdrawService.lambdaQuery().in(Withdraw::getId, idList).list(); |
| | | list.forEach(data -> data.setIsDelete(1)); |
| | | return withdrawService.updateBatchById(list) ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 根据类型统计提现金额 |
| | | * |
| | | * @param request 根据类型统计提现金额 |
| | | * @return 提现金额 |
| | | */ |
| | | @ApiOperation(value = "根据类型统计提现金额", tags = {"后台-用户管理-提现列表"}) |
| | | @PostMapping(value = "/withdrawalTotalMoney") |
| | | public R<BigDecimal> withdrawalTotalMoney(@RequestBody MoneyQueryRequest request) { |
| | | return R.ok(withdrawService.withdrawalTotalMoney(request)); |
| | | } |
| | | |
| | | /** |
| | | * 修改系统设置-关闭/开启审核 |
| | | * |
| | | * @return 操作结果 |
| | | */ |
| | | @ApiOperation(value = "关闭/开启审核", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/enableProcess") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "审核状态(0:未开启,1:已开启)", name = "enableProcess", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> enableProcess(@RequestParam("enableProcess") Integer enableProcess) { |
| | | return R.ok(withdrawService.enableProcess(enableProcess)); |
| | | } |
| | | |
| | | /** |
| | | * 获取系统设置-审核设置 |
| | | * --远程调用 |
| | | * |
| | | * @return 操作结果 |
| | | */ |
| | | @GetMapping(value = "/withdrawProcess") |
| | | public R<WithdrawalSetting> withdrawProcess() { |
| | | return R.ok(withdrawService.withdrawProcess()); |
| | | } |
| | | |
| | | /** |
| | | * 全局审核状态 |
| | | */ |
| | | @ApiOperation(value = "全局审核状态", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/withdrawState") |
| | | public R<WithdrawalSetting> withdrawState() { |
| | | return R.ok(withdrawService.withdrawProcess()); |
| | | } |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param pageNum 页码 |
| | | * @param pageSize 每页显示条数 |
| | | * @return 分页列表 |
| | | */ |
| | | @ApiOperation(value = "用户详情-提现记录分页列表", tags = {"后台-用户管理-用户列表"}) |
| | | @GetMapping(value = "/withdrawList") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户id", name = "userId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "每页条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Page<UserWithdrawRecordVO>> withdrawList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.withdrawList(userId, Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /************************************* 用户端 **************************************************/ |
| | | |
| | | /** |
| | | * 根据订单获取用户提现申请记录 |
| | | */ |
| | | @ApiOperation(value = "根据订单获取用户提现申请记录", tags = {"用户端"}) |
| | | @GetMapping(value = "/withdrawRecordByUser") |
| | | public R<List<Withdraw>> withdrawRecordByUser(@RequestParam("orderId") String orderId, |
| | | @RequestParam("userId") Integer userId) { |
| | | return R.ok(withdrawService.lambdaQuery().eq(Withdraw::getUserId, userId) |
| | | .eq(Withdraw::getOrderId, orderId).list()); |
| | | } |
| | | |
| | | /** |
| | | * 用户提交提现申请 |
| | | */ |
| | | @ApiOperation(value = "用户提交提现申请", tags = {"用户端"}) |
| | | @GetMapping(value = "/confirmWithdrawByUser") |
| | | public R<Boolean> confirmWithdrawByUser(@RequestParam("orderId") String orderId, |
| | | @RequestParam("userId") Integer userId, |
| | | @RequestParam("openId") String openId, |
| | | @RequestParam("userPhone") String userPhone) { |
| | | return R.ok(withdrawService.confirmWithdrawByUser(orderId, userId, openId, userPhone)); |
| | | } |
| | | |
| | | @GetMapping("/withdrawListByUser") |
| | | @ApiOperation(value = "用户订单列表", tags = {"用户端"}) |
| | | public R<Page<Order>> withdrawListByUser(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(orderService.lambdaQuery().eq(Order::getUserId, userId) |
| | | .eq(Order::getState, 3).eq(Order::getIsDelete, 0).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | @GetMapping("/withdrawRecordList") |
| | | @ApiOperation(value = "用户提现申请记录", tags = {"用户端"}) |
| | | public R<Page<Withdraw>> withdrawRecordList(@RequestParam("userId") Integer userId, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | return R.ok(withdrawService.lambdaQuery().eq(Withdraw::getUserId, userId) |
| | | .eq(Withdraw::getIsDelete, 0).orderByDesc(Withdraw::getCreateTime) |
| | | .page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | @GetMapping("/withdrawDetailByUser") |
| | | @ApiOperation(value = "提现订单详情", tags = {"用户端"}) |
| | | public R<WithdrawDetailVO> withdrawDetailByUser(@RequestParam("orderId") String orderId) { |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单不存在!"); |
| | | } |
| | | ServeRecord serveRecord = serveRecordService.lambdaQuery() |
| | | .eq(ServeRecord::getOrderId, orderId).eq(ServeRecord::getIsDelete, 0).one(); |
| | | Withdraw withdraw = withdrawService.lambdaQuery().eq(Withdraw::getOrderId, orderId) |
| | | .eq(Withdraw::getIsDelete, 0) |
| | | .orderByDesc(Withdraw::getCreateTime) |
| | | .last("limit 1").one(); |
| | | WithdrawDetailVO withdrawDetailVO = new WithdrawDetailVO(); |
| | | withdrawDetailVO.setOrderId(order.getId()); |
| | | withdrawDetailVO.setOrderNumber(order.getOrderNumber()); |
| | | withdrawDetailVO.setUserId(order.getUserId()); |
| | | withdrawDetailVO.setServeId(order.getServeId()); |
| | | withdrawDetailVO.setServeName(order.getServeName()); |
| | | withdrawDetailVO.setServePrice(order.getServePrice()); |
| | | withdrawDetailVO.setOrderMoney(order.getOrderMoney()); |
| | | withdrawDetailVO.setReservationName(order.getReservationName()); |
| | | withdrawDetailVO.setReservationPhone(order.getReservationPhone()); |
| | | withdrawDetailVO.setReservationAddress(order.getReservationAddress()); |
| | | withdrawDetailVO.setTime(order.getTime()); |
| | | withdrawDetailVO.setAcceptTime(order.getAcceptTime()); |
| | | withdrawDetailVO.setServerId(order.getServerId()); |
| | | withdrawDetailVO.setServerName(order.getServerName()); |
| | | withdrawDetailVO.setServerPhone(order.getServerPhone()); |
| | | withdrawDetailVO.setReservationRemark(order.getReservationRemark()); |
| | | withdrawDetailVO.setState(order.getState()); |
| | | withdrawDetailVO.setArriveTime(order.getArriveTime()); |
| | | withdrawDetailVO.setCompleteTime(order.getCompleteTime()); |
| | | withdrawDetailVO.setSubsidy(order.getSubsidy()); |
| | | withdrawDetailVO.setIsWithdrawal(order.getIsWithdrawal()); |
| | | if (null != withdraw) { |
| | | withdrawDetailVO.setWithdrawalState(withdraw.getState()); |
| | | withdrawDetailVO.setWithdrawalTime(withdraw.getCreateTime()); |
| | | } |
| | | withdrawDetailVO.setAddress(order.getAddress()); |
| | | if (null != serveRecord) { |
| | | withdrawDetailVO.setPhoto(serveRecord.getPhoto()); |
| | | } |
| | | return R.ok(withdrawDetailVO); |
| | | } |
| | | |
| | | } |
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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 改派管理 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_change_dispatch") |
| | | @ApiModel(value = "ChangeDispatch对象", description = "改派管理") |
| | | public class ChangeDispatch extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("申请师傅") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("申请师傅姓名") |
| | | @TableField("worker_name") |
| | | private String workerName; |
| | | |
| | | @ApiModelProperty("申请原因") |
| | | @TableField("apply_reason") |
| | | private String applyReason; |
| | | |
| | | @ApiModelProperty("申请改派时间") |
| | | @TableField("apply_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date applyTime; |
| | | |
| | | @ApiModelProperty("改派状态 (0:未改派 ;1:已改派 ;2:拒绝)") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | @TableField("order_number") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("下单用户名称") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | |
| | | } |
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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_evaluate") |
| | | @ApiModel(value = "Evaluate对象", description = "用户评价表") |
| | | public class Evaluate extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @TableField("star_rating") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | |
| | | } |
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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | 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-05-29 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_order") |
| | | @ApiModel(value = "Order对象", description = "订单管理") |
| | | public class Order extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("下单城市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | @TableField("order_number") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("站点id") |
| | | @TableField("site_id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty("站点名称") |
| | | @TableField("site_name") |
| | | private String siteName; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | @TableField("serve_id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | @TableField("serve_name") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("回收服务回收价") |
| | | @TableField("serve_price") |
| | | private BigDecimal servePrice; |
| | | |
| | | @ApiModelProperty("订单成交价(服务回收价 + 津贴)") |
| | | @TableField("order_money") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | @TableField("reservation_name") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | @TableField("reservation_phone") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | @TableField("reservation_address") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("上门时间段") |
| | | @TableField("time") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | @TableField("accept_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("服务人员id") |
| | | @TableField("server_id") |
| | | private Integer serverId; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | @TableField("server_name") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | @TableField("server_phone") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("预约备注") |
| | | @TableField("reservation_remark") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派,6:待改派)") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @TableField("arrive_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("下单用户经度") |
| | | @TableField("longitude") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("下单用户纬度") |
| | | @TableField("latitude") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @TableField("complete_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
| | | @TableField("subsidy") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | @TableField("is_withdrawal") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("订单取消原因") |
| | | @TableField("cancel_reason") |
| | | private String cancelReason; |
| | | |
| | | @ApiModelProperty("置顶顺序") |
| | | @TableField("top_sort") |
| | | private Integer topSort; |
| | | |
| | | @ApiModelProperty("是否评价(0:未评价,1:已评价)") |
| | | @TableField("is_evaluate") |
| | | private Integer isEvaluate; |
| | | |
| | | @ApiModelProperty("回收服务封面图") |
| | | @TableField(exist = false) |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("再投原因") |
| | | @TableField(exist = false) |
| | | private String applyReason; |
| | | |
| | | @ApiModelProperty("是否为再投单") |
| | | @TableField("is_reinvest") |
| | | private Integer isReinvest; |
| | | |
| | | } |
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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅路线经纬度信息 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_serve_coordinate") |
| | | @ApiModel(value = "ServeCoordinate对象", description = "师傅路线经纬度信息") |
| | | public class ServeCoordinate extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("路线经纬度") |
| | | @TableField("coordinate") |
| | | private String coordinate; |
| | | |
| | | @ApiModelProperty("经度") |
| | | @TableField("longitude") |
| | | private BigDecimal longitude; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | @TableField("latitude") |
| | | private BigDecimal latitude; |
| | | |
| | | } |
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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅服务记录 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_serve_record") |
| | | @ApiModel(value = "ServeRecord对象", description = "师傅服务记录") |
| | | public class ServeRecord extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("现场照片(多张照片 ','隔开)") |
| | | @TableField("photo") |
| | | private String photo; |
| | | |
| | | @ApiModelProperty("服务备注") |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | } |
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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | 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-09 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("t_withdraw") |
| | | @ApiModel(value = "Withdraw对象", description = "用户提现申请记录表") |
| | | public class Withdraw extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户编号") |
| | | @TableField("user_no") |
| | | private String userNo; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | @TableField("nick_name") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | @TableField("apply_for_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | | @TableField("apply_for_money") |
| | | private BigDecimal applyForMoney; |
| | | |
| | | @ApiModelProperty("申请状态 0待审核;1已通过;2已驳回") |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("审批意见") |
| | | @TableField("opinion") |
| | | private String opinion; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | |
| | | } |
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-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_withdrawal_setting") |
| | | @ApiModel(value = "WithdrawalSetting对象", description = "审核管理全局设置") |
| | | public class WithdrawalSetting { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("是否开启审核(0:未开启,1:已开启)") |
| | | @TableField("enable_process") |
| | | private Integer enableProcess; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 改派管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Mapper |
| | | public interface ChangeDispatchMapper extends BaseMapper<ChangeDispatch> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | 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.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Mapper |
| | | public interface EvaluateMapper extends BaseMapper<Evaluate> { |
| | | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param userName 评价用户 |
| | | * @param orderNumber 订单编号 |
| | | * @param workerName 师傅姓名 |
| | | * @param page 分页 |
| | | * @return 分页 |
| | | */ |
| | | Page<EvaluatePageVO> queryPageList(@Param("userName") String userName, @Param("orderNumber") String orderNumber, |
| | | @Param("workerName") String workerName, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 用户所关联评价记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<EvaluatePageVO> evaluateList(@Param("userId") Integer userId, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 订单与评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param state 状态 |
| | | * @param page 分页 |
| | | * @return 列表数据 |
| | | */ |
| | | Page<OrderEvaluateVO> evaluateListByUser(@Param("userId") Integer userId, |
| | | @Param("state") Integer state, Page<OrderEvaluateVO> page); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.vo.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单管理 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | /** |
| | | * 查询本年订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByYear(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询本月订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByMonth(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询本周订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByWeek(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询当天订单数量 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param orderState 订单状态 |
| | | * @param startTime 开始日期 |
| | | * @param endTime 结束日期 |
| | | * @return 本年订单数量 |
| | | */ |
| | | List<OrderQueryVO> orderCountByToday(@Param("cityList") List<String> cityList, @Param("orderState") Integer orderState, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 查询整个季度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param startDateStr 季度开始时间 |
| | | * @param endDateStr 季度结束时间 |
| | | * @param cityList 城市集合 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByQuarter(@Param("start") String startDateStr, @Param("end") String endDateStr, |
| | | @Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 查询整个年度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByYear(@Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 查询整个月度的交易额(订单状态为:已完工) |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 总交易额 |
| | | */ |
| | | BigDecimal totalMoneyByMonth(@Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 订单管理-订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param page 分页 |
| | | * @return 分页统计 |
| | | */ |
| | | Page<OrderCountVO> orderCount(@Param("name") String name, @Param("phone") String phone, Page<OrderCountVO> page); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | * @param page 分页 |
| | | * @return 分页 |
| | | */ |
| | | Page<Order> queryPage(@Param("data") OrderQueryRequest orderQueryRequest, Page<Order> page); |
| | | |
| | | /** |
| | | * 订单管理分页模块,订单数量统计 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @return 统计数量 |
| | | */ |
| | | List<Order> orderPageCount(@Param("data") OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 根据所选id查询 |
| | | * |
| | | * @param ids id集合 |
| | | * @return 返回列表 |
| | | */ |
| | | List<Order> exportByIdList(List<String> ids); |
| | | |
| | | /** |
| | | * 根据筛选条件查询 |
| | | * |
| | | * @param orderQueryRequest 筛选条件 |
| | | * @return 返回列表 |
| | | */ |
| | | List<Order> exportList(@Param("data") OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 根据类型获取交易额 |
| | | * |
| | | * @param userId 用户端 |
| | | * @param state 订单状态 |
| | | * @param page 分页 |
| | | * @return 交易额 |
| | | */ |
| | | Page<Order> orderListWorker(@Param("userId") Integer userId, @Param("state") Integer state, Page<Order> page); |
| | | |
| | | /** |
| | | * 师傅端-根据师傅id获取订单数量 |
| | | * |
| | | * @param workerIds 师傅id集合 |
| | | * @return 接单列表 |
| | | */ |
| | | List<WorkerOrderRankVO> workerOrderRank(@Param("ids") List<Integer> workerIds); |
| | | |
| | | /** |
| | | * 统计订单状态数量 |
| | | * |
| | | * @param workerId 师傅id |
| | | * @return 统计结果 |
| | | */ |
| | | WorkerOrderCountVO orderStateCount(@Param("workerId") Integer workerId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.ServeCoordinate; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅路线经纬度信息 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Mapper |
| | | public interface ServeCoordinateMapper extends BaseMapper<ServeCoordinate> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.ServeRecord; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅服务记录 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Mapper |
| | | public interface ServeRecordMapper extends BaseMapper<ServeRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | @Mapper |
| | | public interface WithdrawMapper extends BaseMapper<Withdraw> { |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param nickname 用户名称 |
| | | * @param userPhone 用户手机号 |
| | | * @param applyForTime 申请时间 |
| | | * @param state 审核状态 |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawPage(@Param("name") String nickname, @Param("phone") String userPhone, |
| | | @Param("time") String applyForTime, |
| | | @Param("state") Integer state, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 根据所选id导出 |
| | | * |
| | | * @param ids 提现记录ids |
| | | * @return 列表 |
| | | */ |
| | | List<UserWithdrawRecordVO> exportByIdList(@Param("ids") List<String> ids); |
| | | |
| | | /** |
| | | * 提现记录列表 |
| | | * |
| | | * @param nickname 用户名称 |
| | | * @param userPhone 用户手机号 |
| | | * @param applyForTime 申请时间 |
| | | * @param state 审核状态 |
| | | * @return 分页列表 |
| | | */ |
| | | List<UserWithdrawRecordVO> exportList(@Param("name") String nickname, @Param("phone") String userPhone, |
| | | @Param("time") String applyForTime, |
| | | @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 获取用户提现金额 |
| | | * |
| | | * @param cityList 城市集合 |
| | | * @param startDateStr 季度开始时间 |
| | | * @param endDateStr 季度结束时间 |
| | | * @return 总金额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoney(@Param("cityList") List<String> cityList, @Param("start") String startDateStr, @Param("end") String endDateStr); |
| | | |
| | | /** |
| | | * 年度查询 |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 年度提现总额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoneyByYear(@Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 月度查询 |
| | | * |
| | | * @param cityList 城市列表 |
| | | * @return 年度提现总额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoneyByMonth(@Param("cityList") List<String> cityList); |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param page 分页参数 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawList(@Param("userId") Integer userId, Page<UserWithdrawRecordVO> page); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 审核管理全局设置 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Mapper |
| | | public interface WithdrawalSettingMapper extends BaseMapper<WithdrawalSetting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 11:14 |
| | | */ |
| | | @Data |
| | | public class OrderEvaluateSubmitRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @NotNull(message = "请选择评价订单!") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @NotNull(message = "请选择评价星级!") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | private String serveNo; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | | |
| | | public OrderEvaluateSubmitRequest() { |
| | | } |
| | | |
| | | public OrderEvaluateSubmitRequest(String orderId, String content, Double starRating, String serveNo, Integer userId) { |
| | | this.orderId = orderId; |
| | | this.content = content; |
| | | this.starRating = starRating; |
| | | this.serveNo = serveNo; |
| | | this.userId = userId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-08 15:27 |
| | | */ |
| | | @Data |
| | | public class OrderRequest { |
| | | |
| | | @ApiModelProperty("下单城市") |
| | | private String city; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("站点id") |
| | | private Integer siteId; |
| | | |
| | | @ApiModelProperty("站点名称") |
| | | private String siteName; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("回收服务回收价") |
| | | private BigDecimal servePrice; |
| | | |
| | | @ApiModelProperty("订单成交价(服务回收价 + 津贴)") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("上门时间段") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("服务人员id") |
| | | private Integer serverId; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("预约备注") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("下单用户经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("下单用户纬度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("订单取消原因") |
| | | private String cancelReason; |
| | | |
| | | @ApiModelProperty("再投原因") |
| | | private String applyReason; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-06 14:25 |
| | | */ |
| | | @Data |
| | | public class OrderSubmitRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("现场照片") |
| | | private List<String> photo; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 用户下单请求参数对象 |
| | | * |
| | | * @author hjl |
| | | * @since 2024-06-17 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderRequest对象", description = "用户下单请求参数对象") |
| | | public class UserOrderRequest { |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址(收货地址id)") |
| | | private Integer addressId; |
| | | |
| | | @ApiModelProperty("上门时间") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("预约备注(服务备注)") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("下单用户经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("下单用户纬度") |
| | | private Double latitude; |
| | | |
| | | @ApiModelProperty("订单津贴金额") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("回收服务价格") |
| | | private BigDecimal defaultPrice; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("预约下单地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String addressDetail; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | private Integer userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.request; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-28 11:31 |
| | | */ |
| | | @Data |
| | | public class WithdrawExportRequest { |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | private String applyForTime; |
| | | |
| | | @ApiModelProperty("提现状态") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("所选数据id") |
| | | private List<String> idList; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 改派管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | public interface ChangeDispatchService extends IService<ChangeDispatch> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | 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.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | public interface EvaluateService extends IService<Evaluate> { |
| | | |
| | | /** |
| | | * 订单评价分页列表 |
| | | * |
| | | * @param userName 评价用户 |
| | | * @param orderNumber 订单编号 |
| | | * @param workerName 师傅姓名 |
| | | * @param page 分页 |
| | | * @return 分页 |
| | | */ |
| | | Page<EvaluatePageVO> queryPageList(String userName, String orderNumber, String workerName, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 用户所关联评价记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<EvaluatePageVO> evaluateList(Integer userId, Page<EvaluatePageVO> page); |
| | | |
| | | /** |
| | | * 订单评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param state 状态 |
| | | * @param page 分页 |
| | | * @return 评价信息 |
| | | */ |
| | | Page<OrderEvaluateVO> evaluateListByUser(Integer userId, Integer state, Page<OrderEvaluateVO> page); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.request.UserOrderRequest; |
| | | import com.ruoyi.order.vo.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | public interface OrderService extends IService<Order> { |
| | | |
| | | /** |
| | | * 回收订单统计 |
| | | * |
| | | * @param orderCount 查询所需参数 |
| | | * @return 柱状图数据 |
| | | */ |
| | | OrderResultVO orderCountHome(OrderCountRequest orderCount); |
| | | |
| | | /** |
| | | * excel模板导出 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @return 导出结果 |
| | | */ |
| | | List<Order> excelExport(OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 订单列表 |
| | | * |
| | | * @param orderQueryRequest 订单列表查询参数 |
| | | * @return 分页 |
| | | */ |
| | | Page<Order> queryPage(OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 订单管理-订单统计 |
| | | * |
| | | * @param name 师傅姓名 |
| | | * @param phone 师傅电话 |
| | | * @param page 分页 |
| | | * @return 分页统计 |
| | | */ |
| | | Page<OrderCountVO> orderCount(String name, String phone, Page<OrderCountVO> page); |
| | | |
| | | /** |
| | | * 订单管理分页模块,订单数量统计 |
| | | * |
| | | * @param orderQueryRequest 筛选参数 |
| | | * @return 统计数量 |
| | | */ |
| | | OrderPageCountVO orderPageCount(OrderQueryRequest orderQueryRequest); |
| | | |
| | | /** |
| | | * 根据类型获取交易额 |
| | | * |
| | | * @param moneyQueryRequest 筛选参数 |
| | | * @return 交易额 |
| | | */ |
| | | BigDecimal tradeMoney(MoneyQueryRequest moneyQueryRequest); |
| | | |
| | | /** |
| | | * 根据类型获取交易额 |
| | | * |
| | | * @param userId 用户端 |
| | | * @param state 订单状态 |
| | | * @param pageNum 页码 |
| | | * @param pageSize 条数 |
| | | * @return 交易额 |
| | | */ |
| | | Page<Order> orderListWorker(Integer userId, Integer state, Integer pageNum, Integer pageSize); |
| | | |
| | | /** |
| | | * 师傅端-根据师傅id获取订单数量 |
| | | * |
| | | * @param workerIds 师傅id集合 |
| | | * @return 接单列表 |
| | | */ |
| | | List<WorkerOrderRankVO> workerOrderRank(List<Integer> workerIds); |
| | | |
| | | /** |
| | | * 到订单去,路线规划 |
| | | * |
| | | * @param userPosition 用户下单经纬度信息 |
| | | * @param workerPosition 师傅所在经纬度信息 |
| | | * @return 路线规划 |
| | | */ |
| | | Path orderNavigation(String userPosition, String workerPosition); |
| | | |
| | | /** |
| | | * 订单置顶 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param workerId 师傅id |
| | | * @return 操作结果 |
| | | */ |
| | | Boolean orderTop(String orderId, Integer workerId); |
| | | |
| | | /** |
| | | * 统计订单状态数量 |
| | | * |
| | | * @param workerId 师傅id |
| | | * @return 统计结果 |
| | | */ |
| | | WorkerOrderCountVO orderStateCount(Integer workerId); |
| | | |
| | | /** |
| | | * 用户端-用户下单 |
| | | * |
| | | * @param userOrderRequest 下单参数 |
| | | * @return 下单结果 |
| | | */ |
| | | Boolean placeOrder(UserOrderRequest userOrderRequest); |
| | | |
| | | /** |
| | | * 用户端-预订单信息 |
| | | * |
| | | * @param userOrderRequest 下单参数 |
| | | * @return 下单结果 |
| | | */ |
| | | String orderEstimate(UserOrderRequest userOrderRequest); |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.ServeCoordinate; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅路线经纬度信息 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | public interface ServeCoordinateService extends IService<ServeCoordinate> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.ServeRecord; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅服务记录 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | public interface ServeRecordService extends IService<ServeRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.request.WithdrawExportRequest; |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | public interface WithdrawService extends IService<Withdraw> { |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param nickname 用户名称 |
| | | * @param userPhone 用户手机号 |
| | | * @param applyForTime 申请开始时间 |
| | | * @param state 审核状态 |
| | | * @param page 分页 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, |
| | | Integer state, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 根据筛选条件查询数据 |
| | | * |
| | | * @param exportRequest 筛选参数 |
| | | * @return 查询列表 |
| | | */ |
| | | List<UserWithdrawRecordVO> excelExport(WithdrawExportRequest exportRequest); |
| | | |
| | | /** |
| | | * 提现审批通过,微信打款 |
| | | * |
| | | * @param openId 微信用户openId |
| | | * @param userId 用户id |
| | | * @param order 订单信息 |
| | | * @return 打款结果 |
| | | */ |
| | | Boolean confirmWithdraw(String openId, Integer userId, Order order); |
| | | |
| | | /** |
| | | * 根据类型统计提现金额 |
| | | * |
| | | * @param request 根据类型统计提现金额 |
| | | * @return 提现金额 |
| | | */ |
| | | BigDecimal withdrawalTotalMoney(MoneyQueryRequest request); |
| | | |
| | | /** |
| | | * 修改全局审核状态 |
| | | * |
| | | * @param enableProcess 状态 |
| | | * @return 修改结果 |
| | | */ |
| | | Boolean enableProcess(Integer enableProcess); |
| | | |
| | | /** |
| | | * 获取全局审核设置 |
| | | * |
| | | * @return 审核设置 |
| | | */ |
| | | WithdrawalSetting withdrawProcess(); |
| | | |
| | | /** |
| | | * 用户所关联提现记录分页列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @param page 分页参数 |
| | | * @return 分页列表 |
| | | */ |
| | | Page<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page); |
| | | |
| | | /** |
| | | * 用户端-提交提现申请 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param userId 用户id |
| | | * @param openId 微信用户openId |
| | | * @param userPhone 用户手机号 |
| | | * @return 提现结果 |
| | | */ |
| | | Boolean confirmWithdrawByUser(String orderId, Integer userId, String openId, String userPhone); |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service; |
| | | |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 审核管理全局设置 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | public interface WithdrawalSettingService extends IService<WithdrawalSetting> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.ruoyi.order.mapper.ChangeDispatchMapper; |
| | | import com.ruoyi.order.service.ChangeDispatchService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 改派管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Service |
| | | public class ChangeDispatchServiceImpl extends ServiceImpl<ChangeDispatchMapper, ChangeDispatch> implements ChangeDispatchService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.mapper.EvaluateMapper; |
| | | import com.ruoyi.order.service.EvaluateService; |
| | | import com.ruoyi.order.vo.EvaluatePageVO; |
| | | import com.ruoyi.order.vo.OrderEvaluateVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户评价表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Service |
| | | 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); |
| | | } |
| | | |
| | | @Override |
| | | public Page<EvaluatePageVO> evaluateList(Integer userId, Page<EvaluatePageVO> page) { |
| | | return baseMapper.evaluateList(userId, page); |
| | | } |
| | | |
| | | @Override |
| | | public Page<OrderEvaluateVO> evaluateListByUser(Integer userId, Integer state, Page<OrderEvaluateVO> page) { |
| | | return baseMapper.evaluateListByUser(userId, state, page); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.OrderConstants; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.core.vo.Path; |
| | | import com.ruoyi.order.entity.ChangeDispatch; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.request.UserOrderRequest; |
| | | import com.ruoyi.order.service.ChangeDispatchService; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.vo.*; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.Month; |
| | | import java.time.Year; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-05-29 |
| | | */ |
| | | |
| | | @Service |
| | | public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { |
| | | |
| | | @Resource |
| | | private ChangeDispatchService changeDispatchService; |
| | | |
| | | @Override |
| | | public OrderResultVO orderCountHome(OrderCountRequest orderCount) { |
| | | List<String> cityList = orderCount.getCityList(); |
| | | Integer orderState = orderCount.getOrderState(); |
| | | String countType = orderCount.getCountType(); |
| | | String startTime = orderCount.getStartTime(); |
| | | String endTime = orderCount.getEndTime(); |
| | | List<OrderQueryVO> list; |
| | | // 根据查询类型查询订单信息 |
| | | if (OrderConstants.YEAR.equals(countType)) { |
| | | list = baseMapper.orderCountByYear(cityList, orderState, startTime, endTime); |
| | | } else if (OrderConstants.MONTH.equals(countType)) { |
| | | list = baseMapper.orderCountByMonth(cityList, orderState, startTime, endTime); |
| | | } else if (OrderConstants.WEEK.equals(countType)) { |
| | | list = baseMapper.orderCountByWeek(cityList, orderState, startTime, endTime); |
| | | } else if (OrderConstants.TODAY.equals(countType)) { |
| | | list = baseMapper.orderCountByToday(cityList, orderState, startTime, endTime); |
| | | } else { |
| | | list = new ArrayList<>(); |
| | | } |
| | | // 计算订单总额及总订单数量 |
| | | BigDecimal totalMoney; |
| | | int orderNumber; |
| | | if (list.isEmpty()) { |
| | | totalMoney = BigDecimal.ZERO; |
| | | orderNumber = 0; |
| | | } else { |
| | | totalMoney = list.stream().map(OrderQueryVO::getTotalPrice) |
| | | .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | orderNumber = list.stream().filter(order -> order.getNumber() != null) |
| | | .mapToInt(OrderQueryVO::getNumber).sum(); |
| | | } |
| | | return new OrderResultVO(totalMoney, orderNumber, list); |
| | | } |
| | | |
| | | @Override |
| | | public List<Order> excelExport(OrderQueryRequest orderQueryRequest) { |
| | | List<String> ids = orderQueryRequest.getIds(); |
| | | List<Order> list; |
| | | if (null != ids && !ids.isEmpty()) { |
| | | list = baseMapper.exportByIdList(ids); |
| | | } else { |
| | | list = baseMapper.exportList(orderQueryRequest); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Page<Order> queryPage(OrderQueryRequest orderQueryRequest) { |
| | | Page<Order> page = Page.of(orderQueryRequest.getPageNum(), orderQueryRequest.getPageSize()); |
| | | // 基础查询 |
| | | Page<Order> pageList = baseMapper.queryPage(orderQueryRequest, page); |
| | | for (Order order : pageList.getRecords()) { |
| | | ChangeDispatch changeDispatch = changeDispatchService.lambdaQuery() |
| | | .eq(ChangeDispatch::getOrderId, order.getId()) |
| | | .eq(ChangeDispatch::getIsDelete, 0) |
| | | .orderByDesc(ChangeDispatch::getCreateTime) |
| | | .last("limit 1").one(); |
| | | if (null != changeDispatch) { |
| | | order.setApplyReason(changeDispatch.getApplyReason()); |
| | | } |
| | | } |
| | | return pageList; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Page<OrderCountVO> orderCount(String name, String phone, Page<OrderCountVO> page) { |
| | | return baseMapper.orderCount(name, phone, page); |
| | | } |
| | | |
| | | @Override |
| | | public OrderPageCountVO orderPageCount(OrderQueryRequest orderQueryRequest) { |
| | | List<Order> orderList = baseMapper.orderPageCount(orderQueryRequest); |
| | | int total = 0; |
| | | int toBeDispatched = 0; |
| | | int stayDoorstep = 0; |
| | | int toBeCompleted = 0; |
| | | int completed = 0; |
| | | int canceled = 0; |
| | | int reInvestment = 0; |
| | | for (Order order : orderList) { |
| | | total++; |
| | | Integer state = order.getState(); |
| | | if (Constants.ZERO.equals(state)) { |
| | | toBeDispatched++; |
| | | } else if (Constants.ONE.equals(state)) { |
| | | stayDoorstep++; |
| | | } else if (Constants.TWO.equals(state)) { |
| | | toBeCompleted++; |
| | | } else if (Constants.THREE.equals(state)) { |
| | | completed++; |
| | | } else if (Constants.FOUR.equals(state)) { |
| | | canceled++; |
| | | } |
| | | if (order.getIsReinvest() != null && order.getIsReinvest() == 1) { |
| | | reInvestment++; |
| | | } |
| | | } |
| | | return new OrderPageCountVO(total, toBeDispatched, stayDoorstep, |
| | | toBeCompleted, completed, canceled, reInvestment); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal tradeMoney(MoneyQueryRequest moneyQueryRequest) { |
| | | List<String> cityList = moneyQueryRequest.getCityList(); |
| | | String type = moneyQueryRequest.getType(); |
| | | // 计算当前季度时间所包含时间 |
| | | int currentYear = Year.now().getValue(); |
| | | // 获取当前月份 |
| | | Month currentMonth = LocalDate.now().getMonth(); |
| | | // 计算当前季度的开始时间和结束时间 |
| | | LocalDate startDate = LocalDate.of(currentYear, getStartMonthOfQuarter(currentMonth), 1); |
| | | LocalDate endDate = startDate.plusMonths(2).with(TemporalAdjusters.lastDayOfMonth()); |
| | | String startDateStr = String.valueOf(startDate); |
| | | String endDateStr = String.valueOf(endDate); |
| | | BigDecimal totalMoney; |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户总交易额 |
| | | totalMoney = baseMapper.totalMoneyByQuarter(startDateStr, endDateStr, cityList); |
| | | } else if (OrderConstants.YEAR.equals(type)) { |
| | | // 用户总交易额 |
| | | totalMoney = baseMapper.totalMoneyByYear(cityList); |
| | | } else if (OrderConstants.MONTH.equals(type)) { |
| | | // 用户总交易额 |
| | | totalMoney = baseMapper.totalMoneyByMonth(cityList); |
| | | } else { |
| | | // 数量初始化 |
| | | totalMoney = BigDecimal.ZERO; |
| | | } |
| | | return totalMoney; |
| | | } |
| | | |
| | | @Override |
| | | public Page<Order> orderListWorker(Integer userId, Integer state, Integer pageNum, Integer pageSize) { |
| | | return baseMapper.orderListWorker(userId, state, Page.of(pageNum, pageSize)); |
| | | } |
| | | |
| | | @Override |
| | | public List<WorkerOrderRankVO> workerOrderRank(List<Integer> workerIds) { |
| | | List<WorkerOrderRankVO> list = baseMapper.workerOrderRank(workerIds); |
| | | if (list.size() > Constants.TEN) { |
| | | list.subList(Constants.ZERO, Constants.TEN); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Path orderNavigation(String userPosition, String workerPosition) { |
| | | return GaoDeMapUtil.routing(workerPosition, userPosition); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean orderTop(String orderId, Integer workerId) { |
| | | // 订单代办列表 |
| | | List<Order> orderList = this.lambdaQuery().eq(Order::getServerId, workerId) |
| | | .in(Order::getState, Constants.ONE, Constants.TWO) |
| | | .eq(Order::getIsDelete, 0) |
| | | .orderByAsc(Order::getTopSort).list(); |
| | | int itemSort = 2; |
| | | for (Order order : orderList) { |
| | | if (null != order.getTopSort()) { |
| | | order.setTopSort(itemSort); |
| | | itemSort++; |
| | | } |
| | | } |
| | | this.updateBatchById(orderList); |
| | | return this.lambdaUpdate().set(Order::getTopSort, Constants.ONE) |
| | | .eq(Order::getServerId, workerId) |
| | | .eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).update(); |
| | | } |
| | | |
| | | @Override |
| | | public WorkerOrderCountVO orderStateCount(Integer workerId) { |
| | | return baseMapper.orderStateCount(workerId); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean placeOrder(UserOrderRequest userOrderRequest) { |
| | | // 下单参数 |
| | | String orderNumber = userOrderRequest.getOrderNumber(); |
| | | Integer serveId = userOrderRequest.getServeId(); |
| | | String reservationName = userOrderRequest.getReservationName(); |
| | | String reservationPhone = userOrderRequest.getReservationPhone(); |
| | | Integer userId = userOrderRequest.getUserId(); |
| | | String time = userOrderRequest.getTime(); |
| | | String reservationRemark = userOrderRequest.getReservationRemark(); |
| | | Double longitude = userOrderRequest.getLongitude(); |
| | | Double latitude = userOrderRequest.getLatitude(); |
| | | BigDecimal subsidy = userOrderRequest.getSubsidy(); |
| | | BigDecimal defaultPrice = userOrderRequest.getDefaultPrice(); |
| | | String serveName = userOrderRequest.getServeName(); |
| | | String address = userOrderRequest.getAddress(); |
| | | String addressDetail = userOrderRequest.getAddressDetail(); |
| | | // 订单信息 |
| | | Order order = new Order(); |
| | | order.setOrderNumber(orderNumber); |
| | | order.setServeId(serveId); |
| | | order.setServeName(serveName); |
| | | order.setServePrice(defaultPrice); |
| | | order.setUserId(userId); |
| | | order.setReservationName(reservationName); |
| | | order.setReservationPhone(reservationPhone); |
| | | order.setReservationAddress(address); |
| | | order.setTime(time); |
| | | order.setReservationRemark(reservationRemark); |
| | | order.setOrderMoney(defaultPrice.add(new BigDecimal(String.valueOf(subsidy)))); |
| | | order.setState(Constants.ZERO); |
| | | order.setType(Constants.ZERO); |
| | | order.setLongitude(longitude); |
| | | order.setLatitude(latitude); |
| | | order.setIsWithdrawal(Constants.ZERO); |
| | | order.setSubsidy(subsidy); |
| | | order.setAddress(addressDetail); |
| | | return this.save(order); |
| | | } |
| | | |
| | | @Override |
| | | public String orderEstimate(UserOrderRequest userOrderRequest) { |
| | | // 下单参数 |
| | | String orderNumber = userOrderRequest.getOrderNumber(); |
| | | Integer serveId = userOrderRequest.getServeId(); |
| | | String reservationName = userOrderRequest.getReservationName(); |
| | | String reservationPhone = userOrderRequest.getReservationPhone(); |
| | | Integer userId = userOrderRequest.getUserId(); |
| | | String time = userOrderRequest.getTime(); |
| | | String reservationRemark = userOrderRequest.getReservationRemark(); |
| | | Double longitude = userOrderRequest.getLongitude(); |
| | | Double latitude = userOrderRequest.getLatitude(); |
| | | BigDecimal subsidy = userOrderRequest.getSubsidy(); |
| | | BigDecimal defaultPrice = userOrderRequest.getDefaultPrice(); |
| | | String serveName = userOrderRequest.getServeName(); |
| | | String address = userOrderRequest.getAddress(); |
| | | String addressDetail = userOrderRequest.getAddressDetail(); |
| | | // 订单信息 |
| | | Order order = new Order(); |
| | | order.setOrderNumber(orderNumber); |
| | | order.setServeId(serveId); |
| | | order.setServeName(serveName); |
| | | order.setServePrice(defaultPrice); |
| | | order.setUserId(userId); |
| | | order.setReservationName(reservationName); |
| | | order.setReservationPhone(reservationPhone); |
| | | if (null == userOrderRequest.getAddressId()) { |
| | | order.setReservationAddress(addressDetail); |
| | | } else { |
| | | order.setReservationAddress(address); |
| | | } |
| | | order.setTime(time); |
| | | order.setReservationRemark(reservationRemark); |
| | | if (null != subsidy) { |
| | | order.setOrderMoney(defaultPrice.add(new BigDecimal(String.valueOf(subsidy)))); |
| | | } else { |
| | | order.setOrderMoney(defaultPrice); |
| | | } |
| | | order.setState(Constants.ZERO); |
| | | order.setType(Constants.ZERO); |
| | | order.setLongitude(longitude); |
| | | order.setLatitude(latitude); |
| | | order.setIsWithdrawal(Constants.ZERO); |
| | | order.setSubsidy(subsidy); |
| | | order.setAddress(addressDetail); |
| | | this.save(order); |
| | | return String.valueOf(order.getId()); |
| | | } |
| | | |
| | | /** |
| | | * 根据当前月份获取当前季度的开始月份 |
| | | */ |
| | | private static Month getStartMonthOfQuarter(Month currentMonth) { |
| | | if (currentMonth.compareTo(Month.JANUARY) >= 0 && currentMonth.compareTo(Month.MARCH) <= 0) { |
| | | return Month.JANUARY; |
| | | } else if (currentMonth.compareTo(Month.APRIL) >= 0 && currentMonth.compareTo(Month.JUNE) <= 0) { |
| | | return Month.APRIL; |
| | | } else if (currentMonth.compareTo(Month.JULY) >= 0 && currentMonth.compareTo(Month.SEPTEMBER) <= 0) { |
| | | return Month.JULY; |
| | | } else { |
| | | return Month.OCTOBER; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.ServeCoordinate; |
| | | import com.ruoyi.order.mapper.ServeCoordinateMapper; |
| | | import com.ruoyi.order.service.ServeCoordinateService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅路线经纬度信息 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Service |
| | | public class ServeCoordinateServiceImpl extends ServiceImpl<ServeCoordinateMapper, ServeCoordinate> implements ServeCoordinateService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.ServeRecord; |
| | | import com.ruoyi.order.mapper.ServeRecordMapper; |
| | | import com.ruoyi.order.service.ServeRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅服务记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Service |
| | | public class ServeRecordServiceImpl extends ServiceImpl<ServeRecordMapper, ServeRecord> implements ServeRecordService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.OrderConstants; |
| | | import com.ruoyi.common.core.constant.WechatConstants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.Withdraw; |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.mapper.WithdrawMapper; |
| | | import com.ruoyi.order.request.WithdrawExportRequest; |
| | | import com.ruoyi.order.service.OrderService; |
| | | import com.ruoyi.order.service.WithdrawService; |
| | | import com.ruoyi.order.service.WithdrawalSettingService; |
| | | import com.ruoyi.order.vo.MoneyQueryRequest; |
| | | import com.ruoyi.order.vo.UserWithdrawRecordVO; |
| | | import com.ruoyi.order.vx.HttpUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.Month; |
| | | import java.time.Year; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户提现申请记录表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-09 |
| | | */ |
| | | @Service |
| | | public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> implements WithdrawService { |
| | | |
| | | @Resource |
| | | private WithdrawalSettingService withdrawalSettingService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | /** |
| | | * 雪花算法类 |
| | | */ |
| | | private static final SnowflakeIdWorker SNOW_FLAKE_ID_WORKER = new SnowflakeIdWorker(5, 5); |
| | | |
| | | /** |
| | | * 小程序id |
| | | */ |
| | | @Value("wx.appid") |
| | | private String appId; |
| | | /** |
| | | * 转账名称 |
| | | */ |
| | | @Value("wx.batchName") |
| | | private String batchName; |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | @Value("wx.mchId") |
| | | private String mchId; |
| | | /** |
| | | * 支付证书序列号 |
| | | */ |
| | | @Value("wx.wechatPayserialNo") |
| | | private String wechatPayserialNo; |
| | | /** |
| | | * 转账备注 |
| | | */ |
| | | @Value("wx.transferRemark") |
| | | private String transferRemark; |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawPage(String nickname, String userPhone, String applyForTime, Integer state, Page<UserWithdrawRecordVO> page) { |
| | | return baseMapper.withdrawPage(nickname, userPhone, applyForTime, state, page); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserWithdrawRecordVO> excelExport(WithdrawExportRequest exportRequest) { |
| | | String nickname = exportRequest.getNickname(); |
| | | String userPhone = exportRequest.getUserPhone(); |
| | | String applyForTime = exportRequest.getApplyForTime(); |
| | | Integer state = exportRequest.getState(); |
| | | List<String> ids = exportRequest.getIdList(); |
| | | // 结果封装 |
| | | List<UserWithdrawRecordVO> list; |
| | | if (null != ids && !ids.isEmpty()) { |
| | | list = baseMapper.exportByIdList(ids); |
| | | } else { |
| | | list = baseMapper.exportList(nickname, userPhone, applyForTime, state); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean confirmWithdraw(String openId, Integer userId, Order order) { |
| | | // 校验提现 |
| | | List<Withdraw> list = this.lambdaQuery().eq(Withdraw::getUserId, userId) |
| | | .eq(Withdraw::getOrderId, order.getId()).list(); |
| | | List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList()); |
| | | if (stateList.contains(Constants.ONE)) { |
| | | throw new GlobalException("当前订单提现申请已通过!"); |
| | | } |
| | | return weChatPay(order.getOrderMoney(), openId); |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal withdrawalTotalMoney(MoneyQueryRequest request) { |
| | | List<String> cityList = request.getCityList(); |
| | | String type = request.getType(); |
| | | // 计算当前季度时间所包含时间 |
| | | int currentYear = Year.now().getValue(); |
| | | // 获取当前月份 |
| | | Month currentMonth = LocalDate.now().getMonth(); |
| | | // 计算当前季度的开始时间和结束时间 |
| | | LocalDate startDate = LocalDate.of(currentYear, getStartMonthOfQuarter(currentMonth), 1); |
| | | LocalDate endDate = startDate.plusMonths(2).with(TemporalAdjusters.lastDayOfMonth()); |
| | | String startDateStr = String.valueOf(startDate); |
| | | String endDateStr = String.valueOf(endDate); |
| | | BigDecimal withdrawalTotalMoney; |
| | | if (OrderConstants.QUARTER.equals(type)) { |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoney(cityList, startDateStr, endDateStr); |
| | | } else if (OrderConstants.YEAR.equals(type)) { |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoneyByYear(cityList); |
| | | } else if (OrderConstants.MONTH.equals(type)) { |
| | | // 用户提现总额 |
| | | withdrawalTotalMoney = baseMapper.withdrawalTotalMoneyByMonth(cityList); |
| | | } else { |
| | | // 数量初始化 |
| | | withdrawalTotalMoney = BigDecimal.ZERO; |
| | | } |
| | | return withdrawalTotalMoney; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean enableProcess(Integer enableProcess) { |
| | | Integer[] state = {0, 1}; |
| | | boolean contains = Arrays.stream(state).collect(Collectors.toList()).contains(enableProcess); |
| | | if (!contains) { |
| | | throw new GlobalException("系统设置关闭/开启审核状态异常!"); |
| | | } |
| | | return withdrawalSettingService.lambdaUpdate().set(WithdrawalSetting::getEnableProcess, enableProcess) |
| | | .update(); |
| | | } |
| | | |
| | | @Override |
| | | public WithdrawalSetting withdrawProcess() { |
| | | return withdrawalSettingService.lambdaQuery().one(); |
| | | } |
| | | |
| | | @Override |
| | | public Page<UserWithdrawRecordVO> withdrawList(Integer userId, Page<UserWithdrawRecordVO> page) { |
| | | return baseMapper.withdrawList(userId, page); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean confirmWithdrawByUser(String orderId, Integer userId, String openId, String userPhone) { |
| | | Order order = orderService.lambdaQuery() |
| | | .eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | } |
| | | // 校验提现 |
| | | List<Withdraw> list = this.lambdaQuery().eq(Withdraw::getUserId, userId) |
| | | .eq(Withdraw::getOrderId, orderId).list(); |
| | | List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList()); |
| | | if (stateList.contains(Constants.ZERO)) { |
| | | throw new GlobalException("当前订单已提交提现申请,请等待审核!"); |
| | | } else if (stateList.contains(Constants.ONE)) { |
| | | throw new GlobalException("当前订单已完成提现,请勿重复提现!"); |
| | | } |
| | | // 系统审核设置 |
| | | WithdrawalSetting withdrawalSetting = withdrawalSettingService.lambdaQuery().one(); |
| | | Withdraw withdraw = new Withdraw(); |
| | | // 未开启全局 提现审核,则用户提现不需要后台审核 |
| | | if (Constants.ZERO.equals(withdrawalSetting.getEnableProcess())) { |
| | | // 已通过 |
| | | withdraw.setState(Constants.ONE); |
| | | // 商家微信打款至微信零钱 |
| | | boolean update = weChatPay(order.getOrderMoney(), openId); |
| | | if (!update) { |
| | | throw new GlobalException("交易提现失败,请检查是否绑定微信!"); |
| | | } |
| | | } else { |
| | | // 待审核 |
| | | withdraw.setState(Constants.ZERO); |
| | | } |
| | | withdraw.setUserId(userId); |
| | | withdraw.setUserPhone(userPhone); |
| | | withdraw.setApplyForTime(new Date()); |
| | | withdraw.setApplyForMoney(order.getOrderMoney()); |
| | | withdraw.setOrderId(orderId); |
| | | return this.save(withdraw); |
| | | } |
| | | |
| | | private boolean weChatPay(BigDecimal orderMoney, String openId) { |
| | | if (StringUtils.isBlank(openId)) { |
| | | return false; |
| | | } |
| | | Map<String, Object> postMap = new HashMap<>(8); |
| | | // 小程序 id |
| | | postMap.put(WechatConstants.APP_ID, appId); |
| | | postMap.put(WechatConstants.OUT_BATCH_NO, String.valueOf(UUID.randomUUID()).replaceAll("-", "")); |
| | | // 该笔批量转账的名称 |
| | | postMap.put(WechatConstants.BATCH_NAME, batchName); |
| | | // 转账说明,UTF8编码,最多允许32个字符 |
| | | postMap.put(WechatConstants.BATCH_REMARK, batchName); |
| | | // 转账金额单位为“分”。 总金额 |
| | | postMap.put(WechatConstants.TOTAL_AMOUNT, orderMoney.multiply(new BigDecimal(Constants.ONE_HUNDRED))); |
| | | // 转账总笔数 |
| | | postMap.put(WechatConstants.TOTAL_NUM, Constants.ONE); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> subMap = new HashMap<>(4); |
| | | // 商家明细单号 该商家下唯一 |
| | | // subMap.put("out_detail_no", RandomUtil.randomString(32)) |
| | | subMap.put(WechatConstants.OUT_DETAIL_NO, SNOW_FLAKE_ID_WORKER.nextId()); |
| | | // 转账金额 |
| | | subMap.put(WechatConstants.TRANSFER_AMOUNT, orderMoney); |
| | | // 转账备注 |
| | | subMap.put(WechatConstants.TRANSFER_REMARK, transferRemark); |
| | | // 用户在直连商户应用下的用户标示 |
| | | subMap.put(WechatConstants.OPEN_ID, openId); |
| | | // 大金额需要传入真实姓名 |
| | | /*subMap.put("user_name", |
| | | RsaCryptoUtil.encryptOAEP(userName,WechatPayV3Util.getSaveCertificates(privatekeypath)))*/ |
| | | list.add(subMap); |
| | | postMap.put(WechatConstants.TRANSFER_DETAIL_LIST, list); |
| | | // 使用类加载器获取资源 URL |
| | | ClassPathResource classPathResource = new ClassPathResource("vx/apiclient_key.pem"); |
| | | /*// 获取 resources 目录下的文件路径,假设文件路径为 "resources/data/example.txt" |
| | | String filePath = "resources/data/vx/apiclient_key.pem"; |
| | | File file = new File(filePath); |
| | | // 输出文件的绝对路径 |
| | | String absolutePath = file.getAbsolutePath();*/ |
| | | String result = HttpUtil.postTransBatRequest( |
| | | WechatConstants.WE_CHAT_URL_PRE, |
| | | JSONObject.toJSONString(postMap), |
| | | // 支付证书序列号 |
| | | wechatPayserialNo, |
| | | // 商户号 |
| | | mchId, |
| | | classPathResource.getPath(), WechatConstants.WE_CHAT_URL_SUF); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | /* |
| | | * 成功示例 |
| | | * { |
| | | * "out_batch_no": "plfk2020042013", |
| | | * "batch_id": "1030000071100999991182020050700019480001", |
| | | * "create_time": "2015-05-20T13:29:35.120+08:00" |
| | | * } |
| | | */ |
| | | if (null == jsonObject || null != jsonObject.get(WechatConstants.CREATE_TIME)) { |
| | | //转账成功 |
| | | return Boolean.TRUE; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据当前月份获取当前季度的开始月份 |
| | | */ |
| | | private static Month getStartMonthOfQuarter(Month currentMonth) { |
| | | if (currentMonth.compareTo(Month.JANUARY) >= 0 && currentMonth.compareTo(Month.MARCH) <= 0) { |
| | | return Month.JANUARY; |
| | | } else if (currentMonth.compareTo(Month.APRIL) >= 0 && currentMonth.compareTo(Month.JUNE) <= 0) { |
| | | return Month.APRIL; |
| | | } else if (currentMonth.compareTo(Month.JULY) >= 0 && currentMonth.compareTo(Month.SEPTEMBER) <= 0) { |
| | | return Month.JULY; |
| | | } else { |
| | | return Month.OCTOBER; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.order.entity.WithdrawalSetting; |
| | | import com.ruoyi.order.mapper.WithdrawalSettingMapper; |
| | | import com.ruoyi.order.service.WithdrawalSettingService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 审核管理全局设置 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Service |
| | | public class WithdrawalSettingServiceImpl extends ServiceImpl<WithdrawalSettingMapper, WithdrawalSetting> implements WithdrawalSettingService { |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:59 |
| | | */ |
| | | @Data |
| | | public class EvaluateInfoVO { |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | private Integer starRating; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date evaluateTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:54 |
| | | */ |
| | | @Data |
| | | public class EvaluateOrderInfoVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("服务描述") |
| | | private String serveDescribe; |
| | | |
| | | @ApiModelProperty("封面图片") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-01 12:57 |
| | | */ |
| | | @Data |
| | | public class EvaluatePageVO { |
| | | |
| | | @TableId(value = "id", type = IdType.ASSIGN_ID) |
| | | private String id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | @TableField("user_id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价师傅id") |
| | | @TableField("worker_id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @TableField("star_rating") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | @TableField("serve_no") |
| | | private String serveNo; |
| | | |
| | | @TableField("createBy") |
| | | private String createBy; |
| | | |
| | | @TableField("updateBy") |
| | | private String updateBy; |
| | | |
| | | @TableField("createTime") |
| | | 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; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-08 18:45 |
| | | */ |
| | | @Data |
| | | public class MoneyQueryRequest { |
| | | |
| | | private List<String> cityList; |
| | | |
| | | private String type; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 16:50 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderByEvaluate对象", description = "订单评价信息") |
| | | public class OrderByEvaluateVO { |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | private BigDecimal starRating; |
| | | |
| | | @ApiModelProperty("评价时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date evaluateTime; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String evaluateContent; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 16:36 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderByServeRecord对象", description = "服务记录信息") |
| | | public class OrderByServeRecordVO { |
| | | |
| | | @ApiModelProperty("接单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date acceptOrderTime; |
| | | |
| | | @ApiModelProperty("上门时间") |
| | | private String reachTime; |
| | | |
| | | @ApiModelProperty("路线经纬度集合") |
| | | private List<String> coordinate; |
| | | |
| | | @ApiModelProperty("现场照片集合") |
| | | private List<String> photo; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 16:17 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderByServeVO", description = "服务信息") |
| | | public class OrderByServeVO { |
| | | |
| | | @ApiModelProperty("服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("一级分类") |
| | | private String supClassify; |
| | | |
| | | @ApiModelProperty("二级分类") |
| | | private String subClassify; |
| | | |
| | | @ApiModelProperty("回收价格") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty("封面图片") |
| | | private String cover; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 16:14 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderByUserInfoVO对象", description = "预约人信息") |
| | | public class OrderByUserInfoVO { |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | private String userNumber; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("预约上门时间") |
| | | private String time; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 16:19 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderByWorker对象", description = "师傅信息") |
| | | public class OrderByWorkerVO { |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | |
| | | @ApiModelProperty("师傅姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("师傅联系电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("师傅性别") |
| | | private String sex; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-30 15:42 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "orderCount对象", description = "回收订单统计返回类") |
| | | public class OrderCountRequest { |
| | | |
| | | @ApiModelProperty("所选城市id集合") |
| | | private List<String> cityList; |
| | | |
| | | @ApiModelProperty("查询订单状态(全部订单:该字段不传值;其他状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派))") |
| | | private Integer orderState; |
| | | |
| | | @ApiModelProperty("统计类型(全年:year;本月:month;本周:week;今日:today)") |
| | | @NotBlank(message = "请选择:统计类型!") |
| | | private String countType; |
| | | |
| | | @ApiModelProperty("开始日期(yyyy-MM-dd格式)") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty("结束日期(yyyy-MM-dd格式)") |
| | | private String endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 17:37 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderCountVO对象", description = "订单统计返回类") |
| | | public class OrderCountVO { |
| | | |
| | | @ApiModelProperty("师傅id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("真实姓名") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | |
| | | @ApiModelProperty("待完工数量") |
| | | private Integer toBeCompletedNumber; |
| | | |
| | | @ApiModelProperty("已完工数量") |
| | | private Integer completedNumber; |
| | | |
| | | @ApiModelProperty("再投单数量") |
| | | private Integer reInvestment; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.ruoyi.order.entity.Evaluate; |
| | | import com.ruoyi.order.entity.Order; |
| | | import com.ruoyi.order.entity.ServeRecord; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-06 14:16 |
| | | */ |
| | | @Data |
| | | public class OrderDetailVO { |
| | | |
| | | @ApiModelProperty("订单信息") |
| | | private Order orderInfo; |
| | | |
| | | @ApiModelProperty("服务信息") |
| | | private ServeRecord serveInfo; |
| | | |
| | | @ApiModelProperty("评价信息") |
| | | private Evaluate evaluateInfo; |
| | | |
| | | public OrderDetailVO() { |
| | | } |
| | | |
| | | public OrderDetailVO(Order orderInfo, ServeRecord serveInfo, Evaluate evaluateInfo) { |
| | | this.orderInfo = orderInfo; |
| | | this.serveInfo = serveInfo; |
| | | this.evaluateInfo = evaluateInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:53 |
| | | */ |
| | | @Data |
| | | public class OrderEvaluateVO { |
| | | |
| | | @ApiModelProperty("订单信息") |
| | | private EvaluateOrderInfoVO orderInfo; |
| | | |
| | | @ApiModelProperty("评价信息") |
| | | private EvaluateInfoVO evaluateInfo; |
| | | |
| | | @ApiModelProperty("是否还未评价") |
| | | private Boolean evaluate; |
| | | |
| | | public Boolean getEvaluate() { |
| | | return null != evaluateInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 16:11 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "订单信息", description = "订单信息返回") |
| | | public class OrderInfoVO { |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date placeOrderTime; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-28 16:13 |
| | | */ |
| | | @Data |
| | | public class OrderPageCountVO { |
| | | |
| | | @ApiModelProperty("全部订单") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty("待派单") |
| | | private Integer toBeDispatched; |
| | | |
| | | @ApiModelProperty("待上门") |
| | | private Integer stayDoorstep; |
| | | |
| | | @ApiModelProperty("待完成") |
| | | private Integer toBeCompleted; |
| | | |
| | | @ApiModelProperty("已完成") |
| | | private Integer completed; |
| | | |
| | | @ApiModelProperty("已取消") |
| | | private Integer canceled; |
| | | |
| | | @ApiModelProperty("再投订单") |
| | | private Integer reInvestment; |
| | | |
| | | public OrderPageCountVO(Integer total, Integer toBeDispatched, Integer stayDoorstep, Integer toBeCompleted, |
| | | Integer completed, Integer canceled, Integer reInvestment) { |
| | | this.total = total; |
| | | this.toBeDispatched = toBeDispatched; |
| | | this.stayDoorstep = stayDoorstep; |
| | | this.toBeCompleted = toBeCompleted; |
| | | this.completed = completed; |
| | | this.canceled = canceled; |
| | | this.reInvestment = reInvestment; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 11:27 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderQueryRequest对象", description = "订单列表 请求参数") |
| | | public class OrderQueryRequest { |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("所属城市") |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅名称") |
| | | private String workerName; |
| | | |
| | | @ApiModelProperty("师傅电话") |
| | | private String workerPhone; |
| | | |
| | | @ApiModelProperty("下单开始时间") |
| | | private String orderTimeStart; |
| | | |
| | | @ApiModelProperty("下单结束时间") |
| | | private String orderTimeEnd; |
| | | |
| | | @ApiModelProperty("预约上门开始时间") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty("预约上门结束时间") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty("站点名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty(value = "页码", required = true) |
| | | private Integer pageNum = 1; |
| | | |
| | | @ApiModelProperty(value = "每页显示条数", required = true) |
| | | private Integer pageSize = 10; |
| | | |
| | | @ApiModelProperty("导出ids集合") |
| | | private List<String> ids; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-30 16:30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderQuery对象", description = "回收订单统计查询类") |
| | | public class OrderQueryVO { |
| | | |
| | | @ApiModelProperty("对应总金额") |
| | | private BigDecimal totalPrice; |
| | | |
| | | @ApiModelProperty("时间日期") |
| | | private String dateTime; |
| | | |
| | | @ApiModelProperty("订单数量") |
| | | private Integer number; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-30 16:30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "OrderResultVO对象", description = "回收订单统计查询类") |
| | | public class OrderResultVO { |
| | | |
| | | @ApiModelProperty("订单总额") |
| | | private BigDecimal orderTotalMoney; |
| | | |
| | | @ApiModelProperty("订单总数量") |
| | | private Integer orderTotalNumber; |
| | | |
| | | @ApiModelProperty("柱状图数据") |
| | | private List<OrderQueryVO> orderList; |
| | | |
| | | public OrderResultVO() { |
| | | } |
| | | |
| | | public OrderResultVO(BigDecimal orderTotalMoney, Integer orderTotalNumber, List<OrderQueryVO> orderList) { |
| | | this.orderTotalMoney = orderTotalMoney; |
| | | this.orderTotalNumber = orderTotalNumber; |
| | | this.orderList = orderList; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-05-31 10:40 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "UserWithdrawRecordVO对象", description = "用户提现记录信息") |
| | | public class UserWithdrawRecordVO { |
| | | |
| | | @TableId("id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("用户手机号") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty("申请时间") |
| | | private Date applyForTime; |
| | | |
| | | @ApiModelProperty("申请金额") |
| | | private BigDecimal applyForMoney; |
| | | |
| | | @ApiModelProperty("申请状态 0待审核;1已通过;2已驳回") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("审批意见") |
| | | private String opinions; |
| | | |
| | | @ApiModelProperty("用户编号") |
| | | private String userNo; |
| | | |
| | | @ApiModelProperty("用户昵称") |
| | | private String nickname; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String profilePicture; |
| | | |
| | | /** |
| | | * 申请状态中文(导出用) 0待审核;1已通过;2已驳回 |
| | | * |
| | | * @return 中文状态 |
| | | */ |
| | | public String getStateStr() { |
| | | if (null == state) { |
| | | return "未知"; |
| | | } else { |
| | | if (Constants.AUDIT_NUMBER.equals(state)) { |
| | | return Constants.AUDIT_STR; |
| | | } else if (Constants.PASS_THROUGH_NUMBER.equals(state)) { |
| | | return Constants.PASS_THROUGH_STR; |
| | | } else if (Constants.REJECT_NUMBER.equals(state)) { |
| | | return Constants.REJECT_STR; |
| | | } else { |
| | | return "未知"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-09 18:10 |
| | | */ |
| | | @Data |
| | | public class WithdrawDetailVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("下单用户id") |
| | | private Integer userId; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("回收服务回收价") |
| | | private BigDecimal servePrice; |
| | | |
| | | @ApiModelProperty("订单成交价(服务回收价 + 津贴)") |
| | | private BigDecimal orderMoney; |
| | | |
| | | @ApiModelProperty("预约姓名") |
| | | private String reservationName; |
| | | |
| | | @ApiModelProperty("预约手机号") |
| | | private String reservationPhone; |
| | | |
| | | @ApiModelProperty("预约地址") |
| | | private String reservationAddress; |
| | | |
| | | @ApiModelProperty("预约上门时间段") |
| | | private String time; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("服务人员id") |
| | | private Integer serverId; |
| | | |
| | | @ApiModelProperty("服务人员名称") |
| | | private String serverName; |
| | | |
| | | @ApiModelProperty("服务人员手机号") |
| | | private String serverPhone; |
| | | |
| | | @ApiModelProperty("预约备注") |
| | | private String reservationRemark; |
| | | |
| | | @ApiModelProperty("订单状态(0:待派单;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)") |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
| | | private BigDecimal subsidy; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("提现申请状态(0待审核;1已通过;2已驳回)") |
| | | private Integer withdrawalState; |
| | | |
| | | @ApiModelProperty("提现申请时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date withdrawalTime; |
| | | |
| | | @ApiModelProperty("详细地址") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("现场照片(多张照片 ','隔开)") |
| | | private String photo; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 11:27 |
| | | */ |
| | | @Data |
| | | public class WithdrawListVO { |
| | | |
| | | @ApiModelProperty("提现金额统计") |
| | | private WithdrawMoneyVO moneyCount; |
| | | |
| | | @ApiModelProperty("提现订单列表") |
| | | private List<WithdrawOrderVO> withdrawOrder; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 9:22 |
| | | */ |
| | | @Data |
| | | public class WithdrawMoneyVO { |
| | | |
| | | @ApiModelProperty("提现金额总计") |
| | | private BigDecimal total; |
| | | |
| | | @ApiModelProperty("已提现金额") |
| | | private BigDecimal withdraw; |
| | | |
| | | @ApiModelProperty("未提现金额") |
| | | private BigDecimal undelivered; |
| | | |
| | | public WithdrawMoneyVO(BigDecimal total, BigDecimal withdraw, BigDecimal undelivered) { |
| | | this.total = total; |
| | | this.withdraw = withdraw; |
| | | this.undelivered = undelivered; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-06-11 11:28 |
| | | */ |
| | | @Data |
| | | public class WithdrawOrderVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | private Integer serveId; |
| | | |
| | | @ApiModelProperty("回收服务名称") |
| | | private String serveName; |
| | | |
| | | @ApiModelProperty("服务描述") |
| | | private String serveDescribe; |
| | | |
| | | @ApiModelProperty("封面图片") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | private Integer isWithdrawal; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-08 18:37 |
| | | */ |
| | | @Data |
| | | public class WithdrawReturnVO { |
| | | |
| | | private String orderId; |
| | | |
| | | private Integer userId; |
| | | |
| | | public WithdrawReturnVO(String orderId, Integer userId) { |
| | | this.orderId = orderId; |
| | | this.userId = userId; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-09 16:11 |
| | | */ |
| | | @Data |
| | | public class WorkerOrderCountVO { |
| | | |
| | | @ApiModelProperty("总订单数") |
| | | private Integer total; |
| | | |
| | | @ApiModelProperty("待上门订单数") |
| | | private Integer waitVisit; |
| | | |
| | | @ApiModelProperty("已完结订单数") |
| | | private Integer completed; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-09 10:12 |
| | | */ |
| | | @Data |
| | | public class WorkerOrderRankVO { |
| | | |
| | | private Integer workerId; |
| | | |
| | | private Integer orderNumber; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vx; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.util.EntityUtils; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | import static com.wechat.pay.contrib.apache.httpclient.constant.WechatPayHttpHeaders.WECHAT_PAY_SERIAL; |
| | | import static org.apache.http.HttpHeaders.ACCEPT; |
| | | import static org.apache.http.HttpHeaders.CONTENT_TYPE; |
| | | import static org.apache.http.entity.ContentType.APPLICATION_JSON; |
| | | |
| | | |
| | | /** |
| | | * 微信支付专用类 请求操作方法 |
| | | * |
| | | * @author hjl |
| | | */ |
| | | @Slf4j |
| | | public class HttpUtil { |
| | | |
| | | /** |
| | | * 发起批量转账API 批量转账到零钱 |
| | | * |
| | | * @param requestUrl 请求路径 |
| | | * @param requestJson 组合参数 |
| | | * @param wechatPayserialNo 商户证书序列号 |
| | | * @param privatekeypath 商户私钥证书路径 |
| | | */ |
| | | public static String postTransBatRequest( |
| | | String requestUrl, |
| | | String requestJson, |
| | | String wechatPayserialNo, |
| | | String mchId, |
| | | String privatekeypath, String url) { |
| | | CloseableHttpResponse response; |
| | | HttpEntity entity; |
| | | CloseableHttpClient httpClient = null; |
| | | try { |
| | | HttpPost httpPost = createHttpPost(requestUrl, requestJson, wechatPayserialNo, mchId, privatekeypath, url); |
| | | httpClient = HttpClients.createDefault(); |
| | | //发起转账请求 |
| | | response = httpClient.execute(httpPost); |
| | | log.info("response:{}", response); |
| | | //获取返回的数据 |
| | | entity = response.getEntity(); |
| | | log.info("-----getHeaders.Request-ID:" + response.getHeaders("Request-ID")); |
| | | return EntityUtils.toString(entity); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 关闭流 |
| | | try { |
| | | if (httpClient != null) { |
| | | httpClient.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 账单查询 |
| | | * |
| | | * @param requestUrl 请求完整地址 |
| | | * @param wechatPayserialNo 商户证书序列号 |
| | | * @param privatekeypath 商户私钥证书路径 |
| | | */ |
| | | public static String getTransBatRequest( |
| | | String requestUrl, |
| | | String wechatPayserialNo, |
| | | String mchId, |
| | | String privatekeypath, String url) { |
| | | CloseableHttpResponse response; |
| | | HttpEntity entity; |
| | | CloseableHttpClient httpClient = null; |
| | | try { |
| | | HttpGet httpPost = createHttpGet(requestUrl, wechatPayserialNo, mchId, privatekeypath, url); |
| | | httpClient = HttpClients.createDefault(); |
| | | //发起转账请求 |
| | | response = httpClient.execute(httpPost); |
| | | log.info("response:{}", response); |
| | | //获取返回的数据 |
| | | entity = response.getEntity(); |
| | | log.info("-----getHeaders.Request-ID:" + response.getHeaders("Request-ID")); |
| | | return EntityUtils.toString(entity); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 关闭流 |
| | | try { |
| | | if (httpClient != null) { |
| | | httpClient.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * @param requestUrl 请求完整地址 |
| | | * @param requestJson 请求参数 |
| | | * @param wechatPayserialNo 支付证书序列号 |
| | | * @param mchId 商户号 |
| | | * @param privatekeypath 私钥路径 |
| | | * @param servletPath 相对路径 |
| | | */ |
| | | private static HttpPost createHttpPost(String requestUrl, |
| | | String requestJson, |
| | | String wechatPayserialNo, |
| | | String mchId, |
| | | String privatekeypath, String servletPath) { |
| | | //商户私钥证书 |
| | | HttpPost httpPost = new HttpPost(requestUrl); |
| | | // NOTE: 建议指定charset=utf-8。低于4.4.6版本的HttpCore,不能正确的设置字符集,可能导致签名错误 |
| | | httpPost.addHeader(ACCEPT, APPLICATION_JSON.toString()); |
| | | httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON.toString()); |
| | | //"55E551E614BAA5A3EA38AE03849A76D8C7DA735A"); |
| | | httpPost.addHeader(WECHAT_PAY_SERIAL, wechatPayserialNo); |
| | | |
| | | //-------------------------核心认证 start----------------------------------------------------------------- |
| | | String strToken = null; |
| | | try { |
| | | log.info("requestJson:{}", requestJson); |
| | | strToken = WechatPayV3Util.getToken("POST", |
| | | servletPath, |
| | | requestJson, mchId, wechatPayserialNo, privatekeypath); |
| | | } catch (Exception e) { |
| | | log.error("createHttpPost error:", e); |
| | | e.printStackTrace(); |
| | | } |
| | | StringEntity reqEntity = new StringEntity(requestJson, APPLICATION_JSON); |
| | | log.info("token " + strToken); |
| | | // 添加认证信息 |
| | | httpPost.addHeader("Authorization", |
| | | "WECHATPAY2-SHA256-RSA2048" + " " |
| | | + strToken); |
| | | //---------------------------核心认证 end--------------------------------------------------------------- |
| | | httpPost.setEntity(reqEntity); |
| | | return httpPost; |
| | | } |
| | | |
| | | /** |
| | | * 创建get 请求 |
| | | * |
| | | * @param requestUrl 请求完整地址 |
| | | * @param wechatPayserialNo 支付证书序列号 |
| | | * @param mchId 商户号 |
| | | * @param privatekeypath 私钥路径 |
| | | * @param servletPath 相对路径 请求地址上如果有参数 则此处需要带上参数 |
| | | * @return HttpGet |
| | | */ |
| | | private static HttpGet createHttpGet(String requestUrl, |
| | | String wechatPayserialNo, |
| | | String mchId, |
| | | String privatekeypath, String servletPath) { |
| | | //商户私钥证书 |
| | | HttpGet httpGet = new HttpGet(requestUrl); |
| | | // NOTE: 建议指定charset=utf-8。低于4.4.6版本的HttpCore,不能正确的设置字符集,可能导致签名错误 |
| | | httpGet.addHeader("Content-Type", "application/json"); |
| | | httpGet.addHeader("Accept", "application/json"); |
| | | //"55E551E614BAA5A3EA38AE03849A76D8C7DA735A"); |
| | | httpGet.addHeader("Wechatpay-Serial", wechatPayserialNo); |
| | | //-------------------------核心认证 start----------------------------------------------------------------- |
| | | String strToken = null; |
| | | try { |
| | | strToken = WechatPayV3Util.getToken("GET", |
| | | servletPath, |
| | | "", mchId, wechatPayserialNo, privatekeypath); |
| | | } catch (Exception e) { |
| | | log.error("createHttpGet error:", e); |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | log.info("token " + strToken); |
| | | // 添加认证信息 |
| | | httpGet.addHeader("Authorization", |
| | | "WECHATPAY2-SHA256-RSA2048" + " " |
| | | + strToken); |
| | | //---------------------------核心认证 end--------------------------------------------------------------- |
| | | return httpGet; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.order.vx; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.security.KeyFactory; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.PrivateKey; |
| | | import java.security.Signature; |
| | | import java.security.spec.InvalidKeySpecException; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | @Slf4j |
| | | public class WechatPayV3Util { |
| | | |
| | | |
| | | /** |
| | | * @param method 请求方法 post |
| | | * @param canonicalUrl 请求地址 |
| | | * @param body 请求参数 GET请求传空字符 |
| | | * @param merchantId 这里用的商户号 |
| | | * @param certSerialNo 商户证书序列号 |
| | | * @param keyPath 私钥商户证书地址 |
| | | */ |
| | | public static String getToken( |
| | | String method, |
| | | String canonicalUrl, |
| | | String body, |
| | | String merchantId, |
| | | String certSerialNo, |
| | | String keyPath) throws Exception { |
| | | String signStr; |
| | | //获取32位随机字符串 |
| | | String nonceStr = getRandomString(32); |
| | | //当前系统运行时间 |
| | | long timestamp = System.currentTimeMillis() / 1000; |
| | | String message = buildMessage(method, canonicalUrl, timestamp, nonceStr, body); |
| | | //签名操作 |
| | | //签名操作 |
| | | String signature = sign(message.getBytes(StandardCharsets.UTF_8), keyPath); |
| | | //组装参数 |
| | | signStr = "mchid=\"" + merchantId + "\"," + |
| | | "timestamp=\"" + timestamp + "\"," + |
| | | "nonce_str=\"" + nonceStr + "\"," + |
| | | "serial_no=\"" + certSerialNo + "\"," + |
| | | "signature=\"" + signature + "\""; |
| | | |
| | | return signStr; |
| | | } |
| | | |
| | | public static String buildMessage(String method, String canonicalUrl, long timestamp, String nonceStr, String body) { |
| | | // String canonicalUrl = url.encodedPath(); |
| | | // if (url.encodedQuery() != null) { |
| | | // canonicalUrl += "?" + url.encodedQuery(); |
| | | // } |
| | | return method + "\n" + canonicalUrl + "\n" + timestamp + "\n" + nonceStr + "\n" + body + "\n"; |
| | | } |
| | | |
| | | public static String sign(byte[] message, String keyPath) throws Exception { |
| | | Signature sign = Signature.getInstance("SHA256withRSA"); |
| | | sign.initSign(getPrivateKey(keyPath)); |
| | | sign.update(message); |
| | | return Base64.encodeBase64String(sign.sign()); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付-前端唤起支付参数-获取商户私钥 |
| | | * |
| | | * @param filename 私钥文件路径 (required) |
| | | * @return 私钥对象 |
| | | */ |
| | | public static PrivateKey getPrivateKey(String filename) throws IOException { |
| | | log.info("签名 证书地址是 " + filename); |
| | | String content = new String(Files.readAllBytes(Paths.get(filename)), StandardCharsets.UTF_8); |
| | | try { |
| | | String privateKey = content.replace("-----BEGIN PRIVATE KEY-----", "") |
| | | .replace("-----END PRIVATE KEY-----", "") |
| | | .replaceAll("\\s+", ""); |
| | | KeyFactory kf = KeyFactory.getInstance("RSA"); |
| | | return kf.generatePrivate( |
| | | new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKey))); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | throw new RuntimeException("当前Java环境不支持RSA", e); |
| | | } catch (InvalidKeySpecException e) { |
| | | throw new RuntimeException("无效的密钥格式"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取随机位数的字符串 |
| | | * |
| | | * @param length 需要的长度 |
| | | */ |
| | | public static String getRandomString(int length) { |
| | | String base = "abcdefghijklmnopqrstuvwxyz0123456789"; |
| | | Random random = new Random(); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int i = 0; i < length; i++) { |
| | | int number = random.nextInt(base.length()); |
| | | sb.append(base.charAt(number)); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | # Spring |
| | | spring: |
| | | application: |
| | | # 应用名称 |
| | | name: ruoyi-order |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | |
| | | --- |
| | | spring: |
| | | config: |
| | | activate: |
| | | on-profile: dev |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | name: ${spring.application.name} |
| | | # 配置文件格式 |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-order" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- 控制台输出 --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 系统日志输出 --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/info.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>INFO</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/error.log</file> |
| | | <!-- 循环政策:基于时间创建日志文件 --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- 日志文件名格式 --> |
| | | <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- 日志最大的历史 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- 过滤的级别 --> |
| | | <level>ERROR</level> |
| | | <!-- 匹配时的操作:接收(记录) --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- 不匹配时的操作:拒绝(不记录) --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- 系统模块日志级别控制 --> |
| | | <logger name="com.ruoyi" level="info" /> |
| | | <!-- Spring日志级别控制 --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--系统操作日志--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | | </root> |
| | | </configuration> |
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.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" /> |
| | | </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.EvaluateMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.Evaluate"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="user_phone" property="userPhone"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="content" property="content"/> |
| | | <result column="worker_id" property="workerId"/> |
| | | <result column="star_rating" property="starRating"/> |
| | | <result column="serve_no" property="serveNo"/> |
| | | <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"/> |
| | | </resultMap> |
| | | |
| | | <select id="queryPageList" resultType="com.ruoyi.order.vo.EvaluatePageVO"> |
| | | select e.*, |
| | | o.reservation_name as userNo, |
| | | o.order_number, |
| | | o.server_name as workerName, |
| | | o.server_phone as workerPhone |
| | | from t_evaluate e |
| | | left join t_order o on e.order_id = o.id |
| | | <where> |
| | | e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | <if test="userName != null and userName != ''"> |
| | | and o.reservation_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="orderNumber != null and orderNumber != ''"> |
| | | and o.order_number like concat('%', #{orderNumber}, '%') |
| | | </if> |
| | | <if test="workerName != null and workerName != ''"> |
| | | and o.server_name like concat('%', #{workerName}, '%') |
| | | </if> |
| | | </where> |
| | | order by e.createTime desc |
| | | </select> |
| | | |
| | | <resultMap id="pageMap" type="com.ruoyi.order.vo.EvaluatePageVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="user_phone" property="userPhone"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="content" property="content"/> |
| | | <result column="worker_id" property="workerId"/> |
| | | <result column="star_rating" property="starRating"/> |
| | | <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="reservation_name" property="userNo"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="server_name" property="workerName"/> |
| | | <result column="server_phone" property="workerPhone"/> |
| | | </resultMap> |
| | | |
| | | <select id="evaluateList" resultMap="pageMap"> |
| | | select e.*, o.reservation_name, o.order_number, o.server_name, o.server_phone |
| | | from t_evaluate e |
| | | left join t_order o on e.order_id = o.id |
| | | where e.is_delete = 0 |
| | | and o.is_delete = 0 |
| | | </select> |
| | | |
| | | <resultMap id="evaluateMap" type="com.ruoyi.order.vo.OrderEvaluateVO"> |
| | | <association property="orderInfo" javaType="com.ruoyi.order.vo.EvaluateOrderInfoVO"> |
| | | <result column="id" property="orderId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="complete_time" property="completeTime"/> |
| | | <result column="serve_name" property="serveName"/> |
| | | <result column="serve_describe" property="serveDescribe"/> |
| | | <result column="cover" property="cover"/> |
| | | <result column="server_name" property="serverName"/> |
| | | <result column="server_phone" property="serverPhone"/> |
| | | <result column="serve_id" property="serveId"/> |
| | | </association> |
| | | <association property="evaluateInfo" javaType="com.ruoyi.order.vo.EvaluateInfoVO"> |
| | | <result column="content" property="content"/> |
| | | <result column="star_rating" property="starRating"/> |
| | | <result column="createTime" property="evaluateTime"/> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <select id="evaluateListByUser" resultMap="evaluateMap"> |
| | | SELECT o.id, |
| | | o.order_number, |
| | | o.complete_time, |
| | | o.server_name, |
| | | o.server_phone, |
| | | e.content, |
| | | e.star_rating, |
| | | e.createTime, |
| | | o.serve_id |
| | | FROM t_order o |
| | | LEFT JOIN t_evaluate e on o.id = e.order_id |
| | | <where> |
| | | o.user_id = #{userId} |
| | | <if test="state != -1"> |
| | | and o.is_evaluate = #{state} |
| | | </if> |
| | | </where> |
| | | order by o.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.OrderMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.Order"> |
| | | <id column="id" property="id"/> |
| | | <result column="site_id" property="siteId"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="order_money" property="orderMoney"/> |
| | | <result column="site_name" property="siteName"/> |
| | | <result column="serve_id" property="serveId"/> |
| | | <result column="serve_name" property="serveName"/> |
| | | <result column="serve_price" property="servePrice"/> |
| | | <result column="reservation_name" property="reservationName"/> |
| | | <result column="reservation_phone" property="reservationPhone"/> |
| | | <result column="reservation_address" property="reservationAddress"/> |
| | | <result column="time" property="time"/> |
| | | <result column="server_id" property="serverId"/> |
| | | <result column="server_name" property="serverName"/> |
| | | <result column="server_phone" property="serverPhone"/> |
| | | <result column="reservation_remark" property="reservationRemark"/> |
| | | <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="apply_reason" property="applyReason"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="orderCountByYear" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | | and YEAR(createTime) = YEAR(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="orderCountByWeek" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | | and YEARWEEK(DATE_FORMAT(createTime, '%Y-%m-%d')) = YEARWEEK(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="orderCountByMonth" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | is_delete = 0 |
| | | and MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="orderCountByToday" resultType="com.ruoyi.order.vo.OrderQueryVO"> |
| | | SELECT DATE_FORMAT(createTime, '%Y-%m-%d %H') AS dateTime, COUNT(*) AS number, sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | <where> |
| | | DATE(createTime) = CURDATE() |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="orderState != null and orderState != ''"> |
| | | and state = #{orderState} |
| | | </if> |
| | | <if test="startTime != null and startTime != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{startTime} |
| | | </if> |
| | | <if test="endTime != null and endTime != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{endTime} |
| | | </if> |
| | | </where> |
| | | GROUP BY dateTime |
| | | order by dateTime |
| | | </select> |
| | | |
| | | <select id="totalMoneyByQuarter" resultType="java.math.BigDecimal"> |
| | | select sum(order_money) |
| | | from t_order |
| | | <where> |
| | | is_delete = 0 |
| | | and state = 4 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | <if test="start != null and start != ''"> |
| | | and createTime <![CDATA[ >= ]]> #{start} |
| | | </if> |
| | | <if test="end != null and end != ''"> |
| | | and createTime <![CDATA[ <= ]]> #{end} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="totalMoneyByYear" resultType="java.math.BigDecimal"> |
| | | SELECT sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | where YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and state = 4 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="totalMoneyByMonth" resultType="java.math.BigDecimal"> |
| | | SELECT sum(serve_price) as totalPrice |
| | | FROM t_order |
| | | where MONTH(createTime) = MONTH(NOW()) |
| | | AND YEAR(createTime) = YEAR(NOW()) |
| | | and is_delete = 0 |
| | | and state = 4 |
| | | <if test="cityList != null and cityList.size() != 0"> |
| | | and city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="orderCount" resultType="com.ruoyi.order.vo.OrderCountVO"> |
| | | SELECT o.server_name AS realName, |
| | | o.server_id as workerId, |
| | | SUM(CASE WHEN o.state in (1, 2) THEN 1 ELSE 0 END) AS toBeCompletedNumber, |
| | | SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END) AS completedNumber, |
| | | SUM(CASE WHEN o.state = 6 THEN 1 ELSE 0 END) AS reInvestment |
| | | FROM t_order o |
| | | WHERE o.is_delete = 0 |
| | | <if test="phone != null and phone != ''"> |
| | | and o.server_phone like concat('%', #{phone}, '%') |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and o.server_name like concat('%', #{name}, '%') |
| | | </if> |
| | | GROUP BY o.server_name, o.server_id |
| | | </select> |
| | | |
| | | <select id="queryPage" resultMap="BaseResultMap"> |
| | | select * |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.site_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', 1), '%Y-%m-%d %H:%i') <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | AND STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', -1), '%Y-%m-%d %H:%i') <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | </where> |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | <select id="orderPageCount" resultMap="BaseResultMap"> |
| | | select o.* |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.serve_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', 1), '%Y-%m-%d %H:%i') <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | AND STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', -1), '%Y-%m-%d %H:%i') <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="exportByIdList" resultMap="BaseResultMap"> |
| | | select reservation_name, |
| | | reservation_phone, |
| | | reservation_address, |
| | | time, |
| | | serve_name, |
| | | server_name, |
| | | server_phone |
| | | from t_order |
| | | <where> |
| | | id in |
| | | <foreach collection="list" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="exportList" resultMap="BaseResultMap"> |
| | | select * |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.serve_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', 1), '%Y-%m-%d %H:%i') <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | AND STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', -1), '%Y-%m-%d %H:%i') <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | </where> |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | <select id="orderListWorker" resultMap="BaseResultMap"> |
| | | select o.* |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | and o.server_id = #{userId} |
| | | <choose> |
| | | <when test="state == 1"> |
| | | and o.state in (1, 2) |
| | | </when> |
| | | <when test="state == 2"> |
| | | and o.state = 3 |
| | | </when> |
| | | <otherwise> |
| | | and o.state in (1, 2, 3) |
| | | </otherwise> |
| | | </choose> |
| | | </where> |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | <select id="workerOrderRank" resultType="com.ruoyi.order.vo.WorkerOrderRankVO"> |
| | | select server_id as workerId, COUNT(server_id) as orderNumber |
| | | from t_order |
| | | <where> |
| | | is_delete = 0 |
| | | <if test="ids != null and ids.size() != 0"> |
| | | and server_id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | GROUP BY server_id |
| | | ORDER BY orderNumber desc |
| | | </select> |
| | | |
| | | <select id="orderStateCount" resultType="com.ruoyi.order.vo.WorkerOrderCountVO"> |
| | | SELECT COALESCE(SUM(CASE WHEN o.state IN (1, 2, 3) THEN 1 ELSE 0 END), 0) AS total, |
| | | COALESCE(SUM(CASE WHEN o.state in (1, 2) THEN 1 ELSE 0 END), 0) AS waitVisit, |
| | | COALESCE(SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END), 0) AS completed |
| | | FROM t_order o |
| | | where o.server_id = #{workerId} |
| | | and o.is_delete = 0 |
| | | </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.ServeCoordinateMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.ServeCoordinate"> |
| | | <id column="id" property="id" /> |
| | | <result column="worker_id" property="workerId" /> |
| | | <result column="order_id" property="orderId" /> |
| | | <result column="coordinate" property="coordinate" /> |
| | | <result column="longitude" property="longitude" /> |
| | | <result column="latitude" property="latitude" /> |
| | | <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" /> |
| | | </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.ServeRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.ServeRecord"> |
| | | <id column="id" property="id" /> |
| | | <result column="order_id" property="orderId" /> |
| | | <result column="photo" property="photo" /> |
| | | <result column="remark" property="remark" /> |
| | | <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" /> |
| | | </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.WithdrawMapper"> |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.Withdraw"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="user_phone" property="userPhone"/> |
| | | <result column="apply_for_time" property="applyForTime"/> |
| | | <result column="apply_for_money" property="applyForMoney"/> |
| | | <result column="state" property="state"/> |
| | | <result column="opinion" property="opinion"/> |
| | | <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"/> |
| | | </resultMap> |
| | | |
| | | <select id="withdrawPage" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="name != null and name != ''"> |
| | | and w.nick_name like concat('%', #{name}, '%') |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and w.user_phone like concat('%', #{phone}, '%') |
| | | </if> |
| | | <if test="time != null and time != ''"> |
| | | and DATE(w.apply_for_time) = #{time} |
| | | </if> |
| | | <if test="state != null"> |
| | | and w.state = #{state} |
| | | </if> |
| | | </where> |
| | | order by w.createTime desc |
| | | </select> |
| | | |
| | | <!--vo类映射--> |
| | | <resultMap id="voMap" type="com.ruoyi.order.vo.UserWithdrawRecordVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="apply_for_time" property="applyForTime"/> |
| | | <result column="apply_for_money" property="applyForMoney"/> |
| | | <result column="state" property="state"/> |
| | | <result column="opinion" property="opinions"/> |
| | | <result column="user_no" property="userNo"/> |
| | | <result column="profile_picture" property="profilePicture"/> |
| | | <result column="nick_name" property="nickname"/> |
| | | <result column="user_phone" property="userPhone"/> |
| | | </resultMap> |
| | | |
| | | <select id="exportList" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="name != null and name != ''"> |
| | | and w.nick_name like concat('%', #{name}, '%') |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and w.user_phone like concat('%', #{phone}, '%') |
| | | </if> |
| | | <if test="time != null and time != ''"> |
| | | and DATE(w.apply_for_time) = #{time} |
| | | </if> |
| | | <if test="state != null"> |
| | | and w.state = #{state} |
| | | </if> |
| | | </where> |
| | | order by w.createTime desc |
| | | </select> |
| | | |
| | | <select id="exportByIdList" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | and w.id in |
| | | <foreach collection="ids" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </where> |
| | | order by w.createTime desc |
| | | </select> |
| | | |
| | | <select id="withdrawalTotalMoney" resultType="java.math.BigDecimal"> |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="start != null and start != ''"> |
| | | and w.createTime <![CDATA[ >= ]]> #{start} |
| | | </if> |
| | | <if test="end != null and end != ''"> |
| | | and w.createTime <![CDATA[ <= ]]> #{end} |
| | | </if> |
| | | <!--<if test="cityList != null and cityList.size() != 0"> |
| | | and u.city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if>--> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="withdrawalTotalMoneyByYear" resultType="java.math.BigDecimal"> |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | <where> |
| | | YEAR(w.createTime) = YEAR(NOW()) |
| | | and w.is_delete = 0 |
| | | <!--<if test="cityList != null and cityList.size() != 0"> |
| | | and u.city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if>--> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="withdrawalTotalMoneyByMonth" resultType="java.math.BigDecimal"> |
| | | SELECT sum(w.apply_for_money) |
| | | FROM t_withdraw w |
| | | <where> |
| | | YEAR(w.createTime) = YEAR(NOW()) |
| | | AND YEAR(w.createTime) = YEAR(NOW()) |
| | | and w.is_delete = 0 |
| | | <!--<if test="cityList != null and cityList.size() != 0"> |
| | | and u.city in |
| | | <foreach collection="cityList" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if>--> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="withdrawList" resultMap="voMap"> |
| | | SELECT * |
| | | FROM t_withdraw w |
| | | <where> |
| | | w.is_delete = 0 |
| | | <if test="userId != null and userId != ''"> |
| | | and w.user_id = #{userId} |
| | | </if> |
| | | </where> |
| | | </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.WithdrawalSettingMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.order.entity.WithdrawalSetting"> |
| | | <id column="id" property="id" /> |
| | | <result column="enable_process" property="enableProcess" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> |
| | | <configuration> |
| | | |
| | | <settings> |
| | | <!-- 打印查询语句 不会写入到日志文件中--> |
| | | <setting name="logImpl" value="STDOUT_LOGGING"/> |
| | | <!--<setting name="logImpl" value="LOG4J" />--> |
| | | <!-- 控制全局缓存(二级缓存),按美团技术团队的说法,尽量别用缓存机制 emmmm.... --> |
| | | <setting name="cacheEnabled" value="true"/> |
| | | <!-- 延迟加载的全局开关。当开启时,所有关联对象都会延迟加载。默认 false --> |
| | | <!-- <setting name="lazyLoadingEnabled" value="true"/> --> |
| | | <setting name="mapUnderscoreToCamelCase" value="false"/> |
| | | <!-- 是否将map下划线方式转为驼峰式命名--> |
| | | <!-- 当开启时,任何方法的调用都会加载该对象的所有属性。默认 false,可通过select标签的 fetchType来覆盖--> |
| | | <!-- <setting name="aggressiveLazyLoading" value="false"/>--> |
| | | <!-- Mybatis 创建具有延迟加载能力的对象所用到的代理工具,默认JAVASSIST --> |
| | | <!--<setting name="proxyFactory" value="CGLIB" />--> |
| | | <!-- 关于mybatis的一二级缓存 请参照:https://tech.meituan.com/2018/01/19/mybatis-cache.html --> |
| | | <!-- 一级缓存范围默认:SESSION ,此范围在复杂应用场景中可能会出现脏读数据--> |
| | | <!-- STATEMENT级别的缓存,使一级缓存,只针对当前执行的这一statement有效 --> |
| | | <!--<setting name="localCacheScope" value="STATEMENT"/>--> |
| | | <setting name="localCacheScope" value="STATEMENT"/> |
| | | </settings> |
| | | |
| | | </configuration> |
New file |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIIEMTCCAxmgAwIBAgIUfuoEQpsAbhKqpCHAAuxIu+7VvpQwDQYJKoZIhvcNAQEL |
| | | BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT |
| | | FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg |
| | | Q0EwHhcNMjQwNjIwMDY1MzMyWhcNMjkwNjE5MDY1MzMyWjCBijETMBEGA1UEAwwK |
| | | MTY2NTMzMDQxNzEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTYwNAYDVQQL |
| | | DC3mrabmsYnluILlpb3ov5DlkIjnm5vmkKzov4Hlt6XnqIvmnInpmZDlhazlj7gx |
| | | CzAJBgNVBAYTAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEB |
| | | BQADggEPADCCAQoCggEBAMLqFYQnJ7S2ReDfU7FqeYnh3LDQq1F0K00aUYLR0uy3 |
| | | sc83rAUanlJHd48odNKgDc6k7oKuUzgs8y9v5i52ZZCg6LSWrZLnRtPV2qjqRvqY |
| | | ZhasFjqsH/ZCbsHuEvJw34gIUXl3FDPkTW7wThCe8BEqz9rywlKOSGMHZKR5pHTQ |
| | | AtjA4JG3SgV7qCiMtsdpCn8hzsUIflIjg16Qw8j4lav149oHMIp9ZWk6Vuz5oYZf |
| | | X/yqD8OsWz6CG1KmU0n8W7ObfYRNUKhBbZq3msLFscr9a2cxO008h4SzSRwleEQT |
| | | EL711OZyQgy9moBpkyLIEoQp3Wy6NaEvZ9LOBj0wQT8CAwEAAaOBuTCBtjAJBgNV |
| | | HRMEAjAAMAsGA1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0 |
| | | cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIw |
| | | RTUwREJDMDRCMDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0 |
| | | MjJFMTJCMjdBOUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUA |
| | | A4IBAQBTHQhhakcZyah8zTsODzmHS2xq4AiMiSpYyfEe4rTuLZPFj17vZQ4CMjnM |
| | | LXT30uyjPqGCrY8IRajRVCG9DATXX8vKpYk3/LRlM8o0ApBxwpf/g1H2VbO17l0E |
| | | V4CJBbOoi9QA7itMQnJa5PXzrOHlq2G65Q6LAQQTbIzF9TmkxkSIqVbzrKtnbQmL |
| | | dejQxS0ZfKCxA5nuyxmelmidu6VNFzFwV4W/4ToyuXy7gxpBYekhK4SmxQiAa6lU |
| | | 49UamtQDHz8WJFwjmvnmVc0h44TjCTl8EsUI2j+pWzDwvcNNz2kYg+chqUYHHmvn |
| | | 3s+QkMmYLq/LeNi7GF4M2CFpZu1T |
| | | -----END CERTIFICATE----- |
New file |
| | |
| | | -----BEGIN PRIVATE KEY----- |
| | | MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDC6hWEJye0tkXg |
| | | 31OxanmJ4dyw0KtRdCtNGlGC0dLst7HPN6wFGp5SR3ePKHTSoA3OpO6CrlM4LPMv |
| | | b+YudmWQoOi0lq2S50bT1dqo6kb6mGYWrBY6rB/2Qm7B7hLycN+ICFF5dxQz5E1u |
| | | 8E4QnvARKs/a8sJSjkhjB2SkeaR00ALYwOCRt0oFe6gojLbHaQp/Ic7FCH5SI4Ne |
| | | kMPI+JWr9ePaBzCKfWVpOlbs+aGGX1/8qg/DrFs+ghtSplNJ/Fuzm32ETVCoQW2a |
| | | t5rCxbHK/WtnMTtNPIeEs0kcJXhEExC+9dTmckIMvZqAaZMiyBKEKd1sujWhL2fS |
| | | zgY9MEE/AgMBAAECggEARQazEfbv186JFqbgM79aRVsoVbHASftS7l44qZR3Fv/C |
| | | x3iWwcP4d3j5vUf9fy3RVfIQyVTFAerhQFZndOLW+w4Q+ws1cwXWjmR4qEM3Wb2o |
| | | wbS1tpeIRiSmpqUSLquMbddMSzDBhdL/HR+a9cXjjKDVtVstOCFNP0y59olhlUAK |
| | | czDmuhDTTD0lVCcqI/+xc+xeY2rrbYpWVJYTtjH3g5R8oELjvJYARgRb6SAjz58a |
| | | q/4iL5g3B903d3p8XPDdGgyd4xhR0Aaf/rTUYpehUjdoEHkovUVefbrB+xKsIxll |
| | | xax3IdQJq6UvAiskflHTwLsu2Now/xXPEM6TRJC+aQKBgQDv8tvDhECqhcsEcj9/ |
| | | PyyJtfeSEbNTGs3dZqzz3ZN5BKt2FNuCkfQm8UYddVdkODSP7OU0pkVL5A/flNP/ |
| | | KTmrHl/81riYdqujwV3UYhKbIBFfgumy8lFHy6u5rrYdaCdGciKNg6xKbiD6wexd |
| | | G2gWAx+Id2QmYPArVwYhu9TFAwKBgQDP9AJ/tQRhFAIdBN1EpTFE84A5ovA7rd4j |
| | | Me/21MDlwAgOyrlidr8gzBA4TcYIfs+2B3zIWC2YxEc+uRcU5exDG++2/nO9ftMm |
| | | Nlkn/YmxcfcQAd75mPZvqLDpAXEsLogI1FyhDBAg/ICk6dM6cmLuPGDHvP5Ttl8i |
| | | SoB4oNwIFQKBgDkelgQgCojNWrvPOqBe+Io7wBiMkCS7X8BRveA7oeyQGQT+CBc4 |
| | | CWfvzaIbmdcorhKI8TMsVZiwTLsLob+/H5RFodH9h2n77fYIhP6W7hjxdFFJR7qq |
| | | hoDR0ipclcvATIEvkFwhuTTqrH0lBtBPQuLikXIaAcRFFUcr6zDClu7jAoGBAInj |
| | | gsSrgvvcCIq1bwLVhpXx4FRXdnQcFe/AbR1+dWniq3Ujd0mS86kLprWu3GFFtPU+ |
| | | gb9WuOVTQOqWUHfK/Z6CJ7Fvh89fCSONZhDeTS8cIna6xt86Ti477RKTojdpo0o3 |
| | | hjRDi25T//laEnXu4yqVXpcS+pEHnI1gWU+jWkMBAoGBAMVzBi/05H8+zusudGMR |
| | | UWZaVQ0bLtH1ePF7dgDxiEXeAg7Xp2LWxH4jABSwIhyAMApucZKOXPILwPNQBW47 |
| | | zUFB21xK39mFvZOe8UKxLtGKnrNlGtVFWvnJrKPQd+c4r2eCpXUk0QHr1SoNekVq |
| | | VNSUH+BwA3mGKhUqbJquhQZn |
| | | -----END PRIVATE KEY----- |
| | |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | <!--汉字转拼音工具包--> |
| | | <dependency> |
| | | <groupId>com.belerweb</groupId> |
| | | <artifactId>pinyin4j</artifactId> |
| | | <version>2.5.1</version> |
| | | </dependency> |
| | | |
| | | <!--微信小程序依赖--> |
| | | <dependency> |
| | | <groupId>com.github.binarywang</groupId> |
| | | <artifactId>weixin-java-miniapp</artifactId> |
| | | <version>4.4.8.B</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.wechatpay-apiv3</groupId> |
| | |
| | | <artifactId>dom4j</artifactId> |
| | | <version>1.6.1</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alipay.sdk</groupId> |
| | | <artifactId>alipay-sdk-java</artifactId> |
| | | <version>4.8.10.ALL</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-system</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-admin</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-order</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import com.ruoyi.order.api.entity.EvaluateOrderInfoVO; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateSubmitRequest; |
| | | import com.ruoyi.order.api.entity.OrderEvaluateVO; |
| | | import com.ruoyi.order.api.feignClient.EvaluateClient; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.Evaluate; |
| | | import com.ruoyi.user.entity.Order; |
| | | import com.ruoyi.user.entity.RecoveryServe; |
| | | import com.ruoyi.user.request.OrderEvaluateRequest; |
| | | import com.ruoyi.user.service.EvaluateService; |
| | | import com.ruoyi.user.service.OrderService; |
| | | import com.ruoyi.user.vo.OrderEvaluateVO; |
| | | import com.ruoyi.user.service.RecoveryServeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class EvaluateController { |
| | | |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private OrderService orderService; |
| | | private EvaluateClient evaluateClient; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | @GetMapping("/orderEvaluate") |
| | | @ApiOperation(value = "订单评价列表", tags = {"用户端-个人中心"}) |
| | | public R<List<OrderEvaluateVO>> orderEvaluate() { |
| | | public R<Page<OrderEvaluateVO>> orderEvaluate(@RequestParam("state") Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(evaluateService.orderEvaluate(loginUser.getUserid())); |
| | | Page<OrderEvaluateVO> list = evaluateClient.evaluateListByUser(loginUser.getUserid(), state, pageNum, pageSize).getData(); |
| | | if (null != list) { |
| | | // 数据封装,减少循环io |
| | | List<Integer> ids = list.getRecords().stream().map(OrderEvaluateVO::getServeId).collect(Collectors.toList()); |
| | | if (!ids.isEmpty()) { |
| | | List<RecoveryServe> serveList = recoveryServeService.lambdaQuery() |
| | | .in(RecoveryServe::getId, ids) |
| | | .eq(RecoveryServe::getIsDelete, 0).list(); |
| | | Map<Integer, RecoveryServe> map = serveList.stream().collect(Collectors. |
| | | toMap(RecoveryServe::getId, data -> data)); |
| | | for (OrderEvaluateVO data : list.getRecords()) { |
| | | Integer serveId = data.getServeId(); |
| | | RecoveryServe recoveryServe = map.get(serveId); |
| | | if (null != recoveryServe) { |
| | | EvaluateOrderInfoVO orderInfo = data.getOrderInfo(); |
| | | orderInfo.setServeName(recoveryServe.getServeName()); |
| | | orderInfo.setServeDescribe(recoveryServe.getServeDescribe()); |
| | | orderInfo.setCover(recoveryServe.getCover()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @GetMapping("/conductEvaluation") |
| | |
| | | @PostMapping("/submitEvaluation") |
| | | @ApiOperation(value = "提交评价", tags = {"用户端-个人中心"}) |
| | | public R<String> submitEvaluation(@RequestBody @Validated OrderEvaluateRequest orderEvaluate) { |
| | | Integer orderId = orderEvaluate.getOrderId(); |
| | | Long orderId = orderEvaluate.getOrderId(); |
| | | String content = orderEvaluate.getContent(); |
| | | BigDecimal starRating = orderEvaluate.getStarRating(); |
| | | Double starRating = orderEvaluate.getStarRating(); |
| | | String serveNo = orderEvaluate.getServeNo(); |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // 订单详情 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单异常!"); |
| | | } |
| | | Evaluate evaluate = new Evaluate(); |
| | | evaluate.setUserId(loginUser.getUserid()); |
| | | evaluate.setOrderId(orderId); |
| | | evaluate.setContent(content); |
| | | evaluate.setWorkerId(order.getServerId()); |
| | | evaluate.setStarRating(starRating); |
| | | evaluate.setServeNo(serveNo); |
| | | boolean save = evaluateService.save(evaluate); |
| | | boolean save = evaluateClient.evaluateSave(new OrderEvaluateSubmitRequest(orderId, content, starRating, |
| | | serveNo, loginUser.getUserid())).getData(); |
| | | return save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.admin.api.entity.Prize; |
| | | import com.ruoyi.admin.api.feignClient.AdminClient; |
| | | 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.service.TokenService; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import com.ruoyi.order.api.entity.ServeRecord; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.order.api.feignClient.ServeRecordClient; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.Order; |
| | | import com.ruoyi.user.entity.ServeRecord; |
| | | import com.ruoyi.user.entity.RecoveryServe; |
| | | import com.ruoyi.user.entity.RecoveryServePrice; |
| | | import com.ruoyi.user.request.OrderRequest; |
| | | import com.ruoyi.user.service.OrderService; |
| | | import com.ruoyi.user.service.ServeRecordService; |
| | | import com.ruoyi.user.service.RecoveryServePriceService; |
| | | import com.ruoyi.user.service.RecoveryServeService; |
| | | import com.ruoyi.user.vo.OrderDetailVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class OrderController { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | private RecoveryServePriceService recoveryServePriceService; |
| | | @Resource |
| | | private AdminClient adminClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private ServeRecordClient serveRecordClient; |
| | | |
| | | @GetMapping("/orderList") |
| | | @ApiOperation(value = "订单列表", tags = {"用户端-订单"}) |
| | | public R<List<Order>> orderList() { |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "状态(-1:全部;0:派单中;1:待上门;2:待完工;3:已完结;4:已取消;5:已改派)", name = "state", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "条数", name = "pageSize", dataType = "Integer", required = true) |
| | | }) |
| | | public R<IPage<Order>> orderList(@RequestParam Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(orderService.lambdaQuery() |
| | | .eq(Order::getIsDelete, 0) |
| | | .eq(Order::getUserId, loginUser.getUserid()) |
| | | .orderByDesc(Order::getCreateTime).list()); |
| | | IPage<Order> data = orderClient.orderListByUser(loginUser.getUserid(), state, pageNum, pageSize).getData(); |
| | | List<Integer> ids = data.getRecords().stream().map(Order::getServeId).collect(Collectors.toList()); |
| | | if (!ids.isEmpty()) { |
| | | List<RecoveryServe> serveList = recoveryServeService.lambdaQuery() |
| | | .in(RecoveryServe::getId, ids).eq(RecoveryServe::getIsDelete, 0).list(); |
| | | Map<Integer, String> map = serveList.stream().collect(Collectors.toMap(RecoveryServe::getId, |
| | | mw -> Optional.ofNullable(mw.getCover()).orElse(""))); |
| | | for (Order order : data.getRecords()) { |
| | | Integer serveId = order.getServeId(); |
| | | order.setCover(map.get(serveId)); |
| | | } |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | @GetMapping("/estimate") |
| | | @ApiOperation(value = "在线评估", tags = {"用户端-订单"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "回收服务id", name = "orderId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "所在城市", name = "city", dataType = "String") |
| | | }) |
| | | public R<BigDecimal> estimate(@RequestParam String orderId, String city) { |
| | | Order order = orderClient.detail(orderId).getData(); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | BigDecimal money = recoveryServe.getDefaultPrice(); |
| | | if (StringUtils.isNotBlank(city)) { |
| | | RecoveryServePrice price = recoveryServePriceService.lambdaQuery() |
| | | .eq(RecoveryServePrice::getRecoveryServeId, recoveryServe.getId()) |
| | | .eq(RecoveryServePrice::getCity, city).one(); |
| | | if (null != price) { |
| | | money = price.getRecoveryPrice(); |
| | | } |
| | | } |
| | | return R.ok(money); |
| | | } |
| | | |
| | | @GetMapping("/detail") |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<OrderDetailVO> detail(@RequestParam Integer orderId) { |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | public R<OrderDetailVO> detail(@RequestParam String orderId) { |
| | | Order order = orderClient.detail(orderId).getData(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单状态异常!"); |
| | | throw new GlobalException("订单不存在或已删除!"); |
| | | } |
| | | OrderDetailVO orderDetail = new OrderDetailVO(order); |
| | | if (Constants.THREE.equals(order.getState())) { |
| | | ServeRecord record = serveRecordService.lambdaQuery().eq(ServeRecord::getOrderId, orderId) |
| | | .eq(ServeRecord::getIsDelete, 0).one(); |
| | | if (null == record) { |
| | | throw new GlobalException("暂未上传家电照片!"); |
| | | ServeRecord serveRecord = serveRecordClient.serveRecordByOrderId(orderId).getData(); |
| | | if (null != serveRecord) { |
| | | orderDetail.setPhoto(serveRecord.getPhoto()); |
| | | } |
| | | orderDetail.setPhoto(record.getPhoto()); |
| | | } |
| | | return R.ok(orderDetail); |
| | | } |
| | |
| | | return R.ok(orderService.obtainAllowance(adminClient.prizeList().getData())); |
| | | } |
| | | |
| | | /** |
| | | * 抽奖获取津贴 |
| | | * |
| | | * @return 奖品列表 |
| | | */ |
| | | @GetMapping("/allowanceMoney") |
| | | @ApiOperation(value = "补充订单津贴金额", tags = {"用户端-订单"}) |
| | | public R<Object> allowanceMoney(@RequestParam("orderId") String orderId, @RequestParam("prizeId") String prizeId) { |
| | | Prize data = adminClient.prizeDetail(prizeId).getData(); |
| | | if (null == data) { |
| | | return R.fail("奖品信息获取失败!"); |
| | | } |
| | | return R.ok(orderClient.supplementAllowance(orderId, data.getPrizeName()).getData()); |
| | | } |
| | | |
| | | @PostMapping("/orderEstimate") |
| | | @ApiOperation(value = "下单评估,生成预订单信息", tags = {"用户端-订单"}) |
| | | public R<String> orderEstimate(@RequestBody OrderRequest orderRequest) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | String result = orderService.orderEstimate(orderRequest, loginUser.getUserid()); |
| | | return R.ok(result, ""); |
| | | } |
| | | |
| | | @PostMapping("/placeOrder") |
| | | @ApiOperation(value = "用户下单", tags = {"用户端-订单"}) |
| | | public R<String> placeOrder(@RequestBody OrderRequest orderRequest) { |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.RecoveryClassify; |
| | | import com.ruoyi.user.entity.RecoveryServe; |
| | | import com.ruoyi.user.entity.UserCollect; |
| | | import com.ruoyi.user.service.RecoveryClassifyService; |
| | | import com.ruoyi.user.service.RecoveryServeService; |
| | | import com.ruoyi.user.service.UserCollectService; |
| | | import com.ruoyi.user.vo.ServeListVO; |
| | | import com.ruoyi.user.vo.UserServeTypeVO; |
| | | 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; |
| | | |
| | | /** |
| | |
| | | |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private RecoveryClassifyService recoveryClassifyService; |
| | | @Resource |
| | | private UserCollectService collectService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 获取服务列表 |
| | | */ |
| | | @GetMapping(value = "/serveType") |
| | | @ApiOperation(value = "获取服务分类", tags = {"用户端-服务"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "服务类型(0:以旧换新;1:家电回收)", name = "type", dataType = "Integer", required = true) |
| | | }) |
| | | public R<List<UserServeTypeVO>> serveType(@RequestParam("type") Integer type) { |
| | | String serveType; |
| | | if (Constants.ZERO.equals(type)) { |
| | | serveType = Constants.TRADE_IN; |
| | | } else { |
| | | serveType = Constants.RECOVERY; |
| | | } |
| | | List<RecoveryClassify> serveList = recoveryClassifyService.lambdaQuery() |
| | | .eq(RecoveryClassify::getIsDelete, 0) |
| | | .eq(RecoveryClassify::getSupClassify, serveType) |
| | | .orderByAsc(RecoveryClassify::getSort) |
| | | .orderByDesc(RecoveryClassify::getCreateTime).list(); |
| | | List<UserServeTypeVO> list = new ArrayList<>(); |
| | | for (RecoveryClassify classify : serveList) { |
| | | list.add(new UserServeTypeVO(classify.getId(), classify.getSubClassify(), |
| | | classify.getClassificationPicture(), classify.getTypeDescribe(), type)); |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取服务列表 |
| | | */ |
| | | @GetMapping(value = "/servePage") |
| | | @ApiOperation(value = "根据所选分类获取服务列表", tags = {"用户端-服务"}) |
| | | public R<IPage<RecoveryServe>> servePage(@RequestParam("id") Integer id, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | Page<RecoveryServe> page = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getClassifyId, id) |
| | | .eq(RecoveryServe::getIsDelete, 0) |
| | | .orderByAsc(RecoveryServe::getSort) |
| | | .orderByDesc(RecoveryServe::getCreateTime).page(Page.of(pageNum, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取服务列表 |
| | |
| | | @ApiImplicitParam(value = "服务id", name = "serveId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<RecoveryServe> serveDetail(@RequestParam Integer serveId) { |
| | | return R.ok(recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).orderByAsc(RecoveryServe::getSort).one()); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).orderByAsc(RecoveryServe::getSort).one(); |
| | | // 用户是否收藏 |
| | | UserCollect one = collectService.lambdaQuery() |
| | | .eq(UserCollect::getServeId, serveId) |
| | | .eq(UserCollect::getIsDelete, 0).one(); |
| | | if (null != one) { |
| | | recoveryServe.setIsCollect(Boolean.TRUE); |
| | | } else { |
| | | recoveryServe.setIsCollect(Boolean.FALSE); |
| | | } |
| | | // 获取服务分类 |
| | | Integer classifyId = recoveryServe.getClassifyId(); |
| | | RecoveryClassify classify = recoveryClassifyService.lambdaQuery() |
| | | .eq(RecoveryClassify::getId, classifyId) |
| | | .eq(RecoveryClassify::getIsDelete, 0).one(); |
| | | if (classify.getSupClassify().equals(Constants.TRADE_IN)) { |
| | | recoveryServe.setType(Constants.ZERO); |
| | | } else { |
| | | recoveryServe.setType(Constants.ONE); |
| | | } |
| | | return R.ok(recoveryServe); |
| | | } |
| | | |
| | | /** |
| | | * 服务收藏 |
| | | */ |
| | | @GetMapping(value = "/serveCollect") |
| | | @ApiOperation(value = "服务收藏", tags = {"用户端-服务"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "服务id", name = "serveId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<String> serveCollect(@RequestParam Integer serveId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | UserCollect collect = collectService.lambdaQuery() |
| | | .eq(UserCollect::getUserId, loginUser.getUserid()) |
| | | .eq(UserCollect::getServeId, serveId) |
| | | .eq(UserCollect::getIsDelete, 0).one(); |
| | | boolean result; |
| | | if (null != collect) { |
| | | collect.setIsDelete(Constants.ONE); |
| | | result = collectService.updateById(collect); |
| | | } else { |
| | | collect = new UserCollect(loginUser.getUserid(), serveId); |
| | | result = collectService.save(collect); |
| | | } |
| | | |
| | | return result ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.user.service.RegionService; |
| | | 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.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/region") |
| | | @Api(value = "用户端-首页", tags = {"用户端-首页"}) |
| | | public class RegionController { |
| | | |
| | | @Resource |
| | | private RegionService regionService; |
| | | |
| | | /** |
| | | * 选择城市市区列表 |
| | | */ |
| | | @GetMapping("/urbanArea") |
| | | @ApiOperation(value = "选择城市市区列表", tags = {"用户端-首页"}) |
| | | public R<Object> urbanArea(String keyword) { |
| | | return R.ok(regionService.urbanArea(keyword)); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @GetMapping(value = "/collectList") |
| | | @ApiOperation(value = "服务收藏列表", tags = {"用户端-收藏"}) |
| | | public R<List<UserCollectVO>> collectList() { |
| | | public R<IPage<UserCollectVO>> collectList(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | List<UserCollectVO> collectList = userCollectService.collectList(loginUser.getUserid()); |
| | | IPage<UserCollectVO> collectList = userCollectService.collectList(loginUser.getUserid(), Page.of(pageNum, pageSize)); |
| | | return R.ok(collectList); |
| | | } |
| | | |
| | | /** |
| | | * 服务收藏列表 |
| | | */ |
| | | @GetMapping(value = "/detailHaveCollect") |
| | | @ApiOperation(value = "服务详情取消/添加收藏", tags = {"用户端-收藏"}) |
| | | public R<IPage<UserCollectVO>> collectList(@RequestParam Integer serveId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // IPage<UserCollectVO> collectList = userCollectService.collectList(loginUser.getUserid()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | /** |
| | | * 解密用户敏感数据 |
| | | * |
| | | * @param encryptedData 明文,加密数据 |
| | | * @param iv 加密算法的初始向量 |
| | | * @param code 用户允许登录后,回调内容会带上 code(有效期五分钟),开发者需要将 code 发送到开发者服务器后台,使用code 换取 session_key api,将 code 换成 openid 和 session_key |
| | | * @return 登录信息 |
| | | */ |
| | | @ApiOperation("微信授权一键登录") |
| | | @GetMapping("/wxAuthorize") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "用户允许登录后回调内容code", name = "code", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "明文,加密数据", name = "encryptedData", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "加密算法的初始向量", name = "iv", dataType = "String", required = true) |
| | | }) |
| | | public R<Map<String, Object>> decodeUserInfo(@RequestParam("code") String code, |
| | | @RequestParam("encryptedData") String encryptedData, |
| | | @RequestParam("iv") String iv) { |
| | | return R.ok(userService.decodeUserInfo(code, encryptedData, iv)); |
| | | } |
| | | |
| | | /** |
| | | * 用户端-获取微信openId |
| | | * |
| | | * @param code 随机code |
| | | */ |
| | | @ApiOperation(value = "获取微信openId", tags = {"用户端-登录"}) |
| | | @PostMapping(value = "/decodeOpenid") |
| | | public R<String> decodeOpenid(HttpServletResponse response, @RequestParam String code) { |
| | | public R<String> decodeOpenid(HttpServletResponse response, String code) { |
| | | return userService.decodeOpenid(response, code); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(value = "0:用户注册协议、1:用户隐私协议", name = "type", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Agreement> recoverySearch(@RequestParam Integer type) { |
| | | if (!Constants.ZERO.equals(type) || !Constants.ONE.equals(type)) { |
| | | if (!Constants.ZERO.equals(type) && !Constants.ONE.equals(type)) { |
| | | throw new GlobalException("获取类型异常!"); |
| | | } |
| | | return R.ok(adminClient.dataInfo(type).getData()); |
| | |
| | | @ApiOperation(value = "轮播图列表", tags = {"用户端-首页"}) |
| | | @GetMapping(value = "/banner") |
| | | public R<List<Rotate>> banner() { |
| | | return R.ok(adminClient.bannerList().getData()); |
| | | List<Rotate> data = adminClient.bannerList().getData(); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping(value = "/notice") |
| | | public R<List<Notices>> notice() { |
| | | return R.ok(adminClient.noticesList().getData()); |
| | | } |
| | | |
| | | /** |
| | | * 用户端-通知公告详情 |
| | | */ |
| | | @ApiOperation(value = "通知公告详情", tags = {"用户端-首页"}) |
| | | @GetMapping(value = "/noticeDetail") |
| | | public R<Notices> notice(@RequestParam Integer id) { |
| | | return R.ok(adminClient.noticesDetail(id).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | .eq(RecoveryServe::getIsDelete, 0) |
| | | .orderByAsc(RecoveryServe::getSort); |
| | | wrapper = StringUtils.isNotBlank(keyword) ? wrapper.like(RecoveryServe::getServeName, keyword) : wrapper; |
| | | List<RecoveryServe> serveList = wrapper.list(); |
| | | for (RecoveryServe recoveryServe : serveList) { |
| | | RecoveryClassify classify = recoveryClassifyService.lambdaQuery() |
| | | .eq(RecoveryClassify::getId, recoveryServe.getClassifyId()) |
| | | .eq(RecoveryClassify::getIsDelete, 0).one(); |
| | | if (Constants.RECOVERY.equals(classify.getSupClassify())) { |
| | | recoveryServe.setType(Constants.ONE); |
| | | } else { |
| | | recoveryServe.setType(Constants.ZERO); |
| | | } |
| | | } |
| | | return R.ok(wrapper.list()); |
| | | } |
| | | |
| | |
| | | .eq(User::getIsDelete, 0).one()); |
| | | } |
| | | |
| | | /** |
| | | * 用户端-修改头像&昵称 |
| | | */ |
| | | @ApiOperation(value = "修改头像&昵称", tags = {"用户端-个人中心"}) |
| | | @GetMapping(value = "/updateInfo") |
| | | public R<Boolean> updateInfo(@RequestParam String picture, @RequestParam String nickname) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(userService.lambdaUpdate().eq(User::getId, loginUser.getUserid()) |
| | | .set(User::getProfilePicture, picture) |
| | | .set(User::getNickname, nickname).update()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.security.service.TokenService; |
| | |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * 用户端首页回收分类推荐 |
| | | * 收货地址列表 |
| | | */ |
| | | @GetMapping(value = "/list") |
| | | @ApiOperation(value = "收货地址列表", tags = {"用户端-收货地址管理"}) |
| | |
| | | .eq(UserRecipient::getIsDelete, Constants.ZERO) |
| | | .orderByDesc(UserRecipient::getIsDefault) |
| | | .orderByDesc(UserRecipient::getCreateTime).list()); |
| | | } |
| | | |
| | | /** |
| | | * 收货地址列表 |
| | | */ |
| | | @GetMapping(value = "/page") |
| | | @ApiOperation(value = "收货地址分页列表", tags = {"用户端-收货地址管理"}) |
| | | public R<IPage<UserRecipient>> page(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(recipientService.lambdaQuery().eq(UserRecipient::getUserId, loginUser.getUserid()) |
| | | .eq(UserRecipient::getIsDelete, Constants.ZERO) |
| | | .orderByDesc(UserRecipient::getIsDefault) |
| | | .orderByDesc(UserRecipient::getCreateTime).page(Page.of(pageNum, pageSize))); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设置默认收货地址 |
| | | * |
| | | * @param id 收货地址id |
| | | */ |
| | | @ApiOperation(value = "设置默认收货地址", tags = {"用户端-收货地址管理"}) |
| | | @PostMapping(value = "/defaultAddress") |
| | | public R<String> defaultAddress(@RequestParam Integer id) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // 修改所有收货地址 |
| | | boolean update = recipientService.lambdaUpdate() |
| | | .set(UserRecipient::getIsDefault, Constants.ZERO) |
| | | .eq(UserRecipient::getUserId, loginUser.getUserid()) |
| | | .eq(UserRecipient::getIsDelete, Constants.ZERO).update(); |
| | | update = update && recipientService.lambdaUpdate() |
| | | .eq(UserRecipient::getId, id) |
| | | .set(UserRecipient::getIsDefault, Constants.ONE).update(); |
| | | return update ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 修改收货地址 |
| | | * |
| | | * @param userRecipient 收货地址信息 |
| | |
| | | package com.ruoyi.user.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.Withdraw; |
| | | import com.ruoyi.order.api.entity.WithdrawDetailVO; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.Withdraw; |
| | | import com.ruoyi.user.service.WithdrawService; |
| | | import com.ruoyi.user.vo.WithdrawListVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private WithdrawService withdrawService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private WithdrawClient withdrawClient; |
| | | |
| | | @GetMapping("/withdrawList") |
| | | @ApiOperation(value = "提现列表", tags = {"用户端-个人中心-提现"}) |
| | | public R<WithdrawListVO> withdrawList() { |
| | | public R<WithdrawListVO> withdrawList(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(withdrawService.withdrawList(loginUser.getUserid())); |
| | | return R.ok(withdrawService.withdrawList(loginUser.getUserid(), pageNum, pageSize)); |
| | | } |
| | | |
| | | @GetMapping("/withdrawDetail") |
| | | @ApiOperation(value = "提现详情", tags = {"用户端-个人中心-提现"}) |
| | | public R<WithdrawListVO> withdrawDetail() { |
| | | public R<WithdrawDetailVO> withdrawDetail(@RequestParam String orderId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(withdrawService.withdrawList(loginUser.getUserid())); |
| | | return withdrawClient.withdrawDetailByUser(orderId); |
| | | } |
| | | |
| | | @GetMapping("/confirmWithdraw") |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true) |
| | | }) |
| | | public R<Boolean> confirmWithdraw(@RequestParam Integer orderId) { |
| | | public R<Boolean> confirmWithdraw(@RequestParam String orderId) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | |
| | | |
| | | @GetMapping("/withdrawRecord") |
| | | @ApiOperation(value = "提现记录", tags = {"用户端-个人中心-提现"}) |
| | | public R<List<Withdraw>> withdrawRecord() { |
| | | public R<Page<Withdraw>> withdrawRecord(@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginUser = tokenService.getLoginUserByUser(); |
| | | if (null == loginUser) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(withdrawService.lambdaQuery().eq(Withdraw::getUserId, loginUser.getUserid()) |
| | | .eq(Withdraw::getIsDelete, 0).orderByDesc(Withdraw::getCreateTime).list()); |
| | | Page<Withdraw> data = withdrawClient.withdrawRecordList(loginUser.getUserid(), pageNum, pageSize).getData(); |
| | | BigDecimal b = BigDecimal.ZERO; |
| | | if (null != data) { |
| | | for (Withdraw record : data.getRecords()) { |
| | | b = b.add(record.getApplyForMoney()); |
| | | } |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModel(value = "RecoveryClassify对象", description = "回收分类表") |
| | | public class RecoveryClassify extends BaseEntity { |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("上级分类名称") |
| | |
| | | @TableField("is_recommend") |
| | | private Integer isRecommend; |
| | | |
| | | @ApiModelProperty("服务类型(0:以旧换新,1:家电回收)") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | public Integer getType() { |
| | | return supClassify.equals(Constants.TRADE_IN) ? Constants.ZERO : Constants.ONE; |
| | | } |
| | | } |
| | |
| | | @ApiModel(value = "RecoveryServe对象", description = "回收服务列表") |
| | | public class RecoveryServe extends BaseEntity { |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("所属分类id") |
| | |
| | | |
| | | @ApiModelProperty("预估价格") |
| | | @TableField("estimate_price") |
| | | private BigDecimal estimatePrice; |
| | | private String estimatePrice; |
| | | |
| | | @ApiModelProperty("默认回收价") |
| | | @TableField("default_price") |
| | |
| | | @TableField("rotate") |
| | | private String rotate; |
| | | |
| | | @ApiModelProperty("是否收藏") |
| | | @TableField(exist = false) |
| | | private Boolean isCollect; |
| | | |
| | | @ApiModelProperty("服务类型(0:以旧换新,1:家电回收)") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.user.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 com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收服务对应回收价格及所在城市 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-10 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sys_recovery_serve_price") |
| | | @ApiModel(value = "RecoveryServePrice对象", description = "回收服务对应回收价格及所在城市") |
| | | public class RecoveryServePrice extends BaseEntity { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("回收服务id") |
| | | @TableField("recovery_serve_id") |
| | | private Integer recoveryServeId; |
| | | |
| | | @ApiModelProperty("回收价格") |
| | | @TableField("recovery_price") |
| | | private BigDecimal recoveryPrice; |
| | | |
| | | @ApiModelProperty("对应城市") |
| | | @TableField("city") |
| | | private String city; |
| | | |
| | | } |
| | |
| | | @ApiModel(value = "ServeRecord对象", description = "师傅服务记录") |
| | | public class ServeRecord extends BaseEntity { |
| | | |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("现场照片(多张照片 ','隔开)") |
| | | @TableField("photo") |
| | |
| | | @TableField("recipientPhone") |
| | | private String recipientPhone; |
| | | |
| | | @ApiModelProperty("地图搜索名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("地址") |
| | | @TableField("address") |
| | | private String address; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.user.entity.Evaluate; |
| | | import com.ruoyi.user.vo.OrderEvaluateVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Mapper |
| | | public interface EvaluateMapper extends BaseMapper<Evaluate> { |
| | | |
| | | /** |
| | | * 订单与评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 列表数据 |
| | | */ |
| | | List<OrderEvaluateVO> orderEvaluate(Integer userId); |
| | | } |
New file |
| | |
| | | package com.ruoyi.user.mapper; |
| | | |
| | | import com.ruoyi.user.entity.RecoveryServePrice; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收服务对应回收价格及所在城市 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-10 |
| | | */ |
| | | @Mapper |
| | | public interface RecoveryServePriceMapper extends BaseMapper<RecoveryServePrice> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.user.entity.UserCollect; |
| | | import com.ruoyi.user.vo.UserCollectVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 服务收藏列表 |
| | | * |
| | | * @param userid 用户id |
| | | * @param page 分页 |
| | | * @return 服务列表 |
| | | */ |
| | | List<UserCollectVO> collectList(Integer userid); |
| | | IPage<UserCollectVO> collectList(@Param("userid") Integer userid, Page<UserCollectVO> page); |
| | | } |
| | |
| | | private String city; |
| | | |
| | | @ApiModelProperty("微信openId") |
| | | @NotBlank(message = "请先获取微信授权!", groups = PhoneCodeLogin.class) |
| | | // @NotBlank(message = "微信授权异常,无法获取授权信息!") |
| | | private String openId; |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author HJL |
| | |
| | | public class OrderEvaluateRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @NotNull(message = "请选择评价订单") |
| | | private Integer orderId; |
| | | @NotNull(message = "请选择评价订单!") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价星级") |
| | | @NotNull(message = "请选择评价星级") |
| | | private BigDecimal starRating; |
| | | @NotNull(message = "请选择评价星级!") |
| | | private Double starRating; |
| | | |
| | | @ApiModelProperty("服务单号") |
| | | private String serveNo; |
| | |
| | | @ApiModelProperty("预约地址(收货地址id)") |
| | | private Integer addressId; |
| | | |
| | | @ApiModelProperty("手填预约地址") |
| | | private String fillAddress; |
| | | |
| | | @ApiModelProperty("上门时间") |
| | | private String time; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.user.entity.Evaluate; |
| | | import com.ruoyi.user.vo.OrderEvaluateVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface EvaluateService extends IService<Evaluate> { |
| | | |
| | | /** |
| | | * 订单与评价列表 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 列表数据 |
| | | */ |
| | | List<OrderEvaluateVO> orderEvaluate(Integer userId); |
| | | } |
| | |
| | | * @return 下单结果 |
| | | */ |
| | | Boolean placeOrder(OrderRequest orderRequest, Integer userId); |
| | | |
| | | /** |
| | | * 用户下单 |
| | | * |
| | | * @param orderRequest 下单信息 |
| | | * @param userid 用户id |
| | | * @return 下单结果 |
| | | */ |
| | | String orderEstimate(OrderRequest orderRequest, Integer userid); |
| | | } |
New file |
| | |
| | | package com.ruoyi.user.service; |
| | | |
| | | import com.ruoyi.user.entity.RecoveryServePrice; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收服务对应回收价格及所在城市 服务类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-10 |
| | | */ |
| | | public interface RecoveryServePriceService extends IService<RecoveryServePrice> { |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface RegionService extends IService<Region> { |
| | | |
| | | /** |
| | | * 选择城市市区列表 |
| | | * |
| | | * @param keyword 搜索关键字 |
| | | * @return 市区列表 |
| | | */ |
| | | Object urbanArea(String keyword); |
| | | } |
| | |
| | | package com.ruoyi.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.user.entity.UserCollect; |
| | | import com.ruoyi.user.vo.UserCollectVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * 服务收藏列表 |
| | | * |
| | | * @param userid 用户id |
| | | * @param page 分页 |
| | | * @return 服务列表 |
| | | */ |
| | | List<UserCollectVO> collectList(Integer userid); |
| | | IPage<UserCollectVO> collectList(Integer userid, Page<UserCollectVO> page); |
| | | } |
| | |
| | | import com.ruoyi.user.entity.User; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return openId |
| | | */ |
| | | R<String> decodeOpenid(HttpServletResponse response, String code); |
| | | |
| | | /** |
| | | * 解密用户敏感数据 |
| | | * |
| | | * @param encryptedData 明文,加密数据 |
| | | * @param iv 加密算法的初始向量 |
| | | * @param code 用户允许登录后,回调内容会带上 code(有效期五分钟),开发者需要将 code 发送到开发者服务器后台,使用code 换取 session_key api,将 code 换成 openid 和 session_key |
| | | * @return 登录信息 |
| | | */ |
| | | Map<String, Object> decodeUserInfo(String encryptedData, String iv, String code); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.user.entity.Withdraw; |
| | | import com.ruoyi.user.vo.WithdrawListVO; |
| | | |
| | | /** |
| | |
| | | * @author hjl |
| | | * @since 2024-06-07 |
| | | */ |
| | | public interface WithdrawService extends IService<Withdraw> { |
| | | public interface WithdrawService { |
| | | |
| | | /** |
| | | * 提现列表 |
| | | * |
| | | * @param userid 用户id |
| | | * @param userid 用户id |
| | | * @param pageNum 页码 |
| | | * @param pageSize 条数 |
| | | * @return 提现列表 |
| | | */ |
| | | WithdrawListVO withdrawList(Integer userid); |
| | | WithdrawListVO withdrawList(Integer userid, Integer pageNum, Integer pageSize); |
| | | |
| | | /** |
| | | * 确认提现 |
| | |
| | | * @param orderId 订单id |
| | | * @return 操作结果 |
| | | */ |
| | | Boolean confirmWithdraw(Integer orderId, Integer userid); |
| | | Boolean confirmWithdraw(String orderId, Integer userid); |
| | | } |
| | |
| | | import com.ruoyi.user.entity.Evaluate; |
| | | import com.ruoyi.user.mapper.EvaluateMapper; |
| | | import com.ruoyi.user.service.EvaluateService; |
| | | import com.ruoyi.user.vo.OrderEvaluateVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class EvaluateServiceImpl extends ServiceImpl<EvaluateMapper, Evaluate> implements EvaluateService { |
| | | |
| | | @Override |
| | | public List<OrderEvaluateVO> orderEvaluate(Integer userId) { |
| | | return baseMapper.orderEvaluate(userId); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.api.entity.Prize; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.order.api.entity.UserOrderRequest; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.user.entity.Order; |
| | | import com.ruoyi.user.entity.RecoveryServe; |
| | | import com.ruoyi.user.entity.UserRecipient; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.stream.Collectors; |
| | |
| | | private UserRecipientService userRecipientService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | /** |
| | | * 雪花算法类 |
| | | */ |
| | | private static final SnowflakeIdWorker SNOW_FLAKE_ID_WORKER = new SnowflakeIdWorker(5, 5); |
| | | |
| | | @Override |
| | | public Object obtainAllowance(List<Prize> prizeList) { |
| | |
| | | |
| | | @Override |
| | | public Boolean placeOrder(OrderRequest orderRequest, Integer userId) { |
| | | String orderNumber = orderRequest.getOrderNumber(); |
| | | Integer serveId = orderRequest.getServeId(); |
| | | String reservationName = orderRequest.getReservationName(); |
| | | String reservationPhone = orderRequest.getReservationPhone(); |
| | | Integer addressId = orderRequest.getAddressId(); |
| | | String time = orderRequest.getTime(); |
| | | String reservationRemark = orderRequest.getReservationRemark(); |
| | | Double longitude = orderRequest.getLongitude(); |
| | | Double latitude = orderRequest.getLatitude(); |
| | | BigDecimal subsidy = orderRequest.getSubsidy(); |
| | | // 下单相关信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | |
| | | if (null == recoveryServe || null == userRecipient) { |
| | | throw new GlobalException("下单失败,预约服务信息或收货地址信息异常!"); |
| | | } |
| | | // 订单信息 |
| | | Order order = new Order(); |
| | | order.setOrderNumber(orderNumber); |
| | | order.setServeId(serveId); |
| | | order.setServeName(recoveryServe.getServeName()); |
| | | order.setServePrice(recoveryServe.getDefaultPrice()); |
| | | order.setUserId(userId); |
| | | order.setReservationName(reservationName); |
| | | order.setReservationPhone(reservationPhone); |
| | | order.setReservationAddress(userRecipient.getAddress()); |
| | | order.setTime(time); |
| | | order.setReservationRemark(reservationRemark); |
| | | order.setOrderMoney(recoveryServe.getDefaultPrice().add(new BigDecimal(String.valueOf(subsidy)))); |
| | | order.setState(Constants.ZERO); |
| | | order.setType(Constants.ZERO); |
| | | order.setLongitude(longitude); |
| | | order.setLatitude(latitude); |
| | | order.setIsWithdrawal(Constants.ZERO); |
| | | order.setSubsidy(subsidy); |
| | | order.setAddress(userRecipient.getAddressDetail()); |
| | | return this.save(order); |
| | | UserOrderRequest userOrderRequest = new UserOrderRequest(); |
| | | userOrderRequest.setOrderNumber(orderRequest.getOrderNumber()); |
| | | userOrderRequest.setServeId(orderRequest.getServeId()); |
| | | userOrderRequest.setReservationName(orderRequest.getReservationName()); |
| | | userOrderRequest.setReservationPhone(orderRequest.getReservationPhone()); |
| | | userOrderRequest.setAddressId(orderRequest.getAddressId()); |
| | | userOrderRequest.setTime(orderRequest.getTime()); |
| | | userOrderRequest.setReservationRemark(orderRequest.getReservationRemark()); |
| | | userOrderRequest.setLongitude(orderRequest.getLongitude()); |
| | | userOrderRequest.setLatitude(orderRequest.getLatitude()); |
| | | userOrderRequest.setSubsidy(orderRequest.getSubsidy()); |
| | | userOrderRequest.setDefaultPrice(recoveryServe.getDefaultPrice()); |
| | | userOrderRequest.setServeName(recoveryServe.getServeName()); |
| | | userOrderRequest.setAddress(userRecipient.getAddress()); |
| | | userOrderRequest.setAddressDetail(userRecipient.getAddressDetail()); |
| | | userOrderRequest.setUserId(userId); |
| | | return orderClient.placeOrder(userOrderRequest).getData(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String orderEstimate(OrderRequest orderRequest, Integer userid) { |
| | | Integer serveId = orderRequest.getServeId(); |
| | | orderRequest.setOrderNumber(String.valueOf(SNOW_FLAKE_ID_WORKER.nextId())); |
| | | Integer addressId = orderRequest.getAddressId(); |
| | | // 下单相关信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | |
| | | if (null == recoveryServe) { |
| | | throw new GlobalException("下单失败,预约服务信息或收货地址信息异常!"); |
| | | } |
| | | UserOrderRequest userOrderRequest = new UserOrderRequest(); |
| | | if (null != orderRequest.getAddressId()) { |
| | | UserRecipient userRecipient = userRecipientService.lambdaQuery().eq(UserRecipient::getId, addressId) |
| | | .eq(UserRecipient::getIsDelete, 0).one(); |
| | | userOrderRequest.setAddress(userRecipient.getAddress()); |
| | | userOrderRequest.setAddressDetail(userRecipient.getAddressDetail()); |
| | | } else { |
| | | userOrderRequest.setAddressDetail(orderRequest.getFillAddress()); |
| | | } |
| | | userOrderRequest.setOrderNumber(orderRequest.getOrderNumber()); |
| | | userOrderRequest.setServeId(orderRequest.getServeId()); |
| | | userOrderRequest.setReservationName(orderRequest.getReservationName()); |
| | | userOrderRequest.setReservationPhone(orderRequest.getReservationPhone()); |
| | | userOrderRequest.setAddressId(orderRequest.getAddressId()); |
| | | userOrderRequest.setTime(orderRequest.getTime()); |
| | | userOrderRequest.setReservationRemark(orderRequest.getReservationRemark()); |
| | | userOrderRequest.setLongitude(orderRequest.getLongitude()); |
| | | userOrderRequest.setLatitude(orderRequest.getLatitude()); |
| | | userOrderRequest.setSubsidy(orderRequest.getSubsidy()); |
| | | userOrderRequest.setDefaultPrice(recoveryServe.getDefaultPrice()); |
| | | userOrderRequest.setServeName(recoveryServe.getServeName()); |
| | | userOrderRequest.setUserId(userid); |
| | | return orderClient.orderEstimate(userOrderRequest).getData(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.user.service.impl; |
| | | |
| | | import com.ruoyi.user.entity.RecoveryServePrice; |
| | | import com.ruoyi.user.mapper.RecoveryServePriceMapper; |
| | | import com.ruoyi.user.service.RecoveryServePriceService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 回收服务对应回收价格及所在城市 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-10 |
| | | */ |
| | | @Service |
| | | public class RecoveryServePriceServiceImpl extends ServiceImpl<RecoveryServePriceMapper, RecoveryServePrice> implements RecoveryServePriceService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.user.entity.Region; |
| | | import com.ruoyi.user.mapper.RegionMapper; |
| | | import com.ruoyi.user.service.RegionService; |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.Collator; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService { |
| | | |
| | | @Override |
| | | public Object urbanArea(String keyword) { |
| | | LambdaQueryChainWrapper<Region> wrapper = this.lambdaQuery() |
| | | .ne(Region::getParentId, Constants.ZERO); |
| | | if (StringUtils.isNotBlank(keyword)) { |
| | | wrapper.like(Region::getName, keyword); |
| | | } |
| | | // 获取所有市区信息 |
| | | List<Region> reginList = wrapper.orderByAsc(Region::getId).list(); |
| | | List<String> data = reginList.stream().map(Region::getName).collect(Collectors.toList()); |
| | | Map<String, Object> px = px(data); |
| | | return px; |
| | | // 根据市区首字母分组排序 |
| | | // data.sort(new Comparator<String>() { |
| | | // final Collator collator = Collator.getInstance(Locale.CHINA); |
| | | // |
| | | // @Override |
| | | // public int compare(String o1, String o2) { |
| | | // CollationKey key1 = collator.getCollationKey(o1); |
| | | // CollationKey key2 = collator.getCollationKey(o2); |
| | | // return key1.compareTo(key2); |
| | | // } |
| | | // }); |
| | | // return reginList; |
| | | } |
| | | |
| | | /** |
| | | * 获取汉字串拼音,英文字符不变 |
| | | * |
| | | * @param chinese 汉字串 |
| | | * @return 汉语拼音 |
| | | */ |
| | | public String getFullSpell(String chinese) { |
| | | StringBuilder pybf = new StringBuilder(); |
| | | char[] arr = chinese.toCharArray(); |
| | | HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); |
| | | defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE); |
| | | defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); |
| | | for (int i = 0; i < arr.length; i++) { |
| | | if (arr[i] > 128) { |
| | | try { |
| | | pybf.append(PinyinHelper.toHanyuPinyinStringArray(arr[i], defaultFormat)[0]); |
| | | } catch (BadHanyuPinyinOutputFormatCombination e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } else { |
| | | pybf.append(arr[i]); |
| | | } |
| | | } |
| | | return pybf.toString(); |
| | | } |
| | | |
| | | public Map<String, Object> px(List<String> list) { |
| | | Comparator<Object> com = Collator.getInstance(java.util.Locale.CHINA); |
| | | // 按字母排序 |
| | | Collections.sort(list, com); |
| | | //输出26个字母 |
| | | Map<String, Object> map = new TreeMap<>(); |
| | | for (int i = 1; i <= 26; i++) { |
| | | //循环找出 首字母一样的数据 |
| | | String word = String.valueOf((char) (96 + i)).toUpperCase(); |
| | | List<String> letter = new ArrayList<>(); |
| | | for (String str : list) { |
| | | // System.out.println("首字母"+zm); |
| | | String zm = getFullSpell(str).substring(0, 1); |
| | | if (word.equals(zm)) { |
| | | letter.add(str); |
| | | } |
| | | map.put(word, letter); |
| | | } |
| | | //System.out.println(JsoN.to]soNString(map)); |
| | | } |
| | | return map; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.user.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.user.entity.UserCollect; |
| | | import com.ruoyi.user.mapper.UserCollectMapper; |
| | | import com.ruoyi.user.service.UserCollectService; |
| | | import com.ruoyi.user.vo.UserCollectVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class UserCollectServiceImpl extends ServiceImpl<UserCollectMapper, UserCollect> implements UserCollectService { |
| | | |
| | | @Override |
| | | public List<UserCollectVO> collectList(Integer userid) { |
| | | return baseMapper.collectList(userid); |
| | | public IPage<UserCollectVO> collectList(Integer userid, Page<UserCollectVO> page) { |
| | | return baseMapper.collectList(userid, page); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.user.service.impl; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | 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; |
| | | 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.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.user.entity.User; |
| | | import com.ruoyi.user.mapper.UserMapper; |
| | | import com.ruoyi.user.service.UserService; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService { |
| | | |
| | | @Value("wx.appId") |
| | | @Resource |
| | | private WxMaUserService wxMaUserService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private WxMaService wxMaService; |
| | | |
| | | @Value("${wx.appId}") |
| | | private String appId; |
| | | |
| | | @Value("wx.appSecret") |
| | | @Value("${wx.appSecret}") |
| | | private String appSecret; |
| | | |
| | | private final String BASE_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code"; |
| | | |
| | | @Override |
| | | public R<String> decodeOpenid(HttpServletResponse response, String code) { |
| | |
| | | JSONObject json = JSONObject.parseObject(res); |
| | | //获取openid |
| | | String openid = json.getString("openid"); |
| | | return R.ok(openid); |
| | | return R.ok(openid, ""); |
| | | } catch (Exception e) { |
| | | return R.fail("openId生成失败!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public HashMap<String, Object> decodeUserInfo(String code, String encryptedData, String ivStr) { |
| | | WxMaJscode2SessionResult session = null; |
| | | WxMaPhoneNumberInfo phoneNoInfo = null; |
| | | //获取session |
| | | try { |
| | | session = wxMaService.getUserService().getSessionInfo(code); |
| | | String sessionKey = session.getSessionKey(); |
| | | phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(sessionKey, encryptedData, ivStr); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (session != null && StringUtils.isNotBlank(session.getOpenid())) { |
| | | String openid = session.getOpenid(); |
| | | // String sessionKey = session.getSessionKey(); |
| | | // 加密明文及初始向量转义 |
| | | // encryptedData = URLEncoder.encode(encryptedData, "UTF-8").replace("%3D", "=").replace("%2F", "/"); |
| | | // ivStr = URLEncoder.encode(ivStr, "UTF-8").replace("%3D", "=").replace("%2F", "/"); |
| | | // // 获取用户信息 |
| | | // String result = WxAesUtils.decryptData(WxAesUtils.getUrlDecoderString(encryptedData), |
| | | // sessionKey, |
| | | // WxAesUtils.getUrlDecoderString(ivStr)); |
| | | // JSONObject userJson = JSONObject.parseObject(result); |
| | | // 封装项目用户信息 |
| | | if (null != phoneNoInfo) { |
| | | String phoneNumber = phoneNoInfo.getPhoneNumber(); |
| | | User user = this.lambdaQuery().eq(User::getPhone, phoneNumber) |
| | | .eq(User::getIsDelete, 0).one(); |
| | | if (null == user) { |
| | | user = new User(); |
| | | user.setUserNo(String.format(Constants.USER_NO_PRE, RandomUtil.randomNumbers(Constants.EIGHT))); |
| | | user.setPhone(phoneNumber); |
| | | user.setState(Constants.ONE); |
| | | user.setOpenId(openid); |
| | | user.setIsDelete(Constants.ZERO); |
| | | this.save(user); |
| | | } else { |
| | | Integer state = user.getState(); |
| | | if (state == 0) { |
| | | throw new GlobalException("该账号未开启,无法进行登录!"); |
| | | } |
| | | } |
| | | // 校验通过,生成token及过期时间 |
| | | LoginUserInfo loginUserInfo = new LoginUserInfo(); |
| | | loginUserInfo.setName(user.getPhone()); |
| | | loginUserInfo.setUserid(user.getId()); |
| | | loginUserInfo.setPhone(user.getPhone()); |
| | | loginUserInfo.setLoginTime(System.currentTimeMillis()); |
| | | HashMap<String, Object> map = new HashMap<>(8); |
| | | map.put("token", tokenService.createTokenByUser(loginUserInfo)); |
| | | return map; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | public JSONObject getPhone(String code) { |
| | | // 授权(必填) |
| | | String grantType = "client_credential"; |
| | | // 向微信服务器 使用登录凭证 code 获取 session_key 和 openid |
| | | // 请求参数 |
| | | String params2 = "appid=" + appId + "&secret=" + appSecret + "&grant_type=" + grantType; |
| | | // 发送请求 |
| | | String sr2 = com.ruoyi.user.vx.utils.HttpRequest.sendGet("https://api.weixin.qq.com/cgi-bin/token", params2); |
| | | // 解析相应内容(转换成json对象) |
| | | JSONObject json2 = JSONObject.parseObject(sr2); |
| | | String accessToken = json2.getString("access_token"); |
| | | //使用获取到的token和接受到的code像微信获取手机号 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", code); |
| | | String url = ("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + accessToken); |
| | | String sr3 = com.ruoyi.user.vx.utils.HttpRequest.sendPostNew(url, jsonObject); |
| | | JSONObject json = JSONObject.parseObject(sr3); |
| | | JSONObject phoneInfo = json.getJSONObject("phone_info"); |
| | | // return phoneInfo.getString("phoneNumber"); |
| | | return phoneInfo; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.user.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.admin.api.entity.WithdrawalSetting; |
| | | import com.ruoyi.admin.api.feignClient.AdminClient; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.constant.WechatConstants; |
| | | import com.ruoyi.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.SnowflakeIdWorker; |
| | | import com.ruoyi.user.entity.Order; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import com.ruoyi.order.api.feignClient.WithdrawClient; |
| | | import com.ruoyi.user.entity.RecoveryServe; |
| | | import com.ruoyi.user.entity.User; |
| | | import com.ruoyi.user.entity.Withdraw; |
| | | import com.ruoyi.user.mapper.WithdrawMapper; |
| | | import com.ruoyi.user.service.OrderService; |
| | | import com.ruoyi.user.service.RecoveryServeService; |
| | | import com.ruoyi.user.service.UserService; |
| | | import com.ruoyi.user.service.WithdrawService; |
| | | import com.ruoyi.user.vo.WithdrawListVO; |
| | | import com.ruoyi.user.vo.WithdrawMoneyVO; |
| | | import com.ruoyi.user.vo.WithdrawOrderVO; |
| | | import com.ruoyi.user.vx.HttpUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * @since 2024-06-07 |
| | | */ |
| | | @Service |
| | | public class WithdrawServiceImpl extends ServiceImpl<WithdrawMapper, Withdraw> implements WithdrawService { |
| | | public class WithdrawServiceImpl implements WithdrawService { |
| | | |
| | | /** |
| | | * 雪花算法类 |
| | | */ |
| | | private static final SnowflakeIdWorker SNOW_FLAKE_ID_WORKER = new SnowflakeIdWorker(5, 5); |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private AdminClient adminClient; |
| | | /** |
| | | * 小程序id |
| | | */ |
| | | @Value("wx.appid") |
| | | private String appId; |
| | | /** |
| | | * 转账名称 |
| | | */ |
| | | @Value("wx.batchName") |
| | | private String batchName; |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | @Value("wx.mchId") |
| | | private String mchId; |
| | | /** |
| | | * 支付证书序列号 |
| | | */ |
| | | @Value("wx.wechatPayserialNo") |
| | | private String wechatPayserialNo; |
| | | /** |
| | | * 转账备注 |
| | | */ |
| | | @Value("wx.transferRemark") |
| | | private String transferRemark; |
| | | private WithdrawClient withdrawClient; |
| | | |
| | | @Override |
| | | public WithdrawListVO withdrawList(Integer userid) { |
| | | public WithdrawListVO withdrawList(Integer userid, Integer pageNum, Integer pageSize) { |
| | | WithdrawListVO withdrawList = new WithdrawListVO(); |
| | | List<Order> orderList = orderService.lambdaQuery().eq(Order::getUserId, userid) |
| | | .eq(Order::getState, 3).eq(Order::getIsDelete, 0).list(); |
| | | Page<Order> orderList = withdrawClient.withdrawListByUser(userid, pageNum, pageSize).getData(); |
| | | // 总金额 |
| | | BigDecimal totalMoney = BigDecimal.ZERO; |
| | | // 未提现金额 |
| | | BigDecimal undelivered = BigDecimal.ZERO; |
| | | // 已提现金额 |
| | | BigDecimal withdrawn = BigDecimal.ZERO; |
| | | if (!orderList.isEmpty()) { |
| | | if (!orderList.getRecords().isEmpty()) { |
| | | // 总金额 |
| | | totalMoney = orderList.stream().map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | totalMoney = orderList.getRecords().stream().map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 未提现金额 |
| | | undelivered = orderList.stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())) |
| | | undelivered = orderList.getRecords().stream().filter(data -> Constants.ZERO.equals(data.getIsWithdrawal())) |
| | | .map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 已提现金额 |
| | | withdrawn = orderList.stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())) |
| | | withdrawn = orderList.getRecords().stream().filter(data -> Constants.ONE.equals(data.getIsWithdrawal())) |
| | | .map(Order::getOrderMoney).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | } |
| | | withdrawList.setMoneyCount(new WithdrawMoneyVO(totalMoney, undelivered, withdrawn)); |
| | | // 回收服务列表 |
| | | List<Integer> serveIds = orderList.stream().map(Order::getServeId).collect(Collectors.toList()); |
| | | List<Integer> serveIds = orderList.getRecords().stream().map(Order::getServeId).collect(Collectors.toList()); |
| | | LambdaQueryChainWrapper<RecoveryServe> wrapper = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getIsDelete, 0); |
| | | wrapper = serveIds.isEmpty() ? wrapper : wrapper.in(RecoveryServe::getId, serveIds); |
| | |
| | | Map<Integer, RecoveryServe> serveMap = serveList.stream().collect(Collectors.toMap(RecoveryServe::getId, serve -> serve)); |
| | | // 订单列表 |
| | | List<WithdrawOrderVO> list = new ArrayList<>(); |
| | | for (Order order : orderList) { |
| | | for (Order order : orderList.getRecords()) { |
| | | RecoveryServe recoveryServe = serveMap.get(order.getServeId()); |
| | | WithdrawOrderVO withdrawOrder = new WithdrawOrderVO(); |
| | | withdrawOrder.setOrderId(order.getId()); |
| | |
| | | withdrawOrder.setCover(recoveryServe.getCover()); |
| | | withdrawOrder.setCompleteTime(order.getCompleteTime()); |
| | | withdrawOrder.setIsWithdrawal(order.getIsWithdrawal()); |
| | | withdrawOrder.setMoney(order.getOrderMoney()); |
| | | list.add(withdrawOrder); |
| | | } |
| | | withdrawList.setWithdrawOrder(list); |
| | | Page<WithdrawOrderVO> page = new Page<>(); |
| | | page.setSize(orderList.getSize()); |
| | | page.setCurrent(orderList.getCurrent()); |
| | | page.setPages(orderList.getPages()); |
| | | page.setTotal(orderList.getTotal()); |
| | | page.setRecords(list); |
| | | withdrawList.setWithdrawOrder(page); |
| | | return withdrawList; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean confirmWithdraw(Integer orderId, Integer userid) { |
| | | public Boolean confirmWithdraw(String orderId, Integer userid) { |
| | | User user = userService.lambdaQuery().eq(User::getId, userid).eq(User::getIsDelete, 0).one(); |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | if (null == user) { |
| | | throw new GlobalException("提现失败,登录用户信息异常!"); |
| | | } |
| | | // 校验提现 |
| | | List<Withdraw> list = this.lambdaQuery().eq(Withdraw::getUserId, userid) |
| | | .eq(Withdraw::getOrderId, order).list(); |
| | | List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList()); |
| | | if (stateList.contains(Constants.ZERO)) { |
| | | throw new GlobalException("当前订单已提交提现申请,请等待审核!"); |
| | | } else if (stateList.contains(Constants.ONE)) { |
| | | throw new GlobalException("当前订单已提现通过!"); |
| | | } |
| | | // 系统审核设置 |
| | | WithdrawalSetting setting = adminClient.withdrawProcess().getData(); |
| | | Withdraw withdraw = new Withdraw(); |
| | | // 未开启全局 提现审核,则用户提现不需要后台审核 |
| | | if (Constants.ZERO.equals(setting.getEnableProcess())) { |
| | | // 已通过 |
| | | withdraw.setState(Constants.ONE); |
| | | // 商家微信打款至微信零钱 |
| | | boolean update = weChatPay(order.getOrderMoney(), user.getOpenId()); |
| | | if (!update) { |
| | | throw new GlobalException("交易提现失败,请检查是否绑定微信!"); |
| | | } |
| | | } else { |
| | | // 待审核 |
| | | withdraw.setState(Constants.ZERO); |
| | | } |
| | | withdraw.setUserId(user.getId()); |
| | | withdraw.setUserPhone(user.getPhone()); |
| | | withdraw.setApplyForTime(new Date()); |
| | | withdraw.setApplyForMoney(order.getOrderMoney()); |
| | | withdraw.setOrderId(orderId); |
| | | return this.save(withdraw); |
| | | } |
| | | |
| | | private boolean weChatPay(BigDecimal orderMoney, String openId) { |
| | | Map<String, Object> postMap = new HashMap<>(8); |
| | | // 小程序 id |
| | | postMap.put(WechatConstants.APP_ID, appId); |
| | | postMap.put(WechatConstants.OUT_BATCH_NO, String.valueOf(UUID.randomUUID()).replaceAll("-", "")); |
| | | // 该笔批量转账的名称 |
| | | postMap.put(WechatConstants.BATCH_NAME, batchName); |
| | | // 转账说明,UTF8编码,最多允许32个字符 |
| | | postMap.put(WechatConstants.BATCH_REMARK, batchName); |
| | | // 转账金额单位为“分”。 总金额 |
| | | postMap.put(WechatConstants.TOTAL_AMOUNT, orderMoney.multiply(new BigDecimal(Constants.ONE_HUNDRED))); |
| | | // 转账总笔数 |
| | | postMap.put(WechatConstants.TOTAL_NUM, Constants.ONE); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | Map<String, Object> subMap = new HashMap<>(4); |
| | | // 商家明细单号 该商家下唯一 |
| | | // subMap.put("out_detail_no", RandomUtil.randomString(32)) |
| | | subMap.put(WechatConstants.OUT_DETAIL_NO, SNOW_FLAKE_ID_WORKER.nextId()); |
| | | // 转账金额 |
| | | subMap.put(WechatConstants.TRANSFER_AMOUNT, orderMoney); |
| | | // 转账备注 |
| | | subMap.put(WechatConstants.TRANSFER_REMARK, transferRemark); |
| | | // 用户在直连商户应用下的用户标示 |
| | | subMap.put(WechatConstants.OPEN_ID, openId); |
| | | // 大金额需要传入真实姓名 |
| | | /*subMap.put("user_name", |
| | | RsaCryptoUtil.encryptOAEP(userName,WechatPayV3Util.getSaveCertificates(privatekeypath)))*/ |
| | | list.add(subMap); |
| | | postMap.put(WechatConstants.TRANSFER_DETAIL_LIST, list); |
| | | // 使用类加载器获取资源 URL |
| | | ClassPathResource classPathResource = new ClassPathResource("vx/apiclient_key.pem"); |
| | | /*// 获取 resources 目录下的文件路径,假设文件路径为 "resources/data/example.txt" |
| | | String filePath = "resources/data/vx/apiclient_key.pem"; |
| | | File file = new File(filePath); |
| | | // 输出文件的绝对路径 |
| | | String absolutePath = file.getAbsolutePath();*/ |
| | | String result = HttpUtil.postTransBatRequest( |
| | | WechatConstants.WE_CHAT_URL_PRE, |
| | | JSONObject.toJSONString(postMap), |
| | | // 支付证书序列号 |
| | | wechatPayserialNo, |
| | | // 商户号 |
| | | mchId, |
| | | classPathResource.getPath(), WechatConstants.WE_CHAT_URL_SUF); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | /* |
| | | * 成功示例 |
| | | * { |
| | | * "out_batch_no": "plfk2020042013", |
| | | * "batch_id": "1030000071100999991182020050700019480001", |
| | | * "create_time": "2015-05-20T13:29:35.120+08:00" |
| | | * } |
| | | */ |
| | | if (null == jsonObject || null != jsonObject.get(WechatConstants.CREATE_TIME)) { |
| | | //转账成功 |
| | | return Boolean.TRUE; |
| | | } else { |
| | | return Boolean.FALSE; |
| | | } |
| | | return withdrawClient.confirmWithdrawByUser(orderId, userid, user.getOpenId(), user.getPhone()).getData(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | package com.ruoyi.user.utils; |
| | | |
| | | import java.text.Collator; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Comparator; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | import com.ruoyi.user.entity.Region; |
| | | import ev.viewworld.model.sysuser; |
| | | import net.sourceforge.pinyin4j.PinyinHelper; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; |
| | | import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; |
| | | import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination; |
| | | public class changeChinesePinyinUtil { |
| | | */ |
| | | /** |
| | | * 获取姓名全拼和首字母 |
| | | * @author 于公成 |
| | | * @param chinese 汉语名称 |
| | | * @return fullPinyin : 全拼 simplePinyin : 首字母 groupPinyin:微信用户组第一个字母 |
| | | * @throws BadHanyuPinyinOutputFormatCombination |
| | | *//* |
| | | |
| | | public static Map<String, String> changeChinesePinyin(String chinese) throws BadHanyuPinyinOutputFormatCombination { |
| | | Map<String, String> pinyin = new HashMap<String, String>(); |
| | | |
| | | HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); |
| | | format.setCaseType(HanyuPinyinCaseType.LOWERCASE); |
| | | format.setToneType(HanyuPinyinToneType.WITHOUT_TONE); |
| | | format.setVCharType(HanyuPinyinVCharType.WITH_V); |
| | | |
| | | StringBuffer fullPinyin = new StringBuffer(); |
| | | StringBuffer simplePinyin = new StringBuffer(); |
| | | StringBuffer firstPinyin = new StringBuffer(); |
| | | |
| | | char[] chineseChar = chinese.toCharArray(); |
| | | for (int i = 0; i < chineseChar.length; i++) { |
| | | String[] str = null; |
| | | try { |
| | | str = PinyinHelper.toHanyuPinyinStringArray(chineseChar[i], |
| | | format); |
| | | } catch (BadHanyuPinyinOutputFormatCombination e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (str != null) { |
| | | fullPinyin = fullPinyin.append(str[0].toString()); |
| | | simplePinyin = simplePinyin.append(str[0].charAt(0)); |
| | | |
| | | } |
| | | if (str == null) { |
| | | String regex = "^[0-9]*[a-zA-Z]*+$"; |
| | | Pattern pattern = Pattern.compile(regex); |
| | | Matcher m = pattern.matcher(String.valueOf(chineseChar[i])); |
| | | if (m.find()) { |
| | | fullPinyin = fullPinyin.append(chineseChar[i]); |
| | | simplePinyin = simplePinyin.append(chineseChar[i]); |
| | | } |
| | | } |
| | | } |
| | | String[] name = PinyinHelper.toHanyuPinyinStringArray(chineseChar[0],format); |
| | | firstPinyin=firstPinyin.append(name[0].charAt(0)); |
| | | pinyin.put("fullPinyin", fullPinyin.toString()); |
| | | pinyin.put("simplePinyin", simplePinyin.toString().toUpperCase()); |
| | | pinyin.put("groupPinyin", firstPinyin.toString().toUpperCase()); |
| | | return pinyin; |
| | | } |
| | | */ |
| | | /** |
| | | * 按拼音首字母分组 |
| | | * @author 于公成 |
| | | * @param list |
| | | * @return |
| | | * @throws BadHanyuPinyinOutputFormatCombination |
| | | *//* |
| | | |
| | | public static Map<String, Object> getCodeGroup(List<String> list) throws BadHanyuPinyinOutputFormatCombination { |
| | | Comparator<Object> com = Collator.getInstance(java.util.Locale.CHINA); |
| | | //按字母排序 |
| | | Collections.sort(list, com); |
| | | //输出26个字母 |
| | | Map<String, Object> map = new TreeMap<String, Object>(); |
| | | for(int i=1;i<=26;i++){ |
| | | String word = String. valueOf((char) (96 + i)). toUpperCase(); |
| | | //循环找出首字母一样的数据 |
| | | List<String> letter = new ArrayList<String>(); |
| | | for (String str : list) { |
| | | String code=changeChinesePinyin(str).get("groupPinyin"); |
| | | if(word.equals(code)) { |
| | | letter.add(str); |
| | | } |
| | | System.out.println(str); |
| | | } |
| | | map.put(word, letter); |
| | | } |
| | | System.out.println(map); |
| | | return map; |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * @author 于公成 |
| | | * 按用户拼音首字母分组 |
| | | * @param list |
| | | * @return |
| | | * @throws BadHanyuPinyinOutputFormatCombination |
| | | *//* |
| | | |
| | | public static Map<String, List<Region>> getUserCodeGroup(List<Region> list) throws BadHanyuPinyinOutputFormatCombination { |
| | | //Collections工具类的sort()方法对list集合元素排序 |
| | | Collections.sort(list,new Comparator<Region>(){ |
| | | @Override |
| | | public int compare(sysuser o1, sysuser o2) { |
| | | //获取中文环境 |
| | | Comparator<Object> com = Collator.getInstance(java.util.Locale.CHINA); |
| | | return com.compare(o1.getRealname(),o2.getRealname()); |
| | | } |
| | | }); |
| | | |
| | | //输出26个字母 |
| | | Map<String, List<sysuser>> map = new TreeMap<String, List<sysuser>>(); |
| | | for(int i=1;i<=26;i++){ |
| | | String word = String. valueOf((char) (96 + i)). toUpperCase(); |
| | | //循环找出首字母一样的数据 |
| | | List<sysuser> letter = new ArrayList<sysuser>(); |
| | | for (sysuser str : list) { |
| | | |
| | | String code=changeChinesePinyin(str.getRealname()).get("groupPinyin"); |
| | | if(word.equals(code)) { |
| | | letter.add(str); |
| | | } |
| | | System.out.println(str); |
| | | } |
| | | map.put(word, letter); |
| | | } |
| | | System.out.println(map); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) throws BadHanyuPinyinOutputFormatCombination { |
| | | // System.out.println(changeChinesePinyin("于公成").get("groupPinyin")); |
| | | List<String> list=new ArrayList<String>(); |
| | | list.add("于公成"); |
| | | list.add("由于工程"); |
| | | list.add("与工程"); |
| | | list.add("王为"); |
| | | list.add("刘汝祥"); |
| | | list.add("阿宝"); |
| | | list.add("阿亮"); |
| | | getCodeGroup(list); |
| | | } |
| | | }*/ |
| | |
| | | package com.ruoyi.user.vo; |
| | | |
| | | import com.ruoyi.user.entity.Order; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class OrderDetailVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | |
| | | private Integer state; |
| | | |
| | | @ApiModelProperty("接单时间(师傅接单或后台派单,更新该字段时间)") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date acceptTime; |
| | | |
| | | @ApiModelProperty("师傅到达预约地点时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date arriveTime; |
| | | |
| | | @ApiModelProperty("订单完成时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm") |
| | | private Date completeTime; |
| | | |
| | | @ApiModelProperty("订单补贴金额") |
New file |
| | |
| | | package com.ruoyi.user.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author HJL |
| | | * @version 1.0 |
| | | * @since 2024-07-10 8:50 |
| | | */ |
| | | @Data |
| | | public class UserServeTypeVO { |
| | | |
| | | @ApiModelProperty("所属分类id") |
| | | private Integer classifyId; |
| | | |
| | | @ApiModelProperty("所属分类名称") |
| | | private String classifyName; |
| | | |
| | | @ApiModelProperty("分类图标") |
| | | private String classificationPicture; |
| | | |
| | | @ApiModelProperty("分类描述") |
| | | private String typeDescribe; |
| | | |
| | | @ApiModelProperty("服务类型(0:以旧换新;1:家电回收)") |
| | | private Integer type; |
| | | |
| | | public UserServeTypeVO(Integer classifyId, String classifyName, String classificationPicture, String typeDescribe, Integer type) { |
| | | this.classifyId = classifyId; |
| | | this.classifyName = classifyName; |
| | | this.classificationPicture = classificationPicture; |
| | | this.typeDescribe = typeDescribe; |
| | | this.type = type; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.user.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author HJL |
| | |
| | | private WithdrawMoneyVO moneyCount; |
| | | |
| | | @ApiModelProperty("提现订单列表") |
| | | private List<WithdrawOrderVO> withdrawOrder; |
| | | private Page<WithdrawOrderVO> withdrawOrder; |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | public class WithdrawOrderVO { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNumber; |
| | |
| | | @ApiModelProperty("是否已提现(0:未提现,1:已提现)") |
| | | private Integer isWithdrawal; |
| | | |
| | | @ApiModelProperty("订单金额") |
| | | private BigDecimal money; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.user.vx.utils; |
| | | |
| | | import cn.binarywang.wx.miniapp.api.WxMaService; |
| | | import cn.binarywang.wx.miniapp.api.WxMaUserService; |
| | | import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; |
| | | import cn.binarywang.wx.miniapp.api.impl.WxMaUserServiceImpl; |
| | | import cn.binarywang.wx.miniapp.config.WxMaConfig; |
| | | import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * 微信小程序授权登录 配置类 |
| | | * |
| | | * @author HJL |
| | | */ |
| | | @Configuration |
| | | public class AppConfig { |
| | | |
| | | |
| | | @Bean |
| | | public WxMaService wxMaService() { |
| | | WxMaService service = new WxMaServiceImpl(); |
| | | service.setWxMaConfig(memberWxMaConfig()); |
| | | return service; |
| | | } |
| | | |
| | | @Bean |
| | | public WxMaUserService wxMaUserService() { |
| | | WxMaService service = new WxMaServiceImpl(); |
| | | service.setWxMaConfig(memberWxMaConfig()); |
| | | return new WxMaUserServiceImpl(service); |
| | | } |
| | | |
| | | @Bean |
| | | public WxMaConfig memberWxMaConfig() { |
| | | WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); |
| | | config.setAppid("wx98563d0ec9cf21c8"); |
| | | config.setSecret("81787f8e9a3b920fa357be8e81ba61b1"); |
| | | return config; |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.user.vx.utils; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.io.PrintWriter; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author HJL |
| | | */ |
| | | public class HttpRequest { |
| | | |
| | | /** |
| | | * 向指定URL发送GET方法的请求 |
| | | * |
| | | * @param url 发送请求的URL |
| | | * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 |
| | | * @return URL 所代表远程资源的响应结果 |
| | | */ |
| | | public static String sendGet(String url, String param) { |
| | | StringBuilder result = new StringBuilder(); |
| | | BufferedReader in = null; |
| | | try { |
| | | String urlNameString; |
| | | if (null == param) { |
| | | urlNameString = url; |
| | | } else { |
| | | urlNameString = url + "?" + param; |
| | | } |
| | | URL realUrl = new URL(urlNameString); |
| | | // 打开和URL之间的连接 |
| | | URLConnection connection = realUrl.openConnection(); |
| | | // 设置通用的请求属性 |
| | | connection.setRequestProperty("accept", "*/*"); |
| | | connection.setRequestProperty("connection", "Keep-Alive"); |
| | | connection.setRequestProperty("user-agent", |
| | | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); |
| | | // 建立实际的连接 |
| | | connection.connect(); |
| | | // 获取所有响应头字段 |
| | | Map<String, List<String>> map = connection.getHeaderFields(); |
| | | // 遍历所有的响应头字段 |
| | | for (String key : map.keySet()) { |
| | | System.out.println(key + "--->" + map.get(key)); |
| | | } |
| | | // 定义 BufferedReader输入流来读取URL的响应 |
| | | in = new BufferedReader(new InputStreamReader( |
| | | connection.getInputStream())); |
| | | String line; |
| | | while ((line = in.readLine()) != null) { |
| | | result.append(line); |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("发送GET请求出现异常!" + e); |
| | | e.printStackTrace(); |
| | | } |
| | | // 使用finally块来关闭输入流 |
| | | finally { |
| | | try { |
| | | if (in != null) { |
| | | in.close(); |
| | | } |
| | | } catch (Exception e2) { |
| | | e2.printStackTrace(); |
| | | } |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 向指定 URL 发送POST方法的请求 |
| | | * |
| | | * @param url 发送请求的 URL |
| | | * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 |
| | | * @return 所代表远程资源的响应结果 |
| | | */ |
| | | public static String sendPost(String url, String param) { |
| | | PrintWriter out = null; |
| | | BufferedReader in = null; |
| | | StringBuilder result = new StringBuilder(); |
| | | try { |
| | | URL realUrl = new URL(url); |
| | | // 打开和URL之间的连接 |
| | | URLConnection conn = realUrl.openConnection(); |
| | | // 设置通用的请求属性 |
| | | conn.setRequestProperty("accept", "*/*"); |
| | | conn.setRequestProperty("connection", "Keep-Alive"); |
| | | conn.setRequestProperty("user-agent", |
| | | "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); |
| | | // 发送POST请求必须设置如下两行 |
| | | conn.setDoOutput(true); |
| | | conn.setDoInput(true); |
| | | // 获取URLConnection对象对应的输出流 |
| | | out = new PrintWriter(conn.getOutputStream()); |
| | | // 发送请求参数 |
| | | out.print(param); |
| | | // flush输出流的缓冲 |
| | | out.flush(); |
| | | // 定义BufferedReader输入流来读取URL的响应 |
| | | in = new BufferedReader( |
| | | new InputStreamReader(conn.getInputStream())); |
| | | String line; |
| | | while ((line = in.readLine()) != null) { |
| | | result.append(line); |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("发送 POST 请求出现异常!" + e); |
| | | e.printStackTrace(); |
| | | } |
| | | //使用finally块来关闭输出流、输入流 |
| | | finally { |
| | | try { |
| | | if (out != null) { |
| | | out.close(); |
| | | } |
| | | if (in != null) { |
| | | in.close(); |
| | | } |
| | | } catch (IOException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 向指定 URL 发送POST方法的请求 |
| | | * |
| | | * @param url 发送请求的 URL |
| | | * @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。 |
| | | * @return 所代表远程资源的响应结果 |
| | | */ |
| | | public static String sendPostNew(String url, JSONObject param) { |
| | | PrintWriter out = null; |
| | | BufferedReader in = null; |
| | | String result = ""; |
| | | try { |
| | | URL realUrl = new URL(url); |
| | | // 打开和URL之间的连接 |
| | | URLConnection conn = realUrl.openConnection(); |
| | | // 设置通用的请求属性 |
| | | conn.setRequestProperty("accept", "*/*"); |
| | | conn.setRequestProperty("connection", "Keep-Alive"); |
| | | conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); |
| | | // 发送POST请求必须设置如下两行 |
| | | conn.setDoOutput(true); |
| | | conn.setDoInput(true); |
| | | // 获取URLConnection对象对应的输出流 |
| | | out = new PrintWriter(conn.getOutputStream()); |
| | | // 发送请求参数 |
| | | out.print(param); |
| | | // flush输出流的缓冲 |
| | | out.flush(); |
| | | // 定义BufferedReader输入流来读取URL的响应 |
| | | in = new BufferedReader( |
| | | new InputStreamReader(conn.getInputStream())); |
| | | String line; |
| | | while ((line = in.readLine()) != null) { |
| | | result += line; |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("发送 POST 请求出现异常!" + e); |
| | | e.printStackTrace(); |
| | | } |
| | | //使用finally块来关闭输出流、输入流 |
| | | finally { |
| | | try { |
| | | if (out != null) { |
| | | out.close(); |
| | | } |
| | | if (in != null) { |
| | | in.close(); |
| | | } |
| | | } catch (IOException ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | /* |
| | | package com.ruoyi.user.vx.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpResult; |
| | | import okhttp3.OkHttpClient; |
| | | import okhttp3.Request; |
| | | import okhttp3.Response; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.*; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.io.*; |
| | | import java.net.URLDecoder; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Timer; |
| | | import java.util.TimerTask; |
| | | |
| | | */ |
| | | /** |
| | | * 微信工具类 |
| | | *//* |
| | | |
| | | @Component |
| | | public class WeChatUtil { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(WeChatUtil.class); |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private String wxAppletsAppid; |
| | | |
| | | @Value("${wx.appletsAppSecret}") |
| | | private String wxAppletsAppSecret; |
| | | |
| | | @Value("${wx.officialAccountAppid}") |
| | | private String officialAccountAppid; |
| | | |
| | | @Value("{wx.officialAccountAppSecret}") |
| | | private String officialAccountAppSecret; |
| | | |
| | | @Value("${wx.appid}") |
| | | private String webAppId; |
| | | |
| | | @Value("${wx.appSecret}") |
| | | private String webAppSecret; |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | // 获取微信用户access_token的接口地址 |
| | | private static final String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token"; |
| | | // 获取微信用户信息的接口地址 |
| | | private static final String USER_INFO_URL = "https://api.weixin.qq.com/sns/userinfo"; |
| | | { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | Thread.sleep(30000); |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | String wxAppletsAccessToken = getWxAppletsAccessToken(); |
| | | if(ToolUtil.isEmpty(wxAppletsAccessToken)){ |
| | | System.err.println("获取微信小程序access_token失败"); |
| | | } |
| | | redisUtil.setStrValue("wxAppletsAccessToken", wxAppletsAccessToken, 7000); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }, 0, 7000000); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 小程序使用jscode获取openid |
| | | * @param jscode |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String, Object> code2Session(String jscode) throws Exception{ |
| | | String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret |
| | | + "&js_code=" + jscode + "&grant_type=authorization_code"; |
| | | // String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid="+wxAppletsAppid+"&secret="+wxAppletsAppSecret+"&code="+jscode+"&grant_type=authorization_code"; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | if(null == httpResult || httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | int errcode = jsonObject.getIntValue("errcode"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | System.err.println("调用返回"+jsonObject); |
| | | System.err.println("响应结果"+httpResult); |
| | | if(errcode == 0){//成功 |
| | | Map<String, Object> userInfo = getUserInfo(jsonObject.getString("session_key"), jsonObject.getString("openid")); |
| | | System.err.println(userInfo); |
| | | // 用户名 |
| | | // String nickname = userInfo.get("nickname").toString(); |
| | | // // 用户头像 |
| | | // String headimgurl = userInfo.get("headimgurl").toString(); |
| | | // System.err.println("用户名:"+nickname); |
| | | // System.err.println("头像:"+headimgurl); |
| | | map.put("openid", jsonObject.getString("openid")); |
| | | map.put("sessionKey", jsonObject.getString("session_key")); |
| | | map.put("unionid", jsonObject.getString("unionid")); |
| | | String wxAppletsAccessToken = getWxAppletsAccessToken(); |
| | | System.err.println("看看accesstoken:"+wxAppletsAccessToken); |
| | | Map<String, Object> openid = getUserInfo(wxAppletsAccessToken, jsonObject.getString("openid")); |
| | | System.err.println("用户信息:"+ openid); |
| | | return map; |
| | | } |
| | | if(errcode == -1){//系统繁忙,此时请开发者稍候再试 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 40029){//code 无效 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 45011){//频率限制,每个用户每分钟100次 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 40226){//高风险等级用户,小程序登录拦截 。 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | } |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 获取微信小程序token |
| | | * @return |
| | | *//* |
| | | |
| | | public String getWxAppletsAccessToken() throws Exception{ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return ""; |
| | | } |
| | | System.err.println("获取AAAAAAAAAAAAAAAAAAAAAAAAAA:"+httpResult); |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | return jsonObject.getString("access_token"); |
| | | } |
| | | |
| | | |
| | | */ |
| | | /*** |
| | | * 获取jsapiTicket(小程序) |
| | | * 来源 www.vxzsk.com |
| | | * @return |
| | | *//* |
| | | |
| | | public String getWxAppletsJSApiTicket() throws Exception{ |
| | | String wxAppletsAccessToken = redisUtil.getValue("wxAppletsAccessToken"); |
| | | String urlStr = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + wxAppletsAccessToken + "&type=jsapi"; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", urlStr, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | logger.debug(httpResult.getData()); |
| | | String ticket = JSONObject.parseObject(httpResult.getData()).getString("ticket"); |
| | | return ticket; |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 通过config接口注入权限验证配置(小程序) |
| | | * 附录1-JS-SDK使用权限签名算法, |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String,Object> getWxAppletsSignatureConfig(String url) throws Exception{ |
| | | //获取token |
| | | try { |
| | | url = URLDecoder.decode(url, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String ticket = getWxAppletsJSApiTicket(); |
| | | String noncestr = UUIDUtil.getRandomCode(); |
| | | Long timestamp = System.currentTimeMillis(); |
| | | String content = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url=" + url; |
| | | String signature = DigestUtils.sha1Hex(content); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("appId", wxAppletsAppid); |
| | | map.put("timestamp", timestamp); |
| | | map.put("nonceStr", noncestr); |
| | | map.put("signature", signature); |
| | | return map; |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 网站应用登录 |
| | | * @param code |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String, String> webAccessToken(String code) throws Exception{ |
| | | String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + webAppId + "&secret=" + webAppSecret + "&code=" + code + "&grant_type=authorization_code"; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | int errcode = jsonObject.getIntValue("errcode"); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(errcode == 0){//成功 |
| | | map.put("access_token", jsonObject.getString("access_token")); |
| | | map.put("openid", jsonObject.getString("openid")); |
| | | map.put("refresh_token", jsonObject.getString("refresh_token")); |
| | | map.put("unionid", jsonObject.getString("unionid")); |
| | | return map; |
| | | } |
| | | if(errcode == -1){//系统繁忙,此时请开发者稍候再试 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 40029){//code 无效 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 45011){//频率限制,每个用户每分钟100次 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 获取微信个人信息 |
| | | * @param access_token |
| | | * @param openid |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String, Object> getUserInfo(String access_token, String openid) throws Exception{ |
| | | String url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | int errcode = jsonObject.getIntValue("errcode"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(errcode == 0){//成功 |
| | | map.put("nickname", jsonObject.getString("nickname")); |
| | | map.put("openid", jsonObject.getString("openid")); |
| | | map.put("sex", jsonObject.getString("sex")); |
| | | map.put("headimgurl", jsonObject.getString("headimgurl")); |
| | | return map; |
| | | } |
| | | if(errcode == -1){//系统繁忙,此时请开发者稍候再试 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 40029){//code 无效 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | if(errcode == 45011){//频率限制,每个用户每分钟100次 |
| | | map.put("msg", jsonObject.getString("errmsg")); |
| | | return map; |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 公众号获取openid |
| | | * @param code |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String,Object> getOpenId(String code) throws Exception{ |
| | | if (code == null || code.length() == 0) { |
| | | return null; |
| | | } |
| | | String grantType = "authorization_code"; |
| | | String params = "appid=" + officialAccountAppid + "&secret=" + officialAccountAppSecret + "&code=" + code + "&grant_type=" + grantType; |
| | | logger.debug("sssss"+params); |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", "https://api.weixin.qq.com/sns/oauth2/access_token?" + params, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | JSONObject json = JSON.parseObject(httpResult.getData()); |
| | | logger.debug(json.toJSONString()); |
| | | String openId = json.get("openid").toString(); |
| | | String accessToken = json.get("access_token").toString(); |
| | | Integer expiresIn = json.getInteger("expires_in"); |
| | | String refresh_token = json.getString("refresh_token"); |
| | | String unionid = json.getString("unionid"); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("openId",openId); |
| | | map.put("accessToken",accessToken); |
| | | map.put("expiresIn", expiresIn); |
| | | map.put("refreshToken", refresh_token); |
| | | map.put("unionid", unionid); |
| | | return map; |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 获取微信用户的access_token |
| | | * |
| | | * @param code 微信小程序登录时获取的code |
| | | * @return 包含access_token和openid的Map |
| | | * @throws Exception |
| | | *//* |
| | | |
| | | public Map<String, String> getAccessToken(String code) throws Exception { |
| | | OkHttpClient client = new OkHttpClient(); |
| | | String url = ACCESS_TOKEN_URL + "?appid=" + wxAppletsAppid+ "&secret=" + wxAppletsAppSecret + "&code=" + code |
| | | + "&grant_type=authorization_code"; |
| | | Request request = new Request.Builder().url(url).get().build(); |
| | | Response response = client.newCall(request).execute(); |
| | | String responseStr = response.body().string(); |
| | | System.err.println("响应结果"+responseStr); |
| | | JSONObject jsonObject = JSON.parseObject(responseStr); |
| | | String accessToken = jsonObject.getString("access_token"); |
| | | String openid = jsonObject.getString("openid"); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("access_token", accessToken); |
| | | map.put("openid", openid); |
| | | return map; |
| | | } |
| | | |
| | | */ |
| | | /*** |
| | | * 获取acess_token (公众号) |
| | | * 来源www.vxzsk.com |
| | | * @return |
| | | *//* |
| | | |
| | | public String getAccessToken() throws Exception{ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + officialAccountAppid |
| | | + "&secret=" + officialAccountAppSecret; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | String accessToken = JSONObject.parseObject(httpResult.getData()).getString("access_token"); |
| | | return accessToken; |
| | | } |
| | | |
| | | */ |
| | | /*** |
| | | * 获取jsapiTicket(公众号) |
| | | * 来源 www.vxzsk.com |
| | | * @return |
| | | *//* |
| | | |
| | | public String getJSApiTicket() throws Exception{ |
| | | //获取token |
| | | String acess_token = redisUtil.getValue("acess_token"); |
| | | String urlStr = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + acess_token + "&type=jsapi"; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", urlStr, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | logger.debug(httpResult.getData()); |
| | | String ticket = JSONObject.parseObject(httpResult.getData()).getString("ticket"); |
| | | return ticket; |
| | | } |
| | | |
| | | */ |
| | | /** |
| | | * 通过config接口注入权限验证配置(公众号) |
| | | * 附录1-JS-SDK使用权限签名算法, |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String,Object> getSignatureConfig(String url) throws Exception{ |
| | | //获取token |
| | | try { |
| | | url = URLDecoder.decode(url, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String ticket = getJSApiTicket(); |
| | | String noncestr = UUIDUtil.getRandomCode(); |
| | | Long timestamp = System.currentTimeMillis(); |
| | | String content = "jsapi_ticket=" + ticket + "&noncestr=" + noncestr + "×tamp=" + timestamp + "&url=" + url; |
| | | String signature = DigestUtils.sha1Hex(content); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("appId", officialAccountAppid); |
| | | map.put("timestamp", timestamp); |
| | | map.put("nonceStr", noncestr); |
| | | map.put("signature", signature); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 公众号获取用户个人信息 |
| | | * @param access_token |
| | | * @param openid |
| | | * @return |
| | | *//* |
| | | |
| | | public Map<String, Object> queryUserInfo(String access_token, String openid) throws Exception{ |
| | | String url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + openid + "&lang=zh_CN"; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | if(httpResult.getCode() != 200){ |
| | | return null; |
| | | } |
| | | logger.debug(httpResult.getData()); |
| | | JSONObject j = JSON.parseObject(httpResult.getData()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("nickname", j.getString("nickname")); |
| | | map.put("sex", j.getInteger("sex")); |
| | | map.put("headimgurl", j.getString("headimgurl")); |
| | | map.put("unionid", j.getString("unionid")); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 获取小程序二维码 |
| | | * @param page 跳转页 例如 pages/index/index |
| | | * @param scene 参数 a=1&b=2 |
| | | *//* |
| | | |
| | | public InputStream getwxacodeunlimit(String page, String scene, String envVersion) throws Exception{ |
| | | try { |
| | | String wxAppletsAccessToken = redisUtil.getValue("wxAppletsAccessToken"); |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + wxAppletsAccessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("scene", scene); |
| | | param.put("page", page); |
| | | param.put("env_version", envVersion); |
| | | HttpHeaders httpHeaders = new HttpHeaders(); |
| | | MediaType type=MediaType.parseMediaType("application/json;charset=UTF-8"); |
| | | httpHeaders.setContentType(type); |
| | | HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(param, httpHeaders); |
| | | ResponseEntity<byte[]> entity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, byte[].class, new Object[0]); |
| | | byte[] body = entity.getBody(); |
| | | return new ByteArrayInputStream(body); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | */ |
| | | /** |
| | | * 获取小程序urlscheme码 |
| | | * @return |
| | | *//* |
| | | |
| | | public String getUrlscheme(String path) throws Exception{ |
| | | String wxAppletsAccessToken = redisUtil.getValue("wxAppletsAccessToken"); |
| | | String url = "https://api.weixin.qq.com/wxa/generatescheme?access_token=" + wxAppletsAccessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("is_expire", true); |
| | | param.put("expire_type", 1); |
| | | param.put("expire_interval", 180); |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("path", path); |
| | | map1.put("query", ""); |
| | | map1.put("env_version", "release"); |
| | | param.put("jump_wxa", map1); |
| | | HttpHeaders httpHeaders = new HttpHeaders(); |
| | | MediaType type=MediaType.parseMediaType("application/json;charset=UTF-8"); |
| | | httpHeaders.setContentType(type); |
| | | HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(param, httpHeaders); |
| | | ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class); |
| | | String body1 = exchange.getBody(); |
| | | return body1; |
| | | } |
| | | } |
| | | */ |
New file |
| | |
| | | package com.ruoyi.user.vx.utils; |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.spec.IvParameterSpec; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.Key; |
| | | import java.security.Security; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 微信通讯加解密类 |
| | | * |
| | | * @author HJL |
| | | */ |
| | | public class WxAesUtils { |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = decryptData("bmdheU9pKVKVyJOH8CR3mqp4mEeKZ1YOuMsVxXJKjRdc47rolEoe85JKAVEWmP2hl4NZB66qxN/NHHGsy0PqCn7hS4cLKqTgERXcYO0dURt2JuLg1myhG+PYhi0AROwfJytGBv77u8yinmMfyyKx6lSegkqnlIJ6TBIDYe2LCvW3kRVDzNDeWT0hOaLiRI6n3TFQwI0b5Tiu48UbFTHDhAtJ6LaZY+wg+PdtrHDgjWtt46pinENV22GFt77a6iIhdT4GzaW7ln45HuENtzXJLR5yM7SwT2pxKMGEknJGJD3yf/DxnR6a8HpXrwxtXHJfDlUzNS+Af51fOS/Z52LpbtvRecoEz8KKUxJ9lpcK1HrO/RMw/iYf+ce1bu5VIpYyMjTNAoLdffZ7V0HGMrVJUGbQMqk7ZjdCk1eqMyPpuIOuektgKE7K5wHqeo3NVo7A", |
| | | "6pOQ1+4ca2ATDaSg4gauVA==", |
| | | "zzmYGLoLH548Vf0fdJHHvA=="); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | public static String decryptData(String encryptDataB64, String sessionKeyB64, String ivB64) { |
| | | String data = null; |
| | | try { |
| | | data = new String( |
| | | decryptOfDiyIv( |
| | | Base64.decodeBase64(encryptDataB64), |
| | | Base64.decodeBase64(sessionKeyB64), |
| | | Base64.decodeBase64(ivB64) |
| | | ) |
| | | ); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | private static final String KEY_ALGORITHM = "AES"; |
| | | private static final String ALGORITHM_STR = "AES/CBC/PKCS7Padding"; |
| | | private static Key key; |
| | | private static Cipher cipher; |
| | | |
| | | private static void init(byte[] keyBytes) { |
| | | // 如果密钥不足16位,那么就补足. 这个if 中的内容很重要 |
| | | int base = 16; |
| | | if (keyBytes.length % base != 0) { |
| | | int groups = keyBytes.length / base + (keyBytes.length % base != 0 ? 1 : 0); |
| | | byte[] temp = new byte[groups * base]; |
| | | Arrays.fill(temp, (byte) 0); |
| | | System.arraycopy(keyBytes, 0, temp, 0, keyBytes.length); |
| | | keyBytes = temp; |
| | | } |
| | | // 初始化 |
| | | Security.addProvider(new BouncyCastleProvider()); |
| | | // 转化成JAVA的密钥格式 |
| | | key = new SecretKeySpec(keyBytes, KEY_ALGORITHM); |
| | | try { |
| | | // 初始化cipher |
| | | cipher = Cipher.getInstance(ALGORITHM_STR, "BC"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 解密方法 |
| | | * |
| | | * @param encryptedData 要解密的字符串 |
| | | * @param keyBytes 解密密钥 |
| | | * @param ivs 自定义对称解密算法初始向量 iv |
| | | * @return 解密后的字节数组 |
| | | */ |
| | | private static byte[] decryptOfDiyIv(byte[] encryptedData, byte[] keyBytes, byte[] ivs) { |
| | | byte[] encryptedText = null; |
| | | init(keyBytes); |
| | | try { |
| | | cipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(ivs)); |
| | | encryptedText = cipher.doFinal(encryptedData); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return encryptedText; |
| | | } |
| | | |
| | | /** |
| | | * 解码 |
| | | * |
| | | * @param str 加密敏感数据 |
| | | * @return 解码结果 |
| | | */ |
| | | public static String getUrlDecoderString(String str) { |
| | | |
| | | String result = ""; |
| | | if (null == str) { |
| | | return ""; |
| | | } |
| | | try { |
| | | result = java.net.URLDecoder.decode(str, "GBK"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 127.0.0.1:8848 |
| | | group: DEFAULT_GROUP |
| | | namespace: 5b0cc96f-d058-4986-a46f-64644ff8a467 |
| | | # 线上nacos需要鉴权 |
| | | username: nacos |
| | | password: jdhs_nacos! |
| | | name: ${spring.application.name} |
| | | # 配置文件格式 |
| | | file-extension: yml |
| | |
| | | <result column="createTime" property="evaluateTime"/> |
| | | </association> |
| | | </resultMap> |
| | | <select id="orderEvaluate" resultMap="evaluateMap"> |
| | | SELECT o.id,o.order_number, |
| | | o.complete_time, |
| | | r.serve_name, |
| | | r.serve_describe, |
| | | r.cover, |
| | | o.server_name, |
| | | o.server_phone, |
| | | e.content, |
| | | e.star_rating, |
| | | e.createTime |
| | | FROM t_order o |
| | | LEFT JOIN t_evaluate e on o.id = e.order_id |
| | | LEFT JOIN sys_recovery_serve r on o.serve_id = r.id |
| | | </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.user.mapper.RecoveryServePriceMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.user.entity.RecoveryServePrice"> |
| | | <id column="id" property="id" /> |
| | | <result column="recovery_serve_id" property="recoveryServeId" /> |
| | | <result column="recovery_price" property="recoveryPrice" /> |
| | | <result column="city" property="city" /> |
| | | <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" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <artifactId>ruoyi-common-log</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-order</artifactId> |
| | | <version>3.6.4</version> |
| | | </dependency> |
| | | |
| | | <!-- RuoYi Common Swagger --> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | |
| | | package com.ruoyi.worker.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import org.apache.ibatis.reflection.MetaObject; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Component |
| | | public class MyDateObjectHandler implements MetaObjectHandler { |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * mybatisPlus新增修改自动插入当前时间 |
| | |
| | | */ |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | LoginUserInfo user = tokenService.getLoginUserByWorker(); |
| | | // 创建时间 |
| | | this.setFieldValByName("createTime", new Date(), metaObject); |
| | | // 更新时间 |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | // 创建人 |
| | | this.setFieldValByName("createBy", null == user ? "" : user.getName(), metaObject); |
| | | this.setFieldValByName("updateBy", null == user ? "" : user.getName(), metaObject); |
| | | this.setFieldValByName("createBy", "", metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | // 是否软删除 |
| | | this.setFieldValByName("isDelete", 0, metaObject); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | LoginUserInfo user = tokenService.getLoginUserByWorker(); |
| | | // 修改时间为当前时间 |
| | | this.setFieldValByName("updateTime", new Date(), metaObject); |
| | | this.setFieldValByName("updateBy", null == user ? "" : user.getName(), metaObject); |
| | | this.setFieldValByName("updateBy", "", metaObject); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.security.auth.AuthUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.entity.WorkerOrderCountVO; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.worker.entity.MasterWorker; |
| | | import com.ruoyi.worker.entity.WorkerProcess; |
| | |
| | | import com.ruoyi.worker.service.MasterWorkerService; |
| | | import com.ruoyi.worker.service.WorkerProcessService; |
| | | import com.ruoyi.worker.vo.HomePageInfoVO; |
| | | import com.ruoyi.worker.vo.OrderCountVO; |
| | | import com.ruoyi.worker.vo.OrderListVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | private WorkerProcessService workerProcessService; |
| | | @Resource |
| | | private AdminClient adminClient; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | /** |
| | | * 师傅端-密码登录 |
| | |
| | | WorkerProcess process = workerProcessService.lambdaQuery() |
| | | .eq(WorkerProcess::getPhone, phone) |
| | | .eq(WorkerProcess::getIsDelete, 0).one(); |
| | | if (Constants.ZERO.equals(process.getState())) { |
| | | return R.fail("入驻申请暂未审核通过,请耐心等待!"); |
| | | } else if (Constants.TWO.equals(process.getState())) { |
| | | return R.fail("入驻申请已驳回,请重新提交入驻申请!"); |
| | | 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("当前账号未提交入驻申请,无法登录!"); |
| | | } |
| | |
| | | // 校验手机号是否已提交申请 |
| | | WorkerProcess dbProcess = workerProcessService.lambdaQuery() |
| | | .eq(WorkerProcess::getPhone, phone) |
| | | .eq(WorkerProcess::getIsDelete, 0).one(); |
| | | .eq(WorkerProcess::getIsDelete, 0) |
| | | .orderByDesc(WorkerProcess::getCreateTime).last("limit 1").one(); |
| | | if (null != dbProcess) { |
| | | if (Constants.ZERO.equals(dbProcess.getState())) { |
| | | return R.fail("入驻申请已提交,审核未通过,请耐心等待!"); |
| | | } else if (Constants.ONE.equals(dbProcess.getState())) { |
| | | return R.fail("该手机号入驻申请已通过,请通过手机号登录!"); |
| | | } |
| | | } else { |
| | | // 默认状态待审核 |
| | | workerProcess.setState(Constants.ZERO); |
| | | // 获取用户性别 |
| | | String idNumber = workerProcess.getIdNumber(); |
| | | // 判断身份证号码长度是否合法 |
| | | if (idNumber.length() == Constants.EIGHTEEN) { |
| | | // 获取身份证号码倒数第二位的数字 |
| | | int genderNum = Integer.parseInt(idNumber.substring(16, 17)); |
| | | // 判断性别 |
| | | if (genderNum % Constants.TWO == 0) { |
| | | workerProcess.setSex("女"); |
| | | } else { |
| | | workerProcess.setSex("男"); |
| | | } |
| | | } |
| | | // 默认状态待审核 |
| | | workerProcess.setState(Constants.ZERO); |
| | | // 获取用户性别 |
| | | String idNumber = workerProcess.getIdNumber(); |
| | | // 判断身份证号码长度是否合法 |
| | | if (idNumber.length() == Constants.EIGHTEEN) { |
| | | // 获取身份证号码倒数第二位的数字 |
| | | int genderNum = Integer.parseInt(idNumber.substring(16, 17)); |
| | | // 判断性别 |
| | | if (genderNum % Constants.TWO == 0) { |
| | | workerProcess.setSex("女"); |
| | | } else { |
| | | return R.idNumberIllegal("身份证号码不合法!"); |
| | | workerProcess.setSex("男"); |
| | | } |
| | | } else { |
| | | return R.idNumberIllegal("身份证号码不合法!"); |
| | | } |
| | | return workerProcessService.save(workerProcess) ? R.ok("申请成功!") : R.fail("申请失败!"); |
| | | } |
| | |
| | | return R.errorCode("验证码错误或已过期!"); |
| | | } |
| | | // 手机号是否注册 |
| | | MasterWorker worker = masterWorkerService.lambdaQuery().eq(MasterWorker::getPhone, phone) |
| | | MasterWorker worker = masterWorkerService.lambdaQuery() |
| | | .eq(MasterWorker::getPhone, phone) |
| | | .eq(MasterWorker::getIsDelete, 0).one(); |
| | | if (null == worker) { |
| | | return R.registered("该手机号未提交入驻申请!"); |
| | |
| | | return R.registered("当前账号未注册!"); |
| | | } |
| | | // 订单统计 |
| | | OrderCountVO orderCount = masterWorkerService.orderCount(masterWorker.getId()); |
| | | WorkerOrderCountVO orderCount = orderClient.orderStateCount(masterWorker.getId()).getData(); |
| | | // 操作指导详情 |
| | | Agreement agreement = adminClient.dataInfo(Constants.TWO).getData(); |
| | | return R.ok(new HomePageInfoVO(masterWorker, orderCount, |
| | |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-订单代办列表 |
| | | */ |
| | | @ApiOperation(value = "订单代办列表", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/orderMapMode") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "师傅所在经度", name = "longitude", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在纬度", name = "latitude", dataType = "String", required = true) |
| | | }) |
| | | public R<List<OrderListVO>> orderMapMode(@RequestParam String longitude, @RequestParam String latitude) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录已失效!"); |
| | | } |
| | | return R.ok(masterWorkerService.orderMapMode(loginWorker.getUserid(), longitude, latitude)); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-操作指南 |
| | | */ |
| | | @ApiOperation(value = "操作指南", tags = {"师傅端-首页"}) |
| | |
| | | */ |
| | | @ApiOperation(value = "订单置顶", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/orderTop") |
| | | public R<Boolean> orderTop(@RequestParam Integer orderId) { |
| | | public R<Boolean> orderTop(@RequestParam String orderId) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录已失效!"); |
| | | } |
| | | return masterWorkerService.orderTop(orderId, loginWorker.getUserid()) ? R.ok() : R.fail(); |
| | | return orderClient.orderTop(orderId, loginWorker.getUserid()); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.worker.controller; |
| | | |
| | | |
| | | import com.ruoyi.admin.api.entity.ChangeDispatch; |
| | | import com.ruoyi.admin.api.feignClient.AdminClient; |
| | | 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.common.core.exception.GlobalException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.entity.ChangeDispatch; |
| | | import com.ruoyi.order.api.entity.Order; |
| | | import com.ruoyi.order.api.entity.OrderDetailVO; |
| | | import com.ruoyi.order.api.entity.OrderSubmitRequest; |
| | | import com.ruoyi.order.api.feignClient.ExchangeDispatchClient; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.model.LoginUserInfo; |
| | | import com.ruoyi.worker.entity.*; |
| | | import com.ruoyi.worker.request.OrderSubmitRequest; |
| | | import com.ruoyi.worker.service.*; |
| | | import com.ruoyi.worker.vo.OrderDetailVO; |
| | | import com.ruoyi.worker.entity.MasterWorker; |
| | | import com.ruoyi.worker.entity.RecoveryServe; |
| | | import com.ruoyi.worker.entity.ServeCoordinate; |
| | | import com.ruoyi.worker.service.MasterWorkerService; |
| | | import com.ruoyi.worker.service.RecoveryServeService; |
| | | 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.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.io.File; |
| | | import java.io.FileWriter; |
| | | import java.io.IOException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class OrderController { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AdminClient adminClient; |
| | | @Resource |
| | | private MasterWorkerService masterWorkerService; |
| | | @Resource |
| | | private ServeRecordService serveRecordService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private EvaluateService evaluateService; |
| | | private ExchangeDispatchClient dispatchClient; |
| | | @Resource |
| | | private SysServeCoordinateService serveCoordinateService; |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | /** |
| | | * linux服务器保存订单轨迹文件夹 |
| | | */ |
| | | private static final String BASE_PATH = "/usr/local/coordinate/"; |
| | | // private static final String BASE_PATH = "D:/Desktop/coordinate/"; |
| | | |
| | | /** |
| | | * 师傅端-获取订单列表 |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单状态(0:全部、1:待上门、2:已完结)", name = "state", dataType = "Integer", required = true) |
| | | }) |
| | | public R<List<Order>> orderList(@RequestParam Integer state) { |
| | | public R<Page<Order>> orderList(@RequestParam Integer state, |
| | | @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | return R.ok(orderService.orderList(loginWorker.getUserid(), state)); |
| | | Page<Order> dataList = orderClient.orderListWorker(loginWorker.getUserid(), state, pageNum, pageSize).getData(); |
| | | List<Order> orderList = dataList.getRecords(); |
| | | 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(); |
| | | Map<Integer, String> map = serveList.stream().collect(Collectors.toMap(RecoveryServe::getId, |
| | | mw -> Optional.ofNullable(mw.getCover()).orElse(""))); |
| | | for (Order order : orderList) { |
| | | order.setCover(map.get(order.getServeId())); |
| | | } |
| | | } |
| | | return R.ok(dataList); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "申请订单改派", tags = {"师傅端-订单列表"}) |
| | | @GetMapping(value = "/applyChange") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "改派原因", name = "reason", dataType = "String", required = true) |
| | | }) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<String> applyChange(@RequestParam Integer orderId, @RequestParam String reason) { |
| | | public R<String> applyChange(@RequestParam String orderId, @RequestParam String reason) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | ChangeDispatch data = adminClient.changeDispatchOne(orderId).getData(); |
| | | ChangeDispatch data = dispatchClient.changeDispatchOne(orderId).getData(); |
| | | if (null != data) { |
| | | return R.fail("当前订单已提交改派申请!"); |
| | | if (Constants.ZERO.equals(data.getState())) { |
| | | return R.fail("当前订单已提交改派申请,请等待改派!"); |
| | | } else if (Constants.ONE.equals(data.getState())) { |
| | | return R.fail("当前等单已改派!"); |
| | | } |
| | | } |
| | | MasterWorker masterWorker = masterWorkerService.getById(loginWorker.getUserid()); |
| | | // 订单改派信息 |
| | |
| | | changeDispatch.setApplyReason(reason); |
| | | changeDispatch.setApplyTime(DateUtils.getNowDate()); |
| | | changeDispatch.setState(0); |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | Boolean result = orderClient.changeOrderState(orderId, Constants.SIX).getData(); |
| | | Order order = orderClient.detail(orderId).getData(); |
| | | if (null == order) { |
| | | throw new GlobalException("订单信息异常!"); |
| | | } |
| | |
| | | changeDispatch.setUserId(order.getUserId()); |
| | | changeDispatch.setUserName(order.getReservationName()); |
| | | // 添加改派信息 |
| | | Boolean save = adminClient.changeDispatchSave(changeDispatch).getData(); |
| | | return save ? R.ok() : R.fail(); |
| | | Boolean save = dispatchClient.changeDispatchSave(changeDispatch).getData(); |
| | | return result && save ? R.ok() : R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 师傅端-已到达预约地点 |
| | | * |
| | | * @param orderId 订单id |
| | | */ |
| | | @ApiOperation(value = "订单路线导航", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/checkDistance") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在经度", name = "longitude", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在纬度", name = "latitude", dataType = "String", required = true) |
| | | }) |
| | | public R<Object> checkDistance(@RequestParam String orderId, @RequestParam String longitude, |
| | | @RequestParam String latitude) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | // 校验经纬度 |
| | | 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(true); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "订单路线导航", tags = {"师傅端-首页"}) |
| | | @GetMapping(value = "/orderNavigation") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在经度", name = "longitude", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "师傅所在纬度", name = "latitude", dataType = "String", required = true) |
| | | }) |
| | | public R<Object> orderNavigation(@RequestParam Integer orderId, @RequestParam String longitude, |
| | | public R<Object> orderNavigation(@RequestParam String orderId, @RequestParam String longitude, |
| | | @RequestParam String latitude) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId) |
| | | .eq(Order::getServerId, loginWorker.getUserid()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("请确认当前订单所派单师傅是否是您!"); |
| | | } |
| | | // 用户下单经纬度 |
| | | Double userLongitude = order.getLongitude(); |
| | | Double userLatitude = order.getLatitude(); |
| | | String userPosition = userLongitude + "," + userLatitude; |
| | | // 师傅当前位置 经纬度 |
| | | String workerPosition = longitude + "," + latitude; |
| | | return R.ok(orderService.orderNavigation(userPosition, workerPosition)); |
| | | return R.ok(orderClient.orderNavigation(orderId, loginWorker.getUserid(), longitude, latitude).getData()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "orderId", name = "orderId", dataType = "Integer", required = true) |
| | | }) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> reachPosition(@RequestParam Integer orderId) { |
| | | public R<Boolean> reachPosition(@RequestParam String orderId) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getServerId, loginWorker.getUserid()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | if (null == order) { |
| | | throw new GlobalException("请确认当前订单所派单师傅是否是您!"); |
| | | } |
| | | // 待完工状态 |
| | | order.setState(Constants.TWO); |
| | | order.setArriveTime(new Date()); |
| | | return R.ok(orderService.updateById(order)); |
| | | return orderClient.reachPosition(orderId, loginWorker.getUserid()); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "订单详情", tags = {"师傅端-订单列表"}) |
| | | @GetMapping(value = "/orderDetail") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true) |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true) |
| | | }) |
| | | public R<OrderDetailVO> orderDetail(@RequestParam Integer orderId) { |
| | | // 订单信息 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId).eq(Order::getIsDelete, 0).one(); |
| | | // 服务信息(服务备注、上门时间、完成时间、完成所拍现场照片) |
| | | ServeRecord serveRecord = serveRecordService.lambdaQuery().eq(ServeRecord::getOrderId, orderId) |
| | | .eq(ServeRecord::getIsDelete, 0).one(); |
| | | // 评价信息 |
| | | Evaluate evaluate = evaluateService.lambdaQuery().eq(Evaluate::getOrderId, orderId).eq(Evaluate::getIsDelete, 0).one(); |
| | | return R.ok(new OrderDetailVO(order, serveRecord, evaluate)); |
| | | public R<OrderDetailVO> orderDetail(@RequestParam String orderId) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | R<OrderDetailVO> orderDetail = orderClient.orderDetail(orderId); |
| | | if (null == orderDetail) { |
| | | return R.fail(); |
| | | } |
| | | OrderDetailVO data = orderDetail.getData(); |
| | | Integer serveId = data.getOrderInfo().getServeId(); |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, serveId).one(); |
| | | data.getOrderInfo().setCover(recoveryServe.getCover()); |
| | | return R.ok(data); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation(value = "订单完工-提交订单", tags = {"师傅端-订单列表"}) |
| | | @PostMapping(value = "/orderSubmit") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> orderSubmit(@RequestBody OrderSubmitRequest orderSubmitRequest) { |
| | | // 订单信息 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderSubmitRequest.getOrderId()) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | // 订单不存在,或订单状态异常(订单状态为2才可提交) |
| | | if (null == order || !Constants.TWO.equals(order.getState())) { |
| | | throw new GlobalException("订单不存在或订单状态异常!"); |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | order.setCompleteTime(new Date()); |
| | | order.setState(Constants.THREE); |
| | | boolean update = orderService.updateById(order); |
| | | // 服务记录 |
| | | ServeRecord serveRecord = new ServeRecord(); |
| | | serveRecord.setOrderId(order.getId()); |
| | | serveRecord.setPhoto(String.join(",", orderSubmitRequest.getPhoto())); |
| | | boolean save = serveRecordService.save(serveRecord); |
| | | return R.ok(update && save); |
| | | return orderClient.orderSubmit(orderSubmitRequest); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "订单进行-记录路线经纬度", tags = {"师傅端-订单列表"}) |
| | | @GetMapping(value = "/coordinate") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", dataType = "String", required = true), |
| | | @ApiImplicitParam(value = "经度", name = "longitude", dataType = "Integer", required = true), |
| | | @ApiImplicitParam(value = "纬度", name = "latitude", dataType = "Integer", required = true) |
| | | }) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R<Boolean> coordinate(@RequestParam Integer orderId, @RequestParam Double longitude, |
| | | public R<Boolean> coordinate(@RequestParam String orderId, @RequestParam Double longitude, |
| | | @RequestParam Double latitude) { |
| | | LoginUserInfo loginWorker = tokenService.getLoginUserByWorker(); |
| | | if (null == loginWorker) { |
| | | return R.loginExpire("登录失效!"); |
| | | } |
| | | SysServeCoordinate sysServeCoordinate = new SysServeCoordinate(); |
| | | sysServeCoordinate.setWorkerId(loginWorker.getUserid()); |
| | | sysServeCoordinate.setOrderId(orderId); |
| | | sysServeCoordinate.setCoordinate(longitude + "," + latitude); |
| | | sysServeCoordinate.setLongitude(BigDecimal.valueOf(longitude)); |
| | | sysServeCoordinate.setLatitude(BigDecimal.valueOf(latitude)); |
| | | return R.ok(serveCoordinateService.save(sysServeCoordinate)); |
| | | Integer workerId = loginWorker.getUserid(); |
| | | ServeCoordinate serveCoordinate = new ServeCoordinate(); |
| | | serveCoordinate.setWorkerId(workerId); |
| | | serveCoordinate.setOrderId(orderId); |
| | | serveCoordinate.setCoordinate(longitude + "," + latitude); |
| | | serveCoordinate.setLongitude(longitude); |
| | | serveCoordinate.setLatitude(latitude); |
| | | List<ServeCoordinate> list = new ArrayList<>(); |
| | | list.add(serveCoordinate); |
| | | String jsonString = JSONObject.toJSONString(list); |
| | | // 检查师傅ID的文件夹是否存在,不存在则创建 |
| | | String masterFolderPath = BASE_PATH + workerId; |
| | | File masterFolder = new File(masterFolderPath); |
| | | if (!masterFolder.exists()) { |
| | | // 创建师傅ID的文件夹 |
| | | masterFolder.mkdirs(); |
| | | } |
| | | // 检查订单ID的JSON文件是否存在,不存在则创建 |
| | | String jsonFilePath = masterFolderPath + "/" + orderId + ".json"; |
| | | File jsonFile = new File(jsonFilePath); |
| | | if (!jsonFile.exists()) { |
| | | try { |
| | | // 创建订单ID的JSON文件 |
| | | jsonFile.createNewFile(); |
| | | // 首次记录轨迹 |
| | | FileWriter writer = new FileWriter(jsonFile); |
| | | writer.write(jsonString); |
| | | writer.close(); |
| | | } catch (IOException e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } else { |
| | | // 读取订单ID的JSON文件内容 |
| | | try { |
| | | String jsonContent = new String(Files.readAllBytes(Paths.get(jsonFilePath))); |
| | | System.out.println("JSON 文件内容:" + jsonContent); |
| | | List<ServeCoordinate> coordinate = JSONObject.parseObject(jsonContent, List.class); |
| | | // 订单轨迹信息 |
| | | ServeCoordinate data = new ServeCoordinate(); |
| | | data.setWorkerId(workerId); |
| | | data.setOrderId(orderId); |
| | | data.setCoordinate(longitude + "," + latitude); |
| | | data.setLongitude(longitude); |
| | | data.setLatitude(latitude); |
| | | coordinate.add(data); |
| | | String itemStr = JSONObject.toJSONString(coordinate); |
| | | FileWriter writer = new FileWriter(jsonFile); |
| | | writer.write(itemStr); |
| | | writer.close(); |
| | | } catch (IOException e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.GaoDeMapUtil; |
| | | import com.ruoyi.common.core.utils.ObsUploadUtil; |
| | | import com.ruoyi.worker.entity.Order; |
| | | import com.ruoyi.worker.service.OrderService; |
| | | 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; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * @author HJL |
| | |
| | | public class OssController { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private TencentCosUtil tencentCosUtil; |
| | | |
| | | @PostMapping("/upload") |
| | | @ApiOperation(value = "文件上传", tags = "师傅端-文件上传") |
| | |
| | | @ApiImplicitParam(value = "文件", name = "file", dataType = "MultipartFile", required = true) |
| | | }) |
| | | public R<String> upload(@RequestParam("file") MultipartFile file) { |
| | | try { |
| | | return R.ok(ObsUploadUtil.obsUpload(file), ""); |
| | | } catch (IOException e) { |
| | | return R.fail("文件上传失败!"); |
| | | } |
| | | return R.ok(tencentCosUtil.upLoadFile(file)); |
| | | } |
| | | |
| | | @PostMapping("/uploadPhoto") |
| | |
| | | public R<Boolean> uploadPhoto(@RequestParam("file") MultipartFile file, @RequestParam String orderId, |
| | | @RequestParam String longitude, @RequestParam String latitude) { |
| | | // 校验经纬度 |
| | | Order order = orderService.lambdaQuery().eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).one(); |
| | | Order order = orderClient.detail(orderId).getData(); |
| | | // 用户下单位置经纬度 |
| | | String orderPosition = order.getLongitude() + "," + order.getLatitude(); |
| | | // 师傅经纬度 |
| | |
| | | // throw new GlobalException("您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | return R.fail(Boolean.FALSE, "您当前手机定位超出当前订单预约地址范围 3km,无法提供回收服务!"); |
| | | } |
| | | try { |
| | | return R.ok(ObsUploadUtil.obsUpload(file)); |
| | | } catch (IOException e) { |
| | | return R.fail("文件上传失败!"); |
| | | } |
| | | return R.ok(tencentCosUtil.upLoadFile(file)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("订单id") |
| | | @TableField("order_id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @TableField("content") |
| | |
| | | |
| | | @ApiModelProperty("预估价格") |
| | | @TableField("estimate_price") |
| | | private BigDecimal estimatePrice; |
| | | private String estimatePrice; |
| | | |
| | | @ApiModelProperty("默认回收价") |
| | | @TableField("default_price") |
New file |
| | |
| | | package com.ruoyi.worker.entity; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * 师傅路线经纬度信息 |
| | | * </p> |
| | | * |
| | | * @author hjl |
| | | * @since 2024-07-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @ApiModel(value = "ServeCoordinate对象", description = "师傅路线经纬度信息") |
| | | public class ServeCoordinate{ |
| | | |
| | | @ApiModelProperty("师傅id") |
| | | private Integer workerId; |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("路线经纬度") |
| | | private String coordinate; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private Double longitude; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private Double latitude; |
| | | |
| | | } |
| | |
| | | @TableField("opinion") |
| | | private String opinion; |
| | | |
| | | @ApiModelProperty("管辖城市二维数组") |
| | | @TableField("city_str") |
| | | private String cityStr; |
| | | |
| | | @ApiModelProperty("手机验证码") |
| | | @TableField(exist = false) |
| | | private String code; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.worker.entity.MasterWorker; |
| | | import com.ruoyi.worker.vo.OrderCountVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @Mapper |
| | | public interface MasterWorkerMapper extends BaseMapper<MasterWorker> { |
| | | |
| | | /** |
| | | * 根据用户id统计总订单数、待上门订单数、已完结订单数 |
| | | * |
| | | * @param id 用户id |
| | | * @return 数量统计 |
| | | */ |
| | | OrderCountVO orderCount(Integer id); |
| | | } |
| | |
| | | public class OrderSubmitRequest { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private Integer orderId; |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("现场照片") |
| | | private List<String> photo; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.worker.entity.MasterWorker; |
| | | import com.ruoyi.worker.vo.OrderCountVO; |
| | | import com.ruoyi.worker.vo.OrderListVO; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface MasterWorkerService extends IService<MasterWorker> { |
| | | |
| | | /** |
| | | * 根据用户id统计总订单数、待上门订单数、已完结订单数 |
| | | * |
| | | * @param id 用户id |
| | | * @return 数量统计 |
| | | */ |
| | | OrderCountVO orderCount(Integer id); |
| | | |
| | | /** |
| | | * 获取订单代办列表,并根据师傅经纬度排序 |
| | | * |
| | | * @param userid 师傅id |
| | |
| | | List<OrderListVO> orderNotHandle(Integer userid, String longitude, String latitude); |
| | | |
| | | /** |
| | | * 订单置顶 |
| | | * 获取订单代办列表,并根据师傅经纬度排序 |
| | | * |
| | | * @param orderId 订单id |
| | | * @param userid 用户id |
| | | * @return 操作结果 |
| | | * @param userid 师傅id |
| | | * @param longitude 经度 |
| | | * @param latitude 纬度 |
| | | * @return 代办列表 |
| | | */ |
| | | Boolean orderTop(Integer orderId, Integer userid); |
| | | List<OrderListVO> orderMapMode(Integer userid, String longitude, String latitude); |
| | | } |
| | |
| | | package com.ruoyi.worker.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | 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.entity.MasterWorker; |
| | | import com.ruoyi.worker.entity.Order; |
| | | import com.ruoyi.worker.entity.RecoveryServe; |
| | | import com.ruoyi.worker.mapper.MasterWorkerMapper; |
| | | import com.ruoyi.worker.service.MasterWorkerService; |
| | | import com.ruoyi.worker.service.OrderService; |
| | | import com.ruoyi.worker.service.RecoveryServeService; |
| | | import com.ruoyi.worker.vo.OrderCountVO; |
| | | import com.ruoyi.worker.vo.OrderListVO; |
| | | import com.ruoyi.worker.vo.OrderNotHandleVO; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public class MasterWorkerServiceImpl extends ServiceImpl<MasterWorkerMapper, MasterWorker> implements MasterWorkerService { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | @Resource |
| | | private RecoveryServeService recoveryServeService; |
| | | |
| | | @Override |
| | | public OrderCountVO orderCount(Integer id) { |
| | | return baseMapper.orderCount(id); |
| | | } |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | @Override |
| | | public List<OrderListVO> orderNotHandle(Integer userid, String longitude, String latitude) { |
| | | QueryWrapper<Order> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("server_id", userid) |
| | | .in("state", 1, 2) |
| | | .eq("is_delete", Constants.ZERO) |
| | | .orderByAsc("CASE WHEN topSort IS NULL THEN 1 ELSE 0 END") |
| | | .orderByAsc("topSort"); |
| | | List<Order> orderList = orderService.list(wrapper); |
| | | List<Order> orderList = orderClient.orderNotHandle(userid).getData(); |
| | | // 根据经纬度距离封装 |
| | | List<OrderNotHandleVO> list = new ArrayList<>(); |
| | | boolean item = false; |
| | |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | // vo类信息封装 |
| | | OrderListVO orderListVO = new OrderListVO(order.getServeId()); |
| | | OrderListVO orderListVO = new OrderListVO(); |
| | | orderListVO.setOrderId(order.getId()); |
| | | orderListVO.setOrderNumber(order.getOrderNumber()); |
| | | orderListVO.setSiteId(order.getSiteId()); |
| | |
| | | } |
| | | return resultList; |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean orderTop(Integer orderId, Integer userid) { |
| | | // 订单代办列表 |
| | | List<Order> orderList = orderService.lambdaQuery().eq(Order::getServerId, userid) |
| | | .in(Order::getState, Constants.ONE, Constants.TWO) |
| | | .eq(Order::getIsDelete, 0) |
| | | .orderByAsc(Order::getTopSort).list(); |
| | | int itemSort = 2; |
| | | public List<OrderListVO> orderMapMode(Integer userid, String longitude, String latitude) { |
| | | List<Order> orderList = orderClient.orderNotHandle(userid).getData(); |
| | | // 根据经纬度距离封装 |
| | | List<OrderNotHandleVO> list = new ArrayList<>(); |
| | | for (Order order : orderList) { |
| | | if (null != order.getTopSort()) { |
| | | order.setTopSort(itemSort); |
| | | itemSort++; |
| | | // 用户下单经纬度 |
| | | Double orderLongitude = order.getLongitude(); |
| | | Double orderLatitude = order.getLatitude(); |
| | | Integer topSort = order.getTopSort(); |
| | | String orderPosition = orderLongitude + "," + orderLatitude; |
| | | // 根据经纬度计算与师傅的距离 |
| | | Result<Long> result = GaoDeMapUtil.getDistance(orderPosition, longitude + "," + latitude); |
| | | Long distance = result.getDatas(); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() |
| | | .eq(RecoveryServe::getId, order.getServeId()) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | // vo类信息封装 |
| | | OrderListVO orderListVO = new OrderListVO(); |
| | | orderListVO.setOrderId(order.getId()); |
| | | orderListVO.setOrderNumber(order.getOrderNumber()); |
| | | orderListVO.setSiteId(order.getSiteId()); |
| | | orderListVO.setSiteName(order.getSiteName()); |
| | | orderListVO.setServeId(order.getServeId()); |
| | | orderListVO.setServeName(order.getServeName()); |
| | | if (null != recoveryServe) { |
| | | orderListVO.setServePicture(recoveryServe.getCover()); |
| | | orderListVO.setServePrice(recoveryServe.getDefaultPrice()); |
| | | } |
| | | orderListVO.setUserId(userid); |
| | | orderListVO.setReservationName(order.getReservationName()); |
| | | orderListVO.setReservationPhone(order.getReservationPhone()); |
| | | orderListVO.setReservationAddress(order.getReservationAddress()); |
| | | orderListVO.setTime(order.getTime()); |
| | | orderListVO.setServerId(order.getServerId()); |
| | | orderListVO.setServerName(order.getServerName()); |
| | | orderListVO.setServerPhone(order.getServerPhone()); |
| | | orderListVO.setReservationRemark(order.getReservationRemark()); |
| | | orderListVO.setOrderMoney(order.getOrderMoney()); |
| | | orderListVO.setState(order.getState()); |
| | | orderListVO.setAcceptTime(order.getAcceptTime()); |
| | | orderListVO.setArriveTime(order.getArriveTime()); |
| | | orderListVO.setType(order.getType()); |
| | | orderListVO.setLongitude(order.getLongitude()); |
| | | orderListVO.setLatitude(order.getLatitude()); |
| | | orderListVO.setTopSort(topSort); |
| | | OrderNotHandleVO vo = new OrderNotHandleVO(distance, orderListVO); |
| | | list.add(vo); |
| | | } |
| | | // 根据距离排序 |
| | | list.sort(Comparator.comparing(OrderNotHandleVO::getDistance)); |
| | | List<OrderListVO> resultList = list.stream().map(OrderNotHandleVO::getOrderList).collect(Collectors.toList()); |
| | | for (OrderListVO orderListVO : resultList) { |
| | | Integer serveId = orderListVO.getServeId(); |
| | | // 回收服务信息 |
| | | RecoveryServe recoveryServe = recoveryServeService.lambdaQuery().eq(RecoveryServe::getId, serveId) |
| | | .eq(RecoveryServe::getIsDelete, 0).one(); |
| | | if (null != recoveryServe) { |
| | | orderListVO.setServePicture(recoveryServe.getCover()); |
| | | } |
| | | } |
| | | orderService.updateBatchById(orderList); |
| | | return orderService.lambdaUpdate().set(Order::getTopSort, Constants.ONE) |
| | | .eq(Order::getServerId, userid) |
| | | .eq(Order::getId, orderId) |
| | | .eq(Order::getIsDelete, 0).update(); |
| | | return resultList; |
| | | } |
| | | |
| | | } |
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/OrderServiceImpl.java (deleted)
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/ServeRecordServiceImpl.java (deleted)
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/service/impl/SysServeCoordinateServiceImpl.java (deleted)
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/utils/TencentCosUtil.java
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/vo/HomePageInfoVO.java
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/vo/OrderCountVO.java (deleted)
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/vo/OrderDetailVO.java (deleted)
ruoyi-service/ruoyi-worker/src/main/java/com/ruoyi/worker/vo/OrderListVO.java
ruoyi-service/ruoyi-worker/src/main/resources/bootstrap.yaml
ruoyi-service/ruoyi-worker/src/main/resources/mapper/worker/MasterWorkerMapper.xml
ruoyi-service/ruoyi-worker/src/main/resources/mapper/worker/OrderMapper.xml (deleted)
ruoyi-service/ruoyi-worker/src/main/resources/mapper/worker/ServeRecordMapper.xml (deleted)
ruoyi-service/ruoyi-worker/src/main/resources/mapper/worker/SysServeCoordinateMapper.xml (deleted) |