Commit 6dfae757f9e8d70ab0ba6081d39cdef47ebf3f1b

Authored by guzijian
1 parent 182428f5

feat: 新增订单控制,修改登录接口取消token前缀

trash-garbage/src/main/java/com/trash/garbage/controller/GarbageOrderController.java 0 → 100644
  1 +package com.trash.garbage.controller;
  2 +
  3 +
  4 +import com.trash.garbage.global.Result;
  5 +import com.trash.garbage.pojo.dto.OrderDto;
  6 +import com.trash.garbage.service.GarOrderService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.PostMapping;
  9 +import org.springframework.web.bind.annotation.RequestBody;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +/**
  14 + * 订单控制
  15 + * @author 20412
  16 + */
  17 +@RestController
  18 +@RequestMapping("/order")
  19 +public class GarbageOrderController {
  20 +
  21 + @Autowired
  22 + private GarOrderService garOrderService;
  23 +
  24 + @PostMapping("/add")
  25 + public Result<?> saveOrder(@RequestBody OrderDto dto){
  26 + return Result.OK(garOrderService.saveOrder(dto));
  27 + }
  28 +
  29 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/interceptor/MyMetaObjectHandler.java
... ... @@ -23,17 +23,12 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
23 23 if (metaObject.hasGetter("garCreateTime")) {
24 24 this.strictInsertFill(metaObject, "garCreateTime", Date.class, new Date());
25 25 }
26   -
27 26 if (metaObject.hasGetter("garCreateBy")) {
28 27 this.strictInsertFill(metaObject, "garCreateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId());
29 28 }
30   -
31 29 if (metaObject.hasGetter("garUpdateTime")) {
32 30 this.strictInsertFill(metaObject, "garUpdateTime", Date.class, new Date());
33 31 }
34   - if (metaObject.hasGetter("garUserId")) {
35   - this.strictInsertFill(metaObject, "garUserId", String.class, SecurityUtils.getLoginUser().getUser().getUserId());
36   - }
37 32 if (metaObject.hasGetter("garUpdateBy")) {
38 33 this.strictInsertFill(metaObject, "garUpdateBy", String.class, SecurityUtils.getLoginUser().getUser().getUserId());
39 34 }
... ...
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderImageMapper.java 0 → 100644
  1 +package com.trash.garbage.mapper;
  2 +
  3 +import com.trash.garbage.pojo.domain.GarOrderImage;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Mapper
  9 +* @createDate 2023-11-24 16:26:19
  10 +* @Entity com.trash.garbage.pojo.domain.GarOrderImage
  11 +*/
  12 +public interface GarOrderImageMapper extends BaseMapper<GarOrderImage> {
  13 +
  14 +}
  15 +
  16 +
  17 +
  18 +
... ...
trash-garbage/src/main/java/com/trash/garbage/mapper/GarOrderMapper.java 0 → 100644
  1 +package com.trash.garbage.mapper;
  2 +
  3 +import com.trash.garbage.pojo.domain.GarOrder;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Mapper
  9 +* @createDate 2023-11-24 16:26:19
  10 +* @Entity com.trash.garbage.pojo.domain.GarOrder
  11 +*/
  12 +public interface GarOrderMapper extends BaseMapper<GarOrder> {
  13 +
  14 +}
  15 +
  16 +
  17 +
  18 +
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrder.java 0 → 100644
  1 +package com.trash.garbage.pojo.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.*;
  4 +
  5 +import java.io.Serializable;
  6 +import java.util.Date;
  7 +
  8 +import com.fasterxml.jackson.annotation.JsonFormat;
  9 +import lombok.Data;
  10 +
  11 +/**
  12 + * 建筑垃圾—订单表
  13 + * @TableName gar_order
  14 + */
  15 +@TableName(value ="gar_order")
  16 +@Data
  17 +public class GarOrder implements Serializable {
  18 + /**
  19 + * 订单id
  20 + */
  21 + @TableId
  22 + private String garOrderId;
  23 +
  24 + /**
  25 + * 用户id
  26 + */
  27 + private String garOrderUserId;
  28 +
  29 + /**
  30 + * 负责处理人id
  31 + */
  32 + private String garOrderHandlerId;
  33 +
  34 + /**
  35 + * 订单地址
  36 + */
  37 + private String garOrderAddress;
  38 +
  39 + /**
  40 + * 订单详细地址
  41 + */
  42 + private String garOrderAddressDetails;
  43 +
  44 + /**
  45 + * 订单姓名
  46 + */
  47 + private String garOrderContactName;
  48 +
  49 + /**
  50 + * 垃圾类型
  51 + */
  52 + private String garOrderTrashType;
  53 +
  54 + /**
  55 + * 订单人电话
  56 + */
  57 + private String garOrderContactTel;
  58 +
  59 + /**
  60 + * 承接经营单位
  61 + */
  62 + private String garOrderCompanyId;
  63 +
  64 + /**
  65 + * 公司名称
  66 + */
  67 + private String garOrderCompanyName;
  68 +
  69 + /**
  70 + * 公司负责人电话
  71 + */
  72 + private String garOrderCompanyTel;
  73 +
  74 + /**
  75 + * 处理状态
  76 + */
  77 + private Integer garOrderHandlerStatus;
  78 +
  79 + /**
  80 + * 约定时间
  81 + */
  82 + private String garOrderAgreementTime;
  83 +
  84 + /**
  85 + * 订单创建时间
  86 + */
  87 + @TableField(fill = FieldFill.INSERT)
  88 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  89 + private Date garCreateTime;
  90 +
  91 + /**
  92 + * 订单修改时间
  93 + */
  94 + @TableField(fill = FieldFill.INSERT_UPDATE)
  95 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  96 + private Date garUpdateTime;
  97 +
  98 + /**
  99 + * 订单创建人
  100 + */
  101 + @TableField(fill = FieldFill.INSERT)
  102 + private String garCreateBy;
  103 +
  104 + /**
  105 + * 订单修改人
  106 + */
  107 + @TableField(fill = FieldFill.INSERT_UPDATE)
  108 + private String garUpdateBy;
  109 +
  110 + /**
  111 + * 备注
  112 + */
  113 + private String garRemark;
  114 +
  115 + @TableField(exist = false)
  116 + private static final long serialVersionUID = 1L;
  117 +
  118 + @Override
  119 + public boolean equals(Object that) {
  120 + if (this == that) {
  121 + return true;
  122 + }
  123 + if (that == null) {
  124 + return false;
  125 + }
  126 + if (getClass() != that.getClass()) {
  127 + return false;
  128 + }
  129 + GarOrder other = (GarOrder) that;
  130 + return (this.getGarOrderId() == null ? other.getGarOrderId() == null : this.getGarOrderId().equals(other.getGarOrderId()))
  131 + && (this.getGarOrderUserId() == null ? other.getGarOrderUserId() == null : this.getGarOrderUserId().equals(other.getGarOrderUserId()))
  132 + && (this.getGarOrderHandlerId() == null ? other.getGarOrderHandlerId() == null : this.getGarOrderHandlerId().equals(other.getGarOrderHandlerId()))
  133 + && (this.getGarOrderAddress() == null ? other.getGarOrderAddress() == null : this.getGarOrderAddress().equals(other.getGarOrderAddress()))
  134 + && (this.getGarOrderAddressDetails() == null ? other.getGarOrderAddressDetails() == null : this.getGarOrderAddressDetails().equals(other.getGarOrderAddressDetails()))
  135 + && (this.getGarOrderContactName() == null ? other.getGarOrderContactName() == null : this.getGarOrderContactName().equals(other.getGarOrderContactName()))
  136 + && (this.getGarOrderTrashType() == null ? other.getGarOrderTrashType() == null : this.getGarOrderTrashType().equals(other.getGarOrderTrashType()))
  137 + && (this.getGarOrderContactTel() == null ? other.getGarOrderContactTel() == null : this.getGarOrderContactTel().equals(other.getGarOrderContactTel()))
  138 + && (this.getGarOrderCompanyId() == null ? other.getGarOrderCompanyId() == null : this.getGarOrderCompanyId().equals(other.getGarOrderCompanyId()))
  139 + && (this.getGarOrderCompanyName() == null ? other.getGarOrderCompanyName() == null : this.getGarOrderCompanyName().equals(other.getGarOrderCompanyName()))
  140 + && (this.getGarOrderCompanyTel() == null ? other.getGarOrderCompanyTel() == null : this.getGarOrderCompanyTel().equals(other.getGarOrderCompanyTel()))
  141 + && (this.getGarOrderHandlerStatus() == null ? other.getGarOrderHandlerStatus() == null : this.getGarOrderHandlerStatus().equals(other.getGarOrderHandlerStatus()))
  142 + && (this.getGarOrderAgreementTime() == null ? other.getGarOrderAgreementTime() == null : this.getGarOrderAgreementTime().equals(other.getGarOrderAgreementTime()))
  143 + && (this.getGarCreateTime() == null ? other.getGarCreateTime() == null : this.getGarCreateTime().equals(other.getGarCreateTime()))
  144 + && (this.getGarUpdateTime() == null ? other.getGarUpdateTime() == null : this.getGarUpdateTime().equals(other.getGarUpdateTime()))
  145 + && (this.getGarCreateBy() == null ? other.getGarCreateBy() == null : this.getGarCreateBy().equals(other.getGarCreateBy()))
  146 + && (this.getGarUpdateBy() == null ? other.getGarUpdateBy() == null : this.getGarUpdateBy().equals(other.getGarUpdateBy()))
  147 + && (this.getGarRemark() == null ? other.getGarRemark() == null : this.getGarRemark().equals(other.getGarRemark()));
  148 + }
  149 +
  150 + @Override
  151 + public int hashCode() {
  152 + final int prime = 31;
  153 + int result = 1;
  154 + result = prime * result + ((getGarOrderId() == null) ? 0 : getGarOrderId().hashCode());
  155 + result = prime * result + ((getGarOrderUserId() == null) ? 0 : getGarOrderUserId().hashCode());
  156 + result = prime * result + ((getGarOrderHandlerId() == null) ? 0 : getGarOrderHandlerId().hashCode());
  157 + result = prime * result + ((getGarOrderAddress() == null) ? 0 : getGarOrderAddress().hashCode());
  158 + result = prime * result + ((getGarOrderAddressDetails() == null) ? 0 : getGarOrderAddressDetails().hashCode());
  159 + result = prime * result + ((getGarOrderContactName() == null) ? 0 : getGarOrderContactName().hashCode());
  160 + result = prime * result + ((getGarOrderTrashType() == null) ? 0 : getGarOrderTrashType().hashCode());
  161 + result = prime * result + ((getGarOrderContactTel() == null) ? 0 : getGarOrderContactTel().hashCode());
  162 + result = prime * result + ((getGarOrderCompanyId() == null) ? 0 : getGarOrderCompanyId().hashCode());
  163 + result = prime * result + ((getGarOrderCompanyName() == null) ? 0 : getGarOrderCompanyName().hashCode());
  164 + result = prime * result + ((getGarOrderCompanyTel() == null) ? 0 : getGarOrderCompanyTel().hashCode());
  165 + result = prime * result + ((getGarOrderHandlerStatus() == null) ? 0 : getGarOrderHandlerStatus().hashCode());
  166 + result = prime * result + ((getGarOrderAgreementTime() == null) ? 0 : getGarOrderAgreementTime().hashCode());
  167 + result = prime * result + ((getGarCreateTime() == null) ? 0 : getGarCreateTime().hashCode());
  168 + result = prime * result + ((getGarUpdateTime() == null) ? 0 : getGarUpdateTime().hashCode());
  169 + result = prime * result + ((getGarCreateBy() == null) ? 0 : getGarCreateBy().hashCode());
  170 + result = prime * result + ((getGarUpdateBy() == null) ? 0 : getGarUpdateBy().hashCode());
  171 + result = prime * result + ((getGarRemark() == null) ? 0 : getGarRemark().hashCode());
  172 + return result;
  173 + }
  174 +
  175 + @Override
  176 + public String toString() {
  177 + StringBuilder sb = new StringBuilder();
  178 + sb.append(getClass().getSimpleName());
  179 + sb.append(" [");
  180 + sb.append("Hash = ").append(hashCode());
  181 + sb.append(", garOrderId=").append(garOrderId);
  182 + sb.append(", garOrderUserId=").append(garOrderUserId);
  183 + sb.append(", garOrderHandleId=").append(garOrderHandlerId);
  184 + sb.append(", garOrderAddress=").append(garOrderAddress);
  185 + sb.append(", garOrderAddressDetails=").append(garOrderAddressDetails);
  186 + sb.append(", garOrderContactName=").append(garOrderContactName);
  187 + sb.append(", garOrderTrashType=").append(garOrderTrashType);
  188 + sb.append(", garOrderContactTel=").append(garOrderContactTel);
  189 + sb.append(", garOrderCompanyId=").append(garOrderCompanyId);
  190 + sb.append(", garOrderCompanyName=").append(garOrderCompanyName);
  191 + sb.append(", garOrderCompanyTel=").append(garOrderCompanyTel);
  192 + sb.append(", garOrderHanderStatus=").append(garOrderHandlerStatus);
  193 + sb.append(", garOrderAgreementTime=").append(garOrderAgreementTime);
  194 + sb.append(", garCreateTime=").append(garCreateTime);
  195 + sb.append(", garUpdateTime=").append(garUpdateTime);
  196 + sb.append(", garCreateBy=").append(garCreateBy);
  197 + sb.append(", garUpdateBy=").append(garUpdateBy);
  198 + sb.append(", garRemark=").append(garRemark);
  199 + sb.append(", serialVersionUID=").append(serialVersionUID);
  200 + sb.append("]");
  201 + return sb.toString();
  202 + }
  203 +}
0 204 \ No newline at end of file
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/domain/GarOrderImage.java 0 → 100644
  1 +package com.trash.garbage.pojo.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.FieldFill;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import java.io.Serializable;
  8 +import java.util.Date;
  9 +
  10 +import com.fasterxml.jackson.annotation.JsonFormat;
  11 +import lombok.Data;
  12 +
  13 +/**
  14 + * 装修垃圾-订单图片表
  15 + * @TableName gar_order_image
  16 + */
  17 +@TableName(value ="gar_order_image")
  18 +@Data
  19 +public class GarOrderImage implements Serializable {
  20 + /**
  21 + * 图片id
  22 + */
  23 + @TableId
  24 + private String garImageId;
  25 +
  26 + /**
  27 + * 订单表id
  28 + */
  29 + private String garOrderId;
  30 +
  31 + /**
  32 + * 图片类型
  33 + */
  34 + private Integer garOrderImageType;
  35 +
  36 + /**
  37 + * 图片路径
  38 + */
  39 + private String garOrderImageUrl;
  40 +
  41 + /**
  42 + * 创建时间
  43 + */
  44 + @TableField(fill = FieldFill.INSERT)
  45 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  46 + private Date garCreateTime;
  47 +
  48 + /**
  49 + * 修改时间
  50 + */
  51 + @TableField(fill = FieldFill.INSERT_UPDATE)
  52 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:dd")
  53 + private Date garUpdateTime;
  54 +
  55 + /**
  56 + * 创建人
  57 + */
  58 + @TableField(fill = FieldFill.INSERT)
  59 + private String garCreateBy;
  60 +
  61 + /**
  62 + * 修改人
  63 + */
  64 + @TableField(fill = FieldFill.INSERT_UPDATE)
  65 + private String garUpdateBy;
  66 +
  67 + /**
  68 + * 备注
  69 + */
  70 + private String garRemark;
  71 +
  72 + @TableField(exist = false)
  73 + private static final long serialVersionUID = 1L;
  74 +
  75 + @Override
  76 + public boolean equals(Object that) {
  77 + if (this == that) {
  78 + return true;
  79 + }
  80 + if (that == null) {
  81 + return false;
  82 + }
  83 + if (getClass() != that.getClass()) {
  84 + return false;
  85 + }
  86 + GarOrderImage other = (GarOrderImage) that;
  87 + return (this.getGarImageId() == null ? other.getGarImageId() == null : this.getGarImageId().equals(other.getGarImageId()))
  88 + && (this.getGarOrderId() == null ? other.getGarOrderId() == null : this.getGarOrderId().equals(other.getGarOrderId()))
  89 + && (this.getGarOrderImageType() == null ? other.getGarOrderImageType() == null : this.getGarOrderImageType().equals(other.getGarOrderImageType()))
  90 + && (this.getGarOrderImageUrl() == null ? other.getGarOrderImageUrl() == null : this.getGarOrderImageUrl().equals(other.getGarOrderImageUrl()))
  91 + && (this.getGarCreateTime() == null ? other.getGarCreateTime() == null : this.getGarCreateTime().equals(other.getGarCreateTime()))
  92 + && (this.getGarUpdateTime() == null ? other.getGarUpdateTime() == null : this.getGarUpdateTime().equals(other.getGarUpdateTime()))
  93 + && (this.getGarCreateBy() == null ? other.getGarCreateBy() == null : this.getGarCreateBy().equals(other.getGarCreateBy()))
  94 + && (this.getGarUpdateBy() == null ? other.getGarUpdateBy() == null : this.getGarUpdateBy().equals(other.getGarUpdateBy()))
  95 + && (this.getGarRemark() == null ? other.getGarRemark() == null : this.getGarRemark().equals(other.getGarRemark()));
  96 + }
  97 +
  98 + @Override
  99 + public int hashCode() {
  100 + final int prime = 31;
  101 + int result = 1;
  102 + result = prime * result + ((getGarImageId() == null) ? 0 : getGarImageId().hashCode());
  103 + result = prime * result + ((getGarOrderId() == null) ? 0 : getGarOrderId().hashCode());
  104 + result = prime * result + ((getGarOrderImageType() == null) ? 0 : getGarOrderImageType().hashCode());
  105 + result = prime * result + ((getGarOrderImageUrl() == null) ? 0 : getGarOrderImageUrl().hashCode());
  106 + result = prime * result + ((getGarCreateTime() == null) ? 0 : getGarCreateTime().hashCode());
  107 + result = prime * result + ((getGarUpdateTime() == null) ? 0 : getGarUpdateTime().hashCode());
  108 + result = prime * result + ((getGarCreateBy() == null) ? 0 : getGarCreateBy().hashCode());
  109 + result = prime * result + ((getGarUpdateBy() == null) ? 0 : getGarUpdateBy().hashCode());
  110 + result = prime * result + ((getGarRemark() == null) ? 0 : getGarRemark().hashCode());
  111 + return result;
  112 + }
  113 +
  114 + @Override
  115 + public String toString() {
  116 + StringBuilder sb = new StringBuilder();
  117 + sb.append(getClass().getSimpleName());
  118 + sb.append(" [");
  119 + sb.append("Hash = ").append(hashCode());
  120 + sb.append(", garImageId=").append(garImageId);
  121 + sb.append(", garOrderId=").append(garOrderId);
  122 + sb.append(", garOrderImageType=").append(garOrderImageType);
  123 + sb.append(", garOrderImageUrl=").append(garOrderImageUrl);
  124 + sb.append(", garCreateTime=").append(garCreateTime);
  125 + sb.append(", garUpdateTime=").append(garUpdateTime);
  126 + sb.append(", garCreateBy=").append(garCreateBy);
  127 + sb.append(", garUpdateBy=").append(garUpdateBy);
  128 + sb.append(", garRemark=").append(garRemark);
  129 + sb.append(", serialVersionUID=").append(serialVersionUID);
  130 + sb.append("]");
  131 + return sb.toString();
  132 + }
  133 +}
0 134 \ No newline at end of file
... ...
trash-garbage/src/main/java/com/trash/garbage/pojo/dto/OrderDto.java 0 → 100644
  1 +package com.trash.garbage.pojo.dto;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableId;
  4 +import lombok.Data;
  5 +
  6 +/**
  7 + * 新增订单dto
  8 + * @author 20412
  9 + */
  10 +@Data
  11 +public class OrderDto {
  12 + /**
  13 + * 订单id
  14 + */
  15 + @TableId
  16 + private String garOrderId;
  17 +
  18 + /**
  19 + * 负责处理人id
  20 + */
  21 + private String garOrderHandleId;
  22 +
  23 + /**
  24 + * 订单地址
  25 + */
  26 + private String garOrderAddress;
  27 +
  28 + /**
  29 + * 订单详细地址
  30 + */
  31 + private String garOrderAddressDetails;
  32 +
  33 + /**
  34 + * 订单姓名
  35 + */
  36 + private String garOrderContactName;
  37 +
  38 + /**
  39 + * 垃圾类型
  40 + */
  41 + private String garOrderTrashType;
  42 +
  43 + /**
  44 + * 订单人电话
  45 + */
  46 + private String garOrderContactTel;
  47 +
  48 + /**
  49 + * 承接经营单位
  50 + */
  51 + private String garOrderCompanyId;
  52 +
  53 + /**
  54 + * 公司名称
  55 + */
  56 + private String garOrderCompanyName;
  57 +
  58 + /**
  59 + * 公司负责人电话
  60 + */
  61 + private String garOrderCompanyTel;
  62 +
  63 + /**
  64 + * 约定时间
  65 + */
  66 + private String garOrderAgreementTime;
  67 +
  68 + /**
  69 + * 备注
  70 + */
  71 + private String garRemark;
  72 +
  73 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderImageService.java 0 → 100644
  1 +package com.trash.garbage.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.trash.garbage.pojo.domain.GarOrderImage;
  5 +
  6 +/**
  7 +* @author 20412
  8 +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Service
  9 +* @createDate 2023-11-24 16:26:19
  10 +*/
  11 +public interface GarOrderImageService extends IService<GarOrderImage> {
  12 +
  13 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/service/GarOrderService.java 0 → 100644
  1 +package com.trash.garbage.service;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.trash.garbage.pojo.domain.GarOrder;
  5 +import com.trash.garbage.pojo.dto.OrderDto;
  6 +
  7 +/**
  8 +* @author 20412
  9 +* @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Service
  10 +* @createDate 2023-11-24 16:26:19
  11 +*/
  12 +public interface GarOrderService extends IService<GarOrder> {
  13 +
  14 + /**
  15 + * 新增订单
  16 + * @param dto
  17 + * @return
  18 + */
  19 + String saveOrder(OrderDto dto);
  20 +}
... ...
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderImageServiceImpl.java 0 → 100644
  1 +package com.trash.garbage.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.trash.garbage.pojo.domain.GarOrderImage;
  5 +import com.trash.garbage.service.GarOrderImageService;
  6 +import com.trash.garbage.mapper.GarOrderImageMapper;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +/**
  10 +* @author 20412
  11 +* @description 针对表【gar_order_image(装修垃圾-订单图片表)】的数据库操作Service实现
  12 +* @createDate 2023-11-24 16:26:19
  13 +*/
  14 +@Service
  15 +public class GarOrderImageServiceImpl extends ServiceImpl<GarOrderImageMapper, GarOrderImage>
  16 + implements GarOrderImageService{
  17 +
  18 +}
  19 +
  20 +
  21 +
  22 +
... ...
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarOrderServiceImpl.java 0 → 100644
  1 +package com.trash.garbage.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.trash.common.utils.SecurityUtils;
  5 +import com.trash.common.utils.bean.BeanUtils;
  6 +import com.trash.garbage.pojo.domain.GarOrder;
  7 +import com.trash.garbage.pojo.dto.OrderDto;
  8 +import com.trash.garbage.service.GarOrderService;
  9 +import com.trash.garbage.mapper.GarOrderMapper;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +/**
  13 + * @author 20412
  14 + * @description 针对表【gar_order(建筑垃圾—订单表)】的数据库操作Service实现
  15 + * @createDate 2023-11-24 16:26:19
  16 + */
  17 +@Service
  18 +public class GarOrderServiceImpl extends ServiceImpl<GarOrderMapper, GarOrder>
  19 + implements GarOrderService {
  20 +
  21 + @Override
  22 + public String saveOrder(OrderDto dto) {
  23 + String userId = SecurityUtils.getLoginUser().getUser().getUserId();
  24 + GarOrder order = new GarOrder();
  25 + BeanUtils.copyBeanProp(order, dto);
  26 + order.setGarOrderUserId(userId);
  27 + save(order);
  28 + return "订单创建成功";
  29 + }
  30 +}
  31 +
  32 +
  33 +
  34 +
... ...
trash-garbage/src/main/java/com/trash/garbage/service/impl/GarUserServiceImpl.java
... ... @@ -116,9 +116,6 @@ public class GarUserServiceImpl extends ServiceImpl&lt;GarUserMapper, GarUser&gt;
116 116 user.setRoles(roles);
117 117 loginUser.setPermissions(set);
118 118 String token = JwtUtils.createToken(nUser.getGarUserId(), nUser.getGarUserTel());
119   - if (!token.contains("Bearer ")) {
120   - token = "Bearer " + token;
121   - }
122 119 loginUser.setToken(token);
123 120 tokenService.refreshToken(loginUser);
124 121 return token;
... ...
trash-garbage/src/main/resources/mapper/GarOrderImageMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.garbage.mapper.GarOrderImageMapper">
  6 +
  7 + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderImage">
  8 + <id property="garImageId" column="gar_image_id" jdbcType="VARCHAR"/>
  9 + <result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
  10 + <result property="garOrderImageType" column="gar_order_image_type" jdbcType="TINYINT"/>
  11 + <result property="garOrderImageUrl" column="gar_order_image_url" jdbcType="VARCHAR"/>
  12 + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
  13 + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
  14 + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
  15 + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
  16 + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
  17 + </resultMap>
  18 +
  19 + <sql id="Base_Column_List">
  20 + gar_image_id,gar_order_id,gar_order_image_type,
  21 + gar_order_image_url,gar_create_time,gar_update_time,
  22 + gar_create_by,gar_update_by,gar_remark
  23 + </sql>
  24 +</mapper>
... ...
trash-garbage/src/main/resources/mapper/GarOrderMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.trash.garbage.mapper.GarOrderMapper">
  6 +
  7 + <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrder">
  8 + <id property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
  9 + <result property="garOrderUserId" column="gar_order_user_id" jdbcType="VARCHAR"/>
  10 + <result property="garOrderHandlerId" column="gar_order_handler_id" jdbcType="VARCHAR"/>
  11 + <result property="garOrderAddress" column="gar_order_address" jdbcType="VARCHAR"/>
  12 + <result property="garOrderAddressDetails" column="gar_order_address_details" jdbcType="VARCHAR"/>
  13 + <result property="garOrderContactName" column="gar_order_contact_name" jdbcType="VARCHAR"/>
  14 + <result property="garOrderTrashType" column="gar_order_trash_type" jdbcType="VARCHAR"/>
  15 + <result property="garOrderContactTel" column="gar_order_contact_tel" jdbcType="VARCHAR"/>
  16 + <result property="garOrderCompanyId" column="gar_order_company_id" jdbcType="VARCHAR"/>
  17 + <result property="garOrderCompanyName" column="gar_order_company_name" jdbcType="VARCHAR"/>
  18 + <result property="garOrderCompanyTel" column="gar_order_company_tel" jdbcType="VARCHAR"/>
  19 + <result property="garOrderHandlerStatus" column="gar_order_handler_status" jdbcType="INTEGER"/>
  20 + <result property="garOrderAgreementTime" column="gar_order_agreement_time" jdbcType="VARCHAR"/>
  21 + <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
  22 + <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
  23 + <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
  24 + <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
  25 + <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
  26 + </resultMap>
  27 +
  28 + <sql id="Base_Column_List">
  29 + gar_order_id,gar_order_user_id,gar_order_handle_id,
  30 + gar_order_address,gar_order_address_details,gar_order_contact_name,
  31 + gar_order_trash_type,gar_order_contact_tel,gar_order_company_id,
  32 + gar_order_company_name,gar_order_company_tel,gar_order_hander_status,
  33 + gar_order_agreement_time,gar_create_time,gar_update_time,
  34 + gar_create_by,gar_update_by,gar_remark
  35 + </sql>
  36 +</mapper>
... ...