Browse Source

事件转议题1

dev
yinzuomei 3 years ago
parent
commit
8ffec63243
  1. 2
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java
  2. 122
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java
  3. 8
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  4. 11
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  5. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
  6. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java
  7. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java
  8. 45
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  9. 1
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__issue_source.sql
  10. 34
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  11. 6
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql

2
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java

@ -49,7 +49,7 @@ public class IssueDTO implements Serializable {
private String issueStatus;
/**
* 来源类型 话题resi_topic直接立议题issue
* 来源类型 话题resi_topic直接立议题issue事件ic_event
*/
private String sourceType;

122
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java

@ -0,0 +1,122 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @Author yzm
* @Date 2022/10/10 9:32
*/
@Data
public class PublishIssueFormDTO implements Serializable {
private static final long serialVersionUID = 1713711343683095564L;
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 议题状态 表决中voting 已转项目shift_project 已关闭closed
*/
@NotBlank(message = "议题状态不能为空", groups = AddUserShowGroup.class)
private String issueStatus;
/**
* 来源类型 话题resi_topic直接立议题issue事件ic_event
*/
@NotBlank(message = "议题来源不能为空", groups = AddUserShowGroup.class)
private String sourceType;
/**
* 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"这里指话题的ID)
*/
private String sourceId;
/**
* 议题名称 最多20字
*/
@NotBlank(message = "issueTitle不能为空", groups = AddUserShowGroup.class)
private String issueTitle;
/**
* 建议 最多1000字
*/
@NotBlank(message = "suggestion不能为空", groups = AddUserShowGroup.class)
private String suggestion;
/**
* 客户ID
*/
@NotBlank(message = "customerId不能为空", groups = AddUserShowGroup.class)
private String customerId;
/**
* 网格ID 居民端议题对应一个网格Id
*/
@NotBlank(message = "gridId不能为空", groups = AddUserShowGroup.class)
private String gridId;
/**
* 所属机关 数据权限-非必填11:22:33(agencyId)数据权限控制
*/
@NotBlank(message = "", groups = AddUserShowGroup.class)
private String orgIdPath;
/**
* 组织ID 数据权限-非必填agencyId
*/
@NotBlank(message = "", groups = AddUserShowGroup.class)
private String orgId;
/**
* 表决发起日期转议题日期
*/
@NotBlank(message = "表决发起日期(转议题日期)不能为空", groups = AddUserShowGroup.class)
private Date decidedTime;
/**
* 地址
*/
@NotBlank(message = "address不能为空", groups = AddUserShowGroup.class)
private String address;
/**
* 经度
*/
@NotBlank(message = "经度不能为空", groups = AddUserShowGroup.class)
private String longitude;
/**
* 纬度
*/
@NotBlank(message = "纬度不能为空", groups = AddUserShowGroup.class)
private String latitude;
/**
* 创建人
*/
@NotBlank(message = "议题发起人(createdBy)不能为空", groups = AddUserShowGroup.class)
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
private String eventReportUserName;
}

8
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -403,4 +403,12 @@ public interface GovIssueOpenFeignClient {
*/
@PostMapping("/gov/issue/issue/getIssueProfile")
Result<List<IssueProfileDTO>> getIssueProfile(@RequestBody List<String> issueIds);
/**
* 事件转议题
* @param issueFormDTO
* @return
*/
@PostMapping("/gov/issue/issue/publishIssue")
Result<IssueDTO> publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO);
}

11
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -343,5 +343,14 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getIssueProfile", issueIds);
}
/**
* 事件转议题
*
* @param issueFormDTO
* @return
*/
@Override
public Result<IssueDTO> publishIssue(PublishIssueFormDTO issueFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "publishIssue", issueFormDTO);
}
}

11
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java

@ -365,5 +365,16 @@ public class IssueController {
}
return new Result<List<IssueProfileDTO>>().ok(issueService.getIssueProfile(issueIds));
}
/**
* 发布议题
* 事件转议题
* @param issueFormDTO
* @return
*/
@PostMapping("publishIssue")
public Result<IssueDTO> publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO) {
ValidatorUtils.validateEntity(issueFormDTO, PublishIssueFormDTO.AddUserShowGroup.class);
return new Result<IssueDTO>().ok(issueService.publishIssue(issueFormDTO));
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java

@ -43,7 +43,7 @@ public class IssueEntity extends BaseEpmetEntity {
private String issueStatus;
/**
* 来源类型 话题resi_topic直接立议题issue
* 来源类型 话题resi_topic直接立议题issue事件ic_event
*/
private String sourceType;

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java

@ -399,4 +399,12 @@ public interface IssueService extends BaseService<IssueEntity> {
* @return
*/
List<IssueProfileDTO> getIssueProfile(List<String> issueIds);
/**
* 发布议题
* 事件转议题
* @param issueFormDTO
* @return
*/
IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO);
}

45
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -1955,4 +1955,49 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
}
return baseDao.selectIssueProfile(issueIds);
}
/**
* 发布议题
* 事件转议题
*
* @param issueFormDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO) {
// 事件转议题,是由工作端无需审核
IssueEntity issueEntity = ConvertUtils.sourceToTarget(issueFormDTO, IssueEntity.class);
baseDao.insert(issueEntity);
IssueProcessEntity issueProcessEntity = new IssueProcessEntity();
issueProcessEntity.setIssueId(issueEntity.getId());
issueProcessEntity.setIssueStatus(issueEntity.getIssueStatus());
issueProcessEntity.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY);
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(issueFormDTO.getCustomerId(),issueFormDTO.getCreatedBy());
issueProcessEntity.setOrgId(staffInfo.getAgencyId());
issueProcessEntity.setOperationExplain(String.format("【%s】发表的事件被【%s】转为议题", issueFormDTO.getEventReportUserName(), staffInfo.getAgencyName()));
issueProcessEntity.setOrgName(staffInfo.getAgencyName());
issueProcessEntity.setCustomerId(issueFormDTO.getCustomerId());
issueProcessService.insert(issueProcessEntity);
//查询网格的所属居民数
AllResiByGridFormDTO allResiByGridFormDTO=new AllResiByGridFormDTO();
allResiByGridFormDTO.setGridId(issueEntity.getGridId());
Result<Integer> regUserTotalRes=userOpenFeignClient.getAllResiByGrid(allResiByGridFormDTO);
//3.新增议题表决统计表
IssueVoteStatisticalDTO voteStatistical = new IssueVoteStatisticalDTO();
voteStatistical.setIssueId(issueEntity.getId());
//应表决数,该网格下所有的居民
voteStatistical.setVotableCount(regUserTotalRes.success() ? regUserTotalRes.getData() : NumConstant.ZERO);
issueVoteStatisticalService.save(voteStatistical);
VoteRedisFormDTO voteInitCache = new VoteRedisFormDTO();
voteInitCache.setIssueId(issueEntity.getId());
voteInitCache.setShouldVoteCount(regUserTotalRes.success() ? regUserTotalRes.getData() : NumConstant.ZERO);
issueVoteDetailRedis.set(voteInitCache);
IssueDTO issueDTO = ConvertUtils.sourceToTarget(issueEntity, IssueDTO.class);
issueDTO.setIssueId(issueEntity.getId());
return issueDTO;
}
}

1
epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__issue_source.sql

@ -0,0 +1 @@
alter table issue MODIFY COLUMN `SOURCE_TYPE` varchar(32) DEFAULT NULL COMMENT '来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event';

34
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -1690,12 +1691,33 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
List<String> categoryIdList = formDTO.getCategoryList().stream().map(CategoryOrTagFormDTO::getId).collect(Collectors.toList());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryIdList);
Date nowTime = new Date();
//转议题
// todo
//调用issue服务转议题
PublishIssueFormDTO issueFormDTO=new PublishIssueFormDTO();
issueFormDTO.setIssueStatus("voting");
issueFormDTO.setAddress(icEventEntity.getAddress());
issueFormDTO.setLatitude(icEventEntity.getLatitude());
issueFormDTO.setLongitude(icEventEntity.getLongitude());
issueFormDTO.setIssueTitle(formDTO.getIssueTitle());
issueFormDTO.setSuggestion(formDTO.getSuggestion());
issueFormDTO.setGridId(icEventEntity.getGridId());
issueFormDTO.setOrgId(icEventEntity.getAgencyId());
issueFormDTO.setOrgIdPath(icEventEntity.getGridPids());
issueFormDTO.setSourceType("ic_event");
issueFormDTO.setSourceId(icEventEntity.getId());
issueFormDTO.setCreatedBy(formDTO.getCurrentUserId());
issueFormDTO.setUpdatedBy(formDTO.getCurrentUserId());
issueFormDTO.setCreatedTime(nowTime);
issueFormDTO.setUpdatedTime(nowTime);
issueFormDTO.setDecidedTime(nowTime);
issueFormDTO.setEventReportUserName(icEventEntity.getName());
Result<IssueDTO> issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO);
if (!issueRes.success() || null == issueRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常");
}
//校验通过之后.....
//1、修改事件
//1、修改事件相关信息
icEventEntity.setOperationType(formDTO.getOperationType());
icEventEntity.setOperationId("xxxxxtodo");
icEventEntity.setOperationId(issueRes.getData().getIssueId());
if("0".equals(icEventEntity.getSourceType())){
//来源于随手拍的,居民端需要显示红点
icEventEntity.setRedDot(NumConstant.ONE);
@ -1703,7 +1725,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
icEventEntity.setLatestOperatedTime(nowTime);
icEventEntity.setUpdatedTime(nowTime);
baseDao.updateById(icEventEntity);
//2、ic_event_category
//2、插入事件分类表 ic_event_category
//分类全删全增吧
List<IcEventCategoryEntity> categoryEntities=new ArrayList<>();
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){
@ -1716,7 +1738,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
categoryEntities.add(icEventCategoryEntity);
}
icEventCategoryService.delInsert(formDTO.getIcEventId(),categoryEntities);
//3、ic_event_operation_log
//3、插入操作日志表 ic_event_operation_log
IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setIcEventId(formDTO.getIcEventId());

6
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql

@ -1,2 +1,6 @@
ALTER TABLE ic_event MODIFY COLUMN `OPERATION_TYPE` CHAR ( 1 ) DEFAULT NULL COMMENT '0:已回复 1:已转项目 2:已转需求3:转议题';
ALTER TABLE ic_event MODIFY COLUMN `OPERATION_ID` VARCHAR ( 32 ) DEFAULT NULL COMMENT '项目、需求ID、议题id';
ALTER TABLE ic_event MODIFY COLUMN `OPERATION_ID` VARCHAR ( 32 ) DEFAULT NULL COMMENT '项目、需求ID、议题id';
alter TABLE ic_event_operation_log MODIFY COLUMN `ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:add\r\n2、复:reply;3、立项:shift_project;4、转需求:shift_demand5、办结:close_case;6、需求办结:close_demand;转议题:shift_to_issue';
alter TABLE ic_event_operation_log MODIFY COLUMN `ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;2、撤回事件:recall;n3、复:reply;n4、立项:shift_project;5、转需求: shift_demand;6、办结:close_case;7、需求办结:close_demand;8、选择是否已解决:choose_resolve;9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;转议题:shift_to_issue';

Loading…
Cancel
Save