From bcb128d920c7ea43d2b92eeaf95aaa52648b95e7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Nov 2021 16:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=96=B9=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/demand/ServiceQueryFormDTO.java | 29 +++++++++---- .../epmet/constant/UserDemandConstant.java | 6 +++ .../controller/IcUserDemandRecController.java | 41 ++++++++++++++++++- 3 files changed, 67 insertions(+), 9 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java index 1b581426e2..142b081d80 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java @@ -8,22 +8,35 @@ import java.io.Serializable; @Data public class ServiceQueryFormDTO implements Serializable { private static final long serialVersionUID = -2738313255838176318L; - public interface AddUserInternalGroup {} - public interface SocietyOrgInternalGroup {} + public interface AddUserInternalGroup { + } + + public interface SocietyOrgInternalGroup { + } + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + @NotBlank(message = "服务方类型不能为空", groups = AddUserInternalGroup.class) + private String serviceType; + /** - * 前端入参 + * 名称检索 */ private String serviceName; - // 社会组织的:query_demand 新增需求:add_demand - @NotBlank(message = "新增需求:add_demand;列表查询:query_demand",groups = SocietyOrgInternalGroup.class) - private String queryPurpose; + /** + * 列表查询条件:query_demand 需求指派:add_demand + */ + @NotBlank(message = "新增需求:add_demand;列表查询:query_demand", groups = SocietyOrgInternalGroup.class) + private String queryPurpose; + // -------------------------------------------------------- // 以下参数从token中获取 - @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) private String staffId; - @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) private String customerId; private String demandRecId; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java index 5354245351..1f6bd0b578 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java @@ -35,4 +35,10 @@ public interface UserDemandConstant { String ASSIGN="assign"; String TAKE_ORDER="take_order"; String FINISH="finish"; + +// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + String VOLUNTEER="volunteer"; + String SOCIAL_ORG="social_org"; + String COMMUNITY_ORG="community_org"; + String PARTY_UNIT="party_unit"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 415968cb92..022ec5580f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -22,17 +22,22 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.UserDemandConstant; import com.epmet.dto.form.demand.DemandAddFromDTO; import com.epmet.dto.form.demand.DemandRecId; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.service.IcUserDemandRecService; +import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 居民需求记录表 @@ -46,7 +51,41 @@ public class IcUserDemandRecController { @Autowired private IcUserDemandRecService icUserDemandRecService; + @Autowired + private VolunteerInfoService volunteerInfoService; + @Autowired + private IcSocietyOrgService societyOrgService; + @Autowired + private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; + @Autowired + private IcPartyUnitService icPartyUnitService; + + /** + * 根据服务方类型查询 下拉框 + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("servicelist") + public Result> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); + if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) { + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getServiceName())); + } else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) { + ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class); + return new Result>().ok(societyOrgService.queryServiceList(formDTO)); + } else if (UserDemandConstant.COMMUNITY_ORG.equals(formDTO.getServiceType())) { + return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); + } else if (UserDemandConstant.PARTY_UNIT.equals(formDTO.getServiceType())) { + return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); + } + return new Result<>(); + } /** * 新增需求