Browse Source

项目议题事件列表接口分类标签调整

dev
李鹏飞 6 years ago
parent
commit
e301339219
  1. 25
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java
  2. 64
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/events/form/EpdcEventSubmitFormDTO.java
  3. 67
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/entity/EpdcEventsEntity.java
  4. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml
  5. 36
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml
  6. 42
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

25
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java

@ -15,6 +15,7 @@ import com.elink.esua.epdc.feign.OssFeignClient;
import com.elink.esua.epdc.service.IssueService;
import me.chanjar.weixin.mp.api.WxMpMaterialService;
import me.chanjar.weixin.mp.api.WxMpService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -61,12 +62,24 @@ public class IssueServiceImpl implements IssueService {
// 获取该网格所有上级机构
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());
// formDto.setArea(deptDTO.getDistrict());
// formDto.setAreaId(deptDTO.getDistrictId());
// formDto.setStreet(deptDTO.getStreet());
// formDto.setStreetId(deptDTO.getStreetId());
// formDto.setCommunity(deptDTO.getCommunity());
// formDto.setCommunityId(deptDTO.getCommunityId());
// 父所有部门(包含街道、社区)
String deptNames = (StringUtils.isNotEmpty(deptDTO.getStreet()) ? deptDTO.getStreet() : "");
deptNames += (StringUtils.isNotEmpty(deptDTO.getCommunity()) ? ","+deptDTO.getCommunity() : "");
String deptIds = (deptDTO.getStreetId()!=null && deptDTO.getStreetId()!= 0 ? deptDTO.getStreetId().toString() : "");
deptIds += (deptDTO.getCommunityId()!=null && deptDTO.getCommunityId()!= 0 ? ","+deptDTO.getCommunityId().toString() : "");
formDto.setParentDeptIds(deptIds);
formDto.setParentDeptNames(deptNames);
// 所有部门(包含街道、社区、网格)
deptNames += (StringUtils.isNotEmpty(deptDTO.getGrid()) ? ","+deptDTO.getGrid() : "");
deptIds += (deptDTO.getGridId()!=null && deptDTO.getGridId()!= 0 ? ","+deptDTO.getGridId().toString() : "");
formDto.setAllDeptIds(deptIds);
formDto.setAllDeptNames(deptNames);
formDto.setGrid(deptDTO.getGrid());
formDto.setGridId(deptDTO.getGridId());
// 用户信息

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

@ -39,42 +39,58 @@ 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;
/**
*
*/
private String area;
/**
* 区ID
*/
@NotNull(message = "用户区ID不能为空")
private Long areaId;
/**
* 街道
* 网格
*/
private String street;
private String grid;
/**
* 街道ID
* 网格ID
*/
@NotNull(message = "用户街道ID不能为空")
private Long streetId;
@NotNull(message = "用户网格ID不能为空")
private Long gridId;
/**
* 社区
* 父所有部门ID
*/
private String community;
@NotNull(message = "父所有部门ID不能为空")
private String parentDeptIds;
/**
* 社区ID
* 父所有部门
*/
@NotNull(message = "用户社区ID不能为空")
private Long communityId;
private String parentDeptNames;
/**
* 网格
* 所有部门ID
*/
private String grid;
@NotNull(message = "所有部门ID不能为空")
private String allDeptIds;
/**
* 网格ID
* 所有部门
*/
@NotNull(message = "用户网格ID不能为空")
private Long gridId;
private String allDeptNames;
/**
* 用户ID
*/

67
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/entity/EpdcEventsEntity.java

@ -27,6 +27,7 @@ import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
@ -66,30 +67,48 @@ public class EpdcEventsEntity extends BaseEpdcEntity {
* 议题内容
*/
private String eventContent;
/**
*
*/
private String area;
/**
* 区ID
*/
private Long areaId;
/**
* 街道
*/
private String street;
/**
* 街道ID
*/
private Long streetId;
/**
* 社区
*/
private String community;
/**
* 社区ID
*/
private Long communityId;
// /**
// * 区
// */
// 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;
/**
* 网格
*/

6
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml

@ -69,10 +69,12 @@
AND temp.grid_id = #{gridId}
</if>
<if test="streetId != null and streetId != ''">
AND find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
AND (find_in_set(#{streetId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},temp.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
AND (find_in_set(#{communityId},temp.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},temp.ALL_DEPT_IDS))
</if>
AND temp.EVENT_STATE = 0
ORDER BY temp.CREATED_TIME DESC

36
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xml

@ -27,10 +27,12 @@
AND issue.GRID_ID = #{gridId}
</if>
<if test="streetId != null and streetId != ''">
AND find_in_set(#{streetId},issue.PARENT_DEPT_IDS)
AND (find_in_set(#{streetId},issue.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},issue.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND find_in_set(#{communityId},issue.PARENT_DEPT_IDS)
AND (find_in_set(#{communityId},issue.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},issue.ALL_DEPT_IDS))
</if>
ORDER BY
issue.CREATED_TIME DESC
@ -62,15 +64,13 @@
i.ISSUE_ADDRESS,
i.ISSUE_LATITUDE,
i.ISSUE_LONGITUDE,
cate.CATEGORY_NAME,
i.CATEGORY_FULL_NAME as CATEGORY_NAME,
CONCAT(i.AREA,i.STREET,i.COMMUNITY,i.GRID) AS ownGrid,
img.IMG_URL
FROM
epdc_issue i
LEFT JOIN epdc_img img ON i.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON i.ISSUE_CATEGORY_ID = cate.ID
AND cate.DEL_FLAG = '0'
WHERE
i.DEL_FLAG = '0'
AND i.ID = #{id}
@ -107,7 +107,7 @@
i.ISSUE_ADDRESS,
i.ISSUE_LATITUDE,
i.ISSUE_LONGITUDE,
cate.CATEGORY_NAME,
item.CATEGORY_FULL_NAME as CATEGORY_NAME,
CONCAT(i.AREA,i.STREET,i.COMMUNITY,i.GRID) AS ownGrid
FROM
epdc_issue i
@ -115,8 +115,6 @@
AND e.DEL_FLAG = '0'
LEFT JOIN epdc_img img ON i.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON i.ISSUE_CATEGORY_ID = cate.ID
AND cate.DEL_FLAG = '0'
WHERE
i.DEL_FLAG = '0'
AND i.ID = #{issueId}
@ -179,7 +177,7 @@
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_events eve ON issue.EVENT_ID = eve.id
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON issue.ISSUE_CATEGORY_ID = cate.id
LEFT JOIN epdc_category cate ON issue.FIRST_CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
WHERE
issue.ID IN (
@ -200,7 +198,7 @@
AND t1.ISSUE_CONTENT LIKE CONCAT('%',#{searchContent},'%')
</if>
<if test='categoryId != null and categoryId != ""'>
AND t1.ISSUE_CATEGORY_ID = #{categoryId}
AND t1.category_code = #{categoryId}
</if>
ORDER BY
<if test='orderType == "1"'>( t2.APPROVE_NUM + t2.OPPOSE_NUM + t2.COMMENT_NUM + t2.BROWSE_NUM ) DESC,</if>
@ -228,7 +226,7 @@
<result property="browseNum" column="BROWSE_NUM"/>
<result property="approveNum" column="APPROVE_NUM"/>
<result property="opposeNum" column="OPPOSE_NUM"/>
<result property="categoryId" column="ISSUE_CATEGORY_ID"/>
<result property="categoryCode" column="CATEGORY_CODE"/>
<result property="isOperational" column="isOperational"/>
<collection property="images" ofType="java.lang.String">
<result property="image" column="IMG_URL"/>
@ -248,7 +246,7 @@
issue.NICK_NAME,
issue.USER_FACE,
issue.ISSUE_ADDRESS,
issue.ISSUE_CATEGORY_ID,
issue.CATEGORY_CODE,
eve.APPROVE_NUM,
eve.OPPOSE_NUM,
eve.BROWSE_NUM,
@ -338,7 +336,7 @@
epdc_issue issue
LEFT JOIN epdc_events eve ON issue.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON issue.ISSUE_CATEGORY_ID = cate.ID
LEFT JOIN epdc_category cate ON issue.CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
WHERE
issue.DEL_FLAG = '0'
@ -377,7 +375,7 @@
epdc_events eve
LEFT JOIN epdc_img img ON eve.ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON eve.ISSUE_CATEGORY_ID = cate.ID
LEFT JOIN epdc_category cate ON issue.FIRST_CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
WHERE
eve.DEL_FLAG = '0'
@ -401,7 +399,7 @@
epdc_issue issue
LEFT JOIN epdc_img img ON issue.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON issue.ISSUE_CATEGORY_ID = cate.ID
LEFT JOIN epdc_category cate ON issue.FIRST_CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
WHERE
issue.DEL_FLAG = '0'
@ -459,15 +457,13 @@
issue.NICK_NAME,
issue.USER_FACE,
issue.IS_PARTY_MEMBER,
cate.CATEGORY_NAME,
issue.CATEGORY_FULL_NAME as CATEGORY_NAME,
issue.DISTRIBUTE_TIME,
( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS STATEMENT_NUM
FROM
epdc_issue issue
LEFT JOIN epdc_events eve ON issue.EVENT_ID = eve.id
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON issue.ISSUE_CATEGORY_ID = cate.id
AND cate.DEL_FLAG = '0'
WHERE
issue.ID IN (
SELECT temp.ID FROM (
@ -503,7 +499,7 @@
<result property="content" column="ISSUE_CONTENT"/>
<result property="mobile" column="MOBILE"/>
<result property="distributeTime" column="DISTRIBUTE_TIME"/>
<result property="categoryName" column="DISTRIBUTE_TIME"/>
<result property="categoryName" column="CATEGORY_FULL_NAME"/>
<result property="nickname" column="NICK_NAME"/>
<result property="avatar" column="USER_FACE"/>
<result property="address" column="ISSUE_ADDRESS"/>
@ -525,7 +521,7 @@
issue.NICK_NAME,
issue.USER_FACE,
issue.ISSUE_ADDRESS,
issue.ISSUE_CATEGORY_ID,
issue.CATEGORY_FULL_NAME,
eve.APPROVE_NUM,
eve.OPPOSE_NUM,
eve.BROWSE_NUM,

42
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -55,7 +55,7 @@
epdc_item item
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
LEFT JOIN epdc_category cate ON item.FIRST_CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
LEFT JOIN epdc_img img ON item.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
@ -89,7 +89,7 @@
AND t1.ITEM_CONTENT LIKE CONCAT('%',#{formDto.searchContent},'%')
</if>
<if test='formDto.categoryId != null and formDto.categoryId != ""'>
AND t1.ISSUE_CATEGORY_ID = #{formDto.categoryId}
AND t1.CATEGORY_CODE = #{formDto.categoryId}
</if>
<if test='formDto.userId != null and formDto.userId != ""'>
AND t1.USER_ID = #{formDto.userId}
@ -125,7 +125,7 @@
eve.OPPOSE_NUM,
eve.COMMENT_NUM,
( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS statementNum,
cate.CATEGORY_NAME,
item.CATEGORY_FULL_NAME as CATEGORY_NAME,
img.IMG_URL,
hp.CREATED_TIME AS handleTime,
hp.OUT_HANDLE_ADVICE,
@ -142,8 +142,6 @@
epdc_item item
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
AND cate.DEL_FLAG = '0'
LEFT JOIN epdc_img img ON item.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_item_handle_process hp ON item.ID = hp.ITEM_ID
@ -201,7 +199,7 @@
epdc_item item
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
LEFT JOIN epdc_category cate ON item.FIRST_CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
LEFT JOIN epdc_img img ON item.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
@ -234,7 +232,7 @@
AND t1.ITEM_CONTENT LIKE CONCAT('%',#{formDto.searchContent},'%')
</if>
<if test='formDto.categoryId != null and formDto.categoryId != ""'>
AND t1.ISSUE_CATEGORY_ID = #{formDto.categoryId}
AND t1.CATEGORY_CODE = #{formDto.categoryId}
</if>
<if test='formDto.userId != null and formDto.userId != ""'>
AND t1.USER_ID = #{formDto.userId}
@ -275,7 +273,7 @@
<result property="opposeNum" column="OPPOSE_NUM"/>
<result property="commentNum" column="COMMENT_NUM"/>
<result property="statementNum" column="statementNum"/>
<result property="categoryId" column="ISSUE_CATEGORY_ID"/>
<result property="categoryId" column="CATEGORY_CODE"/>
<result property="isOperational" column="isOperational"/>
<result property="isSatisfactionEvaluation" column="isSatisfactionEvaluation"/>
<result property="isShowSatisfactionEvaluation" column="isShowSatisfactionEvaluation"/>
@ -298,7 +296,7 @@
item.NICK_NAME,
item.USER_FACE,
item.ISSUE_ADDRESS,
item.ISSUE_CATEGORY_ID,
item.CATEGORY_CODE,
eve.APPROVE_NUM,
eve.OPPOSE_NUM,
eve.BROWSE_NUM,
@ -349,18 +347,18 @@
COUNT( item.ID ) AS itemNum,
SUM( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.BROWSE_NUM + eve.COMMENT_NUM ) AS attitudeNum,
cate.CATEGORY_NAME,
cate.ID AS categoryId
cate.CATEGORY_CODE AS categoryId
FROM
epdc_item item
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
LEFT JOIN epdc_category cate ON item.CATEGORY_CODE = cate.category_code
AND cate.DEL_FLAG = '0'
WHERE
item.DEL_FLAG = '0'
AND item.ITEM_STATE IN (0, 10)
AND item.GRID_ID = #{gridId}
AND item.ISSUE_CATEGORY_ID = #{categoryId}
AND item.CATEGORY_CODE = #{categoryId}
</select>
<select id="selectListOfPendingHandleItems" resultType="com.elink.esua.epdc.dto.item.ItemPendingHandleDTO">
@ -407,10 +405,12 @@
AND item.GRID_ID = #{gridId}
</if>
<if test="streetId != null and streetId != ''">
AND find_in_set(#{streetId},item.PARENT_DEPT_IDS)
AND (find_in_set(#{streetId},item.PARENT_DEPT_IDS)
OR find_in_set(#{streetId},item.ALL_DEPT_IDS))
</if>
<if test="communityId != null and communityId != ''">
AND find_in_set(#{communityId},item.PARENT_DEPT_IDS)
AND (find_in_set(#{communityId},item.PARENT_DEPT_IDS)
OR find_in_set(#{communityId},item.ALL_DEPT_IDS))
</if>
ORDER BY
item.CREATED_TIME DESC
@ -446,14 +446,12 @@
eve.APPROVE_NUM,
eve.OPPOSE_NUM,
eve.COMMENT_NUM,
cate.CATEGORY_NAME,
item.CATEGORY_FULL_NAME as CATEGORY_NAME,
img.IMG_URL
FROM
epdc_item item
LEFT JOIN epdc_img img ON item.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
AND cate.DEL_FLAG = '0'
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
WHERE
@ -468,7 +466,7 @@
item.MOBILE,
item.USER_FACE,
item.ITEM_CONTENT,
cate.CATEGORY_NAME,
item.CATEGORY_FULL_NAME as CATEGORY_NAME,
item.IS_PARTY_MEMBER,
item.ISSUE_ADDRESS,
eve.APPROVE_NUM,
@ -478,12 +476,11 @@
( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS statementNum,
item.EVENT_ID,
img.IMG_URL
FROM
epdc_item item
LEFT JOIN epdc_img img ON item.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
AND cate.DEL_FLAG = '0'
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
WHERE
@ -616,7 +613,7 @@
item.ISSUE_ADDRESS,
item.ISSUE_LATITUDE,
item.ISSUE_LONGITUDE,
cate.CATEGORY_NAME,
item.CATEGORY_FULL_NAME as CATEGORY_NAME,
eve.APPROVE_NUM,
eve.OPPOSE_NUM,
eve.COMMENT_NUM,
@ -634,8 +631,6 @@
AND eve.DEL_FLAG = '0'
LEFT JOIN epdc_img img ON item.EVENT_ID = img.REFERENCE_ID
AND img.DEL_FLAG = '0'
LEFT JOIN epdc_event_category cate ON item.ISSUE_CATEGORY_ID = cate.ID
AND cate.DEL_FLAG = '0'
WHERE
item.DEL_FLAG = '0'
AND item.ID = #{itemId}
@ -704,6 +699,7 @@
pendingTable.pendingHandleNum,
closingTable.closingCaseNum,
closedTable.closedNum,
noticeTable.noticeNum
FROM
(
SELECT

Loading…
Cancel
Save