diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java new file mode 100644 index 00000000..d92b37d1 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcHistoryOrderController.java @@ -0,0 +1,52 @@ +package com.xhpc.order.controller; + +import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.order.service.IXhpcHistoryOrderService; +import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; +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 java.util.List; +import java.util.Map; + +/** + * 历史订单 + * @author yuyang + * @date 2021/8/3 21:19 + */ +@RestController +@RequestMapping("/histotyOrder") +@Api(value = "历史订单清接口", tags = "历史订单接口") +public class XhpcHistoryOrderController extends BaseController { + + + @Autowired + private IXhpcHistoryOrderService xhpcHistoryOrderService; + /** + * 用户历史订单接口 + */ + @GetMapping("/list") + public TableDataInfo list(@RequestParam Long userId) + { + startPage(); + List> list = xhpcHistoryOrderService.list(userId); + return getDataTable(list); + } + + /** + * 用户订单详情接口 + */ + @GetMapping("/gethistotyOrderMessage") + public AjaxResult gethistotyOrderMessage(@RequestParam Long userId,@RequestParam Long historyOrderId) + { + return xhpcHistoryOrderService.gethistotyOrderMessage(userId,historyOrderId); + } + + + +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java index 84c00ef7..20d7974f 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcHistoryOrderMapper.java @@ -3,6 +3,9 @@ package com.xhpc.order.mapper; import com.xhpc.order.domain.XhpcHistoryOrder; import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; + /** * 历史订单信息 数据层 * @@ -49,4 +52,19 @@ public interface XhpcHistoryOrderMapper { * @return 结果 */ public int updateSorting(String[] xhpcHistoryOrderIds); + + /** + * 用户历史订单表 + * @param userId + * @return + */ + List> list(@Param("userId") Long userId); + + /** + * 订单详情 + * @param userId + * @param historyOrderId + * @return + */ + Map gethistotyOrderMessage(@Param("userId")Long userId,@Param("historyOrderId")Long historyOrderId); } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java new file mode 100644 index 00000000..6aaa43bd --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcHistoryOrderService.java @@ -0,0 +1,30 @@ +package com.xhpc.order.service; + +import com.xhpc.common.core.web.domain.AjaxResult; +import org.springframework.web.bind.annotation.RequestParam; + +import java.util.List; +import java.util.Map; + +/** + * @author yuyang + * @date 2021/8/3 21:23 + */ +public interface IXhpcHistoryOrderService { + + + /** + * 用户历史订单表 + * @param userId + * @return + */ + List> list(Long userId); + + /** + * 用户订单详情 + * @param userId + * @param historyOrderId + * @return + */ + AjaxResult gethistotyOrderMessage(Long userId,Long historyOrderId); +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java new file mode 100644 index 00000000..fcdd35a8 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -0,0 +1,31 @@ +package com.xhpc.order.service.impl; + +import com.xhpc.common.core.web.domain.AjaxResult; +import com.xhpc.order.mapper.XhpcHistoryOrderMapper; +import com.xhpc.order.service.IXhpcHistoryOrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @author yuyang + * @date 2021/8/3 21:23 + */ +@Service +public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService { + + @Autowired + private XhpcHistoryOrderMapper xhpcHistoryOrderMapper; + @Override + public List> list(Long userId) { + return xhpcHistoryOrderMapper.list(userId); + } + + @Override + public AjaxResult gethistotyOrderMessage(Long userId, Long historyOrderId) { + return AjaxResult.success(xhpcHistoryOrderMapper.gethistotyOrderMessage(userId,historyOrderId)); + } + +} diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index c5b0fb6e..cf3b9fa0 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -294,4 +294,46 @@ #{xhpcHistoryOrderId} + + + + \ No newline at end of file