package com.smartor.service.impl;
|
|
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.RSAPublicKeyExample;
|
import com.smartor.domain.PatReservationRecord;
|
import com.smartor.mapper.PatReservationRecordMapper;
|
import com.smartor.service.IPatReservationRecordService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* 【请填写功能名称】Service业务层处理
|
*
|
* @author lihu
|
* @date 2025-06-24
|
*/
|
@Service
|
public class PatReservationRecordServiceImpl implements IPatReservationRecordService {
|
@Autowired
|
private PatReservationRecordMapper patReservationRecordMapper;
|
|
@Autowired
|
private RSAPublicKeyExample rsaPublicKeyExample;
|
|
|
@Value("${pri_key}")
|
private String pri_key;
|
|
/**
|
* 查询【请填写功能名称】
|
*
|
* @param id 【请填写功能名称】主键
|
* @return 【请填写功能名称】
|
*/
|
@Override
|
public PatReservationRecord selectPatReservationRecordById(Long id) {
|
return patReservationRecordMapper.selectPatReservationRecordById(id);
|
}
|
|
/**
|
* 查询【请填写功能名称】列表
|
*
|
* @param patReservationRecord 【请填写功能名称】
|
* @return 【请填写功能名称】
|
*/
|
@Override
|
public List<PatReservationRecord> selectPatReservationRecordList(PatReservationRecord patReservationRecord) {
|
return patReservationRecordMapper.selectPatReservationRecordList(patReservationRecord);
|
}
|
|
/**
|
* 新增【请填写功能名称】
|
*
|
* @param patReservationRecord 【请填写功能名称】
|
* @return 结果
|
*/
|
@Override
|
public int insertPatReservationRecord(PatReservationRecord patReservationRecord) {
|
patReservationRecord.setCreateTime(DateUtils.getNowDate());
|
return patReservationRecordMapper.insertPatReservationRecord(patReservationRecord);
|
}
|
|
/**
|
* 修改【请填写功能名称】
|
*
|
* @param patReservationRecord 【请填写功能名称】
|
* @return 结果
|
*/
|
@Override
|
public int updatePatReservationRecord(PatReservationRecord patReservationRecord) {
|
patReservationRecord.setUpdateTime(DateUtils.getNowDate());
|
return patReservationRecordMapper.updatePatReservationRecord(patReservationRecord);
|
}
|
|
/**
|
* 批量删除【请填写功能名称】
|
*
|
* @param ids 需要删除的【请填写功能名称】主键
|
* @return 结果
|
*/
|
@Override
|
public int deletePatReservationRecordByIds(Long[] ids) {
|
return patReservationRecordMapper.deletePatReservationRecordByIds(ids);
|
}
|
|
/**
|
* 删除【请填写功能名称】信息
|
*
|
* @param id 【请填写功能名称】主键
|
* @return 结果
|
*/
|
@Override
|
public int deletePatReservationRecordById(Long id) {
|
return patReservationRecordMapper.deletePatReservationRecordById(id);
|
}
|
|
|
/**
|
* 判断 允许预约人数 与 实际预约人数 是否相等
|
*
|
* @return
|
*/
|
@Override
|
public Boolean existsEqualNum(String optionId) {
|
Long opid = Long.valueOf(rsaPublicKeyExample.decryptedData(optionId, pri_key));
|
return patReservationRecordMapper.existsEqualNum(opid);
|
}
|
}
|