From 0ae65d020d1b369093982f7a1547e1dbae95c57d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 26 Apr 2022 09:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=9C=80=E6=B1=82=E8=AF=84?= =?UTF-8?q?=E8=AE=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TDemandCommentController.java | 116 ++++++++++++++++++ .../demandComment/dao/TDemandCommentDao.java | 16 +++ .../demandComment/dto/TDemandCommentDTO.java | 45 +++++++ .../entity/TDemandCommentEntity.java | 57 +++++++++ .../excel/TDemandCommentExcel.java | 45 +++++++ .../service/TDemandCommentService.java | 15 +++ .../impl/TDemandCommentServiceImpl.java | 34 +++++ .../listener/ResourceOwnerListener.java | 1 + .../demandComment/TDemandCommentDao.xml | 21 ++++ 9 files changed, 350 insertions(+) create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/controller/TDemandCommentController.java create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/dao/TDemandCommentDao.java create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/dto/TDemandCommentDTO.java create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntity.java create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/excel/TDemandCommentExcel.java create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/service/TDemandCommentService.java create mode 100644 renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java create mode 100644 renren-admin/src/main/resources/mapper/demandComment/TDemandCommentDao.xml diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/controller/TDemandCommentController.java b/renren-admin/src/main/java/io/renren/modules/demandComment/controller/TDemandCommentController.java new file mode 100644 index 00000000..dd40d96f --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/controller/TDemandCommentController.java @@ -0,0 +1,116 @@ +package io.renren.modules.demandComment.controller; + +import io.renren.common.annotation.LogOperation; +import io.renren.common.constant.Constant; +import io.renren.common.page.PageData; +import io.renren.common.utils.ExcelUtils; +import io.renren.common.utils.Result; +import io.renren.common.validator.AssertUtils; +import io.renren.common.validator.ValidatorUtils; +import io.renren.common.validator.group.AddGroup; +import io.renren.common.validator.group.DefaultGroup; +import io.renren.common.validator.group.UpdateGroup; +import io.renren.modules.demandComment.dto.TDemandCommentDTO; +import io.renren.modules.demandComment.excel.TDemandCommentExcel; +import io.renren.modules.demandComment.service.TDemandCommentService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** +* 需求评论 +* +* @author wangliwen wangliwen2@hisense.com +* @since 1.0 2022-04-26 +*/ +@RestController +@RequestMapping("demandComment/tdemandcomment") +@Api(tags="需求评论") +public class TDemandCommentController { + @Autowired + private TDemandCommentService tDemandCommentService; + + @GetMapping("page") + @ApiOperation("分页") + @ApiImplicitParams({ + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , + @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , + @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") + }) + @RequiresPermissions("demandComment:tdemandcomment:page") + public Result> page(@ApiIgnore @RequestParam Map params){ + PageData page = tDemandCommentService.page(params); + + return new Result>().ok(page); + } + + @GetMapping("{id}") + @ApiOperation("信息") + @RequiresPermissions("demandComment:tdemandcomment:info") + public Result get(@PathVariable("id") Long id){ + TDemandCommentDTO data = tDemandCommentService.get(id); + + return new Result().ok(data); + } + + @PostMapping + @ApiOperation("保存") + @LogOperation("保存") + @RequiresPermissions("demandComment:tdemandcomment:save") + public Result save(@RequestBody TDemandCommentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + + tDemandCommentService.save(dto); + + return new Result(); + } + + @PutMapping + @ApiOperation("修改") + @LogOperation("修改") + @RequiresPermissions("demandComment:tdemandcomment:update") + public Result update(@RequestBody TDemandCommentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + + tDemandCommentService.update(dto); + + return new Result(); + } + + @DeleteMapping + @ApiOperation("删除") + @LogOperation("删除") + @RequiresPermissions("demandComment:tdemandcomment:delete") + public Result delete(@RequestBody Long[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + + tDemandCommentService.delete(ids); + + return new Result(); + } + + @GetMapping("export") + @ApiOperation("导出") + @LogOperation("导出") + @RequiresPermissions("demandComment:tdemandcomment:export") + public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { + List list = tDemandCommentService.list(params); + + ExcelUtils.exportExcelToTarget(response, null, "需求评论", list, TDemandCommentExcel.class); + } + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/dao/TDemandCommentDao.java b/renren-admin/src/main/java/io/renren/modules/demandComment/dao/TDemandCommentDao.java new file mode 100644 index 00000000..74a87dc5 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/dao/TDemandCommentDao.java @@ -0,0 +1,16 @@ +package io.renren.modules.demandComment.dao; + +import io.renren.common.dao.BaseDao; +import io.renren.modules.demandComment.entity.TDemandCommentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** +* 需求评论 +* +* @author wangliwen wangliwen2@hisense.com +* @since 1.0 2022-04-26 +*/ +@Mapper +public interface TDemandCommentDao extends BaseDao { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/dto/TDemandCommentDTO.java b/renren-admin/src/main/java/io/renren/modules/demandComment/dto/TDemandCommentDTO.java new file mode 100644 index 00000000..0496c01d --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/dto/TDemandCommentDTO.java @@ -0,0 +1,45 @@ +package io.renren.modules.demandComment.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** +* 需求评论 +* +* @author wangliwen wangliwen2@hisense.com +* @since 1.0 2022-04-26 +*/ +@Data +@ApiModel(value = "需求评论") +public class TDemandCommentDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private Long id; + @ApiModelProperty(value = "评论人") + private Long creator; + @ApiModelProperty(value = "评论时间") + private Date createDate; + @ApiModelProperty(value = "评论人部门名称") + private String createDeptName; + @ApiModelProperty(value = "评论人姓名") + private String name; + @ApiModelProperty(value = "评论内容") + private String comment; + @ApiModelProperty(value = "评论主题id") + private Long targetId; + @ApiModelProperty(value = "备用字段") + private String note1; + @ApiModelProperty(value = "备用字段") + private String note2; + @ApiModelProperty(value = "备用字段") + private String note3; + @ApiModelProperty(value = "备用字段") + private String note4; + @ApiModelProperty(value = "备用字段") + private String note5; + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntity.java b/renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntity.java new file mode 100644 index 00000000..d7296d4a --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/entity/TDemandCommentEntity.java @@ -0,0 +1,57 @@ +package io.renren.modules.demandComment.entity; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.baomidou.mybatisplus.annotation.*; +import java.util.Date; +import io.renren.common.entity.BaseEntity; + +/** + * 需求评论 + * + * @author wangliwen wangliwen2@hisense.com + * @since 1.0 2022-04-26 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("t_demand_comment") +public class TDemandCommentEntity extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 评论人部门名称 + */ + private String createDeptName; + /** + * 评论人姓名 + */ + private String name; + /** + * 评论内容 + */ + private String comment; + /** + * 评论主题id + */ + private Long targetId; + /** + * 备用字段 + */ + private String note1; + /** + * 备用字段 + */ + private String note2; + /** + * 备用字段 + */ + private String note3; + /** + * 备用字段 + */ + private String note4; + /** + * 备用字段 + */ + private String note5; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/excel/TDemandCommentExcel.java b/renren-admin/src/main/java/io/renren/modules/demandComment/excel/TDemandCommentExcel.java new file mode 100644 index 00000000..acc58b4b --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/excel/TDemandCommentExcel.java @@ -0,0 +1,45 @@ +package io.renren.modules.demandComment.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import lombok.Data; +import java.util.Date; + +/** + * 需求评论 + * + * @author wangliwen wangliwen2@hisense.com + * @since 1.0 2022-04-26 + */ +@Data +@ContentRowHeight(20) +@HeadRowHeight(20) +@ColumnWidth(25) +public class TDemandCommentExcel { + @ExcelProperty(value = "Long", index = 0) + private Long id; + @ExcelProperty(value = "评论人", index = 1) + private Long creator; + @ExcelProperty(value = "评论时间", index = 2) + private Date createDate; + @ExcelProperty(value = "评论人部门名称", index = 3) + private String createDeptName; + @ExcelProperty(value = "评论人姓名", index = 4) + private String name; + @ExcelProperty(value = "评论内容", index = 5) + private String comment; + @ExcelProperty(value = "评论主题id", index = 6) + private Long targetId; + @ExcelProperty(value = "备用字段", index = 7) + private String note1; + @ExcelProperty(value = "备用字段", index = 8) + private String note2; + @ExcelProperty(value = "备用字段", index = 9) + private String note3; + @ExcelProperty(value = "备用字段", index = 10) + private String note4; + @ExcelProperty(value = "备用字段", index = 11) + private String note5; +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/service/TDemandCommentService.java b/renren-admin/src/main/java/io/renren/modules/demandComment/service/TDemandCommentService.java new file mode 100644 index 00000000..55a6a6eb --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/service/TDemandCommentService.java @@ -0,0 +1,15 @@ +package io.renren.modules.demandComment.service; + +import io.renren.common.service.CrudService; +import io.renren.modules.demandComment.dto.TDemandCommentDTO; +import io.renren.modules.demandComment.entity.TDemandCommentEntity; + +/** + * 需求评论 + * + * @author wangliwen wangliwen2@hisense.com + * @since 1.0 2022-04-26 + */ +public interface TDemandCommentService extends CrudService { + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java new file mode 100644 index 00000000..4bdfe690 --- /dev/null +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java @@ -0,0 +1,34 @@ +package io.renren.modules.demandComment.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.renren.common.service.impl.CrudServiceImpl; +import io.renren.common.constant.Constant; +import io.renren.modules.demandComment.dao.TDemandCommentDao; +import io.renren.modules.demandComment.dto.TDemandCommentDTO; +import io.renren.modules.demandComment.entity.TDemandCommentEntity; +import io.renren.modules.demandComment.service.TDemandCommentService; +import io.renren.modules.security.user.SecurityUser; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 需求评论 + * + * @author wangliwen wangliwen2@hisense.com + * @since 1.0 2022-04-26 + */ +@Service +public class TDemandCommentServiceImpl extends CrudServiceImpl implements TDemandCommentService { + + @Override + public QueryWrapper getWrapper(Map params){ + QueryWrapper wrapper = new QueryWrapper<>(); + + + return wrapper; + } + + +} \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java index 1339e726..51ce888c 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/listener/ResourceOwnerListener.java @@ -71,6 +71,7 @@ public class ResourceOwnerListener implements TaskListener, ExecutionListener, A default: logger.info("未处理该事件:" + eventName); } + logger.error("-----------------------结束资源所有者节点---------------------------"); } /** diff --git a/renren-admin/src/main/resources/mapper/demandComment/TDemandCommentDao.xml b/renren-admin/src/main/resources/mapper/demandComment/TDemandCommentDao.xml new file mode 100644 index 00000000..964482d2 --- /dev/null +++ b/renren-admin/src/main/resources/mapper/demandComment/TDemandCommentDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file