From ee8ade4700bb033c570cb280db1b701b945933e8 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 21 Apr 2021 10:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/invitation/form/ShareFormDTO.java | 4 +- .../dto/notice/form/AddNoticeFormDTO.java | 10 ++-- .../dto/notice/form/EditNoticeFormDTO.java | 6 +- .../dto/notice/form/NoticeCommentFormDTO.java | 6 +- .../InvitationRecordController.java | 2 +- .../controller/NoticeCommentController.java | 43 +------------ .../notice/controller/NoticeController.java | 40 +------------ .../NoticeReadRecordController.java | 42 ------------- .../notice/service/NoticeCommentService.java | 60 ------------------- .../service/NoticeReadRecordService.java | 60 ------------------- .../modules/notice/service/NoticeService.java | 50 ---------------- .../impl/NoticeCommentServiceImpl.java | 52 ---------------- .../impl/NoticeReadRecordServiceImpl.java | 51 ---------------- .../service/impl/NoticeServiceImpl.java | 46 -------------- 14 files changed, 21 insertions(+), 451 deletions(-) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/invitation/form/ShareFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/invitation/form/ShareFormDTO.java index 879ac465ac..efb075a0b0 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/invitation/form/ShareFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/invitation/form/ShareFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.invitation.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -20,7 +21,7 @@ public class ShareFormDTO implements Serializable { /** * 类型(notice:通知 act:活动) */ - @NotBlank(message = "类型(notice:通知 act:活动)不能为空",groups = {ShareFormDTO.Add.class}) + @NotBlank(message = "类型(notice:通知 act:活动)不能为空",groups = {ShareFormDTO.UserShow.class}) private String type; /** * token中用户Id @@ -28,4 +29,5 @@ public class ShareFormDTO implements Serializable { private String userId; public interface Add{} + public interface UserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java index f83f802c6c..d9345790fe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.notice.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.resi.group.dto.topic.form.FileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -22,14 +23,14 @@ public class AddNoticeFormDTO { /** * 通知标题 */ - @NotBlank(message = "通知标题不能为空",groups = {AddNoticeFormDTO.Add.class}) - @Length(max = 20, message = "通知标题不能超过20个字符") + @NotBlank(message = "通知标题不能为空",groups = {AddNoticeFormDTO.AddUserShow.class}) + @Length(max = 20, message = "通知标题不能超过20个字符",groups = {AddNoticeFormDTO.AddUserShow.class}) private String title; /** * 通知内容 */ - @NotBlank(message = "通知内容不能为空",groups = {AddNoticeFormDTO.Add.class}) - @Length(max = 1000, message = "通知内容不能超过1000个字符") + @NotBlank(message = "通知内容不能为空",groups = {AddNoticeFormDTO.AddUserShow.class}) + @Length(max = 1000, message = "通知内容不能超过1000个字符",groups = {AddNoticeFormDTO.AddUserShow.class}) private String content; /** * 图片附件集合 @@ -41,4 +42,5 @@ public class AddNoticeFormDTO { private List docList; public interface Add{} + public interface AddUserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java index 79dd421f7f..08573cae19 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.notice.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.resi.group.dto.topic.form.FileDTO; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -22,12 +23,12 @@ public class EditNoticeFormDTO { /** * 通知标题 */ - @Length(max = 20, message = "通知标题不能超过20个字符") + @Length(max = 20, message = "通知标题不能超过20个字符",groups = {EditNoticeFormDTO.EditUserShow.class}) private String title; /** * 通知内容 */ - @Length(max = 1000, message = "通知内容不能超过1000个字符") + @Length(max = 1000, message = "通知内容不能超过1000个字符",groups = {EditNoticeFormDTO.EditUserShow.class}) private String content; /** * 图片附件集合 @@ -39,4 +40,5 @@ public class EditNoticeFormDTO { private List docList; public interface Edit{} + public interface EditUserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java index b2f91f22f9..5fc28f52ef 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.notice.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -20,9 +21,10 @@ public class NoticeCommentFormDTO { /** * 评论内容300 */ - @NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.Comment.class}) - @Length(max = 20, message = "评论内容不能超过300个字符") + @NotBlank(message = "评论内容不能为空",groups = {NoticeCommentFormDTO.UserShow.class}) + @Length(max = 20, message = "评论内容不能超过300个字符",groups = {NoticeCommentFormDTO.UserShow.class}) private String commentContent; public interface Comment{} + public interface UserShow extends CustomerClientShowGroup {} } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/InvitationRecordController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/InvitationRecordController.java index 73579acfaf..05cd2d035a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/InvitationRecordController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/InvitationRecordController.java @@ -55,7 +55,7 @@ public class InvitationRecordController { **/ @PostMapping(value = "share") public Result share(@LoginUser TokenDto tokenDto, @RequestBody ShareFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, ShareFormDTO.Add.class); + ValidatorUtils.validateEntity(formDTO, ShareFormDTO.Add.class, ShareFormDTO.UserShow.class); formDTO.setUserId(tokenDto.getUserId()); return new Result().ok(invitationRecordService.share(formDTO)); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java index f3972f4478..854f3c26a6 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java @@ -54,47 +54,6 @@ public class NoticeCommentController { @Autowired private NoticeCommentService noticeCommentService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = noticeCommentService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - NoticeCommentDTO data = noticeCommentService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody NoticeCommentDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - noticeCommentService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody NoticeCommentDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - noticeCommentService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - noticeCommentService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = noticeCommentService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, NoticeCommentExcel.class); - } /** * @param formDTO @@ -104,7 +63,7 @@ public class NoticeCommentController { **/ @PostMapping(value = "noticecomment") public Result noticeComment(@LoginUser TokenDto tokenDto, @RequestBody NoticeCommentFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, NoticeCommentFormDTO.Comment.class); + ValidatorUtils.validateEntity(formDTO, NoticeCommentFormDTO.Comment.class, NoticeCommentFormDTO.UserShow.class); noticeCommentService.noticeComment(tokenDto, formDTO); return new Result(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java index 339fd1e04a..02d6bf79ec 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java @@ -55,48 +55,12 @@ public class NoticeController { @Autowired private NoticeService noticeService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = noticeService.page(params); - return new Result>().ok(page); - } - @GetMapping("{id}") public Result get(@PathVariable("id") String id){ NoticeDTO data = noticeService.get(id); return new Result().ok(data); } - @PostMapping - public Result save(@RequestBody NoticeDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - noticeService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody NoticeDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - noticeService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - noticeService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = noticeService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, NoticeExcel.class); - } - /** * @param formDTO * @return @@ -105,7 +69,7 @@ public class NoticeController { **/ @PostMapping(value = "add") public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddNoticeFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class); + ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class, AddNoticeFormDTO.AddUserShow.class); noticeService.add(tokenDto, formDTO); return new Result(); } @@ -118,7 +82,7 @@ public class NoticeController { **/ @PostMapping(value = "edit") public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditNoticeFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, EditNoticeFormDTO.Edit.class); + ValidatorUtils.validateEntity(formDTO, EditNoticeFormDTO.Edit.class, EditNoticeFormDTO.EditUserShow.class); noticeService.edit(tokenDto, formDTO); return new Result(); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java index dd865bfdf8..ca1dcf86b2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java @@ -54,48 +54,6 @@ public class NoticeReadRecordController { @Autowired private NoticeReadRecordService noticeReafdRecordService; - @GetMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = noticeReafdRecordService.page(params); - return new Result>().ok(page); - } - - @GetMapping("{id}") - public Result get(@PathVariable("id") String id){ - NoticeReadRecordDTO data = noticeReafdRecordService.get(id); - return new Result().ok(data); - } - - @PostMapping - public Result save(@RequestBody NoticeReadRecordDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); - noticeReafdRecordService.save(dto); - return new Result(); - } - - @PutMapping - public Result update(@RequestBody NoticeReadRecordDTO dto){ - //效验数据 - ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); - noticeReafdRecordService.update(dto); - return new Result(); - } - - @DeleteMapping - public Result delete(@RequestBody String[] ids){ - //效验数据 - AssertUtils.isArrayEmpty(ids, "id"); - noticeReafdRecordService.delete(ids); - return new Result(); - } - - @GetMapping("export") - public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { - List list = noticeReafdRecordService.list(params); - ExcelUtils.exportExcelToTarget(response, null, list, NoticeReadRecordExcel.class); - } - /** * @param formDTO * @return diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java index 50b3beaa9d..6e3a82690d 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java @@ -37,66 +37,6 @@ import java.util.Map; */ public interface NoticeCommentService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2021-04-19 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2021-04-19 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return NoticeCommentDTO - * @author generator - * @date 2021-04-19 - */ - NoticeCommentDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2021-04-19 - */ - void save(NoticeCommentDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2021-04-19 - */ - void update(NoticeCommentDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2021-04-19 - */ - void delete(String[] ids); - /** * @param formDTO * @return diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java index f4d048055f..17d41252c0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java @@ -37,66 +37,6 @@ import java.util.Map; */ public interface NoticeReadRecordService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2021-04-19 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2021-04-19 - */ - List list(Map params); - - /** - * 单条查询 - * - * @param id - * @return NoticeReafdRecordDTO - * @author generator - * @date 2021-04-19 - */ - NoticeReadRecordDTO get(String id); - - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2021-04-19 - */ - void save(NoticeReadRecordDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2021-04-19 - */ - void update(NoticeReadRecordDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2021-04-19 - */ - void delete(String[] ids); - /** * @param formDTO * @return diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java index a10a82fb07..48db1b92d3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java @@ -38,26 +38,6 @@ import java.util.Map; */ public interface NoticeService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2021-04-19 - */ - PageData page(Map params); - - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2021-04-19 - */ - List list(Map params); - /** * 单条查询 * @@ -68,36 +48,6 @@ public interface NoticeService extends BaseService { */ NoticeDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2021-04-19 - */ - void save(NoticeDTO dto); - - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2021-04-19 - */ - void update(NoticeDTO dto); - - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2021-04-19 - */ - void delete(String[] ids); - /** * @param formDTO * @return diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java index f3b2671eb4..4bd79318c2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java @@ -84,58 +84,6 @@ public class NoticeCommentServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, NoticeCommentDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, NoticeCommentDTO.class); - } - - private QueryWrapper getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public NoticeCommentDTO get(String id) { - NoticeCommentEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, NoticeCommentDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(NoticeCommentDTO dto) { - NoticeCommentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(NoticeCommentDTO dto) { - NoticeCommentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - /** * @param formDTO * @return diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java index ab5182fbbb..ad26bc805e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java @@ -66,57 +66,6 @@ public class NoticeReadRecordServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, NoticeReadRecordDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, NoticeReadRecordDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public NoticeReadRecordDTO get(String id) { - NoticeReadRecordEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, NoticeReadRecordDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(NoticeReadRecordDTO dto) { - NoticeReadRecordEntity entity = ConvertUtils.sourceToTarget(dto, NoticeReadRecordEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(NoticeReadRecordDTO dto) { - NoticeReadRecordEntity entity = ConvertUtils.sourceToTarget(dto, NoticeReadRecordEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } /** * @param formDTO diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java index 50a2ef85a5..97ec4132f1 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java @@ -114,58 +114,12 @@ public class NoticeServiceImpl extends BaseServiceImpl private NoticeReadRecordDao noticeReafdRecordDao; - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, NoticeDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, NoticeDTO.class); - } - - private QueryWrapper getWrapper(Map params) { - String id = (String) params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - @Override public NoticeDTO get(String id) { NoticeEntity entity = baseDao.selectById(id); return ConvertUtils.sourceToTarget(entity, NoticeDTO.class); } - @Override - @Transactional(rollbackFor = Exception.class) - public void save(NoticeDTO dto) { - NoticeEntity entity = ConvertUtils.sourceToTarget(dto, NoticeEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(NoticeDTO dto) { - NoticeEntity entity = ConvertUtils.sourceToTarget(dto, NoticeEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - /** * @param formDTO * @return