| | |
| | | package com.ycl.platform.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ycl.platform.domain.entity.CheckResult; |
| | | import com.ycl.platform.domain.entity.ContractResultRecord; |
| | | import com.ycl.platform.domain.vo.CheckResultVO; |
| | | import com.ycl.platform.mapper.CheckResultMapper; |
| | | import com.ycl.platform.mapper.ContractResultRecordMapper; |
| | | import com.ycl.platform.service.ICheckResultService; |
| | | import com.ycl.platform.service.ITContractService; |
| | | import com.ycl.platform.service.YwUnitService; |
| | | import com.ycl.utils.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import utils.DateUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 考核结果Service业务层处理 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-04-01 |
| | | */ |
| | | @Service |
| | | public class CheckResultServiceImpl implements ICheckResultService |
| | | { |
| | | public class CheckResultServiceImpl extends ServiceImpl<CheckResultMapper, CheckResult> implements ICheckResultService { |
| | | @Autowired |
| | | private CheckResultMapper checkResultMapper; |
| | | @Autowired |
| | | private ContractResultRecordMapper contractResultRecordMapper; |
| | | @Autowired |
| | | private YwUnitService unitService; |
| | | @Autowired |
| | | private ITContractService contractService; |
| | | |
| | | |
| | | /** |
| | | * 查询考核结果 |
| | | * |
| | | * |
| | | * @param id 考核结果主键 |
| | | * @return 考核结果 |
| | | */ |
| | | @Override |
| | | public CheckResult selectCheckResultById(Long id) |
| | | { |
| | | return checkResultMapper.selectCheckResultById(id); |
| | | public CheckResult selectCheckResultById(Long id) { |
| | | return checkResultMapper.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询考核结果列表 |
| | | * |
| | | * |
| | | * @param checkResult 考核结果 |
| | | * @return 考核结果 |
| | | */ |
| | | @Override |
| | | public List<CheckResult> selectCheckResultList(CheckResult checkResult) |
| | | { |
| | | public List<CheckResultVO> selectCheckResultList(CheckResultVO checkResult) { |
| | | return checkResultMapper.selectCheckResultList(checkResult); |
| | | } |
| | | |
| | | /** |
| | | * 新增考核结果 |
| | | * |
| | | * |
| | | * @param checkResult 考核结果 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertCheckResult(CheckResult checkResult) |
| | | { |
| | | return checkResultMapper.insertCheckResult(checkResult); |
| | | public int insertCheckResult(CheckResult checkResult) { |
| | | return checkResultMapper.insert(checkResult); |
| | | } |
| | | |
| | | /** |
| | | * 修改考核结果 |
| | | * |
| | | * |
| | | * @param checkResult 考核结果 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateCheckResult(CheckResult checkResult) |
| | | { |
| | | public int updateCheckResult(CheckResult checkResult) { |
| | | checkResult.setUpdateTime(DateUtils.getNowDate()); |
| | | return checkResultMapper.updateCheckResult(checkResult); |
| | | return checkResultMapper.updateById(checkResult); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除考核结果 |
| | | * |
| | | * |
| | | * @param ids 需要删除的考核结果主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteCheckResultByIds(Long[] ids) |
| | | { |
| | | return checkResultMapper.deleteCheckResultByIds(ids); |
| | | public int deleteCheckResultByIds(Long[] ids) { |
| | | return checkResultMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 删除考核结果信息 |
| | | * |
| | | * |
| | | * @param id 考核结果主键 |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteCheckResultById(Long id) |
| | | { |
| | | return checkResultMapper.deleteCheckResultById(id); |
| | | public int deleteCheckResultById(Long id) { |
| | | return checkResultMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void saveBatchRecord(List<ContractResultRecord> contractResultRecord) { |
| | | if (!contractResultRecord.isEmpty()) { |
| | | contractResultRecordMapper.saveBatch(contractResultRecord); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ContractResultRecord> selectCheckResultRecordList(Long resultId) { |
| | | return new LambdaQueryChainWrapper<>(contractResultRecordMapper) |
| | | .eq(ContractResultRecord::getResultId, resultId) |
| | | .list(); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean publish(Long id) { |
| | | return new LambdaUpdateChainWrapper<>(checkResultMapper) |
| | | .eq(CheckResult::getId, id) |
| | | .set(CheckResult::getPublish, 1) |
| | | .set(CheckResult::getPublishId, SecurityUtils.getLoginUser().getUserId()) |
| | | .update(); |
| | | } |
| | | } |