| | |
| | | package com.ycl.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.Pattern; |
| | | import java.math.BigDecimal; |
| | | |
| | |
| | | |
| | | @ApiModelProperty("门店积分") |
| | | private BigDecimal storescore; |
| | | |
| | | |
| | | @ApiModelProperty("门店类型") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("描述") |
| | | @TableField("description") |
| | | private String description; |
| | | } |
New file |
| | |
| | | package com.ycl.controller.caseHandler; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ycl.base.BaseController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhanghua |
| | | * @since 2022-10-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/image-resources") |
| | | public class ImageResourcesController extends BaseController { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.entity.caseHandler; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.Version; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author zhanghua |
| | | * @since 2022-10-21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("ums_image_resources") |
| | | public class ImageResources implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键Id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 所属Id |
| | | */ |
| | | @TableField("belong_to_id") |
| | | private Integer belongToId; |
| | | |
| | | /** |
| | | * 图片资源类型 01-上报 02-处置 |
| | | */ |
| | | @TableField("type") |
| | | private String type; |
| | | |
| | | /** |
| | | * 图片路径 |
| | | */ |
| | | @TableField("url") |
| | | private String url; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @TableField("create_user") |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField("create_time") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.mapper.caseHandler; |
| | | |
| | | import com.ycl.entity.caseHandler.ImageResources; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author zhanghua |
| | | * @since 2022-10-21 |
| | | */ |
| | | public interface ImageResourcesMapper extends BaseMapper<ImageResources> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.service.caseHandler; |
| | | |
| | | import com.ycl.entity.caseHandler.ImageResources; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author zhanghua |
| | | * @since 2022-10-21 |
| | | */ |
| | | public interface IImageResourcesService extends IService<ImageResources> { |
| | | |
| | | } |
New file |
| | |
| | | package com.ycl.service.caseHandler.impl; |
| | | |
| | | import com.ycl.entity.caseHandler.ImageResources; |
| | | import com.ycl.mapper.caseHandler.ImageResourcesMapper; |
| | | import com.ycl.service.caseHandler.IImageResourcesService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhanghua |
| | | * @since 2022-10-21 |
| | | */ |
| | | @Service |
| | | public class ImageResourcesServiceImpl extends ServiceImpl<ImageResourcesMapper, ImageResources> implements IImageResourcesService { |
| | | |
| | | } |
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.ycl.mapper.caseHandler.ImageResourcesMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ycl.entity.caseHandler.ImageResources"> |
| | | <id column="id" property="id" /> |
| | | <result column="belong_to_id" property="belongToId" /> |
| | | <result column="type" property="type" /> |
| | | <result column="url" property="url" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="create_time" property="createTime" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, belong_to_id, type, url, create_user, create_time |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | import com.ycl.dto.UmsStoreInfoParam; |
| | | import com.ycl.entity.store.StoreInfo; |
| | | import com.ycl.service.store.StoreInfoService; |
| | | import com.ycl.vo.store.StoreInfoVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @ApiOperation("根据门店名称分页获取门店列表列表") |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | @ResponseBody |
| | | public CommonResult<CommonPage<StoreInfo>> list(@RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize, |
| | | @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { |
| | | Page<StoreInfo> storeInfoPage = storeInfoService.list(keyword, pageSize, pageNum); |
| | | public CommonResult<CommonPage<StoreInfoVO>> list(@RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize, |
| | | @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) { |
| | | Page<StoreInfoVO> storeInfoPage = storeInfoService.list(keyword, pageSize, pageNum); |
| | | return CommonResult.success(CommonPage.restPage(storeInfoPage)); |
| | | } |
| | | |
| | |
| | | .storePhoto(umsStoreInfoParam.getStorephoto()) |
| | | .idCardInfo(umsStoreInfoParam.getIdcardinfo()) |
| | | .storeNumber(utilNumber.createShopCode()) |
| | | .storeScore(umsStoreInfoParam.getStorescore()).build(); |
| | | .storeScore(umsStoreInfoParam.getStorescore()) |
| | | .type(umsStoreInfoParam.getType()) |
| | | .description(umsStoreInfoParam.getDescription()) |
| | | .build(); |
| | | boolean success = storeInfoService.save(storeInfo); |
| | | if (success) { |
| | | return CommonResult.success(null); |
| | |
| | | @ApiModelProperty("门店积分") |
| | | @TableField("store_score") |
| | | private BigDecimal storeScore; |
| | | |
| | | @ApiModelProperty("门店积分") |
| | | @TableField(" relation_video") |
| | | private BigDecimal relationVideo; |
| | | |
| | | |
| | | @ApiModelProperty("门店类型") |
| | | @TableField("type") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("描述") |
| | | @TableField("description") |
| | | private String description; |
| | | } |
| | |
| | | package com.ycl.mapper.store; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ycl.entity.store.StoreInfo; |
| | | import com.ycl.vo.store.StoreInfoVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface StoreInfoMapper extends BaseMapper<StoreInfo> { |
| | | |
| | | Page<StoreInfoVO> selectStorePage(Page<StoreInfo> storeInfoPage, String keyword); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ycl.entity.store.StoreInfo; |
| | | import com.ycl.vo.store.StoreInfoVO; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | |
| | | * @param pageNum 页码 |
| | | * @return 分页实体 |
| | | */ |
| | | Page<StoreInfo> list(String keyword, Integer pageSize, Integer pageNum); |
| | | Page<StoreInfoVO> list(String keyword, Integer pageSize, Integer pageNum); |
| | | |
| | | /** |
| | | * 读取excel文件动态加载文件 |
| | |
| | | import com.ycl.service.store.StoreInfoService; |
| | | import com.ycl.utils.ExcelUtils; |
| | | import com.ycl.vo.store.StoreInfoExcelVo; |
| | | import com.ycl.vo.store.StoreInfoVO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Slf4j |
| | | public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo> implements StoreInfoService { |
| | | |
| | | @Resource |
| | | StoreInfoMapper storeInfoMapper; |
| | | |
| | | |
| | | @Override |
| | | public Page<StoreInfo> list(String keyword, Integer pageSize, Integer pageNum) { |
| | | Page<StoreInfo> page = new Page<>(pageSize, pageNum); |
| | | Page<StoreInfo> storeInfoPage = page(page, new LambdaQueryWrapper<StoreInfo>() |
| | | .like(StringUtils.isNotBlank(keyword), StoreInfo::getStoreName, keyword)); |
| | | storeInfoPage.setRecords(list(new LambdaQueryWrapper<StoreInfo>() |
| | | .like(StringUtils.isNotBlank(keyword), StoreInfo::getStoreName, keyword))); |
| | | return storeInfoPage; |
| | | 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); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.ycl.vo.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 io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author lyq |
| | | * @since 2022-09-08 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("ums_store_store_info") |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @ApiModel(value = "StoreInfo对象", description = "") |
| | | @Builder |
| | | public class StoreInfoVO implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主键") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("姓名") |
| | | @TableField("owner") |
| | | private String owner; |
| | | |
| | | @ApiModelProperty("门店名称") |
| | | @TableField("store_name") |
| | | private String storeName; |
| | | |
| | | |
| | | @ApiModelProperty("门店编码") |
| | | @TableField("store_number") |
| | | private String storeNumber; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | @TableField("contact") |
| | | private String contact; |
| | | |
| | | @ApiModelProperty("地址") |
| | | @TableField("store_address") |
| | | private String storeAddress; |
| | | |
| | | @ApiModelProperty("照片") |
| | | @TableField("store_photo") |
| | | private String storePhoto; |
| | | |
| | | @ApiModelProperty("身份证信息") |
| | | @TableField("id_card") |
| | | private String idCardInfo; |
| | | |
| | | @ApiModelProperty("门店积分") |
| | | @TableField("store_score") |
| | | private BigDecimal storeScore; |
| | | |
| | | @ApiModelProperty("门店积分") |
| | | @TableField(" relation_video") |
| | | private BigDecimal relationVideo; |
| | | |
| | | @ApiModelProperty("门店类型") |
| | | @TableField("type") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("描述") |
| | | @TableField("description") |
| | | private String description; |
| | | } |
| | |
| | | <result column="storescore" property="storescore"/> |
| | | </resultMap> |
| | | |
| | | <select id="selectStorePage" resultType="com.ycl.vo.store.StoreInfoVO"> |
| | | SELECT |
| | | t1.*, |
| | | t2.`name` |
| | | FROM |
| | | ums_store_store_info t1 |
| | | JOIN ums_data_dictionary t2 ON t1.type = t2.id |
| | | <where> |
| | | <if test="keyword!=null and keyword!=''"> |
| | | t1.store_name LIKE CONCAT('%', #{keyword}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |