|
|
@@ -222,13 +222,12 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public R addIntegralTemplate(FsUserAddIntegralTemplateParam param) {
|
|
|
+ log.info("用户获取积分 param:{}",param);
|
|
|
FsUser user = fsUserMapper.selectFsUserByUserId(param.getUserId());
|
|
|
if (user!=null){
|
|
|
String json =configService.selectConfigByKey("his.integral");
|
|
|
IntegralConfig config= JSONUtil.toBean(json,IntegralConfig.class);
|
|
|
Integer[] integralTypeByOneDay = config.getIntegralTypeByOneDay();
|
|
|
- System.out.println("Types: " + Arrays.toString(integralTypeByOneDay));
|
|
|
- System.out.println("User ID: " + param.getUserId());
|
|
|
|
|
|
//判断是否在限额类型内
|
|
|
if (integralTypeByOneDay != null) {
|
|
|
@@ -242,15 +241,6 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-// if (Arrays.asList(integralTypeByOneDay).contains(param.getLogType())){
|
|
|
-// Integer todayTotalIntegral= fsUserIntegralLogsMapper.selectTodayTotalIntegral(integralTypeByOneDay,param.getUserId());
|
|
|
-// if (todayTotalIntegral==null){
|
|
|
-// todayTotalIntegral=0;
|
|
|
-// }
|
|
|
-// if (todayTotalIntegral>=config.getIntegralByOneDay()){
|
|
|
-// return R.error("当天积分已达限额");
|
|
|
-// }
|
|
|
-// }
|
|
|
Integer integralNum = null;
|
|
|
FsUserIntegralLogTypeEnum logsType = null;
|
|
|
List<FsUserIntegralLogs> integralLogs;
|
|
|
@@ -375,6 +365,14 @@ public class FsUserIntegralLogsServiceImpl implements IFsUserIntegralLogsService
|
|
|
integralNum = param.getPoints() * config.getIntegralSubscriptCourse();
|
|
|
logsType = FsUserIntegralLogTypeEnum.TYPE_24;
|
|
|
break;
|
|
|
+ case 28: // 下载app领取积分
|
|
|
+ integralLogs = fsUserIntegralLogsMapper.selectFsUserIntegralLogsByUserIdAndLogType(param.getUserId(),param.getLogType(), null);
|
|
|
+ if (!integralLogs.isEmpty()){
|
|
|
+ return R.error("已领取过该积分");
|
|
|
+ }
|
|
|
+ integralNum = param.getPoints();
|
|
|
+ logsType = FsUserIntegralLogTypeEnum.TYPE_28;
|
|
|
+ break;
|
|
|
default:
|
|
|
return R.error("积分类型错误,联系管理员");
|
|
|
}
|