Browse Source

Merge remote-tracking branch 'origin/dev_group_act_notice' into dev_group_act_notice

master
yinzuomei 4 years ago
parent
commit
67980d326e
  1. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/invitation/form/ShareFormDTO.java
  2. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/AddNoticeFormDTO.java
  3. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/EditNoticeFormDTO.java
  4. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/notice/form/NoticeCommentFormDTO.java
  5. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/controller/InvitationRecordController.java
  6. 43
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeCommentController.java
  7. 40
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeController.java
  8. 42
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/controller/NoticeReadRecordController.java
  9. 60
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeCommentService.java
  10. 60
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeReadRecordService.java
  11. 50
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/NoticeService.java
  12. 52
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeCommentServiceImpl.java
  13. 51
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeReadRecordServiceImpl.java
  14. 46
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/notice/service/impl/NoticeServiceImpl.java

4
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 {}
}

10
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<FileDTO> docList;
public interface Add{}
public interface AddUserShow extends CustomerClientShowGroup {}
}

6
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<FileDTO> docList;
public interface Edit{}
public interface EditUserShow extends CustomerClientShowGroup {}
}

6
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 {}
}

2
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<ShareResultDTO> 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<ShareResultDTO>().ok(invitationRecordService.share(formDTO));
}

43
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<PageData<NoticeCommentDTO>> page(@RequestParam Map<String, Object> params){
PageData<NoticeCommentDTO> page = noticeCommentService.page(params);
return new Result<PageData<NoticeCommentDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<NoticeCommentDTO> get(@PathVariable("id") String id){
NoticeCommentDTO data = noticeCommentService.get(id);
return new Result<NoticeCommentDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<NoticeCommentDTO> 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();
}

40
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<PageData<NoticeDTO>> page(@RequestParam Map<String, Object> params){
PageData<NoticeDTO> page = noticeService.page(params);
return new Result<PageData<NoticeDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<NoticeDTO> get(@PathVariable("id") String id){
NoticeDTO data = noticeService.get(id);
return new Result<NoticeDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<NoticeDTO> 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();
}

42
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<PageData<NoticeReadRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<NoticeReadRecordDTO> page = noticeReafdRecordService.page(params);
return new Result<PageData<NoticeReadRecordDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<NoticeReadRecordDTO> get(@PathVariable("id") String id){
NoticeReadRecordDTO data = noticeReafdRecordService.get(id);
return new Result<NoticeReadRecordDTO>().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<String, Object> params, HttpServletResponse response) throws Exception {
List<NoticeReadRecordDTO> list = noticeReafdRecordService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, NoticeReadRecordExcel.class);
}
/**
* @param formDTO
* @return

60
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<NoticeCommentEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<NoticeCommentDTO>
* @author generator
* @date 2021-04-19
*/
PageData<NoticeCommentDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<NoticeCommentDTO>
* @author generator
* @date 2021-04-19
*/
List<NoticeCommentDTO> list(Map<String, Object> 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

60
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<NoticeReadRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<NoticeReafdRecordDTO>
* @author generator
* @date 2021-04-19
*/
PageData<NoticeReadRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<NoticeReafdRecordDTO>
* @author generator
* @date 2021-04-19
*/
List<NoticeReadRecordDTO> list(Map<String, Object> 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

50
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<NoticeEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<NoticeDTO>
* @author generator
* @date 2021-04-19
*/
PageData<NoticeDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<NoticeDTO>
* @author generator
* @date 2021-04-19
*/
List<NoticeDTO> list(Map<String, Object> params);
/**
* 单条查询
*
@ -68,36 +48,6 @@ public interface NoticeService extends BaseService<NoticeEntity> {
*/
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

52
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<NoticeCommentDao,
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public PageData<NoticeCommentDTO> page(Map<String, Object> params) {
IPage<NoticeCommentEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, NoticeCommentDTO.class);
}
@Override
public List<NoticeCommentDTO> list(Map<String, Object> params) {
List<NoticeCommentEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, NoticeCommentDTO.class);
}
private QueryWrapper<NoticeCommentEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<NoticeCommentEntity> 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

51
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<NoticeReadRecor
@Autowired
private NoticeDao noticeDao;
@Override
public PageData<NoticeReadRecordDTO> page(Map<String, Object> params) {
IPage<NoticeReadRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, NoticeReadRecordDTO.class);
}
@Override
public List<NoticeReadRecordDTO> list(Map<String, Object> params) {
List<NoticeReadRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, NoticeReadRecordDTO.class);
}
private QueryWrapper<NoticeReadRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<NoticeReadRecordEntity> 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

46
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<NoticeDao, NoticeEntity>
private NoticeReadRecordDao noticeReafdRecordDao;
@Override
public PageData<NoticeDTO> page(Map<String, Object> params) {
IPage<NoticeEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, NoticeDTO.class);
}
@Override
public List<NoticeDTO> list(Map<String, Object> params) {
List<NoticeEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, NoticeDTO.class);
}
private QueryWrapper<NoticeEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<NoticeEntity> 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

Loading…
Cancel
Save