Commit bd0f68cf by 邹磊浩

后台接口更新

parent 943a5025
......@@ -32,7 +32,7 @@ import com.pz.common.core.page.TableDataInfo;
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/notice")
@RequestMapping("/system/notices")
public class NoticeController extends BaseController {
private final INoticeService iNoticeService;
......@@ -40,7 +40,7 @@ public class NoticeController extends BaseController {
/**
* 查询公告列表
*/
@SaCheckPermission("system:notice:list")
@SaCheckPermission("system:notices:list")
@GetMapping("/list")
public TableDataInfo<NoticeVo> list(NoticeBo bo, PageQuery pageQuery) {
return iNoticeService.queryPageList(bo, pageQuery);
......@@ -49,7 +49,7 @@ public class NoticeController extends BaseController {
/**
* 导出公告列表
*/
@SaCheckPermission("system:notice:export")
@SaCheckPermission("system:notices:export")
@Log(title = "公告", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(NoticeBo bo, HttpServletResponse response) {
......@@ -62,7 +62,7 @@ public class NoticeController extends BaseController {
*
* @param id 主键
*/
@SaCheckPermission("system:notice:query")
@SaCheckPermission("system:notices:query")
@GetMapping("/{id}")
public R<NoticeVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Integer id) {
......@@ -72,7 +72,7 @@ public class NoticeController extends BaseController {
/**
* 新增公告
*/
@SaCheckPermission("system:notice:add")
@SaCheckPermission("system:notices:add")
@Log(title = "公告", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
......@@ -83,7 +83,7 @@ public class NoticeController extends BaseController {
/**
* 修改公告
*/
@SaCheckPermission("system:notice:edit")
@SaCheckPermission("system:notices:edit")
@Log(title = "公告", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
......@@ -96,7 +96,7 @@ public class NoticeController extends BaseController {
*
* @param ids 主键串
*/
@SaCheckPermission("system:notice:remove")
@SaCheckPermission("system:notices:remove")
@Log(title = "公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
......
......@@ -138,6 +138,8 @@ security:
# actuator 监控配置
- /actuator
- /actuator/**
# system 仅用于调试阶段
- /system/**
# MyBatisPlus配置
# https://baomidou.com/config/
......
......@@ -22,7 +22,12 @@ public enum UserType {
/**
* app端
*/
APP_USER("app_user");
APP_USER("app_user"),
/**
* 商家端
*/
AMERCHANT_USER("merchant_user");
private final String userType;
......
package com.pz.system.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
package com.pz.system.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
......@@ -13,9 +13,8 @@ import lombok.EqualsAndHashCode;
* @date 2023-09-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("city")
public class City extends BaseEntity {
public class City {
private static final long serialVersionUID=1L;
......
package com.pz.system.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
package com.pz.system.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.pz.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
......@@ -23,7 +23,7 @@ public class UserAppreciate extends BaseEntity {
*
*/
@TableId(value = "id")
private Long id;
private Integer id;
/**
* 文章
*/
......@@ -31,7 +31,7 @@ public class UserAppreciate extends BaseEntity {
/**
* 用户
*/
private Long uid;
private Integer uid;
/**
* 删除标志(0代表存在 2代表删除)
*/
......
......@@ -27,11 +27,11 @@ public class UserCollect extends BaseEntity {
/**
* 文章
*/
private Long aid;
private Integer aid;
/**
* 用户
*/
private Long uid;
private Integer uid;
/**
* 删除标志(0代表存在 2代表删除)
*/
......
......@@ -14,8 +14,7 @@ import javax.validation.constraints.*;
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class CityBo extends BaseEntity {
public class CityBo {
/**
*
......
......@@ -20,7 +20,7 @@ public class UserAppreciateBo extends BaseEntity {
/**
*
*/
private Long id;
private Integer id;
/**
* 文章
......@@ -30,7 +30,7 @@ public class UserAppreciateBo extends BaseEntity {
/**
* 用户
*/
private Long uid;
private Integer uid;
}
......@@ -25,10 +25,10 @@ public class UserCollectBo extends BaseEntity {
/**
* 文章
*/
private Long aid;
private Integer aid;
/**
* 用户
*/
private Long uid;
private Integer uid;
}
......@@ -6,6 +6,8 @@ import com.pz.common.annotation.ExcelDictFormat;
import com.pz.common.convert.ExcelDictConvert;
import lombok.Data;
import java.util.List;
/**
* 医院视图对象 hospital
......@@ -85,5 +87,18 @@ public class HospitalVo {
@ExcelProperty(value = "状态:0-禁用,1-启用")
private Integer status;
/**
* 医院类别名称
*/
private String categoryName;
/**
* 医院等级名称
*/
private String levelName;
/**
* 关联科室集
*/
private List<DepartmentVo> departmentVoList;
}
......@@ -23,7 +23,7 @@ public class UserAppreciateVo {
*
*/
@ExcelProperty(value = "")
private Long id;
private Integer id;
/**
* 文章
......@@ -35,7 +35,7 @@ public class UserAppreciateVo {
* 用户
*/
@ExcelProperty(value = "用户")
private Long uid;
private Integer uid;
}
......@@ -29,13 +29,13 @@ public class UserCollectVo {
* 文章
*/
@ExcelProperty(value = "文章")
private Long aid;
private Integer aid;
/**
* 用户
*/
@ExcelProperty(value = "用户")
private Long uid;
private Integer uid;
}
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
......@@ -65,26 +66,28 @@ public class ArticleServiceImpl implements IArticleService {
// 查询城市名称
Map<Integer, String> cityMap = new HashMap<>();
// 查询点赞和收藏数
Map<Integer, Integer> appreciateNumMap = new HashMap<>();
Map<Integer, Integer> collectNumMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(articleIds)){
List<CityVo> cityVos = cityMapper.selectVoBatchIds(articleIds);
for (CityVo cityVo : cityVos) {
cityMap.put(cityVo.getId(), cityVo.getName());
}
// 查询点赞和收藏数
Map<Long, Integer> appreciateNumMap = new HashMap<>();
Map<Long, Integer> collectNumMap = new HashMap<>();
List<UserAppreciate> userAppreciates = userAppreciateMapper.selectList(Wrappers.<UserAppreciate>lambdaQuery().in(UserAppreciate::getAid, articleIds));
List<UserCollect> userCollects = userCollectMapper.selectList(Wrappers.<UserCollect>lambdaQuery().in(UserCollect::getAid, articleIds));
for (UserAppreciate userAppreciate : userAppreciates) {
long articleId = userAppreciate.getAid();
Integer articleId = userAppreciate.getAid();
appreciateNumMap.put(articleId, appreciateNumMap.getOrDefault(articleId, 0) + 1);
}
for (UserCollect userCollect : userCollects) {
long articleId = userCollect.getAid();
Integer articleId = userCollect.getAid();
collectNumMap.put(articleId, collectNumMap.getOrDefault(articleId, 0) + 1);
}
}
// 设置城市名称、点赞数和收藏数
articleVos.forEach(articleVo -> {
......@@ -113,11 +116,7 @@ public class ArticleServiceImpl implements IArticleService {
private LambdaQueryWrapper<Article> buildQueryWrapper(ArticleBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<Article> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getCityId() != null, Article::getCityId, bo.getCityId());
lqw.eq(StringUtils.isNotBlank(bo.getTitle()), Article::getTitle, bo.getTitle());
lqw.eq(StringUtils.isNotBlank(bo.getCover()), Article::getCover, bo.getCover());
lqw.eq(bo.getAuthor() != null, Article::getAuthor, bo.getAuthor());
lqw.eq(StringUtils.isNotBlank(bo.getContent()), Article::getContent, bo.getContent());
lqw.like(StringUtils.isNotBlank(bo.getTitle()), Article::getTitle, bo.getTitle());
return lqw;
}
......
......@@ -59,7 +59,6 @@ public class CityServiceImpl implements ICityService {
}
private LambdaQueryWrapper<City> buildQueryWrapper(CityBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<City> lqw = Wrappers.lambdaQuery();
lqw.like(StringUtils.isNotBlank(bo.getName()), City::getName, bo.getName());
lqw.eq(bo.getProvincialId() != null, City::getProvincialId, bo.getProvincialId());
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......
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