Browse Source

修改调试bug

dev
liuchuang 6 years ago
parent
commit
f2ccd0a888
  1. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java
  2. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml
  3. 21
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/WorkWxMaSubscribeData.java
  4. 3
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/WorkWxMaSubscribeMessage.java
  5. 33
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/EventsCategoryDTO.java
  6. 39
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java
  7. 5
      esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml
  8. 7
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/async/WorkWxSubscribeMessageTask.java
  9. 85
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
  10. 10
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupCreateFormDTO.java
  11. 2
      esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicSubmitFormDTO.java
  12. 2
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppGroupController.java
  13. 45
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/GroupEntity.java
  14. 45
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicEntity.java
  15. 1
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java
  16. 22
      esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml

9
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/GroupServiceImpl.java

@ -42,15 +42,6 @@ public class GroupServiceImpl implements GroupService {
if (null == userDetail) {
return new Result().error("获取用户信息失败");
}
// 获取该网格所有上级机构
// Result<CompleteDeptDTO> deptDTOResult = adminFeignClient.getCompleteDept(userDetail.getGridId());
// CompleteDeptDTO deptDTO = deptDTOResult.getData();
// formDto.setArea(deptDTO.getDistrict());
// formDto.setAreaId(deptDTO.getDistrictId());
// formDto.setStreet(deptDTO.getStreet());
// formDto.setStreetId(deptDTO.getStreetId());
// formDto.setCommunity(deptDTO.getCommunity());
// formDto.setCommunityId(deptDTO.getCommunityId());
//获取所有上级机构名称和ID拼接
Result<ParentAndAllDeptDTO> dtoResult = adminFeignClient.getParentAndAllDept(userDetail.getGridId());
ParentAndAllDeptDTO deptDTO = dtoResult.getData();

5
esua-epdc/epdc-module/epdc-events/epdc-events-client/pom.xml

@ -33,11 +33,6 @@
<artifactId>epdc-websocket-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools-wx-ma</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

21
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/WorkWxMaSubscribeData.java

@ -0,0 +1,21 @@
package com.elink.esua.epdc.dto;
import lombok.Data;
import java.io.Serializable;
/**
*
* 订阅消息数据
*
* @Authorliuchuang
* @Date2019/11/29 18:56
*/
@Data
public class WorkWxMaSubscribeData implements Serializable {
private static final long serialVersionUID = 1321779871459769246L;
private String name;
private String value;
private String color;
}

3
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/WorkWxMaSubscribeMessage.java

@ -1,6 +1,5 @@
package com.elink.esua.epdc.dto;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeData;
import lombok.Data;
import java.io.Serializable;
@ -25,5 +24,5 @@ public class WorkWxMaSubscribeMessage implements Serializable {
/**
* 消息数据
*/
private List<WxMaSubscribeData> data;
private List<WorkWxMaSubscribeData> data;
}

33
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/EventsCategoryDTO.java

@ -0,0 +1,33 @@
package com.elink.esua.epdc.dto.events;
import lombok.Data;
import java.io.Serializable;
/**
*
* 事件分类信息
*
* @Authorliuchuang
* @Date2019/11/29 13:40
*/
@Data
public class EventsCategoryDTO implements Serializable {
private static final long serialVersionUID = 6840230339149351580L;
/**
* 分类编码
*/
private String categoryCode;
/**
* 一级分类编码
*/
private String firstCategoryCode;
/**
* 分类全称
*/
private String categoryFullName;
}

39
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java

@ -39,30 +39,6 @@ public class EpdcEventSubmitFormDTO implements Serializable {
* 图片
*/
private List<String> images;
// /**
// * 区
// */
// private String area;
// /**
// * 区ID
// */
// private Long areaId;
// /**
// * 街道
// */
// private String street;
// /**
// * 街道ID
// */
// private Long streetId;
// /**
// * 社区
// */
// private String community;
// /**
// * 社区ID
// */
// private Long communityId;
/**
* 网格
@ -151,4 +127,19 @@ public class EpdcEventSubmitFormDTO implements Serializable {
* 处理意见
*/
private String advice;
/**
* 评论数
*/
private Integer commentNum;
/**
* 浏览数
*/
private Integer browseNum;
/**
* 分类ID
*/
private String categoryId;
}

5
esua-epdc/epdc-module/epdc-events/epdc-events-server/pom.xml

@ -51,6 +51,11 @@
<artifactId>feign-httpclient</artifactId>
<version>10.3.0</version>
</dependency>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools-wx-ma</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>

7
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/async/WorkWxSubscribeMessageTask.java

@ -1,7 +1,9 @@
package com.elink.esua.epdc.modules.async;
import cn.binarywang.wx.miniapp.api.WxMaMsgService;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeData;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.constant.WorkWxMaSubscribeMessageConstant;
import com.elink.esua.epdc.dto.WorkWxMaSubscribeMessage;
import com.elink.esua.epdc.utils.WxMaServiceUtils;
@ -10,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import java.util.List;
/**
*
@ -34,7 +38,8 @@ public class WorkWxSubscribeMessageTask {
message.setPage(WorkWxMaSubscribeMessageConstant.WORK_SUBSCRIBE_MESSAGE_PAGE);
message.setTemplateId(WorkWxMaSubscribeMessageConstant.WORK_SUBSCRIBE_MESSAGE_TEMPLATE_ID);
message.setToUser(toUser);
message.setData(messages.getData());
List<WxMaSubscribeData> data = ConvertUtils.sourceToTarget(messages.getData(), WxMaSubscribeData.class);
message.setData(data);
wxMaMsgService.sendSubscribeMsg(message);
}
} catch (WxErrorException e) {

85
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java

@ -185,34 +185,12 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
EpdcEventsEntity entity = new EpdcEventsEntity();
entity.setId(dto.getId());
entity.setEventState(dto.getEventState());
// entity.setCategoryCode(dto.getCategoryId());
//初始化分类
// 初始化分类
if(dto.getCategoryId() != null && !"".equals(dto.getCategoryId())){
CategoryDTO cateDto =categoryService.get(Long.parseLong(dto.getCategoryId()));
entity.setCategoryCode(cateDto.getCategoryCode());
//获取所有父类分类标签
List<CategoryEntity> cateList = categoryService.getPidListById(Long.parseLong(dto.getCategoryId()));
//所选分类标签为多级
if(cateList != null && cateList.size() > 0) {
// list第一个为一级分类标签
entity.setFirstCategoryCode(cateList.get(0).getCategoryCode());
//分类标签全称拼接:-分割
String name = "";
for (int i = 0; i < cateList.size(); i++){
if (i == cateList.size() -1){
name = name + cateList.get(i).getCategoryName();
}else {
name = name + cateList.get(i).getCategoryName() + "-";
}
}
name = name + "-" + cateDto.getCategoryName();
entity.setCategoryFullName(name);
// 所选分类标签为一级
} else {
//当前标签作为一级标签
entity.setFirstCategoryCode(cateDto.getCategoryCode());
entity.setCategoryFullName(cateDto.getCategoryName());
}
EventsCategoryDTO categoryInfo = this.initCategoryInfo(dto.getCategoryId());
entity.setCategoryCode(categoryInfo.getCategoryCode());
entity.setFirstCategoryCode(categoryInfo.getCategoryCode());
entity.setCategoryFullName(categoryInfo.getCategoryFullName());
}
entity.setAdvice(dto.getAdvice());
@ -374,12 +352,6 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
issueEntity.setMobile(entity.getMobile());
issueEntity.setIssueContent(entity.getEventContent());
issueEntity.setDistributeTime(entity.getCreatedTime());
// issueEntity.setArea(entity.getArea());
// issueEntity.setAreaId(entity.getAreaId());
// issueEntity.setStreet(entity.getStreet());
// issueEntity.setStreetId(entity.getStreetId());
// issueEntity.setCommunity(entity.getCommunity());
// issueEntity.setCommunityId(entity.getCommunityId());
issueEntity.setParentDeptIds(entity.getParentDeptIds());
issueEntity.setParentDeptNames(entity.getParentDeptNames());
issueEntity.setAllDeptIds(entity.getAllDeptIds());
@ -467,6 +439,12 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
@Override
public Result<IssueDTO> topicToIssue(EpdcEventSubmitFormDTO dto) {
dto.setEventState(EventIssueItemState.EVENT_REVIEW_PASS);
// 初始化分类信息
EventsCategoryDTO categoryInfo = this.initCategoryInfo(dto.getCategoryId());
dto.setCategoryCode(categoryInfo.getCategoryCode());
dto.setFirstCategoryCode(categoryInfo.getCategoryCode());
dto.setCategoryFullName(categoryInfo.getCategoryFullName());
// 保存事件
EpdcEventsEntity eventsEntity = this.saveEvent(dto);
// 保存议题
@ -492,4 +470,45 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
issueDTO.setEventId(issueEntity.getEventId());
return new Result<IssueDTO>().ok(issueDTO);
}
/**
*
* 初始化分类信息
*
* @params [categoryId]
* @return com.elink.esua.epdc.dto.events.EventsCategoryDTO
* @author liuchuang
* @since 2019/11/29 13:51
*/
private EventsCategoryDTO initCategoryInfo(String categoryId) {
Long category = Long.parseLong(categoryId);
EventsCategoryDTO resultDto = new EventsCategoryDTO();
CategoryDTO cateDto =categoryService.get(category);
resultDto.setCategoryCode(cateDto.getCategoryCode());
//获取所有父类分类标签
List<CategoryEntity> cateList = categoryService.getPidListById(category);
//所选分类标签为多级
if(cateList != null && cateList.size() > 0) {
// list第一个为一级分类标签
resultDto.setFirstCategoryCode(cateList.get(0).getCategoryCode());
//分类标签全称拼接:-分割
String name = "";
for (int i = 0; i < cateList.size(); i++){
if (i == cateList.size() -1){
name = name + cateList.get(i).getCategoryName();
}else {
name = name + cateList.get(i).getCategoryName() + "-";
}
}
name = name + "-" + cateDto.getCategoryName();
resultDto.setCategoryFullName(name);
// 所选分类标签为一级
} else {
//当前标签作为一级标签
resultDto.setFirstCategoryCode(cateDto.getCategoryCode());
resultDto.setCategoryFullName(cateDto.getCategoryName());
}
return resultDto;
}
}

10
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/group/form/GroupCreateFormDTO.java

@ -39,15 +39,7 @@ public class GroupCreateFormDTO implements Serializable {
* 社群类别 0党员群1自建群
*/
private String groupCategory;
// /**
// * 区
// */
// private String area;
// /**
// * 区ID
// */
// @NotNull(message = "用户区ID不能为空")
// private Long areaId;
// /**
// * 街道
// */

2
esua-epdc/epdc-module/epdc-group/epdc-group-client/src/main/java/com.elink.esua.epdc/dto/topic/form/TopicSubmitFormDTO.java

@ -61,7 +61,6 @@ public class TopicSubmitFormDTO implements Serializable {
/**
* 父所有部门ID
*/
@NotNull(message = "父所有部门ID不能为空")
private String parentDeptIds;
/**
* 父所有部门
@ -70,7 +69,6 @@ public class TopicSubmitFormDTO implements Serializable {
/**
* 所有部门ID
*/
@NotNull(message = "所有部门ID不能为空")
private String allDeptIds;
/**
* 所有部门

2
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/controller/AppGroupController.java

@ -60,8 +60,6 @@ public class AppGroupController {
@PostMapping("createParty")
public Result createPartyGroup(@RequestBody CompleteDeptDTO formDto) {
GroupCreateFormDTO groupCreateFormDto = ConvertUtils.sourceToTarget(formDto, GroupCreateFormDTO.class);
// groupCreateFormDto.setArea(formDto.getDistrict());
// groupCreateFormDto.setAreaId(formDto.getDistrictId());
groupCreateFormDto.setGroupName(formDto.getCommunity().concat(formDto.getGrid()).concat(GroupConstant.PARTY_GROUP_NAME_SUFFIX));
groupCreateFormDto.setGroupAvatar(GroupConstant.PARTY_GROUP_AVATAR);
groupCreateFormDto.setGroupIntroduction(formDto.getStreet().concat(formDto.getCommunity()).concat(formDto.getGrid()));

45
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/group/entity/GroupEntity.java

@ -58,35 +58,22 @@ public class GroupEntity extends BaseEpdcEntity {
*/
private String groupCategory;
// /**
// * 区
// */
// private String area;
//
// /**
// * 区ID
// */
// private Long areaId;
//
// /**
// * 街道
// */
// private String street;
//
// /**
// * 街道ID
// */
// private Long streetId;
//
// /**
// * 社区
// */
// private String community;
//
// /**
// * 社区ID
// */
// private Long communityId;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门
*/
private String allDeptNames;
/**
* 网格

45
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/entity/TopicEntity.java

@ -79,35 +79,22 @@ public class TopicEntity extends BaseEpdcEntity {
*/
private String itemId;
// /**
// * 区
// */
// private String area;
//
// /**
// * 区ID
// */
// private Long areaId;
//
// /**
// * 街道
// */
// private String street;
//
// /**
// * 街道ID
// */
// private Long streetId;
//
// /**
// * 社区
// */
// private String community;
//
// /**
// * 社区ID
// */
// private Long communityId;
/**
* 父所有部门ID
*/
private String parentDeptIds;
/**
* 父所有部门
*/
private String parentDeptNames;
/**
* 所有部门ID
*/
private String allDeptIds;
/**
* 所有部门
*/
private String allDeptNames;
/**
* 网格

1
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/java/com.elink.esua.epdc/modules/topic/service/impl/TopicServiceImpl.java

@ -263,6 +263,7 @@ public class TopicServiceImpl extends BaseServiceImpl<TopicDao, TopicEntity> imp
// 插入事件表、议题表
EpdcEventSubmitFormDTO eventSubmitFormDto = baseDao.selectOneOfTopicForChangeToIssue(formDto.getId());
eventSubmitFormDto.setCategoryId(formDto.getCategoryId());
eventSubmitFormDto.setAdvice(formDto.getAdvice());
Result<IssueDTO> eventResult = eventFeignClient.submitEvent(eventSubmitFormDto);
if (!eventResult.success()) {

22
esua-epdc/epdc-module/epdc-group/epdc-group-server/src/main/resources/mapper/topic/TopicDao.xml

@ -68,12 +68,10 @@
<result property="issueAddress" column="TOPIC_ADDRESS"/>
<result property="issueLatitude" column="TOPIC_LATITUDE"/>
<result property="issueLongitude" column="TOPIC_LONGITUDE"/>
<result property="area" column="AREA"/>
<result property="areaId" column="AREA_ID"/>
<result property="street" column="STREET"/>
<result property="streetId" column="STREET_ID"/>
<result property="community" column="COMMUNITY"/>
<result property="communityId" column="COMMUNITY_ID"/>
<result property="allDeptIds" column="ALL_DEPT_IDS"/>
<result property="allDeptNames" column="ALL_DEPT_NAMES"/>
<result property="parentDeptIds" column="PARENT_DEPT_IDS"/>
<result property="parentDeptNames" column="PARENT_DEPT_NAMES"/>
<result property="grid" column="GRID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
@ -83,6 +81,8 @@
<result property="mobile" column="MOBILE"/>
<result property="groupId" column="GROUP_ID"/>
<result property="groupName" column="GROUP_NAME"/>
<result property="commentNum" column="COMMENT_NUM"/>
<result property="browseNum" column="BROWSE_NUM"/>
<collection property="images" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
</collection>
@ -93,12 +93,6 @@
tp.TOPIC_ADDRESS,
tp.TOPIC_LATITUDE,
tp.TOPIC_LONGITUDE,
tp.AREA,
tp.AREA_ID,
tp.STREET,
tp.STREET_ID,
tp.COMMUNITY,
tp.COMMUNITY_ID,
tp.GRID,
tp.GRID_ID,
tp.USER_ID,
@ -108,6 +102,10 @@
tp.MOBILE,
tp.GROUP_ID,
tp.GROUP_NAME,
tp.ALL_DEPT_IDS,
tp.ALL_DEPT_NAMES,
tp.PARENT_DEPT_IDS,
tp.PARENT_DEPT_NAMES,
img.IMG_URL
FROM
epdc_topic tp

Loading…
Cancel
Save