|
|
@ -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<List<OptionDTO>> 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<List<OptionDTO>>().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<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO)); |
|
|
|
} else if (UserDemandConstant.COMMUNITY_ORG.equals(formDTO.getServiceType())) { |
|
|
|
return new Result<List<OptionDTO>>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); |
|
|
|
} else if (UserDemandConstant.PARTY_UNIT.equals(formDTO.getServiceType())) { |
|
|
|
return new Result<List<OptionDTO>>().ok(icPartyUnitService.queryServiceList(formDTO)); |
|
|
|
} |
|
|
|
return new Result<>(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 新增需求 |
|
|
|