Commit 0aab1d8c authored by yaobaizheng's avatar yaobaizheng

都市圈添加雪花id

parent 45082688
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.ApiModelProperty;
import lombok.Data;
......@@ -17,6 +19,10 @@ public class MegalopolisInfoListVO implements Serializable {
@ApiModelProperty(value = "主键id")
private Integer id;
@ApiModelProperty(value = "业务id")
@JsonSerialize(using = ToStringSerializer.class)
private Long businessId;
/**
* 都市圈名称
*/
......
......@@ -2,6 +2,7 @@ package com.lyy.admin.controller.megalopolisinfo;
import com.github.pagehelper.PageInfo;
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.utils.PageUtils;
import com.lyy.admin.controller.BaseController;
......@@ -40,6 +41,7 @@ public class MegalopolisInfoController extends BaseController {
@ApiImplicitParam(name = "orderByColumn", value = "排序字段(可为空,传类属性)", type = "String"),
@ApiImplicitParam(name = "isAsc", value = "排序字段(可为空,请传asc或者desc)", type = "String")
})
// @EncryptBusiness
public TableDataInfo list(MegalopolisInfoParam megalopolisInfoParam) {
boolean login = isLogin();
startPage();
......@@ -60,12 +62,13 @@ public class MegalopolisInfoController extends BaseController {
return getDataTable(parkInfoListVOs,new PageInfo(megalopolisInfos).getTotal());
}
// @Cache(cacheByUser = false,type = CacheType.LOCAL)
@GetMapping("/get/{id}")
@GetMapping("/get/{businessId}")
@ResponseBody
@ApiOperation(value = "某个都市圈信息",notes = "rest风格传参,将参数拼接在url上")
@ApiImplicitParam(name = "id", value = "都市圈id", type = "Integer")
public MegalopolisInfoAllVO get(@PathVariable Integer id) {
return MegalopolisInfoSerivce.getMegalopolisInfo(id, getUserInfo().getUserId(), getUserInfo().getIsMembership());
@ApiImplicitParam(name = "businessId", value = "都市圈id", type = "Long")
// @EncryptBusiness
public MegalopolisInfoAllVO get(@PathVariable Long businessId) {
return MegalopolisInfoSerivce.getMegalopolisInfo(businessId, getUserInfo().getUserId(), getUserInfo().getIsMembership());
}
}
......@@ -3,6 +3,7 @@ package com.lyy.admin.domain.megalopolisinfo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lyy.admin.common.constant.BaseEntity;
import lombok.Data;
import java.io.Serializable;
......@@ -14,7 +15,7 @@ import java.math.BigDecimal;
*/
@TableName(value ="megalopolis_info")
@Data
public class MegalopolisInfo implements Serializable {
public class MegalopolisInfo extends BaseEntity implements Serializable {
/**
* 主键id
*/
......
......@@ -20,7 +20,7 @@ public interface MegalopolisInfoService extends IService<MegalopolisInfo> {
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);
......
......@@ -46,8 +46,6 @@ import java.util.stream.Collectors;
public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMapper, MegalopolisInfo>
implements MegalopolisInfoService {
@Autowired
MegalopolisInfoMapper megalopolisInfoMapper;
@Autowired
MegalopolisCityInfoMapper megalopolisCityInfoMapper;
......@@ -110,18 +108,23 @@ public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMappe
}
megalopolisInfoQW.orderByAsc("sequence");
List<MegalopolisInfo> megalopolisInfos = megalopolisInfoMapper.selectList(megalopolisInfoQW);
List<MegalopolisInfo> megalopolisInfos = this.list(megalopolisInfoQW);
return megalopolisInfos;
}
@Override
public MegalopolisInfoAllVO getMegalopolisInfo(Integer id, Integer userId, Boolean isMembership) {
public MegalopolisInfoAllVO getMegalopolisInfo( Long businessId, Integer userId, Boolean isMembership) {
//通过用户id获取会员信息
// boolean flag = sysMembershipInfoService.isMemberShip(userId);
boolean flag = isMembership;
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) {
throw new APIException(APIExceptionEnum.NOTEXISTS_EXCEPTION);
}
......@@ -215,7 +218,7 @@ public class MegalopolisInfoServiceImpl extends ServiceImpl<MegalopolisInfoMappe
}
public List<MegalopolisInfoListVO> selectMegalopolisInfoCollectionList(MegalopolisInfoCollectionParam megalopolisInfoParam) {
return megalopolisInfoMapper.selectMegalopolisInfoCollectionList(megalopolisInfoParam);
return this.baseMapper.selectMegalopolisInfoCollectionList(megalopolisInfoParam);
}
@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