feat(活动): 月基金每月补发

This commit is contained in:
luying
2023-03-24 19:13:34 +08:00
parent 6ca399c2e8
commit 47a896c0ba
8 changed files with 93 additions and 5 deletions

View File

@@ -5,6 +5,8 @@ import { getMonthlyFundData, getMonthlyFundDataShow } from '../../../services/ac
import { ActivityWeeklyFundModel } from '../../../db/ActivityWeeklyFund';
import { addReward, stringToRewardParam } from '../../../services/activity/giftPackageService';
import { ActivityMonthlyFundModel } from '../../../db/ActivityMonthlyFund';
import { monthlyFundSchedule } from '../../../services/timeTaskService';
import moment = require('moment');
export default function (app: Application) {
@@ -63,6 +65,11 @@ export class MonthlyFundHandler {
let record = await ActivityMonthlyFundModel.sign(serverId, activityId, roleId, playerData.roundIndex, pageIndex, dayIndex, playerData.todayIndex);
if(!record) return resResult(STATUS.ACTIVITY_MONTHLY_FUND_HAS_SIGN);
pageData.setPlayerRecord(record);
if(pageData.hasReceivedAll()) {
await ActivityMonthlyFundModel.setReceivedAll(serverId, activityId, roleId, playerData.roundIndex, pageIndex);
}
let rewardParamArr = stringToRewardParam(signReward.reward);
let { goods, addHeros } = await addReward(roleId, roleName, sid, serverId, rewardParamArr, ITEM_CHANGE_REASON.ACT_MONTHLY_FUND_SIGN);
@@ -70,4 +77,10 @@ export class MonthlyFundHandler {
activityId, dayIndex, pageIndex, goods, addHeros
});
}
async debugSendMonthlyFundReward(msg: {}, session: BackendSession) {
await monthlyFundSchedule(parseInt(moment().format('YYYYMM')));
return resResult(STATUS.SUCCESS);
}
}