From 836b66954d973ee5f4868ccf2c812c898f4d9e37 Mon Sep 17 00:00:00 2001 From: yujt Date: Fri, 12 Jun 2020 09:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E7=90=86=E5=92=A8=E8=AF=A2=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiPropertyController.java | 4 +-- .../controller/ApiWorkPropertyController.java | 18 +++++------ .../esua/epdc/feign/PropertyFeignClient.java | 10 +++--- .../epdc/feign/WorkPropertyFeignClient.java | 31 +++++++++---------- .../fallback/PropertyFeignClientFallback.java | 1 + .../WorkPropertyFeignClientFallback.java | 5 ++- .../epdc/service/WorkPropertyService.java | 5 ++- .../service/impl/WorkPropertyServiceImpl.java | 16 +++++----- 8 files changed, 41 insertions(+), 49 deletions(-) diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java index 3d4eda9..2eeaff5 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java @@ -416,7 +416,7 @@ public class ApiPropertyController { * @since 2019/10/22 15:33 */ @GetMapping("psychology/listUserQuestion") - public Result> listUserQuestion(@LoginUser TokenDto userDetail, @RequestBody PsychologyAnswerFormDTO formDto) { + public Result> listUserQuestion(@LoginUser TokenDto userDetail, PsychologyAnswerFormDTO formDto) { return propertyService.listUserQuestion(userDetail, formDto); } @@ -429,7 +429,7 @@ public class ApiPropertyController { * @since 2019/10/22 15:33 */ @GetMapping("psychology/listQuestion") - public Result> listQuestion(@LoginUser TokenDto userDetail, @RequestBody PsychologyAnswerFormDTO formDto) { + public Result> listQuestion(@LoginUser TokenDto userDetail, PsychologyAnswerFormDTO formDto) { return propertyService.listQuestion(userDetail, formDto); } } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiWorkPropertyController.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiWorkPropertyController.java index e66aba9..a7f2ef7 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiWorkPropertyController.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiWorkPropertyController.java @@ -2,7 +2,6 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; -import com.elink.esua.epdc.dto.conflict.form.ConflictMediateDetailFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateHistoryFormDTO; import com.elink.esua.epdc.dto.conflict.result.ConflictMediateDetailResultDTO; @@ -14,10 +13,7 @@ import com.elink.esua.epdc.dto.psychology.result.PsychologyAnswerOfMineResultDTO import com.elink.esua.epdc.dto.psychology.result.PsychologyUnansweredResultDTO; import com.elink.esua.epdc.service.WorkPropertyService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -60,7 +56,7 @@ public class ApiWorkPropertyController { } /** - * 工作端--心理咨询-提交问题的回答 + * 工作端--心理咨询-解答心理咨询问题(提交回复) * * @return com.elink.esua.epdc.commons.tools.utils.Result < PsychologyAnswerOfMineResultDTO > * @params [formDto] @@ -68,7 +64,7 @@ public class ApiWorkPropertyController { * @since 2020/6/9 15:33 */ @PostMapping("psychology/submitAnswer") - public Result submitAnswer(PsychologySubmitAnswerFormDTO formDto) { + public Result submitAnswer(@RequestBody PsychologySubmitAnswerFormDTO formDto) { ValidatorUtils.validateEntity(formDto); return workPropertyService.submitAnswer(formDto); } @@ -94,9 +90,9 @@ public class ApiWorkPropertyController { * @author zhangyuan * @since 2020/6/9 15:33 */ - @GetMapping("conflict/getById") - public Result getById(ConflictMediateDetailFormDTO formDto) { - return workPropertyService.getById(formDto); + @GetMapping("conflict/getById/{conflictId}") + public Result getById(@PathVariable("conflictId") String conflictId) { + return workPropertyService.getById(conflictId); } /** @@ -108,7 +104,7 @@ public class ApiWorkPropertyController { * @since 2020/6/9 15:33 */ @PostMapping("conflict/submit") - public Result submit(ConflictMediateFormDTO formDto) { + public Result submit(@RequestBody ConflictMediateFormDTO formDto) { ValidatorUtils.validateEntity(formDto); return workPropertyService.submit(formDto); } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/PropertyFeignClient.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/PropertyFeignClient.java index 547914b..2990edc 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/PropertyFeignClient.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/PropertyFeignClient.java @@ -299,7 +299,7 @@ public interface PropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/psychology/listPsychiatrist", consumes = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "property/epdc-app/psychology/listPsychiatrist", consumes = MediaType.APPLICATION_JSON_VALUE) Result> listPsychiatrist(@RequestBody PsychologistFormDTO fromDTO); /*** @@ -309,7 +309,7 @@ public interface PropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/psychology/psychologistInfo", consumes = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "property/epdc-app/psychology/psychologistInfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result psychologistInfo(@RequestBody PsychologistInfoFormDTO fromDTO); /*** @@ -319,7 +319,7 @@ public interface PropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @PostMapping(value = "news/epdc-app/psychology/submitQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "property/epdc-app/psychology/submitQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) Result submitQuestion(@RequestBody PsychologyQuestionFormDTO fromDTO); /*** @@ -329,7 +329,7 @@ public interface PropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/psychology/listUserQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "property/epdc-app/psychology/listUserQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) Result> listUserQuestion(@RequestBody PsychologyAnswerFormDTO fromDTO); /*** @@ -339,7 +339,7 @@ public interface PropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/psychology/listQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(value = "property/epdc-app/psychology/listQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) Result> listQuestion(@RequestBody PsychologyAnswerFormDTO fromDTO); } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/WorkPropertyFeignClient.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/WorkPropertyFeignClient.java index 8de3cb6..1821d8e 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/WorkPropertyFeignClient.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/WorkPropertyFeignClient.java @@ -3,7 +3,6 @@ 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.config.FeignRequestInterceptor; -import com.elink.esua.epdc.dto.conflict.form.ConflictMediateDetailFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateHistoryFormDTO; import com.elink.esua.epdc.dto.conflict.result.ConflictMediateDetailResultDTO; @@ -17,8 +16,8 @@ import com.elink.esua.epdc.feign.fallback.WorkPropertyFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -28,7 +27,7 @@ import java.util.List; * @Author zhangyuan * @Date 2020/6/9 16:39 */ -@FeignClient(name = ServiceConstant.EPDC_EVENTS_SERVER, fallback = WorkPropertyFeignClientFallback.class, configuration = FeignRequestInterceptor.class) +@FeignClient(name = ServiceConstant.EPDC_PROPERTY_SERVER, fallback = WorkPropertyFeignClientFallback.class, configuration = FeignRequestInterceptor.class) public interface WorkPropertyFeignClient { /*** @@ -38,8 +37,8 @@ public interface WorkPropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/psychology/listUnansweredQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> listUnansweredQuestion(@RequestBody PsychologyUnansweredFormDTO fromDTO); + @GetMapping(value = "property/epdc-app/psychology/listUnansweredQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listUnansweredQuestion(PsychologyUnansweredFormDTO fromDTO); /*** * 工作端--待解答的心理咨询问题列表 @@ -48,8 +47,8 @@ public interface WorkPropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/psychology/listMyQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> listMyQuestion(@RequestBody PsychologyAnswerFormDTO fromDTO); + @GetMapping(value = "property/epdc-app/psychology/listMyQuestion", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listMyQuestion(PsychologyAnswerFormDTO fromDTO); /*** * 工作端--待解答的心理咨询问题列表 @@ -58,8 +57,8 @@ public interface WorkPropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @PostMapping(value = "news/epdc-app/psychology/submitAnswer", consumes = MediaType.APPLICATION_JSON_VALUE) - Result submitAnswer(@RequestBody PsychologySubmitAnswerFormDTO fromDTO); + @PostMapping(value = "property/epdc-app/psychology/submitAnswer", consumes = MediaType.APPLICATION_JSON_VALUE) + Result submitAnswer(PsychologySubmitAnswerFormDTO fromDTO); /*** * 工作端--矛盾纠纷历史上报列表 @@ -68,18 +67,18 @@ public interface WorkPropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/conflict/listHistory", consumes = MediaType.APPLICATION_JSON_VALUE) - Result> listHistory(@RequestBody ConflictMediateHistoryFormDTO fromDTO); + @GetMapping(value = "property/epdc-app/conflict/listHistory", consumes = MediaType.APPLICATION_JSON_VALUE) + Result> listHistory(ConflictMediateHistoryFormDTO fromDTO); /*** * 工作端--矛盾调解 详情 - * @param fromDTO + * @param conflictId * @return com.elink.esua.epdc.commons.tools.utils.Result < ConflictMediateDetailResultDTO > * @author zhangyuan * @date 2020/6/8 9:25 */ - @GetMapping(value = "news/epdc-app/conflict/getById", consumes = MediaType.APPLICATION_JSON_VALUE) - Result getById(@RequestBody ConflictMediateDetailFormDTO fromDTO); + @GetMapping(value = "property/epdc-app/conflict/getById/{conflictId}", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getById(@PathVariable("conflictId") String conflictId); /*** * 工作端--矛盾纠纷提交 @@ -88,6 +87,6 @@ public interface WorkPropertyFeignClient { * @author zhangyuan * @date 2020/6/8 9:25 */ - @PostMapping(value = "news/epdc-app/conflict/submit", consumes = MediaType.APPLICATION_JSON_VALUE) - Result submit(@RequestBody ConflictMediateFormDTO fromDTO); + @PostMapping(value = "property/epdc-app/conflict/submit", consumes = MediaType.APPLICATION_JSON_VALUE) + Result submit(ConflictMediateFormDTO fromDTO); } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/PropertyFeignClientFallback.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/PropertyFeignClientFallback.java index 7e15996..fe36244 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/PropertyFeignClientFallback.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/PropertyFeignClientFallback.java @@ -154,6 +154,7 @@ public class PropertyFeignClientFallback implements PropertyFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPDC_PROPERTY_SERVER, "getDeptPolice", formDto); } + @Override public Result submit(TopicCommentFormDTO commentFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPDC_GROUP_SERVER, "submit", commentFormDTO); } diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/WorkPropertyFeignClientFallback.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/WorkPropertyFeignClientFallback.java index 3307f13..609ce1d 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/WorkPropertyFeignClientFallback.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/WorkPropertyFeignClientFallback.java @@ -3,7 +3,6 @@ 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.conflict.form.ConflictMediateDetailFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateHistoryFormDTO; import com.elink.esua.epdc.dto.conflict.result.ConflictMediateDetailResultDTO; @@ -46,8 +45,8 @@ public class WorkPropertyFeignClientFallback implements WorkPropertyFeignClient } @Override - public Result getById(ConflictMediateDetailFormDTO formDto) { - return ModuleUtils.feignConError(ServiceConstant.EPDC_PROPERTY_SERVER, "getById", formDto); + public Result getById(String conflictId) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_PROPERTY_SERVER, "getById", conflictId); } @Override diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/WorkPropertyService.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/WorkPropertyService.java index 35fcd3d..3769c14 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/WorkPropertyService.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/WorkPropertyService.java @@ -1,7 +1,6 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.conflict.form.ConflictMediateDetailFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateHistoryFormDTO; import com.elink.esua.epdc.dto.conflict.result.ConflictMediateDetailResultDTO; @@ -65,12 +64,12 @@ public interface WorkPropertyService { /** * 工作端--矛盾调解 详情 * - * @param formDto 查询参数 + * @param conflictId 查询参数 * @return com.elink.esua.epdc.commons.tools.utils.Result> * @author zhangyuan * @date 2020/6/8 09:15 */ - Result getById(ConflictMediateDetailFormDTO formDto); + Result getById(String conflictId); /** * 工作端--矛盾纠纷提交 diff --git a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/WorkPropertyServiceImpl.java b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/WorkPropertyServiceImpl.java index 05312eb..832a613 100644 --- a/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/WorkPropertyServiceImpl.java +++ b/epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/WorkPropertyServiceImpl.java @@ -1,7 +1,8 @@ package com.elink.esua.epdc.service.impl; +import com.elink.esua.epdc.commons.tools.utils.DateUtils; +import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.conflict.form.ConflictMediateDetailFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateFormDTO; import com.elink.esua.epdc.dto.conflict.form.ConflictMediateHistoryFormDTO; import com.elink.esua.epdc.dto.conflict.result.ConflictMediateDetailResultDTO; @@ -32,37 +33,34 @@ public class WorkPropertyServiceImpl implements WorkPropertyService { @Override public Result> listUnansweredQuestion(PsychologyUnansweredFormDTO formDto) { - return workPropertyFeignClient.listUnansweredQuestion(formDto); } @Override public Result> listMyQuestion(PsychologyAnswerFormDTO formDto) { - return workPropertyFeignClient.listMyQuestion(formDto); } @Override public Result submitAnswer(PsychologySubmitAnswerFormDTO formDto) { - return workPropertyFeignClient.submitAnswer(formDto); } @Override public Result> listHistory(ConflictMediateHistoryFormDTO formDto) { - return workPropertyFeignClient.listHistory(formDto); } @Override - public Result getById(ConflictMediateDetailFormDTO formDto) { - - return workPropertyFeignClient.getById(formDto); + public Result getById(String conflictId) { + return workPropertyFeignClient.getById(conflictId); } @Override public Result submit(ConflictMediateFormDTO formDto) { - + if (!ModuleUtils.isValidDate(formDto.getSubmitTime(), DateUtils.DATE_PATTERN)) { + return new Result().error("提报日期格式错误"); + } return workPropertyFeignClient.submit(formDto); } }