| | |
| | | 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.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; |
| | |
| | | * @return 考核结果 |
| | | */ |
| | | @Override |
| | | public List<CheckResultVO> selectCheckResultList(CheckResult checkResult) { |
| | | return checkResultMapper.selectList(null).stream().map( |
| | | item -> { |
| | | CheckResultVO checkResultVO = CheckResultVO.getVoByEntity(item, null); |
| | | checkResultVO.setUnitName(unitService.getById(item.getUnitId()).getUnitName()); |
| | | checkResultVO.setContractName(contractService.getById(item.getContractId()).getName()); |
| | | return checkResultVO; |
| | | } |
| | | ).toList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CheckResult> selectCheckResult(CheckResult checkResult) { |
| | | return checkResultMapper.selectList(null); |
| | | public List<CheckResultVO> selectCheckResultList(CheckResultVO checkResult) { |
| | | return checkResultMapper.selectCheckResultList(checkResult); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public void saveBatchRecord(List<ContractResultRecord> contractResultRecord) { |
| | | // contractResultRecordMapper |
| | | 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(); |
| | | } |
| | | } |