From a2bc0d00e6d503d3ecd6abcb06c8a2a9a767bc95 Mon Sep 17 00:00:00 2001 From: haotianmingyue <2421912570@qq.com> Date: Thu, 19 Dec 2024 15:17:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=A5=E9=94=80=E5=AE=98--=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8--=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A4=B4=E5=83=8F=E5=92=8C=E6=94=AF=E4=BB=98=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backstage/SysMarketController.java | 11 +- .../system/domain/dto/OrderDetailDto.java | 266 ++++++++++++++++++ .../ruoyi/system/domain/dto/OrderInfoDto.java | 21 ++ .../ruoyi/system/domain/dto/OrderListDto.java | 10 + .../ruoyi/system/mapper/SysOrderMapper.java | 3 + .../system/service/ISysOrderService.java | 6 + .../service/impl/SysOrderServiceImpl.java | 6 + .../mapper/system/SysOrderMapper.xml | 42 ++- 8 files changed, 359 insertions(+), 6 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderDetailDto.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java index b4d08e5b..cb8c4edb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/backstage/SysMarketController.java @@ -135,6 +135,8 @@ public class SysMarketController extends BaseController { orderInfoDto.setNickName(orderListDto.getNickName()); orderInfoDto.setPhoneNumber(orderListDto.getPhonenumber()); orderInfoDto.setSource(orderInfoDto.getCity()+orderInfoDto.getScenic()+orderInfoDto.getPart()+orderInfoDto.getCoordinate()); + orderInfoDto.setAvatar(orderListDto.getAvatar()); + orderInfoDto.setWay(orderListDto.getWay()); } orderListDto.setOrderInfoList(orderInfoList); @@ -147,7 +149,7 @@ public class SysMarketController extends BaseController { //获取订单详情 @Log(title = "营销管理--查看订单详情", businessType = BusinessType.GET) - @PostMapping("/getOrderDetail/") + @PostMapping("/getOrderDetail") public AjaxResult getOrderDetail(@RequestBody GetOrderDetailDto getOrderDetailDto){ // sys_order 中的 order_id @@ -158,7 +160,12 @@ public class SysMarketController extends BaseController { // OrderInfoDto orderInfoDto = orderInfoService.getOrderInfoDto(id); - return success(); + OrderDetailDto orderDetailDto = sysOrderService.getOrderDetailDto(orderId, id); + + orderDetailDto.setSource(orderDetailDto.getCity()+orderDetailDto.getScenic()+orderDetailDto.getPart()+orderDetailDto.getCoordinate()); + orderDetailDto.setPresent(orderDetailDto.getStartTime() + " ~ " + orderDetailDto.getEndTime()); + + return success(orderDetailDto); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderDetailDto.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderDetailDto.java new file mode 100644 index 00000000..ea189153 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderDetailDto.java @@ -0,0 +1,266 @@ +package com.ruoyi.system.domain.dto; + +import java.util.Date; + +public class OrderDetailDto { + + private Long orderId; + + private Long userId; + + private String nickName; + private String phonenumber; + + private Date createTime; + + private Date startTime; + private Date endTime; + + private String present; + + private Long orderInfoId; + + private Long money; + + private Long refund; + private String way; + private String orderDetail; + + private String status; + + private Long id; + + private Long sourceId; + + private String workId; + + private String workName; + + private String workAddress; + + private String workDetail; + + private String city; + private String scenic; + private String part; + + private String source; + + + private String coordinate; + + private Date refundTime; + + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getNickName() { + return nickName; + } + + + public void setNickName(String nickName) { + this.nickName = nickName; + } + + public String getPhonenumber() { + return phonenumber; + } + + public void setPhonenumber(String phonenumber) { + this.phonenumber = phonenumber; + } + + public Date getCreateTime() { + + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Long getOrderInfoId() { + return orderInfoId; + } + + public void setOrderInfoId(Long orderInfoId) { + this.orderInfoId = orderInfoId; + } + + public Long getMoney() { + return money; + } + + public void setMoney(Long money) { + this.money = money; + } + + public Long getRefund() { + return refund; + } + + public void setRefund(Long refund) { + this.refund = refund; + } + + public String getWay() { + return way; + } + + public void setWay(String way) { + this.way = way; + } + + public String getOrderDetail() { + return orderDetail; + } + + public void setOrderDetail(String orderDetail) { + this.orderDetail = orderDetail; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getSourceId() { + return sourceId; + } + + public void setSourceId(Long sourceId) { + this.sourceId = sourceId; + } + + public String getWorkId() { + return workId; + } + + public void setWorkId(String workId) { + this.workId = workId; + } + + public String getWorkName() { + return workName; + } + + public void setWorkName(String workName) { + this.workName = workName; + } + + public String getWorkAddress() { + return workAddress; + } + + public void setWorkAddress(String workAddress) { + this.workAddress = workAddress; + } + + public String getWorkDetail() { + return workDetail; + } + + public void setWorkDetail(String workDetail) { + this.workDetail = workDetail; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getScenic() { + return scenic; + } + + public void setScenic(String scenic) { + this.scenic = scenic; + } + + public String getPart() { + return part; + } + + public void setPart(String part) { + this.part = part; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getCoordinate() { + return coordinate; + } + + public void setCoordinate(String coordinate) { + this.coordinate = coordinate; + } + + public Date getRefundTime() { + return refundTime; + } + + public void setRefundTime(Date refundTime) { + this.refundTime = refundTime; + } + + public String getPresent() { + return present; + } + + public void setPresent(String present) { + this.present = present; + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderInfoDto.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderInfoDto.java index 072d5369..ed4f2da4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderInfoDto.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderInfoDto.java @@ -35,6 +35,10 @@ public class OrderInfoDto { private Date refundTime; + private String avatar; + + private String way; + public String getPart() { return part; } @@ -172,4 +176,21 @@ public class OrderInfoDto { } + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public String getWay() { + return way; + } + + public void setWay(String way) { + this.way = way; + } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderListDto.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderListDto.java index eb5bd4c5..36c2c90c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderListDto.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/OrderListDto.java @@ -28,6 +28,8 @@ public class OrderListDto { private String status; + private String avatar; + private List orderInfoList; public Long getOrderId() { @@ -143,6 +145,14 @@ public class OrderListDto { this.phonenumber = phonenumber; } + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOrderMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOrderMapper.java index 49131fbe..6c497a25 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOrderMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOrderMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.system.mapper; import java.time.LocalDate; import java.util.List; import com.ruoyi.system.domain.SysOrder; +import com.ruoyi.system.domain.dto.OrderDetailDto; import com.ruoyi.system.domain.dto.OrderListDto; import org.apache.ibatis.annotations.Param; @@ -67,4 +68,6 @@ public interface SysOrderMapper public int isTimeLegal(@Param("startTime")LocalDate startTime, @Param("endTime") LocalDate endTime, @Param("sourceId") Long sourceId); public List getOrderListDto(SysOrder sysOrder); + + public OrderDetailDto getOrderDetailDto(@Param("orderId") Long orderId, @Param("id") Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOrderService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOrderService.java index 8d634831..43eb346d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOrderService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOrderService.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service; import java.time.LocalDate; import java.util.List; import com.ruoyi.system.domain.SysOrder; +import com.ruoyi.system.domain.dto.OrderDetailDto; import com.ruoyi.system.domain.dto.OrderListDto; /** @@ -72,4 +73,9 @@ public interface ISysOrderService * */ public List getOrderListDto(SysOrder sysOrder); + + /* + * 营销管理--获取订单的详细信息 + * */ + public OrderDetailDto getOrderDetailDto(Long orderId, Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOrderServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOrderServiceImpl.java index 7e251503..1acaa9db 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOrderServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOrderServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; import java.time.LocalDate; import java.util.List; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.dto.OrderDetailDto; import com.ruoyi.system.domain.dto.OrderListDto; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -104,4 +105,9 @@ public class SysOrderServiceImpl implements ISysOrderService public List getOrderListDto(SysOrder sysOrder){ return sysOrderMapper.getOrderListDto(sysOrder); } + + @Override + public OrderDetailDto getOrderDetailDto(Long orderId, Long id){ + return sysOrderMapper.getOrderDetailDto(orderId, id); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysOrderMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysOrderMapper.xml index b1ce93d5..66b7594f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysOrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysOrderMapper.xml @@ -34,8 +34,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -69,18 +96,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select count(*) from sys_order where source_id = #{sourceId} and #{endTime} >= sys_order.start_time and sys_order.end_time >= #{startTime} + insert into sys_order