|
|
@ -161,11 +161,14 @@ public class ActivePointLogServiceImpl extends BaseServiceImpl<ActivePointLogDao |
|
|
|
if (BehaviorEnum.POINTS_SIGN_RULES.getValue().equals(formDTO.getType())) { |
|
|
|
// 获取五天之内签到次数
|
|
|
|
int signCount = baseDao.selectDoubleTimeCount(formDTO); |
|
|
|
if (signCount >= 5) { |
|
|
|
if (signCount >= Integer.parseInt(doubleTime)) { |
|
|
|
// 开启加倍
|
|
|
|
points = Integer.parseInt(points) * 2 + ""; |
|
|
|
} |
|
|
|
} |
|
|
|
if ("0".equals(priod)) { |
|
|
|
priod = "3"; |
|
|
|
} |
|
|
|
// 查询当前用户积分状态 判断是否上线(次数) (上限)
|
|
|
|
Map<String, String> parames = new HashMap<>(); |
|
|
|
parames.put("userId", formDTO.getUserId()); |
|
|
@ -173,36 +176,35 @@ public class ActivePointLogServiceImpl extends BaseServiceImpl<ActivePointLogDao |
|
|
|
parames.put("priod", priod); |
|
|
|
UserPointInfo pointInfo = baseDao.selectByType(parames); |
|
|
|
// 只允许加一次积分 并且 已经加过了
|
|
|
|
if ("0".equals(priod) && pointInfo.getPointTimeCount() != 0) { |
|
|
|
if (pointInfo.getPointTimeCount() >= Integer.parseInt(time) || pointInfo.getPointCount() >= Integer.parseInt(limit)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
//没达到上限可以继续添加积分操作
|
|
|
|
ActivePointLogEntity logEntity = new ActivePointLogEntity(); |
|
|
|
if (pointInfo.getPointCount() < Integer.parseInt(limit) && pointInfo.getPointTimeCount() < Integer.parseInt(time)) { |
|
|
|
// 获取用户真实姓名
|
|
|
|
Result<EpdcUserInfoResultDTO> infoById = userFeignClient.getInfoById(formDTO.getUserId()); |
|
|
|
|
|
|
|
logEntity.setUserId(formDTO.getUserId()); |
|
|
|
logEntity.setOperationType(PointsOperationConstant.OPERATION_ADD); |
|
|
|
logEntity.setPoints(Integer.parseInt(points)); |
|
|
|
logEntity.setOperationCode(operationCode); |
|
|
|
logEntity.setOperationDesc(operationDesc); |
|
|
|
logEntity.setOperationTime(new Date()); |
|
|
|
logEntity.setUserName(infoById.getData().getRealName()); |
|
|
|
|
|
|
|
logEntity.setDeptId(infoById.getData().getGridId()); |
|
|
|
logEntity.setDeptName(infoById.getData().getRealName()); |
|
|
|
logEntity.setParentDeptIds(infoById.getData().getRealName()); |
|
|
|
logEntity.setParentDeptNames(infoById.getData().getRealName()); |
|
|
|
logEntity.setAllDeptIds(infoById.getData().getRealName()); |
|
|
|
logEntity.setAllDeptNames(infoById.getData().getRealName()); |
|
|
|
baseDao.insert(logEntity); |
|
|
|
// 更新用户表积分
|
|
|
|
UserPointsFormDTO userPointsFormDTO = new UserPointsFormDTO(); |
|
|
|
userPointsFormDTO.setPoints(Integer.parseInt(points)); |
|
|
|
userPointsFormDTO.setUserId(formDTO.getUserId()); |
|
|
|
userFeignClient.updataUserPoint(userPointsFormDTO); |
|
|
|
} |
|
|
|
// 获取用户真实姓名
|
|
|
|
Result<EpdcUserInfoResultDTO> infoById = userFeignClient.getInfoById(formDTO.getUserId()); |
|
|
|
|
|
|
|
logEntity.setUserId(formDTO.getUserId()); |
|
|
|
logEntity.setOperationType(PointsOperationConstant.OPERATION_ADD); |
|
|
|
logEntity.setPoints(Integer.parseInt(points)); |
|
|
|
logEntity.setOperationCode(operationCode); |
|
|
|
logEntity.setOperationDesc(operationDesc); |
|
|
|
logEntity.setOperationTime(new Date()); |
|
|
|
logEntity.setUserName(infoById.getData().getRealName()); |
|
|
|
|
|
|
|
logEntity.setDeptId(infoById.getData().getGridId()); |
|
|
|
logEntity.setDeptName(infoById.getData().getGridName()); |
|
|
|
logEntity.setParentDeptIds(infoById.getData().getParentDeptIds()); |
|
|
|
logEntity.setParentDeptNames(infoById.getData().getParentDeptNames()); |
|
|
|
logEntity.setAllDeptIds(infoById.getData().getAllDeptIds()); |
|
|
|
logEntity.setMobile(infoById.getData().getMobile()); |
|
|
|
logEntity.setAllDeptNames(infoById.getData().getAllDeptNames()); |
|
|
|
baseDao.insert(logEntity); |
|
|
|
// 更新用户表积分
|
|
|
|
UserPointsFormDTO userPointsFormDTO = new UserPointsFormDTO(); |
|
|
|
userPointsFormDTO.setPoints(Integer.parseInt(points)); |
|
|
|
userPointsFormDTO.setUserId(formDTO.getUserId()); |
|
|
|
userFeignClient.updataUserPoint(userPointsFormDTO); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|