Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop
7 files added
7 files modified
New file |
| | |
| | | package com.xzx.gc.entity; |
| | | |
| | | import com.xzx.gc.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Table; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @Table(name = "xzx_score_details") |
| | | public class ScoreDetails extends BaseEntity { |
| | | |
| | | //订单编号 |
| | | private String orderNo; |
| | | |
| | | //用户ID |
| | | private String userId; |
| | | |
| | | //交易类型 1-用户充值2-集物员支付3-用户兑换所得4-用户消费5-消费退回6-管理员充值7-其他 |
| | | private Integer type; |
| | | |
| | | //原始积分 |
| | | private BigDecimal originalScore; |
| | | |
| | | //变化积分 |
| | | private BigDecimal changeScore; |
| | | |
| | | //当前积分 |
| | | private BigDecimal currentScore; |
| | | } |
| | |
| | | package com.xzx.gc.entity; |
| | | |
| | | import com.xzx.gc.common.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Table; |
| | |
| | | **/ |
| | | @Data |
| | | @Table(name = "xzx_score_order_details") |
| | | public class ScoreOrderDetails { |
| | | public class ScoreOrderDetails extends BaseEntity { |
| | | |
| | | private String goodsName; |
| | | |
| | |
| | | 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.*; |
| | | 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; |
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.QueryOrderListDto; |
| | | import com.xzx.gc.shop.dto.QueryScoreDetailsListDto; |
| | | import com.xzx.gc.shop.service.GoodsService; |
| | | import com.xzx.gc.shop.service.ScoreDetailsService; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import com.xzx.gc.shop.vo.QueryScoreDetailsListVo; |
| | | 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 AdminScoreDetailsController extends BaseController { |
| | | |
| | | @Resource |
| | | private ScoreDetailsService scoreDetailsService; |
| | | |
| | | /** |
| | | * 查询积分明细 |
| | | * xzx_score_details 用户积分明细表 |
| | | */ |
| | | @PostMapping(Constants.ADMIN_VIEW_PREFIX+"/score/goods/queryScoreDetailsList.json") |
| | | @ApiResponses({@ApiResponse( code = 200, message = "success", response = QueryScoreDetailsListVo.class)}) |
| | | @ApiOperation(value = "积分管理-查询积分明细", notes = "test: 仅0有正确返回") |
| | | public JsonResult<Map<String, Object>> queryScoreDetailsList(@RequestBody QueryScoreDetailsListDto model) { |
| | | Map<String, Object> result = scoreDetailsService.queryScoreDetailsList(model); |
| | | return JsonResult.success(result); |
| | | } |
| | | |
| | | |
| | | } |
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 QueryScoreDetailsListDto { |
| | | |
| | | @ApiModelProperty(value="订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value="交易类型") |
| | | private Integer type; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="预约开始时间") |
| | | private Date createTimeStart; |
| | | |
| | | @JsonFormat(shape=JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @ApiModelProperty(value="预约结束时间") |
| | | private Date createTimeEnd; |
| | | |
| | | @ApiModelProperty(value="第几页",required=true) |
| | | private int page; |
| | | @ApiModelProperty(value="每一页数量",required=true) |
| | | private int limit; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value="积分商品样式") |
| | | private List<ScoreGoodsStyleDto> scoreGoodsStyles; |
| | | |
| | | @ApiModelProperty(value="创建人") |
| | | private String createdBy; |
| | | |
| | | @ApiModelProperty(value="创建时间") |
| | | private Date createdTime; |
| | | // @ApiModelProperty(value="创建人") |
| | | // private String createdBy; |
| | | // |
| | | // @ApiModelProperty(value="创建时间") |
| | | // private Date createdTime; |
| | | } |
New file |
| | |
| | | package com.xzx.gc.shop.mapper; |
| | | |
| | | import com.xzx.gc.entity.ScoreDetails; |
| | | import com.xzx.gc.shop.dto.QueryScoreDetailsListDto; |
| | | import com.xzx.gc.shop.vo.QueryScoreDetailsListVo; |
| | | import com.xzx.gc.util.GcMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ScoreDetailsMapper extends GcMapper<ScoreDetails> { |
| | | |
| | | List<QueryScoreDetailsListVo> queryScoreDetailsList(@Param("record") QueryScoreDetailsListDto model); |
| | | |
| | | } |
| | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| | | viewGoodsVo = objectMapper.convertValue(scoreGoods, ViewGoodsVo.class); |
| | | viewGoodsVo.setCreateTime(scoreGoods.getCreatedTime()); |
| | | // viewGoodsVo.setCreateTime(scoreGoods.getCreatedTime().toString()); |
| | | //轮播图 |
| | | List<String> goodsImages = scoreGoodsImagesMapper.selectScoreGoodsImagesByGoodsId(id); |
| | | viewGoodsVo.setGoodsImages(goodsImages); |
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.QueryScoreDetailsListDto; |
| | | import com.xzx.gc.shop.mapper.ScoreDetailsMapper; |
| | | import com.xzx.gc.shop.vo.QueryOrderListVo; |
| | | import com.xzx.gc.shop.vo.QueryScoreDetailsListVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | @Transactional |
| | | @Slf4j |
| | | public class ScoreDetailsService { |
| | | |
| | | @Resource |
| | | ScoreDetailsMapper scoreDetailsMapper; |
| | | |
| | | public Map<String, Object> queryScoreDetailsList(QueryScoreDetailsListDto model) { |
| | | PageHelper.startPage(model.getPage(), model.getLimit()); |
| | | List<QueryScoreDetailsListVo> maps = scoreDetailsMapper.queryScoreDetailsList(model); |
| | | 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; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "QueryScoreDetailsListVo", description = "返回") |
| | | public class QueryScoreDetailsListVo { |
| | | |
| | | //订单编号 |
| | | private String orderNo; |
| | | |
| | | //用户 |
| | | private String name; |
| | | |
| | | //交易类型 1-用户充值2-集物员支付3-用户兑换所得4-用户消费5-消费退回6-管理员充值7-其他 |
| | | private Integer type; |
| | | |
| | | private String createTime; |
| | | |
| | | //原始积分 |
| | | private BigDecimal originalScore; |
| | | |
| | | //变化积分 |
| | | private BigDecimal changeScore; |
| | | |
| | | //当前积分 |
| | | private BigDecimal currentScore; |
| | | } |
| | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty(value="创建时间") |
| | | private Date createdTime; |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty(value="创建人") |
| | | private String createdBy; |
| | |
| | | private Integer isQg; |
| | | |
| | | @ApiModelProperty(value="抢购开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date qgStartTime; |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private String qgStartTime; |
| | | |
| | | @ApiModelProperty(value="抢购结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date qgEndTime; |
| | | // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private String qgEndTime; |
| | | |
| | | @ApiModelProperty(value="是否上架 1/是 2/否",required=true) |
| | | private Integer isSale; |
| | |
| | | @ApiModelProperty(value="积分商品样式") |
| | | private List<ScoreGoodsStyleVo> scoreGoodsStyles; |
| | | |
| | | @ApiModelProperty(value="创建人") |
| | | private String createdBy; |
| | | |
| | | @ApiModelProperty(value="创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | // @ApiModelProperty(value="创建人") |
| | | // private String createdBy; |
| | | // |
| | | // @ApiModelProperty(value="创建时间") |
| | | //// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | // private String createTime; |
| | | } |
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.ScoreDetailsMapper"> |
| | | |
| | | <select id="queryScoreDetailsList" resultType="com.xzx.gc.shop.vo.QueryScoreDetailsListVo"> |
| | | SELECT |
| | | a.*, |
| | | a.CREATED_TIME createTime |
| | | FROM |
| | | xzx_score_details a |
| | | left join xzx_user_info b on b.user_id = a.user_id |
| | | WHERE 1 = 1 |
| | | <if test="record.orderNo != null and record.orderNo != ''"> |
| | | and a.order_no like concat('%',#{record.orderNo},'%') |
| | | </if> |
| | | <if test="record.type != null and record.type != ''"> |
| | | and a.type = #{record.type} |
| | | </if> |
| | | <if test="record.createTimeStart != null"> |
| | | and a.CREATED_TIME >= #{record.createTimeStart} |
| | | </if> |
| | | |
| | | <if test="record.createTimeEnd != null"> |
| | | and a.CREATED_TIME >= #{record.createTimeEnd} |
| | | </if> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="viewGoodsCategoryList" resultType="com.xzx.gc.shop.vo.ViewGoodsCategoryListVo"> |
| | | SELECT |
| | | a.*,, |
| | | a.*, |
| | | a.CREATED_TIME createTime, |
| | | (select name from xzx_score_goods_category where a.parent_id = id) parentName |
| | | FROM |