Commit 42cd994b authored by 高建强's avatar 高建强

item:解决移动端巡检离线模式问题appDownloadDatas

parent 28decfa2
...@@ -4,6 +4,7 @@ import com.yeejoin.equipmanage.common.entity.*; ...@@ -4,6 +4,7 @@ import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.vo.BuildingTreeVo; import com.yeejoin.equipmanage.common.vo.BuildingTreeVo;
import lombok.Data; import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -18,47 +19,47 @@ public class AppDownloadVO { ...@@ -18,47 +19,47 @@ public class AppDownloadVO {
/** /**
* 装备 * 装备
*/ */
private List<DownloadEquipmentDataVO> downloadEquipmentDatas; private List<DownloadEquipmentDataVO> downloadEquipmentDatas = new ArrayList<>();
/** /**
* 车辆 * 车辆
*/ */
private List<Car> downloadCarDatas; private List<Car> downloadCarDatas = new ArrayList<>();
/** /**
* 建筑 * 建筑
*/ */
private List<BuildingTreeVo> buildTree; private List<BuildingTreeVo> buildTree = new ArrayList<>();
/** /**
*设备对应性能指标 *设备对应性能指标
*/ */
private List<EquipmentSpecificIndex> equipmentSpecificIndexs; private List<EquipmentSpecificIndex> equipmentSpecificIndexs = new ArrayList<>();
/** /**
*性能指标模板 *性能指标模板
*/ */
private List<EquipmentIndex> equipmentIndex; private List<EquipmentIndex> equipmentIndex = new ArrayList<>();
/** /**
*货位 *货位
*/ */
private List<WarehouseStructure> warehouseStructure; private List<WarehouseStructure> warehouseStructure = new ArrayList<>();
/** /**
* 车载装备 * 车载装备
*/ */
private List<EquipmentOnCar> equipmentOnCar; private List<EquipmentOnCar> equipmentOnCar = new ArrayList<>();
/** /**
* 车载灭火药剂 * 车载灭火药剂
*/ */
private List<ExtinguishantOnCar> extinguishantOnCar; private List<ExtinguishantOnCar> extinguishantOnCar = new ArrayList<>();
/** /**
*报废原因 *报废原因
*/ */
private List<SystemDic> reason; private List<SystemDic> reason = new ArrayList<>();
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.equipmanage.common.entity.FormGroup; import com.yeejoin.equipmanage.common.entity.FormGroup;
import com.yeejoin.equipmanage.common.entity.SystemDic; import com.yeejoin.equipmanage.common.entity.SystemDic;
import com.yeejoin.equipmanage.common.entity.vo.AppDownloadVO; import com.yeejoin.equipmanage.common.entity.vo.AppDownloadVO;
import com.yeejoin.equipmanage.common.enums.GroupCodeEnum; import com.yeejoin.equipmanage.common.enums.GroupCodeEnum;
import com.yeejoin.equipmanage.common.utils.FileUploadFactory;
import com.yeejoin.equipmanage.common.utils.FileUploadTypeEnum;
import com.yeejoin.equipmanage.common.utils.ImportFile;
import com.yeejoin.equipmanage.common.vo.BuildingTreeVo; import com.yeejoin.equipmanage.common.vo.BuildingTreeVo;
import com.yeejoin.equipmanage.mapper.EquipmentMapper; import com.yeejoin.equipmanage.mapper.EquipmentMapper;
import com.yeejoin.equipmanage.mapper.ExtinguishantOnCarMapper;
import com.yeejoin.equipmanage.service.*; import com.yeejoin.equipmanage.service.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.yeejoin.equipmanage.common.utils.FileUploadFactory;
import com.yeejoin.equipmanage.common.utils.FileUploadTypeEnum;
import com.yeejoin.equipmanage.common.utils.ImportFile;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Service @Service
public class DownloadFileService implements IDownloadFileService { public class DownloadFileService implements IDownloadFileService {
@Autowired @Autowired
@Lazy @Lazy
private FileUploadFactory factory; private FileUploadFactory factory;
@Autowired @Autowired
private IFormInstanceService iFormInstanceService; private IFormInstanceService iFormInstanceService;
@Autowired @Autowired
private IFormGroupService iFormGroupService; private IFormGroupService iFormGroupService;
@Autowired @Autowired
private ICarService carService; private ICarService carService;
@Autowired @Autowired
private EquipmentMapper equipmentMapper; private EquipmentMapper equipmentMapper;
@Autowired @Autowired
private IExtinguishantOnCarService extinguishantOnCarService; private IExtinguishantOnCarService extinguishantOnCarService;
@Autowired @Autowired
private IEquipmentIndexService equipmentIndexService; private IEquipmentIndexService equipmentIndexService;
@Autowired @Autowired
private IEquipmentSpecificIndexSerivce equipmentSpecificIndexSerivce; private IEquipmentSpecificIndexSerivce equipmentSpecificIndexSerivce;
@Autowired @Autowired
private IWarehouseStructureService warehouseStructureService; private IWarehouseStructureService warehouseStructureService;
@Autowired @Autowired
private ISystemDicService systemDicService; private ISystemDicService systemDicService;
@Autowired @Autowired
private IEquipmentOnCarService equipmentOnCarService; private IEquipmentOnCarService equipmentOnCarService;
@Resource(name = "fileUploadFactory") @Resource(name = "fileUploadFactory")
public void setFactory(FileUploadFactory factory) { public void setFactory(FileUploadFactory factory) {
this.factory = factory; this.factory = factory;
} }
@Override
public HSSFWorkbook DownloadFile(String type) { @Override
ImportFile up = factory.create(FileUploadTypeEnum.getEnum(type)); public HSSFWorkbook DownloadFile(String type) {
HSSFWorkbook workbook =(HSSFWorkbook) up.downloadImportFile(); ImportFile up = factory.create(FileUploadTypeEnum.getEnum(type));
return workbook; HSSFWorkbook workbook = (HSSFWorkbook) up.downloadImportFile();
} return workbook;
}
@Override
public AppDownloadVO appDownloadDatas() { @Override
AppDownloadVO appDownload = new AppDownloadVO(); public AppDownloadVO appDownloadDatas() {
AppDownloadVO appDownload = new AppDownloadVO();
//建筑信息
FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode()); //建筑信息
List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null); FormGroup formGroup = iFormGroupService.getByUniqueKey(GroupCodeEnum.ALL_BUILDING.getGroupCode());
List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList); List<Map<String, Object>> allList = iFormInstanceService.getSpecialChildrenList(null);
appDownload.setBuildTree(allListVo); List<BuildingTreeVo> allListVo = buildBuildingData(formGroup, allList);
appDownload.setBuildTree(allListVo);
//车辆信息
appDownload.setDownloadCarDatas(carService.list()); //车辆信息
appDownload.setDownloadCarDatas(carService.list());
//装备信息
appDownload.setDownloadEquipmentDatas(equipmentMapper.getDownloadEquipmentData()); //装备信息
//性能指标模板 // appDownload.setDownloadEquipmentDatas(equipmentMapper.getDownloadEquipmentData());
appDownload.setEquipmentIndex(equipmentIndexService.list()); //
// //性能指标模板
//性能指标 // appDownload.setEquipmentIndex(equipmentIndexService.list(queryWrapper1));
appDownload.setEquipmentSpecificIndexs(equipmentSpecificIndexSerivce.list()); //
// //性能指标
//仓库 // appDownload.setEquipmentSpecificIndexs(equipmentSpecificIndexSerivce.list(queryWrapper));
appDownload.setWarehouseStructure(warehouseStructureService.list());
//仓库
//车载装备 appDownload.setWarehouseStructure(warehouseStructureService.list());
appDownload.setEquipmentOnCar(equipmentOnCarService.list());
//车载装备
//车载灭火药剂 appDownload.setEquipmentOnCar(equipmentOnCarService.list());
appDownload.setExtinguishantOnCar(extinguishantOnCarService.list());
//车载灭火药剂
//报废原因 appDownload.setExtinguishantOnCar(extinguishantOnCarService.list());
appDownload.setReason(systemDicService.list(new QueryWrapper<SystemDic>().eq("type", "ScrapReason")));
//报废原因
return appDownload; appDownload.setReason(systemDicService.list(new QueryWrapper<SystemDic>().eq("type", "ScrapReason")));
}
return appDownload;
/** }
* 建筑树数据处理
* @param formGroup /**
* @param allList * 建筑树数据处理
* @return *
*/ * @param formGroup
private List<BuildingTreeVo> buildBuildingData(FormGroup formGroup, List<Map<String, Object>> allList) { * @param allList
List<BuildingTreeVo> allListVo = Bean.listMap2ListBean(allList, BuildingTreeVo.class); * @return
BuildingTreeVo treeNode = new BuildingTreeVo(); */
treeNode.setInstanceId(formGroup.getId()); private List<BuildingTreeVo> buildBuildingData(FormGroup formGroup, List<Map<String, Object>> allList) {
treeNode.setInstanceName(formGroup.getGroupName()); List<BuildingTreeVo> allListVo = Bean.listMap2ListBean(allList, BuildingTreeVo.class);
treeNode.setParentId("-1"); BuildingTreeVo treeNode = new BuildingTreeVo();
treeNode.setGroupType(formGroup.getGroupType()); treeNode.setInstanceId(formGroup.getId());
treeNode.setGroupCode(formGroup.getGroupCode()); treeNode.setInstanceName(formGroup.getGroupName());
allListVo.add(treeNode); treeNode.setParentId("-1");
return allListVo; treeNode.setGroupType(formGroup.getGroupType());
} treeNode.setGroupCode(formGroup.getGroupCode());
allListVo.add(treeNode);
return allListVo;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment