Browse Source

pc指派时志愿者列表修改为,当前组织及下级所有志愿者。

dev_shibei_match
yinzuomei 4 years ago
parent
commit
27dec0dc17
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  3. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java
  4. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  5. 27
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  6. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml
  7. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -85,7 +85,7 @@ public class IcUserDemandRecController {
formDTO.setStaffId(tokenDto.getUserId()); formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class);
if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) { if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) {
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getServiceName())); return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getStaffId(),formDTO.getServiceName()));
} else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) { } else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) {
ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class); ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class);
return new Result<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO)); return new Result<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO));

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java

@ -125,7 +125,7 @@ public class ResiVolunteerController {
*/ */
@PostMapping("listprofile") @PostMapping("listprofile")
public Result<List<OptionDTO>> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ public Result<List<OptionDTO>> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getServiceName()));
} }
/** /**

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java

@ -74,4 +74,12 @@ public interface VolunteerInfoDao extends BaseDao<VolunteerInfoEntity> {
* @date 2020.08.13 10:06 * @date 2020.08.13 10:06
**/ **/
List<String> selectVolunteerIds(@Param("customerId")String customerId); List<String> selectVolunteerIds(@Param("customerId")String customerId);
/**
*
* @param customerId
* @param pids 查询当前组织及下级所有的志愿者
* @return
*/
List<String> selectVolunteerByPids(@Param("customerId") String customerId, @Param("pids") String pids);
} }

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -94,7 +94,7 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @param customerId * @param customerId
* @return * @return
*/ */
List<OptionDTO> queryListVolunteer(String customerId,String userRealName); List<OptionDTO> queryListVolunteer(String customerId,String staffId,String userRealName);
List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize); List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize);
} }

27
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -22,13 +22,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
@ -231,10 +235,29 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return volunteerInfoDTO; return volunteerInfoDTO;
} }
/**
* pc指派需求给志愿者时根据工作人员登录的组织显示组织下的志愿者
*
* @param customerId
* @param staffId
* @param userRealName
* @return
*/
@Override @Override
public List<OptionDTO> queryListVolunteer(String customerId, String userRealName) { public List<OptionDTO> queryListVolunteer(String customerId, String staffId,String userRealName) {
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(customerId,staffId);
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询工作人员信息异常");
}
// 如果是根级组织的工作人员,agencyPids="";正常是以英文冒号隔开
String pids="";
if(StringUtils.isBlank(staffInfo.getAgencyPIds())||NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())){
pids=staffInfo.getAgencyId();
}else{
pids=staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId());
}
List<OptionDTO> resultList = new ArrayList<>(); List<OptionDTO> resultList = new ArrayList<>();
List<String> userIds = baseDao.selectVolunteerIds(customerId); List<String> userIds = baseDao.selectVolunteerByPids(customerId,pids);
if (CollectionUtils.isEmpty(userIds)) { if (CollectionUtils.isEmpty(userIds)) {
return resultList; return resultList;
} }

10
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -75,4 +75,14 @@
AND CUSTOMER_ID = #{customerId} AND CUSTOMER_ID = #{customerId}
order by CREATED_TIME asc order by CREATED_TIME asc
</select> </select>
<select id="selectVolunteerByPids" parameterType="map" resultType="java.lang.String">
SELECT
distinct USER_ID
FROM volunteer_info
WHERE DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
and pids like concat(#{pids},'%')
order by CREATED_TIME asc
</select>
</mapper> </mapper>

4
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -23,8 +23,8 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com * @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09 * @date 2020/6/4 13:09
*/ */
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) //@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
public interface EpmetUserOpenFeignClient { public interface EpmetUserOpenFeignClient {
/** /**

Loading…
Cancel
Save