Browse Source

已经是志愿者的居民,积分任务列表"注册志愿者"显示已完成

dev_shibei_match
yinzuomei 4 years ago
parent
commit
bf3d9bc0fd
  1. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  2. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  3. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  4. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  5. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  6. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml
  7. 6
      epmet-module/epmet-point/epmet-point-server/pom.xml
  8. 14
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -3,6 +3,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
@ -41,4 +42,14 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/act/published/{staffId}")
Result<List<ActInfoDTO>> getPublishedAct(@PathVariable("staffId") String staffId);
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.VolunteerInfoDTO>
* @param userId
* @author yinzuomei
* @description 根据用户id查询用户的注册志愿者信息
* @Date 2021/6/28 9:30
**/
@PostMapping("/heart/resi/volunteer/queryuservolunteerinfo/{userId}")
Result<VolunteerInfoDTO> queryUserVolunteerInfo(@PathVariable("userId") String userId);
}

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import org.springframework.stereotype.Component;
@ -35,4 +36,16 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result<List<ActInfoDTO>> getPublishedAct(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getPublishedAct", staffId);
}
/**
* @param userId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.VolunteerInfoDTO>
* @author yinzuomei
* @description 根据用户id查询用户的注册志愿者信息
* @Date 2021/6/28 9:30
**/
@Override
public Result<VolunteerInfoDTO> queryUserVolunteerInfo(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryUserVolunteerInfo", userId);
}
}

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

@ -21,16 +21,14 @@ import com.epmet.commons.tools.annotation.LoginUser;
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.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.service.VolunteerInfoService;
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 org.springframework.web.bind.annotation.*;
import java.util.List;
@ -102,4 +100,16 @@ public class ResiVolunteerController {
ValidatorUtils.validateEntity(customerFormDTO,CommonCustomerFormDTO.CustomerIdGroup.class);
return new Result<List<String>>().ok(volunteerInfoService.getVolunteerIds(customerFormDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.VolunteerInfoDTO>
* @param userId
* @author yinzuomei
* @description 根据用户id查询用户的注册志愿者信息
* @Date 2021/6/28 9:34
**/
@PostMapping("queryuservolunteerinfo/{userId}")
public Result<VolunteerInfoDTO> queryUserVolunteerInfo(@PathVariable("userId")String userId){
return new Result<VolunteerInfoDTO>().ok(volunteerInfoService.queryUserVolunteerInfo(userId));
}
}

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

@ -18,7 +18,6 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
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.dto.VolunteerInfoDTO;
@ -29,7 +28,6 @@ import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.entity.VolunteerInfoEntity;
import java.util.List;
import java.util.Map;
/**
* 志愿者信息
@ -78,4 +76,12 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @date 2020.08.13 10:22
**/
List<String> getVolunteerIds(CommonCustomerFormDTO customerFormDTO);
/**
* 根据用户id查询用户的注册志愿者信息
*
* @param userId
* @return com.epmet.dto.VolunteerInfoDTO
*/
VolunteerInfoDTO queryUserVolunteerInfo(String userId);
}

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

@ -208,4 +208,16 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
logger.info(String.format("短信验证码key=%s", smsCodeKey));
redisUtils.set(smsCodeKey, smsCode, RedisUtils.MINUTE_THIRTY_EXPIRE);
}
/**
* 根据用户id查询用户的注册志愿者信息
*
* @param userId
* @return com.epmet.dto.VolunteerInfoDTO
*/
@Override
public VolunteerInfoDTO queryUserVolunteerInfo(String userId) {
VolunteerInfoDTO volunteerInfoDTO=baseDao.selectVolunteerInfoByUserId(userId);
return volunteerInfoDTO;
}
}

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

@ -59,7 +59,8 @@
VOLUNTEER_INTRODUCE volunteerIntroduce,
VOLUNTEER_SIGNATURE volunteerSignature,
GRID_ID gridId,
GRID_NAME gridName
GRID_NAME gridName,
USER_ID as userId
FROM volunteer_info
WHERE DEL_FLAG = '0'
AND USER_ID = #{userId}

6
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -97,6 +97,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-heart-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

14
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

@ -28,11 +28,13 @@ import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dao.UserPointActionLogDao;
import com.epmet.dto.BizPointTotalDetailDTO;
import com.epmet.dto.BizPointUserTotalDetailDTO;
import com.epmet.dto.UserPointActionLogDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonPageUserFormDTO;
import com.epmet.dto.form.MyPointTaskFormDTO;
import com.epmet.dto.result.MyPointTaskResultDTO;
@ -42,6 +44,7 @@ import com.epmet.entity.PointRuleEntity;
import com.epmet.entity.UserPointActionLogEntity;
import com.epmet.entity.UserPointStatisticalDailyEntity;
import com.epmet.entity.UserPointTotalEntity;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.service.*;
import com.epmet.utils.DimIdGenerator;
import com.epmet.utils.ModuleConstant;
@ -81,6 +84,9 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
private BizPointTotalDetailService bizPointTotalDetailService;
@Autowired
private BizPointUserTotalDetailService bizPointUserTotalDetailService;
@Autowired
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient;
@Override
public PageData<UserPointActionLogDTO> page(Map<String, Object> params) {
IPage<UserPointActionLogEntity> page = baseDao.selectPage(
@ -542,6 +548,14 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
if("1".equals(dto.getDisposable())&&dto.getFinishedCount().equals(NumConstant.ONE)){
dto.setFinishFlag("已完成");
}
//如果是注册志愿者
if ("register_volunteer".equals(dto.getEventCode())){
Result<VolunteerInfoDTO> volunteerInfoDTOResult= epmetHeartOpenFeignClient.queryUserVolunteerInfo(formDTO.getUserId());
if(volunteerInfoDTOResult.success()&&null!=volunteerInfoDTOResult.getData()){
dto.setFinishFlag("已完成");
dto.setFinishTotalDesc("完成1");
}
}
});
return list;
}

Loading…
Cancel
Save