|
|
|
@ -27,13 +27,17 @@ import com.elink.esua.epdc.commons.mybatis.utils.DeptEntityUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.enums.UserTagEnum; |
|
|
|
import com.elink.esua.epdc.commons.tools.enums.pointsenum.PointsOperationEnum; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
|
import com.elink.esua.epdc.constant.UserFieldConsant; |
|
|
|
import com.elink.esua.epdc.constant.VolunteerInfoNoticeConstant; |
|
|
|
import com.elink.esua.epdc.dao.VolunteerInfoDao; |
|
|
|
import com.elink.esua.epdc.dto.*; |
|
|
|
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; |
|
|
|
import com.elink.esua.epdc.dto.UserTagDTO; |
|
|
|
import com.elink.esua.epdc.dto.VolunteerInfoDTO; |
|
|
|
import com.elink.esua.epdc.dto.VolunteerTagRelationDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.*; |
|
|
|
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcCompleteVolunteerInfoV2FormDTO; |
|
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAdjustVolunteerPointsDTO; |
|
|
|
@ -46,7 +50,6 @@ import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|
|
|
import com.elink.esua.epdc.service.UserTagRelationService; |
|
|
|
import com.elink.esua.epdc.service.VolunteerInfoService; |
|
|
|
import com.elink.esua.epdc.service.VolunteerTagRelationService; |
|
|
|
import com.elink.esua.epdc.service.VolunteerTagService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -484,6 +487,29 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
updateBatchById(entities); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result handleVolunteerPoints(EpdcVolunteerPointsFormDTO formDTO) { |
|
|
|
VolunteerInfoEntity volunteerInfoEntity= baseDao.selectById(formDTO.getVolunteerId()); |
|
|
|
if (null == volunteerInfoEntity) { |
|
|
|
return new Result().error("未查询到该志愿者"); |
|
|
|
} |
|
|
|
int points = null == volunteerInfoEntity.getVolunteerPoints() ? 0 : volunteerInfoEntity.getVolunteerPoints(); |
|
|
|
int pointsTotal = null == volunteerInfoEntity.getVolunteerPointsTotal() ? 0 : volunteerInfoEntity.getVolunteerPointsTotal(); |
|
|
|
//规则操作类型(0-减积分,1-加积分)
|
|
|
|
if (PointsOperationEnum.OPERATION_TYPE_ADD.getOperationType().equals(formDTO.getOperationType())) { |
|
|
|
volunteerInfoEntity.setVolunteerPoints(points + formDTO.getPoints()); |
|
|
|
volunteerInfoEntity.setVolunteerPointsTotal(pointsTotal + formDTO.getPoints()); |
|
|
|
} else if (PointsOperationEnum.OPERATION_TYPE_SUBSTRACT.getOperationType().equals(formDTO.getOperationType())) { |
|
|
|
if (formDTO.getPoints() > points) { |
|
|
|
return new Result().error("用户积分不足"); |
|
|
|
} |
|
|
|
volunteerInfoEntity.setVolunteerPoints(volunteerInfoEntity.getVolunteerPoints() - formDTO.getPoints()); |
|
|
|
} |
|
|
|
baseDao.updateById(volunteerInfoEntity); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 组织机构信息处理 |
|
|
|
* |
|
|
|
|