From d375fe94715d15bfa748991df5d922106a477e5d Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 24 Jun 2021 19:23:04 +0800 Subject: [PATCH] Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop --- gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminOrderController.java | 95 +++++++++++++ gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java | 20 ++ gc-shop/src/main/java/com/xzx/gc/shop/dto/DeliverGoodsDto.java | 17 ++ gc-shop/src/main/resources/mapper/shop/ScoreExpressInfoMapper.xml | 5 gc-shop/src/main/resources/sql | 5 gc-core/src/main/java/com/xzx/gc/entity/ScoreExpressInfo.java | 3 gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java | 10 gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java | 2 gc-shop/src/main/java/com/xzx/gc/shop/dto/ScoreGoodsStyleDto.java | 2 gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreExpressInfoMapper.java | 7 + gc-shop/src/main/resources/mapper/shop/ScoreOrderDetailsMapper.xml | 5 gc-shop/src/main/java/com/xzx/gc/shop/dto/ViewOrderDto.java | 10 + gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java | 13 + gc-shop/src/main/java/com/xzx/gc/shop/dto/InsureOrderDto.java | 15 ++ gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java | 90 ++++++++++++ gc-shop/src/main/java/com/xzx/gc/shop/vo/ScoreGoodsStyleVo.java | 2 gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreOrderDetailsMapper.java | 7 + gc-shop/src/main/resources/mapper/shop/ScoreOrderMapper.xml | 13 + gc-shop/src/main/java/com/xzx/gc/shop/vo/ExpressInfoVo.java | 32 ++++ gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewOrderVo.java | 52 +++++++ gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewGoodsVo.java | 2 21 files changed, 392 insertions(+), 15 deletions(-) diff --git a/gc-core/src/main/java/com/xzx/gc/entity/ScoreExpressInfo.java b/gc-core/src/main/java/com/xzx/gc/entity/ScoreExpressInfo.java index 6372f9e..e42eb4b 100644 --- a/gc-core/src/main/java/com/xzx/gc/entity/ScoreExpressInfo.java +++ b/gc-core/src/main/java/com/xzx/gc/entity/ScoreExpressInfo.java @@ -1,5 +1,6 @@ package com.xzx.gc.entity; +import com.xzx.gc.common.entity.BaseEntity; import lombok.Data; import javax.persistence.Table; @@ -10,7 +11,7 @@ **/ @Data @Table(name = "xzx_score_express_info") -public class ScoreExpressInfo { +public class ScoreExpressInfo extends BaseEntity { private String userId; diff --git a/gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java b/gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java index 204968e..7dcc56c 100644 --- a/gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java +++ b/gc-core/src/main/java/com/xzx/gc/entity/ScoreOrder.java @@ -1,5 +1,6 @@ package com.xzx.gc.entity; +import com.xzx.gc.common.entity.BaseEntity; import lombok.Data; import javax.persistence.Table; @@ -11,7 +12,7 @@ **/ @Data @Table(name = "xzx_score_order") -public class ScoreOrder { +public class ScoreOrder extends BaseEntity { private String orderNo; @@ -19,14 +20,22 @@ private String userId; + private String voucherImg; + private Integer cnt; private BigDecimal totalPrice; /** - * 2-待收货3-已完成4-已取消 + * 1-待发货2-待收货3-已收货4-已完成5-已评价6-已取消 */ private Integer status; + public static final Integer STATUS_READY = 1; + public static final Integer STATUS_ON = 2; + public static final Integer STATUS_DOING = 3; + public static final Integer STATUS_DONE = 4; + public static final Integer STATUS_EVALUATE = 5; + public static final Integer STATUS_CANCEL = 6; private String remark; } diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminOrderController.java b/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminOrderController.java index 8047c64..bff21e1 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminOrderController.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/controller/AdminOrderController.java @@ -1,13 +1,22 @@ package com.xzx.gc.shop.controller; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.xzx.gc.common.constant.CommonEnum; import com.xzx.gc.common.constant.Constants; +import com.xzx.gc.common.dto.log.OperationAppLog; import com.xzx.gc.common.request.BaseController; +import com.xzx.gc.entity.ScoreGoods; +import com.xzx.gc.entity.ScoreOrder; import com.xzx.gc.model.JsonResult; -import com.xzx.gc.shop.dto.QueryGoodsListDto; -import com.xzx.gc.shop.dto.QueryOrderListDto; +import com.xzx.gc.shop.dto.*; +import com.xzx.gc.shop.mapper.ScoreOrderMapper; import com.xzx.gc.shop.service.OrderService; import com.xzx.gc.shop.vo.QueryGoodsListVo; import com.xzx.gc.shop.vo.QueryOrderListVo; +import com.xzx.gc.shop.vo.ViewGoodsVo; +import com.xzx.gc.shop.vo.ViewOrderVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -18,6 +27,8 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; import java.util.Map; @RestController @@ -27,6 +38,8 @@ @Resource private OrderService orderService; + @Resource + private ScoreOrderMapper scoreOrderMapper; /** * 查询订单列表 @@ -40,4 +53,82 @@ return JsonResult.success(result); } + /** + * 查询订单详情 + */ + @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/goods/viewOrder.json") + @ApiResponses({@ApiResponse( code = 200, message = "success", response = ViewOrderVo.class)}) + @ApiOperation(value="订单管理-查询订单详情", notes="test: 仅0有正确返回") + public JsonResult<ViewOrderVo> viewOrder(@RequestBody ViewOrderDto viewOrderDto) { + Long id = viewOrderDto.getId(); + ViewOrderVo viewOrderVo = orderService.viewOrder(id); + return JsonResult.success(viewOrderVo); + } + + /** + * 发货 + */ + @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/goods/deliverGoods.json") + @ApiOperation(value="订单管理-发货", notes="test: 仅0有正确返回") + public JsonResult deliverGoods(@RequestBody DeliverGoodsDto model, HttpServletRequest request) { + long id = model.getId(); + ScoreOrder scoreOrder = scoreOrderMapper.selectByPrimaryKey(id); + if(ObjectUtil.isEmpty(scoreOrder)){ + return JsonResult.failMessage("订单不存在!"); + } + Integer status = scoreOrder.getStatus(); + if(ScoreOrder.STATUS_READY != status){ + return JsonResult.failMessage("当前订单不是代发货状态!"); + } + String expressCom = model.getExpressCom(); + if(StrUtil.isEmpty(expressCom)){ + return JsonResult.failMessage("物流公司不能为空!"); + } + String expressNo = model.getExpressNo(); + if(StrUtil.isEmpty(expressNo)){ + return JsonResult.failMessage("快递单号不能为空!"); + } + Long expressId = orderService.deliverGoods(model); + if(expressId > 0){ + OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) + .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-发货-" + id).build(); + mqUtil.sendApp(build); + return JsonResult.success("操作成功!"); + }else{ + return JsonResult.success("操作失败!"); + } + } + + /** + * 确认提货 + */ + @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/score/goods/insureOrder.json") + @ApiOperation(value="订单管理-确认提货", notes="test: 仅0有正确返回") + public JsonResult insureOrder(@RequestBody InsureOrderDto model, HttpServletRequest request) { + long id = model.getId(); + ScoreOrder scoreOrder = scoreOrderMapper.selectByPrimaryKey(id); + if(ObjectUtil.isEmpty(scoreOrder)){ + return JsonResult.failMessage("订单不存在!"); + } + Integer status = scoreOrder.getStatus(); + if(ScoreOrder.STATUS_DOING != status){ + return JsonResult.failMessage("当前订单不是已收货状态!"); + } + List<String> voucherImgs = model.getVoucherImgs(); + if(CollUtil.isEmpty(voucherImgs)){ + return JsonResult.failMessage("凭证不能为空!"); + } + Long orderId = orderService.insureOrder(model); + if(orderId > 0){ + OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) + .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("订单管理-确认提货-" + orderId).build(); + mqUtil.sendApp(build); + return JsonResult.success("操作成功!"); + }else{ + return JsonResult.success("操作失败!"); + } + } + + + } diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/DeliverGoodsDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/DeliverGoodsDto.java new file mode 100644 index 0000000..2bbaa1a --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/DeliverGoodsDto.java @@ -0,0 +1,17 @@ +package com.xzx.gc.shop.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class DeliverGoodsDto { + + @ApiModelProperty(value="订单ID") + private Long id; + + @ApiModelProperty(value="快递单号") + private String expressNo; + + @ApiModelProperty(value="物流公司") + private String expressCom; +} diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/InsureOrderDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/InsureOrderDto.java new file mode 100644 index 0000000..44b1df3 --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/InsureOrderDto.java @@ -0,0 +1,15 @@ +package com.xzx.gc.shop.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class InsureOrderDto { + + private Long id; + + @ApiModelProperty(value="凭证") + private List<String> voucherImgs; +} diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/ScoreGoodsStyleDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/ScoreGoodsStyleDto.java index 2760479..0a52b82 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/dto/ScoreGoodsStyleDto.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/ScoreGoodsStyleDto.java @@ -17,6 +17,6 @@ private Long goodsId; @ApiModelProperty(value="积分商品规格") - private List<ScoreGoodsSkuDto> scoreGoodsSkuDtos; + private List<ScoreGoodsSkuDto> scoreGoodsSkus; } diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java index 6d62cf1..192e053 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/UpdateGoodsDto.java @@ -68,7 +68,7 @@ private List<String> goodsImages; @ApiModelProperty(value="积分商品样式") - private List<ScoreGoodsStyleDto> scoreGoodsStyleDtos; + private List<ScoreGoodsStyleDto> scoreGoodsStyles; @ApiModelProperty(value="创建人") private String createdBy; diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/dto/ViewOrderDto.java b/gc-shop/src/main/java/com/xzx/gc/shop/dto/ViewOrderDto.java new file mode 100644 index 0000000..2d4054d --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/dto/ViewOrderDto.java @@ -0,0 +1,10 @@ +package com.xzx.gc.shop.dto; + +import lombok.Data; + +@Data +public class ViewOrderDto { + + + private Long id; +} diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreExpressInfoMapper.java b/gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreExpressInfoMapper.java new file mode 100644 index 0000000..b1b1907 --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreExpressInfoMapper.java @@ -0,0 +1,7 @@ +package com.xzx.gc.shop.mapper; + +import com.xzx.gc.entity.ScoreExpressInfo; +import com.xzx.gc.util.GcMapper; + +public interface ScoreExpressInfoMapper extends GcMapper<ScoreExpressInfo> { +} diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreOrderDetailsMapper.java b/gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreOrderDetailsMapper.java new file mode 100644 index 0000000..9cc3840 --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/mapper/ScoreOrderDetailsMapper.java @@ -0,0 +1,7 @@ +package com.xzx.gc.shop.mapper; + +import com.xzx.gc.entity.ScoreOrderDetails; +import com.xzx.gc.util.GcMapper; + +public interface ScoreOrderDetailsMapper extends GcMapper<ScoreOrderDetails> { +} diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java b/gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java index 906944e..805507b 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/service/GoodsService.java @@ -126,7 +126,7 @@ scoreGoodsStyle.setDelFlag(Convert.toShort(Constants.DEL_NOT_FLAG)); scoreGoodsStyleMapper.insert(scoreGoodsStyle); //规格信息 - List<ScoreGoodsSkuDto> scoreGoodsSkuDtos = scoreGoodsStyleDto.getScoreGoodsSkuDtos(); + List<ScoreGoodsSkuDto> scoreGoodsSkuDtos = scoreGoodsStyleDto.getScoreGoodsSkus(); if(CollUtil.isNotEmpty(scoreGoodsSkuDtos)){ for(ScoreGoodsSkuDto scoreGoodsSkuDto : scoreGoodsSkuDtos){ ScoreGoodsSku scoreGoodsSku = objectMapper.convertValue(scoreGoodsSkuDto, ScoreGoodsSku.class); @@ -196,11 +196,11 @@ //获取规格 Long styleId = goodsStyle.getId(); List<ScoreGoodsSkuVo> goodsSkus = scoreGoodsSkuMapper.selectScoreGoodsSkuByGoodsIdAndStyleId(id,styleId); - scoreGoodsStyleVo.setScoreGoodsSkuVos(goodsSkus); + scoreGoodsStyleVo.setScoreGoodsSkus(goodsSkus); scoreGoodsStyleVos.add(scoreGoodsStyleVo); } } - viewGoodsVo.setScoreGoodsStyleVos(scoreGoodsStyleVos); + viewGoodsVo.setScoreGoodsStyles(scoreGoodsStyleVos); } return viewGoodsVo; } @@ -227,7 +227,7 @@ } } - List<ScoreGoodsStyleDto> scoreGoodsStyleDtos = model.getScoreGoodsStyleDtos(); + List<ScoreGoodsStyleDto> scoreGoodsStyleDtos = model.getScoreGoodsStyles(); if(CollUtil.isNotEmpty(scoreGoodsStyleDtos)){ for(ScoreGoodsStyleDto scoreGoodsStyleDto : scoreGoodsStyleDtos){ ScoreGoodsStyle scoreGoodsStyle = new ScoreGoodsStyle(); @@ -236,7 +236,7 @@ scoreGoodsStyle.setGoodsId(scoreGoods.getId()); scoreGoodsStyleMapper.updateByPrimaryKeySelective(scoreGoodsStyle); //规格 - List<ScoreGoodsSkuDto> scoreGoodsSkuDtos = scoreGoodsStyleDto.getScoreGoodsSkuDtos(); + List<ScoreGoodsSkuDto> scoreGoodsSkuDtos = scoreGoodsStyleDto.getScoreGoodsSkus(); if(CollUtil.isNotEmpty(scoreGoodsSkuDtos)){ for(ScoreGoodsSkuDto scoreGoodsSkuDto : scoreGoodsSkuDtos){ ScoreGoodsSku scoreGoodsSku = objectMapper.convertValue(scoreGoodsSkuDto, ScoreGoodsSku.class); diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java b/gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java index 3f08d63..6b45805 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/service/OrderService.java @@ -1,14 +1,29 @@ package com.xzx.gc.shop.service; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.ObjectUtil; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import com.xzx.gc.entity.ScoreExpressInfo; +import com.xzx.gc.entity.ScoreGoodsStyle; +import com.xzx.gc.entity.ScoreOrder; +import com.xzx.gc.entity.ScoreOrderDetails; +import com.xzx.gc.shop.dto.DeliverGoodsDto; +import com.xzx.gc.shop.dto.InsureOrderDto; import com.xzx.gc.shop.dto.QueryOrderListDto; +import com.xzx.gc.shop.mapper.ScoreExpressInfoMapper; +import com.xzx.gc.shop.mapper.ScoreOrderDetailsMapper; import com.xzx.gc.shop.mapper.ScoreOrderMapper; +import com.xzx.gc.shop.vo.ExpressInfoVo; import com.xzx.gc.shop.vo.QueryOrderListVo; +import com.xzx.gc.shop.vo.ViewOrderVo; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import tk.mybatis.mapper.entity.Example; import javax.annotation.Resource; import java.util.Date; @@ -23,6 +38,12 @@ @Resource ScoreOrderMapper scoreOrderMapper; + + @Resource + ScoreExpressInfoMapper scoreExpressInfoMapper; + + @Resource + ScoreOrderDetailsMapper scoreOrderDetailsMapper; public Map<String, Object> queryOrderList(QueryOrderListDto model) { String name = model.getName(); @@ -41,4 +62,73 @@ return map; } + public ViewOrderVo viewOrder(Long id) { + ViewOrderVo viewOrderVo = new ViewOrderVo(); + ScoreOrder scoreOrder = scoreOrderMapper.selectByPrimaryKey(id); + if(ObjectUtil.isNotEmpty(scoreOrder)){ + /** + * 获取基本信息 + * 获取物流信息 + * 获取商品订单详情 + */ + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + viewOrderVo = objectMapper.convertValue(scoreOrder, ViewOrderVo.class); + //2-待收货3-已收货4-已完成5-已评价,获取物流信息 + Integer status = scoreOrder.getStatus() == null ? 0:scoreOrder.getStatus(); + if(ScoreOrder.STATUS_DOING == status + || ScoreOrder.STATUS_DONE == status + || ScoreOrder.STATUS_ON == status + || ScoreOrder.STATUS_EVALUATE == status){ + Example exampleExpress = new Example(ScoreExpressInfo.class); + Example.Criteria criteriaExpress = exampleExpress.createCriteria(); + criteriaExpress.andEqualTo("orderId",id); + ScoreExpressInfo scoreExpressInfo = scoreExpressInfoMapper.selectOneByExample(exampleExpress); + ExpressInfoVo expressInfoVo = objectMapper.convertValue(scoreExpressInfo, ExpressInfoVo.class); + viewOrderVo.setExpressInfoVo(expressInfoVo); + } + //订单详情 + Example exampleDetails = new Example(ScoreOrderDetails.class); + Example.Criteria criteriaDetails = exampleDetails.createCriteria(); + criteriaDetails.andEqualTo("orderId",id); + List<ScoreOrderDetails> scoreOrderDetails = scoreOrderDetailsMapper.selectByExample(exampleDetails); + if(CollUtil.isNotEmpty(scoreOrderDetails)){ + viewOrderVo.setScoreOrderDetails(scoreOrderDetails); + } + + } + return viewOrderVo; + } + + public Long deliverGoods(DeliverGoodsDto model) { + /** + * 获取物流表的信息 + * 更新物流信息 + * 更新订单状态 + */ + Long id = model.getId(); + Example exampleExpress = new Example(ScoreExpressInfo.class); + Example.Criteria criteriaExpress = exampleExpress.createCriteria(); + criteriaExpress.andEqualTo("orderId",id); + ScoreExpressInfo scoreExpressInfo = scoreExpressInfoMapper.selectOneByExample(exampleExpress); + if(ObjectUtil.isNotEmpty(scoreExpressInfo)){ + scoreExpressInfo.setExpressNo(model.getExpressNo()); + scoreExpressInfo.setExpressCom(model.getExpressCom()); + scoreExpressInfoMapper.updateByPrimaryKeySelective(scoreExpressInfo); + + ScoreOrder scoreOrder = new ScoreOrder(); + scoreOrder.setId(id); + scoreOrder.setStatus(ScoreOrder.STATUS_ON); + scoreOrderMapper.updateByPrimaryKeySelective(scoreOrder); + } + return scoreExpressInfo.getId(); + } + + public Long insureOrder(InsureOrderDto model) { + ScoreOrder scoreOrder = new ScoreOrder(); + scoreOrder.setId(model.getId()); + scoreOrder.setVoucherImg(model.getVoucherImgs().toString()); + scoreOrderMapper.updateByPrimaryKeySelective(scoreOrder); + return scoreOrder.getId(); + } } diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/vo/ExpressInfoVo.java b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ExpressInfoVo.java new file mode 100644 index 0000000..76bac7b --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ExpressInfoVo.java @@ -0,0 +1,32 @@ +package com.xzx.gc.shop.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "ViewOrderVo", description = "物流") +public class ExpressInfoVo { + + @ApiModelProperty(value="用户ID") + private String userId; + + @ApiModelProperty(value="联系姓名") + private String username; + + @ApiModelProperty(value="联系电话") + private String phone; + + @ApiModelProperty(value="地址") + private String address; + + @ApiModelProperty(value="快递单号") + private String expressNo; + + @ApiModelProperty(value="物流公司") + private String expressCom; + + @ApiModelProperty(value="订单ID") + private Long orderId; + +} diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java b/gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java index 94aa9e7..feeb063 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/vo/QueryOrderListVo.java @@ -1,9 +1,29 @@ package com.xzx.gc.shop.vo; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "QueryOrderListVo", description = "返回") public class QueryOrderListVo { + + @ApiModelProperty(value="订单编号") + private String orderNo; + @ApiModelProperty(value="客户姓名") + private String name; + @ApiModelProperty(value="客户手机号") + private String phone; + @ApiModelProperty(value="下单时间") + private String createdTime; + @ApiModelProperty(value="订单总价") + private String totalPrice; + @ApiModelProperty(value="数量") + private String cnt; + @ApiModelProperty(value="状态 2-待收货3-已完成4-已取消") + private String status; + @ApiModelProperty(value="物流公司") + private String expressCom; + @ApiModelProperty(value="物流单号") + private String expressNo; } diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/vo/ScoreGoodsStyleVo.java b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ScoreGoodsStyleVo.java index 95929c1..85f3692 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/vo/ScoreGoodsStyleVo.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ScoreGoodsStyleVo.java @@ -19,5 +19,5 @@ private Long goodsId; @ApiModelProperty(value="积分商品规格") - private List<ScoreGoodsSkuVo> scoreGoodsSkuVos; + private List<ScoreGoodsSkuVo> scoreGoodsSkus; } diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewGoodsVo.java b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewGoodsVo.java index 4faee4b..c8f1608 100644 --- a/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewGoodsVo.java +++ b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewGoodsVo.java @@ -72,7 +72,7 @@ private List<String> goodsImages; @ApiModelProperty(value="积分商品样式") - private List<ScoreGoodsStyleVo> scoreGoodsStyleVos; + private List<ScoreGoodsStyleVo> scoreGoodsStyles; @ApiModelProperty(value="创建人") private String createdBy; diff --git a/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewOrderVo.java b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewOrderVo.java new file mode 100644 index 0000000..076d0b7 --- /dev/null +++ b/gc-shop/src/main/java/com/xzx/gc/shop/vo/ViewOrderVo.java @@ -0,0 +1,52 @@ +package com.xzx.gc.shop.vo; + +import com.xzx.gc.entity.ScoreOrderDetails; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@ApiModel(value = "ViewOrderVo", description = "订单") +public class ViewOrderVo { + + @ApiModelProperty(value="订单编号") + private String orderNo; + + @ApiModelProperty(value="商品名称") + private String goodsName; + + @ApiModelProperty(value="用户ID") + private String userId; + + @ApiModelProperty(value="数量") + private Integer cnt; + + @ApiModelProperty(value="总价") + private BigDecimal totalPrice; + + @ApiModelProperty(value="凭证") + private String voucherImg; + + /** + * 2-待收货3-已完成4-已取消 + */ + @ApiModelProperty(value="状态 2-待收货3-已完成4-已取消") + private Integer status; + + @ApiModelProperty(value="备注") + private String remark; + + @ApiModelProperty(value="物流信息") + private ExpressInfoVo expressInfoVo; + + @ApiModelProperty(value="订单详情信息") + private List<ScoreOrderDetails> scoreOrderDetails; + + + + + +} diff --git a/gc-shop/src/main/resources/mapper/shop/ScoreExpressInfoMapper.xml b/gc-shop/src/main/resources/mapper/shop/ScoreExpressInfoMapper.xml new file mode 100644 index 0000000..e77e5f3 --- /dev/null +++ b/gc-shop/src/main/resources/mapper/shop/ScoreExpressInfoMapper.xml @@ -0,0 +1,5 @@ +<?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.xzx.gc.shop.mapper.ScoreExpressInfoMapper"> + +</mapper> diff --git a/gc-shop/src/main/resources/mapper/shop/ScoreOrderDetailsMapper.xml b/gc-shop/src/main/resources/mapper/shop/ScoreOrderDetailsMapper.xml new file mode 100644 index 0000000..4286ee6 --- /dev/null +++ b/gc-shop/src/main/resources/mapper/shop/ScoreOrderDetailsMapper.xml @@ -0,0 +1,5 @@ +<?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.xzx.gc.shop.mapper.ScoreOrderDetailsMapper"> + +</mapper> diff --git a/gc-shop/src/main/resources/mapper/shop/ScoreOrderMapper.xml b/gc-shop/src/main/resources/mapper/shop/ScoreOrderMapper.xml index 6d45814..bd91fb4 100644 --- a/gc-shop/src/main/resources/mapper/shop/ScoreOrderMapper.xml +++ b/gc-shop/src/main/resources/mapper/shop/ScoreOrderMapper.xml @@ -4,13 +4,24 @@ <select id="queryOrderList" resultType="com.xzx.gc.shop.vo.QueryOrderListVo"> SELECT - * + a.*, + b.name name, + b.mobile_phone phone, + d.express_com expressCom, + d.express_no expressNo, FROM xzx_score_order a + left join xzx_user_info b where b.user_id = a.user_id +-- left join xzx_score_order_details c where c.order_id = a.id + left join xzx_score_express_info d where d.order_id = a.id WHERE 1 = 1 <if test="orderNo != null and orderNo != ''"> and a.order_no like concat('%',#{orderNo},'%') </if> + + <if test="name != null and name != ''"> + and b.name like concat('%',#{name},'%') + </if> <if test="status != null and status != ''"> and a.status = #{status} </if> diff --git a/gc-shop/src/main/resources/sql b/gc-shop/src/main/resources/sql index 263f717..9057995 100644 --- a/gc-shop/src/main/resources/sql +++ b/gc-shop/src/main/resources/sql @@ -50,5 +50,10 @@ ADD COLUMN `category_id` bigint(20) NULL COMMENT '分类ID' AFTER `price_range`, ADD COLUMN `category_name` varchar(100) NULL COMMENT '分类名称' AFTER `category_id`; +ALTER TABLE `xzx_score_order` +ADD COLUMN `voucher_img` varchar(500) NULL COMMENT '凭证' AFTER `remark`; + + + -- Gitblit v1.9.1