Browse Source

服务方下拉框

dev_shibei_match
yinzuomei 4 years ago
parent
commit
bcb128d920
  1. 23
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  3. 41
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

23
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java

@ -8,18 +8,31 @@ 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
/**
* 列表查询条件query_demand 需求指派add_demand
*/
@NotBlank(message = "新增需求:add_demand;列表查询:query_demand", groups = SocietyOrgInternalGroup.class)
private String queryPurpose;
// --------------------------------------------------------
// 以下参数从token中获取
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String staffId;

6
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";
}

41
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<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<>();
}
/**
* 新增需求

Loading…
Cancel
Save