| | |
| | | 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; |
| | |
| | | |
| | | 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.*; |
| | |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Value("${jeecg.path.upload}") |
| | | private String upLoadPath; |
| | | |
| | | |
| | | /** |
| | |
| | | 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导å
¥æ°æ® |
| | |
| | | @Param("sql")String sql |
| | | ); |
| | | List<DailyInspectionStandardDetail> getStandardList(Page<DailyInspectionStandardDetail> page,@Param("mainId") String mainId,@Param("type")String type); |
| | | |
| | | List<Map<String, Object>> exportXlsNew(); |
| | | } |
| | |
| | | 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> |
| | |
| | | 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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |