Browse Source

北尚诉办-我的上报列表

feature/dangjian
Jackwang 3 years ago
parent
commit
7a4b29c585
  1. 21
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiItemController.java
  2. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java
  3. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java
  4. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ItemService.java
  5. 27
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java
  6. 43
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/PeopleItemFormDTO.java
  7. 14
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SubmitItemFormDTO.java
  8. 14
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/EpdcAppItemController.java
  9. 9
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java
  10. 2
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java
  11. 9
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java
  12. 10
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  13. 75
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

21
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiItemController.java

@ -3,10 +3,7 @@ package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.annotation.LoginUser;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.item.form.EvaluationFormDTO;
import com.elink.esua.epdc.dto.item.form.ItemFormDTO;
import com.elink.esua.epdc.dto.item.form.ItemOfMineFormDTO;
import com.elink.esua.epdc.dto.item.form.SubmitItemFormDTO;
import com.elink.esua.epdc.dto.item.form.*;
import com.elink.esua.epdc.dto.item.result.ItemCategoryStatisticsResultDTO;
import com.elink.esua.epdc.dto.item.result.ItemDetailResultDTO;
import com.elink.esua.epdc.dto.item.result.ItemHandleProgressResultDTO;
@ -106,4 +103,20 @@ public class ApiItemController {
public Result submitItem(@LoginUser TokenDto userDetail, @RequestBody SubmitItemFormDTO formDto) {
return itemService.submitItem(userDetail, formDto);
}
/**
* @describe: 居民端-北尚诉办-我的上报
* @author wangtong
* @date 2022/8/23 15:39
* @params [userDetail]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>>
*/
@GetMapping("getItemListByUserId")
public Result<List<ItemResultDTO>> getItemListByUserId(@LoginUser TokenDto userDetail, PeopleItemFormDTO formDto) {
if (null == userDetail) {
return new Result<List<ItemResultDTO>>().error("获取用户信息失败");
}
formDto.setUserId(userDetail.getUserId());
return itemService.getItemListByUserId(formDto);
}
}

10
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/ItemFeignClient.java

@ -111,4 +111,14 @@ public interface ItemFeignClient {
*/
@PostMapping(value = "events/epdc-app/item/people/submitItem", consumes = MediaType.APPLICATION_JSON_VALUE)
Result submitItem(SubmitItemFormDTO formDto);
/**
* @describe: 居民端-北尚诉办-我的上报
* @author wangtong
* @date 2022/8/23 15:49
* @params [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>>
*/
@GetMapping(value = "events/epdc-app/item/getItemListByUserId", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<ItemResultDTO>> getItemListByUserId(PeopleItemFormDTO formDto);
}

5
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/ItemFeignClientFallback.java

@ -65,4 +65,9 @@ public class ItemFeignClientFallback implements ItemFeignClient {
public Result submitItem(SubmitItemFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "submitItem", formDto);
}
@Override
public Result<List<ItemResultDTO>> getItemListByUserId(PeopleItemFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "getItemListByUserId", formDto);
}
}

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

@ -95,4 +95,13 @@ public interface ItemService {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result submitItem(TokenDto userDetail, SubmitItemFormDTO formDto);
/**
* @describe: 居民端-北尚诉办-我的上报
* @author wangtong
* @date 2022/8/23 15:45
* @params [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>>
*/
Result<List<ItemResultDTO>> getItemListByUserId(PeopleItemFormDTO formDto);
}

27
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ItemServiceImpl.java

@ -172,4 +172,31 @@ public class ItemServiceImpl implements ItemService {
formDto.setMobile(userDetail.getMobile());
return itemFeignClient.submitItem(formDto);
}
@Override
public Result<List<ItemResultDTO>> getItemListByUserId(PeopleItemFormDTO formDto) {
Result<List<ItemResultDTO>> listResult = itemFeignClient.getItemListByUserId(formDto);
Optional.of(listResult.getData()).ifPresent(
itemList -> {
List<String> userIdList = itemList.stream().filter(item -> YesOrNoEnum.YES.value().equals(item.getPartyFlag())).map(ItemResultDTO::getUserId).distinct().collect(Collectors.toList());
if (CollUtil.isNotEmpty(userIdList)) {
EpdcUserMatchTagFormDTO form = new EpdcUserMatchTagFormDTO();
form.setUserIdList(userIdList);
form.setUserTagValue(UserTagEnum.PARTY_STANDARD_BEARER.value());
Result<List<String>> filterByTagRes = userFeignClient.filterUserIdListByTag(form);
List<String> filter = filterByTagRes.getData();
if (filterByTagRes.success() && null != filter && CollUtil.isNotEmpty(filter)) {
itemList.forEach(
item -> {
if (filter.contains(item.getUserId())) {
item.setStandardBearerFlag(YesOrNoEnum.YES.value());
}
}
);
}
}
}
);
return listResult;
}
}

43
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/PeopleItemFormDTO.java

@ -0,0 +1,43 @@
package com.elink.esua.epdc.dto.item.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author LC
* @Date 2019/9/9 16:24
*/
@Data
public class PeopleItemFormDTO implements Serializable {
private static final long serialVersionUID = -3034807666143092535L;
/**
* 用户id
*/
private String userId;
/**
* 搜索内容
*/
private String searchContent;
/**
* 诉求分类0民生 1发展
*/
@NotBlank(message = "诉求分类不可为空")
private String peopleFlag;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0")
private int pageIndex;
/**
* 页容量默认20页
*/
@Min(value = 1, message = "每页条数必须大于必须大于0")
private int pageSize = 20;
}

14
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/SubmitItemFormDTO.java

@ -2,6 +2,8 @@ package com.elink.esua.epdc.dto.item.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
@ -41,10 +43,11 @@ public class SubmitItemFormDTO implements Serializable {
/**
* 议题内容
*/
@NotNull(message = "描述内容不可为空")
private String itemContent;
/**
* 网格
* 网格名称
*/
private String grid;
@ -54,18 +57,21 @@ public class SubmitItemFormDTO implements Serializable {
private Long gridId;
/**
* 议题位置地址
* 详细地址
*/
@NotNull(message = "详细地址不可为空")
private String issueAddress;
/**
* 议题位置纬度
*/
@NotNull(message = "纬度不能为空")
private Double issueLatitude;
/**
* 议题位置经度
*/
@NotNull(message = "经度不能为空")
private Double issueLongitude;
@ -86,10 +92,12 @@ public class SubmitItemFormDTO implements Serializable {
/**
* 诉求分类0民生 1发展
*/
@NotBlank(message = "诉求分类不能为空")
private String peopleFlag;
/**
* 是否显示0不显示 1显示
* 是否公开0不公开 1公开
*/
@NotBlank(message = "是否公开不能为空")
private String showFlag;
}

14
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/EpdcAppItemController.java

@ -39,6 +39,19 @@ public class EpdcAppItemController {
return this.itemService.listItems(formDto);
}
/**
* @describe: 居民端-北尚诉办-我的上报
* @author wangtong
* @date 2022/8/23 15:51
* @params [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>>
*/
@GetMapping("getItemListByUserId")
public Result<List<ItemResultDTO>> getItemListByUserId(@RequestBody PeopleItemFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return itemService.getItemListByUserId(formDto);
}
/**
* 项目列表(问题采集使用)
* @Params: [formDto]
@ -145,6 +158,7 @@ public class EpdcAppItemController {
*/
@PostMapping(value = "people/submitItem")
public Result submitItem(@RequestBody SubmitItemFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return itemService.submitItem(formDto);
}

9
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java

@ -63,6 +63,15 @@ public interface ItemDao extends BaseDao<ItemEntity> {
*/
List<ItemResultDTO> selectListOfItems(ItemFormDTO formDto, int[] states);
/**
* @describe: 居民端-北尚诉办-我的上报
* @author wangtong
* @date 2022/8/23 15:52
* @params [formDto]
* @return java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>
*/
List<ItemResultDTO> getItemListByUserId(PeopleItemFormDTO formDto);
/**
* 移动端-项目列表(问题采集使用)
*

2
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/entity/ItemEntity.java

@ -216,7 +216,7 @@ public class ItemEntity extends BaseEpdcEntity {
private String peopleFlag;
/**
* 是否显示0不显示 1显示
* 是否公开0不公开 1公开
*/
private String showFlag;

9
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java

@ -463,4 +463,13 @@ public interface ItemService extends BaseService<ItemEntity> {
* @return com.elink.esua.epdc.commons.tools.utils.Result
*/
Result submitItem(SubmitItemFormDTO formDto);
/**
* @describe: 居民端-北尚诉办-我的上报
* @author wangtong
* @date 2022/8/23 15:51
* @params [formDto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.item.result.ItemResultDTO>>
*/
Result<List<ItemResultDTO>> getItemListByUserId(PeopleItemFormDTO formDto);
}

10
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -279,6 +279,15 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return new Result<List<ItemResultDTO>>().ok(data);
}
@Override
public Result<List<ItemResultDTO>> getItemListByUserId(PeopleItemFormDTO formDto) {
int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize();
formDto.setPageIndex(pageIndex);
List<ItemResultDTO> data = baseDao.getItemListByUserId(formDto);
return new Result<List<ItemResultDTO>>().ok(data);
}
@Override
public Result<List<ItemResultDTO>> getQuestionList(ItemByQuestionFormDTO formDto) {
@ -1943,6 +1952,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return new Result();
}
/**
*
* @param params

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

@ -80,6 +80,7 @@
AND t2.DEL_FLAG = '0'
WHERE t1.DEL_FLAG = '0'
AND t1.GRID_ID = #{formDto.deptId}
AND t1.SHOW_FLAG = '1'
AND t1.ITEM_STATE IN
<foreach collection="states" item="state" index="no" open="("
separator="," close=")">
@ -1184,4 +1185,78 @@
t.id=#{id}
and t.FIRST_CATEGORY_CODE!=t.category_code
</select>
<select id="getItemListByUserId" resultMap="itemsMap">
SELECT
item.ID,
item.EVENT_ID,
item.USER_ID,
item.ITEM_CONTENT,
item.NICK_NAME,
item.USER_FACE,
item.IS_PARTY_MEMBER,
item.CREATED_TIME,
eve.APPROVE_NUM,
eve.OPPOSE_NUM,
eve.COMMENT_NUM,
( eve.APPROVE_NUM + eve.OPPOSE_NUM + eve.COMMENT_NUM + eve.BROWSE_NUM ) AS statementNum,
cate.CATEGORY_NAME,
img.IMG_URL,
hp.CREATED_TIME AS handleTime,
hp.OUT_HANDLE_ADVICE,
CASE
item.ITEM_STATE
WHEN 0 THEN
'处理中'
WHEN 5 THEN
'已关闭'
WHEN 10 THEN
'已结案' ELSE ''
END AS stateName
FROM
epdc_item item
LEFT JOIN epdc_events eve ON item.EVENT_ID = eve.ID
AND eve.DEL_FLAG = '0'
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'
AND img.IMG_TYPE = 'events'
LEFT JOIN epdc_item_handle_process hp ON item.ID = hp.ITEM_ID
AND hp.DEL_FLAG = '0'
AND hp.CREATED_TIME = ( SELECT MAX( a.CREATED_TIME ) FROM epdc_item_handle_process a WHERE a.DEL_FLAG = '0' AND a.ITEM_ID = hp.ITEM_ID )
WHERE
item.ID IN (
SELECT temp.ID FROM (
SELECT
t1.id
FROM
epdc_item t1
WHERE t1.DEL_FLAG = '0'
<if test="formDto.timestamp != null">
<![CDATA[ AND DATE_FORMAT(t1.CREATED_TIME,'%Y-%m-%d %H:%i:%s') <= ]]> #{formDto.timestamp}
</if>
<if test='formDto.searchContent != null and formDto.searchContent != ""'>
AND t1.ITEM_CONTENT LIKE CONCAT('%',#{formDto.searchContent},'%')
</if>
<if test='formDto.userId != null and formDto.userId != ""'>
AND t1.USER_ID = #{formDto.userId}
</if>
<if test='formDto.peopleFlag != null and formDto.peopleFlag != ""'>
AND t1.PEOPLE_FLAG = #{formDto.peopleFlag}
</if>
ORDER BY
<if test='formDto.orderType != null and formDto.orderType != "" and formDto.orderType == "1"'>
t1.LAST_HANDLE_TIME DESC
</if>
t1.CREATED_TIME DESC
LIMIT #{formDto.pageIndex},#{formDto.pageSize}
) temp
)
ORDER BY
<if test='formDto.orderType != null and formDto.orderType != "" and formDto.orderType == "1"'>
item.LAST_HANDLE_TIME DESC
</if>
item.CREATED_TIME DESC,
img.IMG_URL
</select>
</mapper>

Loading…
Cancel
Save