17 changed files with 279 additions and 5 deletions
@ -0,0 +1,28 @@ |
|||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; |
||||
|
import com.elink.esua.epdc.service.WorkIssueService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("work/event/issue/") |
||||
|
public class ApiWorkIssueController { |
||||
|
|
||||
|
@Autowired |
||||
|
private WorkIssueService workIssueService; |
||||
|
|
||||
|
|
||||
|
@GetMapping("statistics") |
||||
|
public Result<IssueStateStatisticsResultDTO> statistics(@RequestBody IssueStateStatisticsFormDTO formDto) { |
||||
|
return workIssueService.stateStatistics(formDto); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.elink.esua.epdc.feign; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.issue.form.*; |
||||
|
import com.elink.esua.epdc.dto.issue.result.*; |
||||
|
import com.elink.esua.epdc.feign.fallback.IssueFeignClientFallback; |
||||
|
import com.elink.esua.epdc.feign.fallback.WorkIssueFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = WorkIssueFeignClientFallback.class) |
||||
|
public interface WorkIssueFeignClient { |
||||
|
|
||||
|
@GetMapping(value = "events/epdc-app/issue/stateStatistics", consumes = MediaType.APPLICATION_JSON_VALUE) |
||||
|
Result<IssueStateStatisticsResultDTO> stateStatistics(IssueStateStatisticsFormDTO formDto); |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.elink.esua.epdc.feign.fallback; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.events.form.EpdcEventSubmitFormDTO; |
||||
|
import com.elink.esua.epdc.dto.events.result.EventAppDetailResultDTO; |
||||
|
import com.elink.esua.epdc.dto.issue.form.*; |
||||
|
import com.elink.esua.epdc.dto.issue.result.*; |
||||
|
import com.elink.esua.epdc.feign.IssueFeignClient; |
||||
|
import com.elink.esua.epdc.feign.WorkIssueFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Author LC |
||||
|
* @Date 2019/9/7 11:34 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class WorkIssueFeignClientFallback implements WorkIssueFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<IssueStateStatisticsResultDTO> stateStatistics(IssueStateStatisticsFormDTO formDto) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_EVENTS_SERVER, "stateStatistics", formDto); |
||||
|
} |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
public interface WorkIssueService { |
||||
|
|
||||
|
Result<IssueStateStatisticsResultDTO> stateStatistics(@RequestBody IssueStateStatisticsFormDTO formDto); |
||||
|
|
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.issue.form.IssueStateStatisticsFormDTO; |
||||
|
import com.elink.esua.epdc.dto.issue.result.IssueStateStatisticsResultDTO; |
||||
|
import com.elink.esua.epdc.feign.WorkIssueFeignClient; |
||||
|
import com.elink.esua.epdc.service.WorkIssueService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
|
||||
|
@Service |
||||
|
public class WorkIssueServiceImpl implements WorkIssueService { |
||||
|
|
||||
|
@Autowired |
||||
|
private WorkIssueFeignClient workIssueFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public Result<IssueStateStatisticsResultDTO> stateStatistics(IssueStateStatisticsFormDTO formDto) { |
||||
|
return workIssueFeignClient.stateStatistics(formDto); |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.elink.esua.epdc.dto.issue.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
@Data |
||||
|
public class IssueStateStatisticsFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -8864248267071206774L; |
||||
|
|
||||
|
/** |
||||
|
* 用户所属网格ID |
||||
|
*/ |
||||
|
private Long deptId; |
||||
|
|
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.elink.esua.epdc.dto.issue.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
@Data |
||||
|
public class IssueStateStatisticsResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -4512771534907006929L; |
||||
|
|
||||
|
private Integer pendingResponseNum; |
||||
|
|
||||
|
private Integer pendingHandleNum; |
||||
|
|
||||
|
private Integer rejectedNum; |
||||
|
|
||||
|
private Integer closed; |
||||
|
} |
||||
|
|
Loading…
Reference in new issue