| | |
| | | |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import utils.DateUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @date 2024-04-01 |
| | | */ |
| | | @Service |
| | | public class CheckResultServiceImpl extends ServiceImpl<CheckResultMapper, CheckResult> 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; |
| | | |
| | | |
| | | /** |
| | | * 查询考核结果 |
| | |
| | | * @return 考核结果 |
| | | */ |
| | | @Override |
| | | public CheckResult selectCheckResultById(Long id) |
| | | { |
| | | return checkResultMapper.selectCheckResultById(id); |
| | | public CheckResult selectCheckResultById(Long id) { |
| | | return checkResultMapper.selectById(id); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 考核结果 |
| | | */ |
| | | @Override |
| | | public List<CheckResult> selectCheckResultList(CheckResult checkResult) |
| | | { |
| | | return checkResultMapper.selectCheckResultList(checkResult); |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertCheckResult(CheckResult checkResult) |
| | | { |
| | | return checkResultMapper.insertCheckResult(checkResult); |
| | | public int insertCheckResult(CheckResult checkResult) { |
| | | return checkResultMapper.insert(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); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteCheckResultByIds(Long[] ids) |
| | | { |
| | | return checkResultMapper.deleteCheckResultByIds(ids); |
| | | public int deleteCheckResultByIds(Long[] ids) { |
| | | return checkResultMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @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) { |
| | | // contractResultRecordMapper |
| | | } |
| | | } |