ycl-platform/src/main/java/com/ycl/controller/store/StoreInfoController.java
@@ -6,12 +6,15 @@ import com.ycl.api.CommonPage; import com.ycl.api.CommonResult; import com.ycl.common.util.UtilNumber; import com.ycl.dto.UmsStoreInfoParam; import com.ycl.dto.store.UmsStoreInfoParam; import com.ycl.entity.store.StoreInfo; import com.ycl.entity.video.VideoPoint; import com.ycl.service.store.StoreInfoService; import com.ycl.service.video.impl.IVideoPointService; import com.ycl.vo.store.StoreInfoVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -35,6 +38,10 @@ UtilNumber utilNumber; @Autowired private IVideoPointService videoPointService; @Autowired public void setUmsStoreInfoService(StoreInfoService umsStoreInfoService) { this.storeInfoService = umsStoreInfoService; } @@ -54,6 +61,9 @@ @ResponseBody public CommonResult<StoreInfo> 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); } @@ -73,6 +83,7 @@ .storeScore(umsStoreInfoParam.getStorescore()) .type(umsStoreInfoParam.getType()) .description(umsStoreInfoParam.getDescription()) .videoId(umsStoreInfoParam.getVideoId()) .build(); boolean success = storeInfoService.save(storeInfo); if (success) { ycl-platform/src/main/java/com/ycl/dto/store/UmsStoreInfoParam.java
File was renamed from ycl-common/src/main/java/com/ycl/dto/UmsStoreInfoParam.java @@ -1,4 +1,4 @@ package com.ycl.dto; package com.ycl.dto.store; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModelProperty; @@ -45,10 +45,12 @@ @ApiModelProperty("门店类型") @TableField("type") private Integer type; @ApiModelProperty("描述") @TableField("description") private String description; @ApiModelProperty("摄像头") @TableField("video_id") private String videoId; } ycl-platform/src/main/java/com/ycl/entity/store/StoreInfo.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ycl.entity.video.VideoPoint; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.*; @@ -80,4 +81,8 @@ @ApiModelProperty("描述") @TableField("description") private String description; @ApiModelProperty("摄像头") @TableField("video_id") private String videoId; } ycl-platform/src/main/java/com/ycl/vo/store/StoreInfoVO.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ycl.entity.video.VideoPoint; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.*; @@ -79,4 +80,7 @@ @ApiModelProperty("描述") @TableField("description") private String description; @ApiModelProperty("摄像头") private VideoPoint videoPoint; } ycl-platform/src/main/resources/mapper/store/UmsStoreInfoMapper.xml
@@ -17,10 +17,12 @@ <select id="selectStorePage" resultType="com.ycl.vo.store.StoreInfoVO"> SELECT t1.*, t2.`name` as typeName t2.`name` as typeName, t3.* FROM ums_store_store_info t1 left JOIN ums_data_dictionary t2 ON t1.type = t2.id 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}, '%')