Commit 0aab1d8c authored by yaobaizheng's avatar yaobaizheng

都市圈添加雪花id

parent 45082688
package com.lyy.admin.VO; package com.lyy.admin.VO;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -17,6 +19,10 @@ public class MegalopolisInfoListVO implements Serializable { ...@@ -17,6 +19,10 @@ public class MegalopolisInfoListVO implements Serializable {
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
private Integer id; private Integer id;
@ApiModelProperty(value = "业务id")
@JsonSerialize(using = ToStringSerializer.class)
private Long businessId;
/** /**
* 都市圈名称 * 都市圈名称
*/ */
......
...@@ -2,6 +2,7 @@ package com.lyy.admin.controller.megalopolisinfo; ...@@ -2,6 +2,7 @@ package com.lyy.admin.controller.megalopolisinfo;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.lyy.admin.common.anno.Cache; import com.lyy.admin.common.anno.Cache;
import com.lyy.admin.common.anno.EncryptBusiness;
import com.lyy.admin.common.page.TableDataInfo; import com.lyy.admin.common.page.TableDataInfo;
import com.lyy.admin.common.utils.PageUtils; import com.lyy.admin.common.utils.PageUtils;
import com.lyy.admin.controller.BaseController; import com.lyy.admin.controller.BaseController;
...@@ -40,6 +41,7 @@ public class MegalopolisInfoController extends BaseController { ...@@ -40,6 +41,7 @@ public class MegalopolisInfoController extends BaseController {
@ApiImplicitParam(name = "orderByColumn", value = "排序字段(可为空,传类属性)", type = "String"), @ApiImplicitParam(name = "orderByColumn", value = "排序字段(可为空,传类属性)", type = "String"),
@ApiImplicitParam(name = "isAsc", value = "排序字段(可为空,请传asc或者desc)", type = "String") @ApiImplicitParam(name = "isAsc", value = "排序字段(可为空,请传asc或者desc)", type = "String")
}) })
// @EncryptBusiness
public TableDataInfo list(MegalopolisInfoParam megalopolisInfoParam) { public TableDataInfo list(MegalopolisInfoParam megalopolisInfoParam) {
boolean login = isLogin(); boolean login = isLogin();
startPage(); startPage();
...@@ -60,12 +62,13 @@ public class MegalopolisInfoController extends BaseController { ...@@ -60,12 +62,13 @@ public class MegalopolisInfoController extends BaseController {
return getDataTable(parkInfoListVOs,new PageInfo(megalopolisInfos).getTotal()); return getDataTable(parkInfoListVOs,new PageInfo(megalopolisInfos).getTotal());
} }
// @Cache(cacheByUser = false,type = CacheType.LOCAL) // @Cache(cacheByUser = false,type = CacheType.LOCAL)
@GetMapping("/get/{id}") @GetMapping("/get/{businessId}")
@ResponseBody @ResponseBody
@ApiOperation(value = "某个都市圈信息",notes = "rest风格传参,将参数拼接在url上") @ApiOperation(value = "某个都市圈信息",notes = "rest风格传参,将参数拼接在url上")
@ApiImplicitParam(name = "id", value = "都市圈id", type = "Integer") @ApiImplicitParam(name = "businessId", value = "都市圈id", type = "Long")
public MegalopolisInfoAllVO get(@PathVariable Integer id) { // @EncryptBusiness
return MegalopolisInfoSerivce.getMegalopolisInfo(id, getUserInfo().getUserId(), getUserInfo().getIsMembership()); public MegalopolisInfoAllVO get(@PathVariable Long businessId) {
return MegalopolisInfoSerivce.getMegalopolisInfo(businessId, getUserInfo().getUserId(), getUserInfo().getIsMembership());
} }
} }
...@@ -3,6 +3,7 @@ package com.lyy.admin.domain.megalopolisinfo; ...@@ -3,6 +3,7 @@ package com.lyy.admin.domain.megalopolisinfo;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.lyy.admin.common.constant.BaseEntity;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
...@@ -14,7 +15,7 @@ import java.math.BigDecimal; ...@@ -14,7 +15,7 @@ import java.math.BigDecimal;
*/ */
@TableName(value ="megalopolis_info") @TableName(value ="megalopolis_info")
@Data @Data
public class MegalopolisInfo implements Serializable { public class MegalopolisInfo extends BaseEntity implements Serializable {
/** /**
* 主键id * 主键id
*/ */
......
...@@ -20,7 +20,7 @@ public interface MegalopolisInfoService extends IService<MegalopolisInfo> { ...@@ -20,7 +20,7 @@ public interface MegalopolisInfoService extends IService<MegalopolisInfo> {
public List<MegalopolisInfo> selectMegalopolisInfoVOList(MegalopolisInfoParam megalopolisInfoParam); public List<MegalopolisInfo> selectMegalopolisInfoVOList(MegalopolisInfoParam megalopolisInfoParam);
public MegalopolisInfoAllVO getMegalopolisInfo(Integer id, Integer userId, Boolean isMembership); public MegalopolisInfoAllVO getMegalopolisInfo(Long businessId, Integer userId, Boolean isMembership);
public List<MegalopolisInfoListVO> selectMegalopolisInfoCollectionList(MegalopolisInfoCollectionParam megalopolisInfoParam); public List<MegalopolisInfoListVO> selectMegalopolisInfoCollectionList(MegalopolisInfoCollectionParam megalopolisInfoParam);
......
...@@ -46,8 +46,6 @@ import java.util.stream.Collectors; ...@@ -46,8 +46,6 @@ import java.util.stream.Collectors;
public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMapper, MegalopolisInfo> public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMapper, MegalopolisInfo>
implements MegalopolisInfoService { implements MegalopolisInfoService {
@Autowired
MegalopolisInfoMapper megalopolisInfoMapper;
@Autowired @Autowired
MegalopolisCityInfoMapper megalopolisCityInfoMapper; MegalopolisCityInfoMapper megalopolisCityInfoMapper;
...@@ -110,18 +108,23 @@ public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMappe ...@@ -110,18 +108,23 @@ public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMappe
} }
megalopolisInfoQW.orderByAsc("sequence"); megalopolisInfoQW.orderByAsc("sequence");
List<MegalopolisInfo> megalopolisInfos = megalopolisInfoMapper.selectList(megalopolisInfoQW); List<MegalopolisInfo> megalopolisInfos = this.list(megalopolisInfoQW);
return megalopolisInfos; return megalopolisInfos;
} }
@Override @Override
public MegalopolisInfoAllVO getMegalopolisInfo(Integer id, Integer userId, Boolean isMembership) { public MegalopolisInfoAllVO getMegalopolisInfo( Long businessId, Integer userId, Boolean isMembership) {
//通过用户id获取会员信息 //通过用户id获取会员信息
// boolean flag = sysMembershipInfoService.isMemberShip(userId); // boolean flag = sysMembershipInfoService.isMemberShip(userId);
boolean flag = isMembership; boolean flag = isMembership;
MegalopolisInfoAllVO megalopolisInfoAllVO = new MegalopolisInfoAllVO(); MegalopolisInfoAllVO megalopolisInfoAllVO = new MegalopolisInfoAllVO();
MegalopolisInfo megalopolisInfo = megalopolisInfoMapper.selectById(id);
LambdaQueryWrapper<MegalopolisInfo> MILambdaQueryWrapper = new LambdaQueryWrapper<>();
MILambdaQueryWrapper.eq(MegalopolisInfo::getBusinessId,businessId);
MegalopolisInfo megalopolisInfo = this.getOne(MILambdaQueryWrapper);
Integer id = megalopolisInfo.getId();
if (megalopolisInfo == null) { if (megalopolisInfo == null) {
throw new APIException(APIExceptionEnum.NOTEXISTS_EXCEPTION); throw new APIException(APIExceptionEnum.NOTEXISTS_EXCEPTION);
} }
...@@ -215,7 +218,7 @@ public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMappe ...@@ -215,7 +218,7 @@ public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMappe
} }
public List<MegalopolisInfoListVO> selectMegalopolisInfoCollectionList(MegalopolisInfoCollectionParam megalopolisInfoParam) { public List<MegalopolisInfoListVO> selectMegalopolisInfoCollectionList(MegalopolisInfoCollectionParam megalopolisInfoParam) {
return megalopolisInfoMapper.selectMegalopolisInfoCollectionList(megalopolisInfoParam); return this.baseMapper.selectMegalopolisInfoCollectionList(megalopolisInfoParam);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment