diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueSuggestionDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueSuggestionDTO.java new file mode 100644 index 0000000000..e5a3300212 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueSuggestionDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Data +public class IssueSuggestionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 议题id + */ + private String issueId; + + /** + * 议题所属网格id + */ + private String gridId; + + /** + * 对议题的想法 + */ + private String suggestion; + + /** + * 1公开; 0匿名 + */ + private Integer publicFlag; + + /** + * 删除标识:0 未删除 1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 提建议的人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 修改人ID + */ + private String updatedBy; + + /** + * 修改时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/UserIssueSuggestionFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/UserIssueSuggestionFormDTO.java new file mode 100644 index 0000000000..a9f37302a9 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/UserIssueSuggestionFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询用户对于某个议题的想法 返回一条记录 + * + * @author yinzuomei@elink-cn.com + * @date 2020/11/18 10:09 + */ +@Data +public class UserIssueSuggestionFormDTO implements Serializable { + private static final long serialVersionUID = -8506264833919404944L; + /** + * 用户id + */ + @NotBlank(message = "userId不能为空") + private String userId; + + /** + * 议题id + */ + @NotBlank(message = "issueId不能为空") + private String issueId; + + public UserIssueSuggestionFormDTO( String userId, String issueId) { + this.userId = userId; + this.issueId = issueId; + } +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 3599df403b..50b8eef39f 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -1,14 +1,16 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IssueSuggestionDTO; +import com.epmet.dto.form.UserIssueSuggestionFormDTO; +import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; import com.epmet.resi.group.dto.group.form.AllIssueFormDTO; import com.epmet.resi.group.dto.group.result.GroupClosedListResultDTO; import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO; import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import org.springframework.cloud.openfeign.FeignClient; - -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -51,4 +53,13 @@ public interface GovIssueOpenFeignClient { */ @PostMapping("/gov/issue/issue/groupclosedlist") Result> getClosedListByGroup(@RequestBody AllIssueFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description + * @Date 2020/11/18 10:17 + **/ + @PostMapping(value = "/gov/issue/issuesuggestion/queryuserissuesuggestion",consumes = MediaType.APPLICATION_JSON_VALUE) + Result queryIssueSuggestion(@RequestBody UserIssueSuggestionFormDTO formDTO); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index d37933045a..d8aea745c5 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -3,6 +3,8 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IssueSuggestionDTO; +import com.epmet.dto.form.UserIssueSuggestionFormDTO; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.resi.group.dto.group.form.AllIssueFormDTO; import com.epmet.resi.group.dto.group.result.GroupClosedListResultDTO; @@ -58,4 +60,15 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result> getClosedListByGroup(AllIssueFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getShiftProjectListByGroup", formDTO); } + + /** + * @param formDTO + * @author yinzuomei + * @description + * @Date 2020/11/18 10:17 + **/ + @Override + public Result queryIssueSuggestion(UserIssueSuggestionFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryIssueSuggestion", formDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueSuggestionController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueSuggestionController.java new file mode 100644 index 0000000000..401743eb81 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueSuggestionController.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IssueSuggestionDTO; +import com.epmet.dto.form.UserIssueSuggestionFormDTO; +import com.epmet.service.IssueSuggestionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@RestController +@RequestMapping("issuesuggestion") +public class IssueSuggestionController { + + @Autowired + private IssueSuggestionService issueSuggestionService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = issueSuggestionService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + IssueSuggestionDTO data = issueSuggestionService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody IssueSuggestionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + issueSuggestionService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody IssueSuggestionDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + issueSuggestionService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + issueSuggestionService.delete(ids); + return new Result(); + } + + /** + * @param formDTO + * @author yinzuomei + * @description 查询用户对于某个议题的想法 返回一条记录 + * @Date 2020/11/18 10:12 + **/ + @PostMapping("queryuserissuesuggestion") + public Result queryUserIssueSuggestion(@RequestBody UserIssueSuggestionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + IssueSuggestionDTO issueSuggestionDTO=issueSuggestionService.queryUserIssueSuggestion(formDTO); + return new Result().ok(issueSuggestionDTO); + } +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java new file mode 100644 index 0000000000..c3989ae403 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueSuggestionDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.IssueSuggestionDTO; +import com.epmet.dto.form.UserIssueSuggestionFormDTO; +import com.epmet.entity.IssueSuggestionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Mapper +public interface IssueSuggestionDao extends BaseDao { + + /** + * @return com.epmet.dto.IssueSuggestionDTO + * @param formDTO + * @author yinzuomei + * @description 查询用户对于某个议题的想法 返回一条记录 + * @Date 2020/11/18 10:12 + **/ + IssueSuggestionDTO selectUserIssueSuggestion(UserIssueSuggestionFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueSuggestionEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueSuggestionEntity.java new file mode 100644 index 0000000000..2d160030ab --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueSuggestionEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_suggestion") +public class IssueSuggestionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 议题id + */ + private String issueId; + + /** + * 议题所属网格id + */ + private String gridId; + + /** + * 对议题的想法 + */ + private String suggestion; + + /** + * 1公开; 0匿名 + */ + private Integer publicFlag; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueSuggestionService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueSuggestionService.java new file mode 100644 index 0000000000..0c320c08d4 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueSuggestionService.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueSuggestionDTO; +import com.epmet.dto.form.UserIssueSuggestionFormDTO; +import com.epmet.entity.IssueSuggestionEntity; + +import java.util.List; +import java.util.Map; + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +public interface IssueSuggestionService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-11-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-11-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueSuggestionDTO + * @author generator + * @date 2020-11-18 + */ + IssueSuggestionDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-18 + */ + void save(IssueSuggestionDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-11-18 + */ + void update(IssueSuggestionDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-11-18 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @author yinzuomei + * @description 查询用户对于某个议题的想法 返回一条记录 + * @Date 2020/11/18 10:12 + **/ + IssueSuggestionDTO queryUserIssueSuggestion(UserIssueSuggestionFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java new file mode 100644 index 0000000000..a706e252b8 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IssueSuggestionDao; +import com.epmet.dto.IssueSuggestionDTO; +import com.epmet.dto.form.UserIssueSuggestionFormDTO; +import com.epmet.entity.IssueSuggestionEntity; +import com.epmet.service.IssueSuggestionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Service +public class IssueSuggestionServiceImpl extends BaseServiceImpl implements IssueSuggestionService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueSuggestionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueSuggestionDTO.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 IssueSuggestionDTO get(String id) { + IssueSuggestionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueSuggestionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueSuggestionDTO dto) { + IssueSuggestionEntity entity = ConvertUtils.sourceToTarget(dto, IssueSuggestionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueSuggestionDTO dto) { + IssueSuggestionEntity entity = ConvertUtils.sourceToTarget(dto, IssueSuggestionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @author yinzuomei + * @description 查询用户对于某个议题的想法 返回一条记录 + * @Date 2020/11/18 10:12 + **/ + @Override + public IssueSuggestionDTO queryUserIssueSuggestion(UserIssueSuggestionFormDTO formDTO) { + return baseDao.selectUserIssueSuggestion(formDTO); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.2__issue_audit_tables.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.2__issue_audit_tables.sql new file mode 100644 index 0000000000..93f8c2338e --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.2__issue_audit_tables.sql @@ -0,0 +1,37 @@ +drop table if exists issue_application; +CREATE TABLE `issue_application` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `ISSUE_TITLE` varchar(128) NOT NULL COMMENT '议题名称 ', + `SUGGESTION` varchar(1024) NOT NULL COMMENT '建议', + `APPLY_STATUS` varchar(32) NOT NULL COMMENT '审核状态:under_auditing:待审核;approved:通过;rejected:驳回', + `TOPIC_ID` varchar(32) NOT NULL COMMENT '话题id', + `GROUP_ID` varchar(64) NOT NULL COMMENT '小组id', + `GRID_ID` varchar(32) NOT NULL COMMENT '网格ID 居民端议题对应一个网格Id', + `ISSUE_ID` varchar(64) DEFAULT NULL COMMENT '审核通过后对应的 议题id', + `PASSED_REASON` varchar(1024) DEFAULT NULL COMMENT '审核通过时填写的理由', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题转议题申请表'; + +drop table if exists issue_application_history; +CREATE TABLE `issue_application_history` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `ISSUE_APPLICATION_ID` varchar(64) NOT NULL COMMENT '话题转议题申请表 issue_application.id', + `ACTION_TYPE` varchar(32) NOT NULL COMMENT 'under_auditing:提交审核;\r\napproved:审核通过,\r\nrejected:驳回', + `REASON` varchar(1024) DEFAULT NULL COMMENT '审核时的说明', + `STAFF_NAME` varchar(255) DEFAULT NULL COMMENT '工作端人员姓名', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识:0 未删除 1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人 提交人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '修改人ID', + `UPDATED_TIME` datetime NOT NULL COMMENT '修改时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='话题转议题审核历史表'; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.3__issue_sugg_tables.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.3__issue_sugg_tables.sql new file mode 100644 index 0000000000..0ee88d49d5 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.3__issue_sugg_tables.sql @@ -0,0 +1,16 @@ +drop table if exists issue_suggestion; +CREATE TABLE `issue_suggestion` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `ISSUE_ID` varchar(64) NOT NULL COMMENT '议题id', + `GRID_ID` varchar(64) NOT NULL COMMENT '议题所属网格id', + `SUGGESTION` varchar(512) NOT NULL COMMENT '对议题的想法', + `PUBLIC_FLAG` tinyint(1) NOT NULL COMMENT '1公开; 0匿名', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识:0 未删除 1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '提建议的人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '修改人ID', + `UPDATED_TIME` datetime NOT NULL COMMENT '修改时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民端用户对议题建议或意见表'; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml new file mode 100644 index 0000000000..1c3ca8ce0a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java index 0d95ff6c84..f1c2ee1f83 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java @@ -60,5 +60,13 @@ public class IssueDetailResultDTO implements Serializable { */ private String projectId = ""; + /** + * 对议题的想法 + */ + private String issueIdea; + /** + * true已发表过想法,false未发表想法 + */ + private Boolean publishIdeaFlag; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 0551eb8423..015ae25e0c 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1,11 +1,14 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constat.HallConstat; +import com.epmet.dto.IssueSuggestionDTO; import com.epmet.dto.form.CheckVoteFormDTO; import com.epmet.dto.TopicInfoDTO; import com.epmet.dto.form.*; @@ -38,6 +41,10 @@ public class IssueServiceImpl implements IssueService { private GovIssueFeignClient govIssueFeignClient; @Autowired private GovProjectFeignClient govProjectFeignClient; + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; /** * @param issueDetail @@ -96,6 +103,14 @@ public class IssueServiceImpl implements IssueService { //已关闭议题,无需判断 issueDetailResult.setProjectStatus(true); } + Result issueSuggestionDTOResult=govIssueOpenFeignClient.queryIssueSuggestion(new UserIssueSuggestionFormDTO(loginUserUtil.getLoginUserId(),issueDetail.getIssueId())); + if(!issueSuggestionDTOResult.success()||null==issueSuggestionDTOResult.getData()){ + issueDetailResult.setPublishIdeaFlag(false); + issueDetailResult.setIssueIdea(StrConstant.EPMETY_STR); + }else{ + issueDetailResult.setPublishIdeaFlag(true); + issueDetailResult.setIssueIdea(issueSuggestionDTOResult.getData().getSuggestion()); + } return issueDetailResult; }