/* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.task.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.common.param.CommonParamSet; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.modules.task.entity.TaskEntity; import org.springblade.modules.task.entity.TaskResidencePermitApplyEntity; import org.springblade.modules.task.service.ITaskSchoolEvenService; import org.springblade.modules.task.service.ITaskService; import org.springblade.modules.task.vo.TaskResidencePermitApplyVO; import org.springblade.modules.task.vo.TaskSchoolEvenVO; import org.springblade.modules.task.entity.TaskSchoolEvenEntity; import org.springblade.modules.task.mapper.TaskSchoolEvenMapper; import org.springblade.core.mp.base.BaseServiceImpl; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; import javax.annotation.Resource; import java.util.Date; /** * 校园事件 服务实现类 * * @author BladeX * @since 2024-04-18 */ @Service public class TaskSchoolEvenServiceImpl extends ServiceImpl implements ITaskSchoolEvenService { @Resource @Lazy private ITaskService taskService; @Override public IPage selectTaskSchoolEvenPage(IPage page, TaskSchoolEvenVO taskSchoolEven) { CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskSchoolEvenVO.class, taskSchoolEven); if (taskSchoolEven.getRoleName() != null && (taskSchoolEven.getRoleName().equals("xyty"))) { taskSchoolEven.setCreateUser(AuthUtil.getUserId()); } return page.setRecords(baseMapper.selectTaskSchoolEvenPage(page, taskSchoolEven, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList())); } @Override public boolean updateSchoolEven(TaskSchoolEvenVO taskSchoolEvenVO) { taskSchoolEvenVO.setConfirmTime(new Date()); taskSchoolEvenVO.setConfirmUserId(AuthUtil.getUserId()); return updateById(taskSchoolEvenVO); } @Override public int schoolEvenCount(TaskSchoolEvenVO taskSchoolEven) { CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskSchoolEvenVO.class, taskSchoolEven); return baseMapper.schoolEvenCount(taskSchoolEven, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), commonParamSet.getGridCodeList()); } @Override public TaskSchoolEvenVO selectTaskSchoolEvenDetail(TaskSchoolEvenVO taskSchoolEven) { return baseMapper.selectTaskSchoolEvenDetail(taskSchoolEven); } }