qushaowei
2025-06-04 c1eb0a70dd3362ea94e1b9507e832751ce3ac348
设备台账导出
已添加1个文件
已修改5个文件
267 ■■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/EquipmentExportVo.java 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java
@@ -22,6 +22,7 @@
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.base.entity.Constructor;
import org.jeecg.modules.base.service.IConstructorService;
import org.jeecg.modules.base.service.IFactoryModelService;
@@ -37,13 +38,18 @@
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.eam.vo.EquipmentExportVo;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@@ -130,6 +136,9 @@
     @Autowired
     private ISysUserService sysUserService;
     @Value("${jeecg.path.upload}")
     private String upLoadPath;
    /**
@@ -561,6 +570,43 @@
    public ModelAndView exportXls(HttpServletRequest request, Equipment equipment) {
        return super.exportXls(request, equipment, Equipment.class, "设备台账导出");
    }
     /**
      * å¯¼å‡ºexcel
      *
      * @param request
      * @param equipment
      */
     //@RequiresPermissions("org.jeecg.modules.demo:mom_eam_equipment:exportXls")
     @RequestMapping(value = "/exportXlsNew")
     public ModelAndView exportXlsNew(HttpServletRequest request, Equipment equipment) {
         // Step.1 ç»„装查询条件
//         QueryWrapper<T> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         // è¿‡æ»¤é€‰ä¸­æ•°æ®
//         String selections = request.getParameter("selections");
//         if (oConvertUtils.isNotEmpty(selections)) {
//             List<String> selectionList = Arrays.asList(selections.split(","));
//             queryWrapper.in("id",selectionList);
//         }
//         // Step.2 èŽ·å–å¯¼å‡ºæ•°æ®
//         List<T> exportList = service.list(queryWrapper);
         List<Map<String, Object>> mapList = equipmentService.exportXlsNew();
         // Step.3 AutoPoi å¯¼å‡ºExcel
         ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
         //此处设置的filename无效 ,前端会重更新设置一下
         mv.addObject(NormalExcelConstants.FILE_NAME, "设备台账导出");
         mv.addObject(NormalExcelConstants.CLASS, EquipmentExportVo.class);
         //update-begin--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
         ExportParams exportParams=new ExportParams("设备台账导出" + "报表", "导出人:" + sysUser.getRealname(), "设备台账导出");
         exportParams.setImageBasePath(upLoadPath);
         //update-end--Author:liusq  Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
         mv.addObject(NormalExcelConstants.PARAMS,exportParams);
         mv.addObject(NormalExcelConstants.DATA_LIST, mapList);
         return mv;
     }
//    /**
//      * é€šè¿‡excel导入数据
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/EamEquipmentMapper.java
@@ -113,4 +113,6 @@
                                        @Param("sql")String sql
    );
    List<DailyInspectionStandardDetail>  getStandardList(Page<DailyInspectionStandardDetail> page,@Param("mainId") String mainId,@Param("type")String type);
    List<Map<String, Object>> exportXlsNew();
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamEquipmentMapper.xml
@@ -588,4 +588,70 @@
        ORDER BY t1.create_time desc
    </select>
    <select id="exportXlsNew"  parameterType="Map" resultType="map">
        SELECT
            t1.num,
            t1.name,
            t2.depart_name AS useDepart,
            t2.depart_name AS manageDepart,
            t4.name as workCenter,
            t5.name as factoryModel,
            t6.name as area,
            t7.name as teamName,
            t8.name as equipmentCategoryName,
            t9.item_text as equipmentStatus,
            t10.item_text as technologyStatus,
            t1.equipment_importance_id as abc,
            t11.item_text as specificEquipment,
            t1.security_configuration as securityConfiguration,
            t12.item_text as coolingSystem,
            t1.fire_extinguisher as fireExtinguisher,
            t1.fire_extinguisher_validity_period as fireExtinguisherValidityPeriod,
            t13.item_text as operatingSystem,
            t1.system,
            t1.port,
            t1.coordinate_num as coordinateNum,
            t1.equipment_uda3 as equipmentUda3,
            t1.equipment_uda4 as equipmentUda4,
            t1.equipment_Uda5 as equipmentUda5,
            t1.location,
            CONVERT(VARCHAR(10), t1.leave_factory_date, 120) as leaveFactoryDate,
            t1.project_approval_no as projectApprovalNo,
            t1.fund_source as fundSource,
            CONVERT(VARCHAR(10), t1.acceptance_check_date, 120) as acceptanceCheckDate,
            t1.factory_number as factoryNumber,
            t15.name as constructor,
            t1.source_country as sourceCountry,
            t1.model as equipmentModel,
            t1.specification as equpmentSspecification,
            t1.gpo,
            t1.warranty_start as warrantyStart,
            t1.warranty_end as warrantyEnd,
            t14.item_text as propertyStatus,
            CONVERT(VARCHAR(10), t1.third_maintenance_time, 120) as thirdMaintenanceTime,
            CONVERT(VARCHAR(10), t1.next_technology_status_qualification_time, 120) as nextTechnologyStatusQualificationTime,
            t1.create_by as createBy,
            CONVERT(VARCHAR(10), t1.create_time, 120) as createTime,
            t1.update_by as updateBy,
            CONVERT(VARCHAR(10), t1.update_time, 120) as updateTime
        FROM
            mom_eam_equipment t1
                LEFT JOIN sys_depart t2 ON t1.use_id = t2.id
                left join sys_depart t3 on t1.manage_id = t3.id
                left join mom_base_area t4 on t1.work_center_id = t4.id
                left join mom_base_area t5 on t1.factory_model_id = t5.id
                left join mom_base_area t6 on t1.area_id = t6.id
                left join mom_base_team t7 on t1.team_id = t7.id
                left join mom_eam_equipment_category t8 on t1.equipment_category_id = t8.id
                left join (SELECT * FROM v_sys_dict WHERE dict_code = 'equipment_status')  t9 on t1.equipment_status = t9.item_value
                left join (SELECT * FROM v_sys_dict WHERE dict_code = 'technology_status') t10 on t1.technology_status =t10.item_value
                left join (SELECT * FROM v_sys_dict WHERE dict_code = 'specific_equipment') t11 on t1.specific_equipment = t11.item_value
                left join (SELECT * FROM v_sys_dict WHERE dict_code = 'cooling_system') t12 on t1.cooling_system = t12.item_value
                left join (SELECT * FROM v_sys_dict WHERE dict_code = 'operation_flag') t13 on t1.operating_system = t13.item_value
                left join (SELECT * FROM v_sys_dict WHERE dict_code = 'property_status') t14 on t1.property_status = t14.item_value
                left join mom_base_constructor t15 on t1.constructor_id = t15.id
        where t1.del_flag = '0' ORDER BY t1.create_time DESC
    </select>
</mapper>
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentService.java
@@ -66,4 +66,6 @@
    IPage<DailyInspectionStandardDetail>  getStandardList(Page<DailyInspectionStandardDetail> page, String mainId,String type);
    IPage<Map<String, Object>> getEquipmentListAllStandard(Integer pageNo, Integer pageSize, Map<String, Object> params);
    List<Map<String, Object>> exportXlsNew();
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
@@ -195,4 +195,9 @@
        IPage<Map> pageData = new Page<Map>(pageNo, pageSize);
        return super.getBaseMapper().getEquipmentListAllStandard(pageData,params);
    }
    @Override
    public List<Map<String, Object>> exportXlsNew() {
        return super.getBaseMapper().exportXlsNew();
    }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/vo/EquipmentExportVo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,146 @@
package org.jeecg.modules.eam.vo;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class EquipmentExportVo {
    @Excel(name = "统一编码", width = 15)
    private String num;
    @Excel(name = "设备名称", width = 15)
    private String name;
    @Excel(name = "使用部门", width = 15)
    private String useDepart;
    @Excel(name = "维护部门", width = 15)
    private String manageDepart;
    @Excel(name = "中心", width = 15)
    private String workCenter;
    @Excel(name = "工区", width = 15)
    private String factoryModel;
    @Excel(name = "工段", width = 15)
    private String area;
    @Excel(name = "维修班组", width = 15)
    private String teamName;
    @Excel(name = "设备所属分类", width = 15)
    private String equipmentCategoryName;
    @Excel(name = "设备状态", width = 15)
    private String equipmentStatus;
    @Excel(name = "技术状态", width = 15)
    private String technologyStatus;
    @Excel(name = "ABC标识", width = 15)
    private String abc;
    @Excel(name = "关键设备标识", width = 15)
    private String specificEquipment;
    @Excel(name = "安全配置", width = 15)
    private String securityConfiguration;
    @Excel(name = "冷却系统", width = 15)
    private String coolingSystem;
    @Excel(name = "灭火器", width = 15)
    private String fireExtinguisher;
    @Excel(name = "灭火器有效期", width = 15)
    private String fireExtinguisherValidityPeriod;
    @Excel(name = "操作系统", width = 15)
    private String operatingSystem;
    @Excel(name = "系统", width = 15)
    private String system;
    @Excel(name = "设备端口", width = 15)
    private String port;
    @Excel(name = "坐标数量", width = 15)
    private String coordinateNum;
    @Excel(name = "重量", width = 15)
    private String equipmentUda3;
    @Excel(name = "重量计量单位", width = 15)
    private String equipmentUda4;
    @Excel(name = "功能位置", width = 15)
    private String equipmentUda5;
    @Excel(name = "安装位置", width = 15)
    private String location;
    @Excel(name = "出厂日期", width = 15)
    private String leaveFactoryDate;
    @Excel(name = "立项卡号", width = 15)
    private String projectApprovalNo;
    @Excel(name = "资金来源", width = 15)
    private String fundSource;
    @Excel(name = "验收日期", width = 15)
    private String acceptanceCheckDate;
    @Excel(name = "出厂编号", width = 15)
    private String factoryNumber;
    @Excel(name = "资产制造商", width = 15)
    private String constructor;
    @Excel(name = "资产来源国家", width = 15)
    private String sourceCountry;
    @Excel(name = "型号", width = 15)
    private String equipmentModel;
    @Excel(name = "设备规格", width = 15)
    private String equpmentSspecification;
    @Excel(name = "总功率", width = 15)
    private String gpo;
    @Excel(name = "质保开始日期", width = 15)
    private String warrantyStart;
    @Excel(name = "质保结束日期", width = 15)
    private String warrantyEnd;
    @Excel(name = "资产状态", width = 15)
    private String propertyStatus;
    @Excel(name = "三保日期", width = 20)
    private String thirdMaintenanceTime;
    @Excel(name = "技术状态鉴定日期", width = 20)
    private String nextTechnologyStatusQualificationTime;
    @Excel(name = "创建人", width = 15)
    private String createBy;
    @Excel(name = "创建时间", width = 15)
    private String createTime;
    @Excel(name = "更新人", width = 15)
    private String updateBy;
    @Excel(name = "更新时间", width = 15)
    private String updateTime;
}