4 files modified
5 files added
| | |
| | | |
| | | private String details; |
| | | |
| | | private String priceRange; |
| | | // private String priceRange; |
| | | |
| | | private String originalPrice; |
| | | |
| | | private String presentPrice; |
| | | |
| | | private String categoryId; |
| | | |
| | |
| | | if(!parentId.equals(scoreGoodsCategory.getParentId())){ |
| | | scoreGoodsCategory.setParentId(parentId); |
| | | } |
| | | if(parentId.equals(id)){ |
| | | return JsonResult.failMessage("父类不能为自己!"); |
| | | } |
| | | |
| | | GoodsCategoryModel goodsCategoryModel = new GoodsCategoryModel(); |
| | | goodsCategoryModel.setName(name); |
New file |
| | |
| | | package com.xzx.gc.shop.controller; |
| | | |
| | | import com.xzx.gc.common.constant.Constants; |
| | | import com.xzx.gc.common.request.BaseController; |
| | | 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.service.OrderService; |
| | | import com.xzx.gc.shop.vo.QueryGoodsListVo; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(tags = {"积分商城--订单管理"}) |
| | | @Slf4j |
| | | public class AdminOrderController extends BaseController { |
| | | |
| | | @Resource |
| | | private OrderService orderService; |
| | | |
| | | /** |
| | | * 查询订单列表 |
| | | * xzx_score_order 积分商城订单 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX+"/score/goods/queryOrderList.json") |
| | | @ApiResponses({@ApiResponse( code = 200, message = "success", response = QueryOrderListVo.class)}) |
| | | @ApiOperation(value = "订单管理-查询订单列表", notes = "test: 仅0有正确返回") |
| | | public JsonResult<Map<String, Object>> queryOrderList(@RequestBody QueryOrderListDto model) { |
| | | Map<String, Object> result = orderService.queryOrderList(model); |
| | | return JsonResult.success(result); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value="商品详情",required=true) |
| | | private String details; |
| | | |
| | | @ApiModelProperty(value="积分范围",required=true) |
| | | private String priceRange; |
| | | // @ApiModelProperty(value="积分范围",required=true) |
| | | // private String priceRange; |
| | | |
| | | @ApiModelProperty(value="原价",required=true) |
| | | private String originalPrice; |
| | | |
| | | @ApiModelProperty(value="现价",required=true) |
| | | private String presentPrice; |
| | | |
| | | @ApiModelProperty(value="商品分类ID",required=true) |
| | | private String categoryId; |
New file |
| | |
| | | package com.xzx.gc.shop.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class QueryOrderListDto { |
| | | |
| | | @ApiModelProperty(value="订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value="客户姓名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value="状态 2-待收货3-已完成4-已取消") |
| | | private Integer status; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="下单时间开始时间") |
| | | private Date createdTimeStart; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="下单时间结束时间") |
| | | private Date createdTimeEnd; |
| | | |
| | | @ApiModelProperty(value="第几页",required=true) |
| | | private int page; |
| | | @ApiModelProperty(value="每一页数量",required=true) |
| | | private int limit; |
| | | |
| | | |
| | | } |
| | |
| | | package com.xzx.gc.shop.mapper; |
| | | |
| | | import com.xzx.gc.entity.ScoreOrder; |
| | | import com.xzx.gc.shop.dto.QueryOrderListDto; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface ScoreOrderMapper extends GcMapper<ScoreOrder> { |
| | | |
| | | List<QueryOrderListVo> queryOrderList(@Param("name")String name, |
| | | @Param("orderNo")String orderNo, |
| | | @Param("status")Integer status, |
| | | @Param("createdTimeStart")Date createdTimeStart, |
| | | @Param("createdTimeEnd")Date createdTimeEnd); |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.service; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.xzx.gc.shop.dto.QueryOrderListDto; |
| | | import com.xzx.gc.shop.mapper.ScoreOrderMapper; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @Transactional |
| | | @Slf4j |
| | | public class OrderService { |
| | | |
| | | @Resource |
| | | ScoreOrderMapper scoreOrderMapper; |
| | | |
| | | public Map<String, Object> queryOrderList(QueryOrderListDto model) { |
| | | String name = model.getName(); |
| | | String orderNo = model.getOrderNo(); |
| | | Integer status = model.getStatus() == null ? 0 : model.getStatus(); |
| | | Date createdTimeStart = model.getCreatedTimeStart(); |
| | | Date createdTimeEnd = model.getCreatedTimeEnd(); |
| | | PageHelper.startPage(model.getPage(), model.getLimit()); |
| | | List<QueryOrderListVo> maps = scoreOrderMapper.queryOrderList(name,orderNo,status,createdTimeStart,createdTimeEnd); |
| | | PageInfo pageInfo = new PageInfo(maps); |
| | | int count = Convert.toInt(pageInfo.getTotal()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", maps); |
| | | map.put("count", count); |
| | | map.put("code", 0); |
| | | return map; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "QueryOrderListVo", description = "返回") |
| | | public class QueryOrderListVo { |
| | | } |
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.xzx.gc.shop.mapper.ScoreOrderMapper"> |
| | | |
| | | <select id="queryOrderList" resultType="com.xzx.gc.shop.vo.QueryOrderListVo"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | xzx_score_order a |
| | | WHERE 1 = 1 |
| | | <if test="orderNo != null and orderNo != ''"> |
| | | and a.order_no like concat('%',#{orderNo},'%') |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | </mapper> |