Browse Source
# Conflicts: # epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java # epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java # epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.javadev_shibei_match
32 changed files with 734 additions and 37 deletions
@ -0,0 +1,43 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 1:38 下午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class EventProjectInfoDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5622220354099001615L; |
|||
|
|||
/** |
|||
* 项目ID |
|||
*/ |
|||
private String projectId; |
|||
|
|||
/** |
|||
* 操作人【xxx社区-张三】 |
|||
*/ |
|||
private String operationName; |
|||
|
|||
/** |
|||
* 操作时间 |
|||
*/ |
|||
private String operationTime; |
|||
|
|||
/** |
|||
* 报事说明 |
|||
*/ |
|||
private String projectDeclare; |
|||
|
|||
public EventProjectInfoDTO() { |
|||
this.projectId = ""; |
|||
this.operationName = ""; |
|||
this.operationTime = ""; |
|||
this.projectDeclare = ""; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 1:27 下午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class EventDetailFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -297495947153154171L; |
|||
|
|||
public interface EventDetailForm{} |
|||
|
|||
@NotBlank(message = "报事ID不能为空",groups = EventDetailForm.class) |
|||
private String eventId; |
|||
} |
@ -0,0 +1,29 @@ |
|||
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; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 10:43 上午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class EventListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5882062169112022561L; |
|||
|
|||
public interface EventListForm{} |
|||
|
|||
/** |
|||
* 报事列表类型【已处理:processed 未处理:undisposed 已办结:transferred】 |
|||
*/ |
|||
@NotBlank(message = "报事列表类型不能为空",groups = EventListForm.class) |
|||
private String eventType; |
|||
|
|||
@NotBlank(message = "",groups = EventListForm.class) |
|||
private String orgId; |
|||
} |
@ -0,0 +1,23 @@ |
|||
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; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 11:07 上午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class ReplyListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3875624725235229558L; |
|||
|
|||
public interface ReplyListForm{} |
|||
|
|||
@NotBlank(message = "报事ID不能为空",groups = ReplyListForm.class) |
|||
private String resiEventId; |
|||
} |
@ -0,0 +1,29 @@ |
|||
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; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 10:55 上午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class UpdateViewTimeFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 7104400078458366322L; |
|||
|
|||
public interface UpdateViewTimeForm{} |
|||
|
|||
/** |
|||
* 居民端用户:resi_user;工作人员:staff |
|||
*/ |
|||
@NotBlank(message = "viewType不能为空",groups = UpdateViewTimeForm.class) |
|||
private String viewType; |
|||
|
|||
@NotBlank(message = "事件ID不能为空",groups = UpdateViewTimeForm.class) |
|||
private String eventId; |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import com.epmet.dto.EventProjectInfoDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 1:30 下午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class EventDetailResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3905105043326445613L; |
|||
|
|||
/** |
|||
* 报事时间 |
|||
*/ |
|||
private String eventTime; |
|||
|
|||
/** |
|||
* 报事内容 |
|||
*/ |
|||
private String eventContent; |
|||
|
|||
/** |
|||
* 报事地址 |
|||
*/ |
|||
private String eventAddress; |
|||
|
|||
/** |
|||
* 所属网格【xx社区-xx网格】 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 是否办结【是:true,否:false】 |
|||
*/ |
|||
private Boolean isClosed; |
|||
|
|||
/** |
|||
* 是否解决【是:true,否:false】 |
|||
*/ |
|||
private Boolean isResolve; |
|||
|
|||
/** |
|||
* 是否可以撤回【true:是,false:否】 |
|||
*/ |
|||
private Boolean isRollback; |
|||
|
|||
/** |
|||
* 报事图片 |
|||
*/ |
|||
private List<String> eventImgs; |
|||
|
|||
/** |
|||
* 报事提到的人 |
|||
*/ |
|||
private List<String> eventPerson; |
|||
|
|||
/** |
|||
* 项目信息 |
|||
*/ |
|||
private EventProjectInfoDTO projectInfo; |
|||
|
|||
public EventDetailResultDTO() { |
|||
this.eventTime = ""; |
|||
this.eventContent = ""; |
|||
this.eventAddress = ""; |
|||
this.gridName = ""; |
|||
this.isClosed = false; |
|||
this.isResolve = false; |
|||
this.isRollback = false; |
|||
this.eventImgs = new ArrayList<>(); |
|||
this.eventPerson = new ArrayList<>(); |
|||
this.projectInfo = new EventProjectInfoDTO(); |
|||
} |
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 10:41 上午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class EventListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -8550265282744924930L; |
|||
|
|||
/** |
|||
* 报事标题 |
|||
*/ |
|||
private String eventTitle; |
|||
|
|||
/** |
|||
* 报事时间 |
|||
*/ |
|||
private String eventTime; |
|||
|
|||
/** |
|||
* 报事ID |
|||
*/ |
|||
private String eventId; |
|||
|
|||
/** |
|||
* 是否立项【true:是,false:否】 |
|||
*/ |
|||
private Boolean isProject; |
|||
|
|||
/** |
|||
* 红点显示【true:显示,false:不显示】 |
|||
*/ |
|||
private Boolean redDot; |
|||
|
|||
/** |
|||
* 报事图片 |
|||
*/ |
|||
private List<String> eventImgs; |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/8/3 11:07 上午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class ReplyListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 4875335642497226847L; |
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.EventListFormDTO; |
|||
import com.epmet.dto.form.UpdateViewTimeFormDTO; |
|||
import com.epmet.dto.result.EventListResultDTO; |
|||
import com.epmet.service.ResiEventService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 居民报事表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-08-03 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("event") |
|||
public class EventController { |
|||
|
|||
@Autowired |
|||
private ResiEventService resiEventService; |
|||
|
|||
/** |
|||
* @Description 群众直报(待处理、处理中、已办结)列表 |
|||
* @Param formDTO |
|||
* @author zxc |
|||
* @date 2021/8/3 10:53 上午 |
|||
*/ |
|||
@PostMapping("eventlist") |
|||
public Result<List<EventListResultDTO>> eventList(@RequestBody EventListFormDTO formDTO){ |
|||
ValidatorUtils.validateEntity(formDTO, EventListFormDTO.EventListForm.class); |
|||
return new Result<List<EventListResultDTO>>().ok(resiEventService.eventList(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 查看报事时,更新时间操作 |
|||
* @Param formDTO |
|||
* @author zxc |
|||
* @date 2021/8/3 11:01 上午 |
|||
*/ |
|||
@PostMapping("updateviewtime") |
|||
public Result updateViewTime(@RequestBody UpdateViewTimeFormDTO formDTO){ |
|||
ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.UpdateViewTimeForm.class); |
|||
resiEventService.updateViewTime(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @Description 我要报事人大代表列表 |
|||
* @author wxz |
|||
* @date 2021.08.03 09:16:59 |
|||
*/ |
|||
@Data |
|||
public class ResiEventNpcListFormDTO { |
|||
private String gridId; |
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @Description 我要报事-人大代表列表 |
|||
* @author wxz |
|||
* @date 2021.08.03 09:12:57 |
|||
*/ |
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class ResiEventNpcResultDTO { |
|||
|
|||
private String userId; |
|||
|
|||
private String gridId; |
|||
|
|||
private String displayName; |
|||
|
|||
private String headImgUrl; |
|||
|
|||
private String agencyId; |
|||
} |
@ -1,9 +1,20 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.dto.result.ResiEventNpcResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 报事service |
|||
* @author wxz |
|||
* @date 2021.08.02 09:59:16 |
|||
*/ |
|||
public interface ResiEventService { |
|||
/** |
|||
* @Description 查询网格的人大代表列表 |
|||
* @return |
|||
* @author wxz |
|||
* @date 2021.08.03 09:29 |
|||
*/ |
|||
List<ResiEventNpcResultDTO> listNpcByGrid(String gridId); |
|||
} |
|||
|
@ -1,13 +1,54 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.feign.ResultDataResolver; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.constant.BadgeConstant; |
|||
import com.epmet.dto.form.ListUserByBadgeFormDTO; |
|||
import com.epmet.dto.result.GridInfoResultDTO; |
|||
import com.epmet.dto.result.ListUserByBadgeResultDTO; |
|||
import com.epmet.dto.result.ResiEventNpcResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.feign.GovOrgOpenFeignClient; |
|||
import com.epmet.service.ResiEventService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @Description 报事service |
|||
* @author wxz |
|||
* @Description 报事service |
|||
* @date 2021.08.02 09:59:36 |
|||
*/ |
|||
*/ |
|||
@Service |
|||
public class ResiEventServiceImpl implements ResiEventService { |
|||
public class ResiEventServiceImpl implements ResiEventService, ResultDataResolver { |
|||
|
|||
@Autowired |
|||
GovOrgOpenFeignClient govOrgOpenFeignClient; |
|||
|
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
@Override |
|||
public List<ResiEventNpcResultDTO> listNpcByGrid(String gridId) { |
|||
|
|||
// 查询网格所属的组织信息
|
|||
Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId); |
|||
GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null); |
|||
String parentAgencyId = gridInfoData.getParentAgencyId(); |
|||
|
|||
//查询人大代表列表
|
|||
ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(gridId, BadgeConstant.BADGE_KEY_NPC); |
|||
Result<List<ListUserByBadgeResultDTO>> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm); |
|||
List<ListUserByBadgeResultDTO> npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null); |
|||
|
|||
List<ResiEventNpcResultDTO> npcResultList = npcData.stream() |
|||
.map(npc -> new ResiEventNpcResultDTO(npc.getUserId(), gridId, "人大代表-".concat(npc.getRealName()), npc.getHeadImgUrl(), parentAgencyId)) |
|||
.collect(Collectors.toList()); |
|||
|
|||
return npcResultList; |
|||
} |
|||
} |
|||
|
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class ListUserByBadgeFormDTO { |
|||
|
|||
@NotBlank(message = "网格ID不能为空") |
|||
private String gridId; |
|||
|
|||
@NotBlank(message = "徽章key不能为空") |
|||
private String badgeKey; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
/** |
|||
* @author wxz |
|||
* @Description 根据徽章查询用户结果集 |
|||
* @date 2021.08.02 10:23:37 |
|||
*/ |
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
public class ListUserByBadgeResultDTO { |
|||
private String userId; |
|||
private String gridId; |
|||
private String realName; |
|||
private String headImgUrl; |
|||
} |
Loading…
Reference in new issue