|
|
@ -50,6 +50,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|
|
|
import com.elink.esua.epdc.constant.*; |
|
|
|
import com.elink.esua.epdc.dto.ScheduleJobDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.EpdcVolunteerKindnessTimeUpdateFormDTO; |
|
|
|
import com.elink.esua.epdc.modules.activity.dao.*; |
|
|
|
import com.elink.esua.epdc.modules.activity.entity.ActBannerEntity; |
|
|
|
import com.elink.esua.epdc.modules.activity.entity.ActInfoEntity; |
|
|
@ -68,8 +69,10 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 活动信息表 |
|
|
@ -247,6 +250,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
} |
|
|
|
//内容审核 - end
|
|
|
|
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); |
|
|
|
//如果更新了公益时长,则更新相关确认积分的志愿者的公益时长
|
|
|
|
updateKindnessTime(dto); |
|
|
|
updateById(entity); |
|
|
|
//内容审核- 开始
|
|
|
|
//接口异常,保存至待审核信息
|
|
|
@ -276,6 +281,34 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
//内容审核 - 结束
|
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
/** |
|
|
|
* @Description 更新志愿者公益时长 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/9/11 |
|
|
|
* @Param [dto] |
|
|
|
* @return void |
|
|
|
**/ |
|
|
|
private void updateKindnessTime(ActInfoDTO dto) { |
|
|
|
ActInfoEntity oldActInfoEntity = selectById(dto.getId()); |
|
|
|
if(dto.getKindnessTime() == oldActInfoEntity.getKindnessTime()){ |
|
|
|
return; |
|
|
|
} |
|
|
|
//查询出所有的此活动下已确认积分的用户列表ID
|
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
params.put("ACT_ID",dto.getId()); |
|
|
|
params.put("STATUS","5"); |
|
|
|
List<ActUserRelationEntity> actUserRelationEntities = actUserRelationDao.selectByMap(params); |
|
|
|
if(actUserRelationEntities==null || actUserRelationEntities.size() == 0){ |
|
|
|
return; |
|
|
|
} |
|
|
|
List<String> userIds = actUserRelationEntities.stream().map(ActUserRelationEntity::getUserId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
EpdcVolunteerKindnessTimeUpdateFormDTO epdcVolunteerKindnessTimeUpdateFormDTO = new EpdcVolunteerKindnessTimeUpdateFormDTO(); |
|
|
|
//更改的值减去原先的值 若是正的,则代表加上时长差 若是负的 则代表减去时长差
|
|
|
|
epdcVolunteerKindnessTimeUpdateFormDTO.setKindnessTime(new BigDecimal(dto.getKindnessTime()-oldActInfoEntity.getKindnessTime())); |
|
|
|
epdcVolunteerKindnessTimeUpdateFormDTO.setUserIds(userIds); |
|
|
|
userInfoFeignClient.updateKindnessTime(epdcVolunteerKindnessTimeUpdateFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 活动列表-移动app端用 |
|
|
|