zhanghua
2022-11-28 a4047b6048ebfe09e66a765b58ea12b5bd0e2e6e
店铺管理优化
8个文件已修改
3个文件已添加
148 ■■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/vo/store/StoreScoreRuleVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/store/StoreInfoController.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/dto/store/UmsStoreInfoParam.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/store/StoreInfo.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/store/StoreScore.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/store/StoreScoreRule.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/store/StoreScoreMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/store/StoreInfoService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/store/impl/StoreInfoServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/store/StoreInfoVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/store/StoreScoreMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/vo/store/StoreScoreRuleVO.java
@@ -21,6 +21,6 @@
        @NotBlank(message = "扣分项不能为空")
        @ApiModelProperty("扣除分数")
        private BigDecimal markScore;
        private Double markScore;
    }
}
ycl-platform/src/main/java/com/ycl/controller/store/StoreInfoController.java
@@ -8,6 +8,7 @@
import com.ycl.controller.video.common.util.UtilNumber;
import com.ycl.dto.store.UmsStoreInfoParam;
import com.ycl.entity.store.StoreInfo;
import com.ycl.entity.store.StoreScore;
import com.ycl.service.store.StoreInfoService;
import com.ycl.service.video.impl.IVideoPointService;
import com.ycl.vo.store.StoreInfoVO;
@@ -75,16 +76,16 @@
    public CommonResult<StoreInfo> add(@Validated @RequestBody UmsStoreInfoParam umsStoreInfoParam) {
        StoreInfo storeInfo = StoreInfo.builder()
                .owner(umsStoreInfoParam.getOwner())
                .storeName(umsStoreInfoParam.getStorename())
                .storeName(umsStoreInfoParam.getStoreName())
                .contact(umsStoreInfoParam.getContact())
                .storeAddress(umsStoreInfoParam.getStoreaddr())
                .storeAddress(umsStoreInfoParam.getStoreAddress())
                .storePhoto(umsStoreInfoParam.getStorephoto())
                .idCardInfo(umsStoreInfoParam.getIdcardinfo())
                .storeNumber(utilNumber.createShopCode())
                .storeScore(umsStoreInfoParam.getStorescore())
                .type(umsStoreInfoParam.getType())
                .description(umsStoreInfoParam.getDescription())
                .videoId(umsStoreInfoParam.getVideoId())
                .videoId(umsStoreInfoParam.getRelationVideo())
                .storeScore(100.0)
                .build();
        boolean success = storeInfoService.save(storeInfo);
        if (success) {
@@ -132,5 +133,16 @@
            return CommonResult.failed();
        }
    }
    @ApiOperation("根据id获取门店积分详情")
    @RequestMapping(value = "/{id}/storeScore", method = RequestMethod.GET)
    @ResponseBody
    @LogSave(operationType = "门店积分详情", contain = "门店积分详情")
    public CommonResult<Page<StoreScore>> getScoreList(@PathVariable Long id,
                                                       @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                       @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        Page<StoreScore> page = storeInfoService.getScoreList(id, pageSize, pageNum);
        return CommonResult.success(page);
    }
}
ycl-platform/src/main/java/com/ycl/dto/store/UmsStoreInfoParam.java
@@ -23,7 +23,7 @@
    @NotBlank(message = "门店名称不能为空")
    @ApiModelProperty("门店名称")
    private String storename;
    private String storeName;
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
@@ -31,7 +31,7 @@
    private String contact;
    @ApiModelProperty("地址")
    private String storeaddr;
    private String storeAddress;
    @ApiModelProperty("照片")
    private String storephoto;
@@ -51,6 +51,5 @@
    private String description;
    @ApiModelProperty("摄像头")
    @TableField("video_id")
    private String videoId;
    private String relationVideo;
}
ycl-platform/src/main/java/com/ycl/entity/store/StoreInfo.java
@@ -67,7 +67,7 @@
    @ApiModelProperty("门店积分")
    @TableField("store_score")
    private BigDecimal storeScore;
    private Double storeScore;
    @ApiModelProperty("关联摄像点位")
    @TableField(" relation_video")
ycl-platform/src/main/java/com/ycl/entity/store/StoreScore.java
New file
@@ -0,0 +1,57 @@
package com.ycl.entity.store;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
 * @author admin
 */
@Data
@TableName("ums_store_score")
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "StoreScore对象", description = "")
@Builder
public class StoreScore implements Serializable {
    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("storeId")
    @TableField(value = "store_id")
    private Integer storeId;
    @ApiModelProperty("ruleId")
    @TableField(value = "rule_id")
    private Integer ruleId;
    @ApiModelProperty("规则类别")
    @TableField(value = "category")
    private String category;
    @ApiModelProperty("扣分项")
    @TableField(value = "deduction_item")
    private String deductionItem;
    @ApiModelProperty("扣除分数")
    @TableField(value = "mark_score")
    private Double markScore;
    @TableField(value = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
}
ycl-platform/src/main/java/com/ycl/entity/store/StoreScoreRule.java
@@ -41,7 +41,7 @@
    private String deductionItem;
    @ApiModelProperty("扣除分数")
    private BigDecimal markScore;
    private Double markScore;
}
ycl-platform/src/main/java/com/ycl/mapper/store/StoreScoreMapper.java
New file
@@ -0,0 +1,17 @@
package com.ycl.mapper.store;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ycl.entity.store.StoreScore;
import com.ycl.entity.store.StoreScoreRule;
/**
 * <p>
 * 商铺积分管理 Mapper 接口
 * </p>
 *
 * @author lyq
 * @since 2022-09-14
 */
public interface StoreScoreMapper extends BaseMapper<StoreScore> {
}
ycl-platform/src/main/java/com/ycl/service/store/StoreInfoService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.entity.store.StoreInfo;
import com.ycl.entity.store.StoreScore;
import com.ycl.vo.store.StoreInfoVO;
import org.springframework.web.multipart.MultipartFile;
@@ -17,6 +18,7 @@
public interface StoreInfoService extends IService<StoreInfo> {
    /**
     * 根据门店名称分页获取门店列表列表
     *
     * @param keyword 关键字
     * @param pageSize 页面大小
     * @param pageNum 页码
@@ -26,8 +28,11 @@
    /**
     * 读取excel文件动态加载文件
     *
     * @param file
     * @return
     */
    boolean addByExcel(MultipartFile file);
    Page<StoreScore> getScoreList(Long storeId, Integer pageSize, Integer pageNum);
}
ycl-platform/src/main/java/com/ycl/service/store/impl/StoreInfoServiceImpl.java
@@ -6,9 +6,11 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.entity.store.StoreInfo;
import com.ycl.entity.store.StoreScore;
import com.ycl.enums.common.ResultCode;
import com.ycl.exception.ApiException;
import com.ycl.mapper.store.StoreInfoMapper;
import com.ycl.mapper.store.StoreScoreMapper;
import com.ycl.mapper.video.VideoPointMapper;
import com.ycl.service.store.StoreInfoService;
import com.ycl.utils.ExcelUtils;
@@ -41,6 +43,9 @@
    @Resource
    VideoPointMapper videoPointMapper;
    @Resource
    StoreScoreMapper storeScoreMapper;
    @Override
@@ -79,4 +84,14 @@
            throw new ApiException(ResultCode.FAILED);
        }
    }
    @Override
    public Page<StoreScore> getScoreList(Long storeId, Integer pageSize, Integer pageNum) {
        Page<StoreScore> storeScorePage = new Page<>();
        storeScorePage.setSize(pageSize);
        storeScorePage.setCurrent(pageNum);
        LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<StoreScore>().eq(StoreScore::getStoreId, storeId);
        Page<StoreScore> page = storeScoreMapper.selectPage(storeScorePage, queryWrapper);
        return page;
    }
}
ycl-platform/src/main/java/com/ycl/vo/store/StoreInfoVO.java
@@ -67,11 +67,11 @@
    @ApiModelProperty("门店积分")
    @TableField("store_score")
    private BigDecimal storeScore;
    private Double storeScore;
    @ApiModelProperty("门店积分")
    @TableField(" relation_video")
    private BigDecimal relationVideo;
    private String relationVideo;
    @ApiModelProperty("门店类型")
    @TableField("type")
ycl-platform/src/main/resources/mapper/store/StoreScoreMapper.xml
New file
@@ -0,0 +1,17 @@
<?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.ycl.mapper.store.StoreScoreMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.store.StoreScore">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="rule_id" property="ruleId" jdbcType="INTEGER"/>
        <result column="store_id" property="storeId" jdbcType="INTEGER"/>
        <result column="category" property="category" jdbcType="VARCHAR"/>
        <result column="deduction_item" property="deductionItem" jdbcType="VARCHAR"/>
        <result column="mark_score" property="markScore" jdbcType="FLOAT"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
    </resultMap>
</mapper>