Oliver
2022-11-09 beb5929ea5ac874f256fce08a679a674ef02868a
bug修改
7个文件已修改
183 ■■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/utils/common/LiveTimeMillisecond.java 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/region/SccgRegionController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/store/StoreInfoController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/region/impl/SccgRegionServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/store/impl/StoreInfoServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/store/StoreInfoVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/store/UmsStoreInfoMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/utils/common/LiveTimeMillisecond.java
@@ -1,70 +1,109 @@
package com.ycl.utils.common;
/**
 *   redis缓存时间
 *      单位毫秒
 * redis缓存时间
 * 单位毫秒
 *
 * @version 1.0
 * @date 2022/9/9
 */
public enum LiveTimeMillisecond {
                     s1(1000),
                      /** 5秒 */
                      s5(5000),
                        /** 10秒 */
                      s10(10000),
                      /** 1分钟 */
                      s60(60000),
                        /** 2分钟 */
                        s120(120000),
                      /** 3分钟*/
                      s180(180000),
                      /** 5分钟*/
                      s300(300000),
                     /** 10分钟 */
                      s600(600000),
                     /** 30分钟 */
                      s1800(1800000),
                      /** 1小时 */
                      s3600(3600000),
                      /** 2小时 */
                      s7200(7200000),
                      /** 3小时 */
                      s10800(10800000),
                      /** 4小时 */
                      s14400(14400000),
                      /** 12小时 */
                      s43200(43200000),
                      /** 一天 */
                      s86400(86400000),
                        /** 三天*/
                      s259200000(259200000),
                      /** 七天 */
                      s604800(604800000),
                      /** 30天*/
                      s2592000(2592000000L),
                     /** 60天*/
                     s5184000(5184000000L),
                     /**180天*/
                     s15552000(15552000000L);
    s1(1000),
    /**
     * 5秒
     */
    s5(5000),
    /**
     *  超时时间  单位秒
     * 10秒
     */
    s10(10000),
    /**
     * 1分钟
     */
    s60(60000),
    /**
     * 2分钟
     */
    s120(120000),
    /**
     * 3分钟
     */
    s180(180000),
    /**
     * 5分钟
     */
    s300(300000),
    /**
     * 10分钟
     */
    s600(600000),
    /**
     * 30分钟
     */
    s1800(1800000),
    /**
     * 1小时
     */
    s3600(3600000),
    /**
     * 2小时
     */
    s7200(7200000),
    /**
     * 3小时
     */
    s10800(10800000),
    /**
     * 4小时
     */
    s14400(14400000),
    /**
     * 12小时
     */
    s43200(43200000),
    /**
     * 一天
     */
    s86400(86400000),
    /**
     * 三天
     */
    s259200000(259200000),
    /**
     * 七天
     */
    s604800(604800000),
    /**
     * 30天
     */
    s2592000(2592000000L),
    /**
     * 60天
     */
    s5184000(5184000000L),
    /**
     * 180天
     */
    s15552000(15552000000L);
    /**
     * 超时时间  单位秒
     */
    public long time;
ycl-platform/src/main/java/com/ycl/controller/region/SccgRegionController.java
@@ -7,7 +7,9 @@
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.entity.region.SccgRegion;
import com.ycl.service.redis.RedisService;
import com.ycl.service.region.ISccgRegionService;
import com.ycl.utils.redis.RedisKey;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -32,6 +34,9 @@
public class SccgRegionController extends BaseController {
    @Resource
    private RedisService redisService;
    @Resource
    private ISccgRegionService iSccgRegionService;
    @ApiOperation("树结构")
@@ -45,6 +50,7 @@
    @RequestMapping(value = "/addRegion", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult addRegion(@Validated @RequestBody SccgRegion sccgRegion) {
        redisService.del(RedisKey.SCCG_REGION);
        return CommonResult.success(iSccgRegionService.save(sccgRegion));
    }
@@ -70,6 +76,7 @@
    @RequestMapping(value = "/update/{id}", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult update(@PathVariable Long id, @RequestBody SccgRegion sccgRegion) {
        redisService.del(RedisKey.SCCG_REGION);
        sccgRegion.setId(id);
        boolean success = iSccgRegionService.updateById(sccgRegion);
        if (success) {
@@ -82,6 +89,7 @@
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult delete(@RequestParam("ids") List<Long> ids) {
        redisService.del(RedisKey.SCCG_REGION);
        boolean success = iSccgRegionService.removeBatchByIds(ids);
        if (success) {
            return CommonResult.success(null);
ycl-platform/src/main/java/com/ycl/controller/store/StoreInfoController.java
@@ -59,12 +59,12 @@
    @ApiOperation("根据id获取门店信息")
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<StoreInfo> getItem(@PathVariable Long id) {
    public CommonResult<StoreInfoVO> getItem(@PathVariable Long id) {
        StoreInfo storeInfo = storeInfoService.getById(id);
        StoreInfoVO vo = new StoreInfoVO();
        BeanUtils.copyProperties(storeInfo, vo);
        vo.setVideoPoint(videoPointService.getById(storeInfo.getVideoId()));
        return CommonResult.success(storeInfo);
        return CommonResult.success(vo);
    }
    @ApiOperation(value = "添加门店信息")
ycl-platform/src/main/java/com/ycl/service/region/impl/SccgRegionServiceImpl.java
@@ -51,7 +51,7 @@
                return item;
            }).collect(Collectors.toList());
            List<SccgRegion> treeData = getTreeData(collect);
            redisService.set(RedisKey.SCCG_REGION, JSON.toJSONString(treeData), LiveTimeMillisecond.s5184000.time);
            redisService.set(RedisKey.SCCG_REGION, JSON.toJSONString(treeData), LiveTimeMillisecond.s3600.time);
            return treeData;
        }
        return JSON.parseArray(result, SccgRegion.class);
ycl-platform/src/main/java/com/ycl/service/store/impl/StoreInfoServiceImpl.java
@@ -9,6 +9,7 @@
import com.ycl.enums.common.ResultCode;
import com.ycl.exception.ApiException;
import com.ycl.mapper.store.StoreInfoMapper;
import com.ycl.mapper.video.VideoPointMapper;
import com.ycl.service.store.StoreInfoService;
import com.ycl.utils.ExcelUtils;
import com.ycl.vo.store.StoreInfoExcelVo;
@@ -38,13 +39,18 @@
    @Resource
    StoreInfoMapper storeInfoMapper;
    @Resource
    VideoPointMapper videoPointMapper;
    @Override
    public Page<StoreInfoVO> list(String keyword, Integer pageSize, Integer pageNum) {
        Page<StoreInfo> storeInfoPage = new Page<>();
        storeInfoPage.setSize(pageSize);
        storeInfoPage.setCurrent(pageNum);
        return storeInfoMapper.selectStorePage(storeInfoPage,keyword);
        Page<StoreInfoVO> page = storeInfoMapper.selectStorePage(storeInfoPage, keyword);
        page.getRecords().forEach(x->x.setVideoPoint(videoPointMapper.selectById(x.getVideoId())));
        return page;
    }
    @Override
ycl-platform/src/main/java/com/ycl/vo/store/StoreInfoVO.java
@@ -81,6 +81,10 @@
    @TableField("description")
    private String description;
    @ApiModelProperty("摄像头ID")
    @TableField("video_id")
    private String videoId;
    @ApiModelProperty("摄像头")
    private VideoPoint videoPoint;
}
ycl-platform/src/main/resources/mapper/store/UmsStoreInfoMapper.xml
@@ -17,12 +17,10 @@
    <select id="selectStorePage" resultType="com.ycl.vo.store.StoreInfoVO">
        SELECT
            t1.*,
            t2.`name` as typeName,
            t3.*
            t2.`name` as typeName
        FROM
            ums_store_store_info t1
            left JOIN ums_data_dictionary t2 ON t1.type = t2.id
            left JOIN ums_video_point t3 ON t1.video_id = t3.id
        <where>
            <if test="keyword!=null and keyword!=''">
                t1.store_name LIKE  CONCAT('%', #{keyword}, '%')