| | |
| | | import org.springblade.modules.farm.vo.FarmPaperVO; |
| | | import org.springblade.modules.farm.vo.FarmVO; |
| | | import org.springblade.modules.farm.vo.FarmingRecordVO; |
| | | import org.springblade.modules.lang.entity.Land; |
| | | import org.springblade.modules.lang.service.ILandService; |
| | | import org.springblade.modules.lang.vo.LandVO; |
| | | import org.springblade.modules.recovery.service.RecoveryService; |
| | | import org.springblade.modules.recovery.vo.RecoveryVO; |
| | | import org.springblade.modules.traceability.dto.TraceabilityDTO; |
| | |
| | | |
| | | @Autowired |
| | | private FarmPaperService farmPaperService; |
| | | |
| | | @Autowired |
| | | private ILandService landService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | @Override |
| | | public TraceabilityDetailDTO getTraceabilityDetailInfo(Traceability traceability) { |
| | | TraceabilityDetailDTO dto = new TraceabilityDetailDTO(); |
| | | int count = 0; |
| | | //根据溯源码编号查询溯源信息 |
| | | Traceability traceability1 = baseMapper.selectOne(new QueryWrapper<>(traceability)); |
| | | //1. 查询农产品采收记录信息 |
| | |
| | | //2. 查询相关检测信息 |
| | | List<FarmPaperVO> farmPaperList = farmPaperService.getFarmPaperList(traceability1.getDeptId()); |
| | | //3. 查询产地(地块)信息 |
| | | |
| | | LandVO land = new LandVO(); |
| | | land.setId(Long.parseLong(recoveryVO.getLandId())); |
| | | LandVO landInfo = (LandVO)landService.getLandInfo(land); |
| | | //4. 查询农事记录信息(种植开始起) |
| | | List<FarmingRecordVO> farmingRecordVOList = farmingRecordService.getFarmingRecordByFarmPlantId(recoveryVO); |
| | | //5. 查询企业信息 |
| | |
| | | dto.setFarm(farmVO); |
| | | dto.setRecordVOList(farmingRecordVOList); |
| | | dto.setPaperVOList(farmPaperList); |
| | | dto.setLandVO(landInfo); |
| | | //计算百分比 |
| | | if (null!=recoveryVO){ |
| | | count = count + 20; |
| | | } |
| | | if (null!=farmVO){ |
| | | count = count + 20; |
| | | } |
| | | if (null==landInfo){ |
| | | count = count + 20; |
| | | } |
| | | if (farmingRecordVOList.size()>0){ |
| | | count = count + 20; |
| | | } |
| | | if (farmPaperList.size()>0){ |
| | | count = count + 20; |
| | | } |
| | | dto.setNum(count); |
| | | //返回数据 |
| | | return dto; |
| | | } |