|
|
@ -30,6 +30,7 @@ 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.PointAdditiveRuleDao; |
|
|
|
import com.epmet.dao.UserPointActionLogDao; |
|
|
|
import com.epmet.dto.BizPointTotalDetailDTO; |
|
|
|
import com.epmet.dto.BizPointUserTotalDetailDTO; |
|
|
@ -38,10 +39,8 @@ import com.epmet.dto.VolunteerInfoDTO; |
|
|
|
import com.epmet.dto.form.CommonPageUserFormDTO; |
|
|
|
import com.epmet.dto.form.IcResiPointPageFormDTO; |
|
|
|
import com.epmet.dto.form.MyPointTaskFormDTO; |
|
|
|
import com.epmet.dto.result.MyPointTaskResultDTO; |
|
|
|
import com.epmet.dto.result.ResiPointLogListResultDTO; |
|
|
|
import com.epmet.dto.result.ResiPointLogPeriodResultDTO; |
|
|
|
import com.epmet.dto.result.ResiPointPageResDTO; |
|
|
|
import com.epmet.dto.form.PartyPointFormDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.PointRuleEntity; |
|
|
|
import com.epmet.entity.UserPointActionLogEntity; |
|
|
|
import com.epmet.entity.UserPointStatisticalDailyEntity; |
|
|
@ -64,6 +63,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -89,6 +89,8 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi |
|
|
|
private BizPointUserTotalDetailService bizPointUserTotalDetailService; |
|
|
|
@Autowired |
|
|
|
private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; |
|
|
|
@Resource |
|
|
|
private PointAdditiveRuleDao pointAdditiveRuleDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<UserPointActionLogDTO> page(Map<String, Object> params) { |
|
|
@ -207,6 +209,9 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi |
|
|
|
throw new RenException("无法识别事件类型与积分规则"); |
|
|
|
} |
|
|
|
PointRuleEntity ruleInfo = pointRuleService.getByEventCodeAndCustomerId(event.getCustomerId(),eventCode); |
|
|
|
if ("party_building".equals(event.getEventClass())) { |
|
|
|
ruleInfo = pointAdditiveRuleDao.selectByRoleName(event.getCustomerId(), eventCode); |
|
|
|
} |
|
|
|
if(null != ruleInfo && StringUtils.equals(NumConstant.ONE_STR,ruleInfo.getEnabledFlag())){ |
|
|
|
Date dateCheck = null; |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
@ -338,6 +343,9 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi |
|
|
|
if (("resi_group").equals(event.getEventClass())) { |
|
|
|
action.setBizType("group"); |
|
|
|
action.setObjectId(event.getGroupId()); |
|
|
|
} else if ("party_building".equals(event.getEventClass())) { |
|
|
|
action.setBizType("party_building"); |
|
|
|
action.setObjectId(event.getSourceId()); |
|
|
|
} else { |
|
|
|
action.setBizType("activity"); |
|
|
|
action.setObjectId(event.getSourceId()); |
|
|
@ -406,6 +414,26 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi |
|
|
|
bizPointTotalDetailService.update(totalDetailDTO); |
|
|
|
} |
|
|
|
|
|
|
|
} else if ("party_building".equals(event.getEventClass())){ |
|
|
|
//个人小组积分
|
|
|
|
BizPointUserTotalDetailDTO userTotalDetailDTO = bizPointUserTotalDetailService.getDataByObject("party_building", null, |
|
|
|
event.getUserId()); |
|
|
|
Integer userTotal = getUserTotalByObject("party_building", null, event.getUserId()); |
|
|
|
if (null == userTotalDetailDTO) { |
|
|
|
userTotalDetailDTO = new BizPointUserTotalDetailDTO(); |
|
|
|
userTotalDetailDTO.setCustomerId(event.getCustomerId()); |
|
|
|
userTotalDetailDTO.setAgencyId(event.getAgencyId()); |
|
|
|
userTotalDetailDTO.setGridId(event.getGridId()); |
|
|
|
userTotalDetailDTO.setUserId(event.getUserId()); |
|
|
|
userTotalDetailDTO.setBizType("party_building"); |
|
|
|
userTotalDetailDTO.setObjectId(event.getSourceId()); |
|
|
|
userTotalDetailDTO.setTotalPoint(userTotal); |
|
|
|
bizPointUserTotalDetailService.save(userTotalDetailDTO); |
|
|
|
} else { |
|
|
|
userTotalDetailDTO.setTotalPoint(userTotal); |
|
|
|
userTotalDetailDTO.setUpdatedTime(new Date()); |
|
|
|
bizPointUserTotalDetailService.update(userTotalDetailDTO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -507,7 +535,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi |
|
|
|
QueryWrapper<UserPointActionLogEntity> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.select("IFNULL(SUM(POINT), 0) as POINT") |
|
|
|
.eq("BIZ_TYPE", type) |
|
|
|
.eq("OBJECT_ID", objectId) |
|
|
|
.eq(StringUtils.isNotBlank(objectId), "OBJECT_ID", objectId) |
|
|
|
.eq("USER_ID", userId) |
|
|
|
.eq("ACTION_FLAG", "plus") |
|
|
|
.eq("DEL_FLAG", NumConstant.ZERO_STR); |
|
|
@ -579,6 +607,54 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi |
|
|
|
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 党建积分 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @Param formDTO |
|
|
|
* @Return {@link PageData< PartyPointResultDTO >} |
|
|
|
* @Author zhaoqifeng |
|
|
|
* @Date 2022/8/22 16:04 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public PageData<PartyPointResultDTO> pagePartyPoint(PartyPointFormDTO formDTO) { |
|
|
|
if (StringUtils.isNotBlank(formDTO.getQuarter())) { |
|
|
|
if (StringUtils.isNotBlank(formDTO.getMonth())) { |
|
|
|
formDTO.setStartDate(formDTO.getYear().concat(formDTO.getMonth())); |
|
|
|
formDTO.setDateType(NumConstant.TWO_STR); |
|
|
|
} else { |
|
|
|
switch (formDTO.getQuarter()) { |
|
|
|
case NumConstant.ONE_STR: |
|
|
|
formDTO.setStartDate(formDTO.getYear().concat("01")); |
|
|
|
formDTO.setEndDate(formDTO.getYear().concat("03")); |
|
|
|
break; |
|
|
|
case NumConstant.TWO_STR: |
|
|
|
formDTO.setStartDate(formDTO.getYear().concat("04")); |
|
|
|
formDTO.setEndDate(formDTO.getYear().concat("06")); |
|
|
|
break; |
|
|
|
case NumConstant.THREE_STR: |
|
|
|
formDTO.setStartDate(formDTO.getYear().concat("07")); |
|
|
|
formDTO.setEndDate(formDTO.getYear().concat("09")); |
|
|
|
break; |
|
|
|
case NumConstant.FOUR_STR: |
|
|
|
formDTO.setStartDate(formDTO.getYear().concat("10")); |
|
|
|
formDTO.setEndDate(formDTO.getYear().concat("12")); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
formDTO.setDateType(NumConstant.THREE_STR); |
|
|
|
} |
|
|
|
} else if (StringUtils.isNotBlank(formDTO.getMonth())){ |
|
|
|
formDTO.setStartDate(formDTO.getYear().concat(formDTO.getMonth())); |
|
|
|
formDTO.setDateType(NumConstant.TWO_STR); |
|
|
|
} else { |
|
|
|
formDTO.setStartDate(formDTO.getYear()); |
|
|
|
formDTO.setDateType(NumConstant.ONE_STR); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 需求完成,给志愿者发放积分 |
|
|
|
* @param list |
|
|
|