1、优化配置文件;
2、优化ID生成器代码;
3、修改注释;
4、修改权限初始化时算法;
5、导出Excel文件功能归为一个新类;
6、工站数据库存入验空修改;
| | |
| | | invocation.getArgs()[PARAMETER_INDEX] = entity; |
| | | }else if(entity instanceof Map){ |
| | | try { |
| | | ((List)((Map<?, ?>) entity).get("list")).forEach(e -> { |
| | | if (e instanceof BaseEntity) { |
| | | Class<?> entityClass = e.getClass(); |
| | | Method setIdMt = null ; |
| | | try{ |
| | | setIdMt = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME, Long.class) ; |
| | | if(setIdMt != null){ |
| | | setIdMt.invoke(e, new IDLongGenerator().generate()); |
| | | Map<?, ?> map = (Map)entity; |
| | | List list = (List)map.get("list") ; |
| | | if(list != null && list.size() > 0){ |
| | | IDLongGenerator idg = new IDLongGenerator() ; |
| | | list.forEach(e -> { |
| | | if (e instanceof BaseEntity) { |
| | | Class<?> entityClass = e.getClass(); |
| | | Method setIdMt = null ; |
| | | try{ |
| | | setIdMt = entityClass.getMethod(BASE_FIELD_SET_PRIMARY_KEY_FUNTION_NAME, Long.class) ; |
| | | if(setIdMt != null){ |
| | | setIdMt.invoke(e, idg.generate()); |
| | | } |
| | | }catch (Exception e1){ |
| | | //当entityClass没有setId方法时,会抛出异常 |
| | | } |
| | | }catch (Exception e1){ |
| | | //当entityClass没有setId方法时,会抛出异常 |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检查元素是否存在 |
| | | * 得到元素 |
| | | * @param doc doc对象 |
| | | * @param elementName 元素名称 |
| | | * @return 返回结果 返回结果 |
| | |
| | | * @param roleId 用户ID |
| | | * @return List<Integer> |
| | | */ |
| | | List<Integer> selectPrivilegeByRoleId(@Param("roleId") Long roleId) ; |
| | | Long selectPrivilegeByRoleId(@Param("roleId") Long roleId) ; |
| | | |
| | | |
| | | int insert(BaPrivilege record); |
| | |
| | | int updateByPrimaryKey(BaPrivilege record); |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int deleteAll(); |
| | | } |
New file |
| | |
| | | package com.dy.pmsGlobal.util; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.converters.Converter; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.net.URLEncoder; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: liurunyu |
| | | * @Date: 2025/5/21 13:50 |
| | | * @Description |
| | | */ |
| | | @Slf4j |
| | | public class ExportExcelUtil { |
| | | |
| | | public static void downloadExcel(HttpServletResponse response, String fileName, String sheetName, List<Converter> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return; |
| | | } |
| | | try{ |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName).doWrite(list); |
| | | }catch (Exception e){ |
| | | log.error("导出{}异常", sheetName, e); |
| | | } |
| | | } |
| | | public static void downloadExcelSheets(HttpServletResponse response, String fileName, String sheetName, List<Converter> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return; |
| | | } |
| | | /*try(ExcelWriter excelWriter = EasyExcel.write(file).build()) { |
| | | WriteSheet writeSheet; |
| | | for (SheetInfoBean bean : sheetInfoList) { |
| | | // 构建sheet对象 |
| | | writeSheet = EasyExcel.writerSheet(bean.getSheetName()).head(bean.getHeadClass()).build(); |
| | | // 写出sheet数据 |
| | | excelWriter.write(bean.getDataList(), writeSheet); |
| | | } |
| | | // 关流 |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | // do something you want |
| | | }*/ |
| | | try{ |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName).doWrite(list); |
| | | }catch (Exception e){ |
| | | log.error("导出{}异常",sheetName,e); |
| | | } |
| | | } |
| | | } |
| | |
| | | return ""; |
| | | } |
| | | |
| | | public static void downloadExcel(HttpServletResponse response, String fileName, String sheetName, List<Converter> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return; |
| | | } |
| | | try{ |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName).doWrite(list); |
| | | }catch (Exception e){ |
| | | log.error("导出{}异常",sheetName,e); |
| | | } |
| | | } |
| | | public static void downloadExcelSheets(HttpServletResponse response, String fileName, String sheetName, List<Converter> list){ |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | return; |
| | | } |
| | | /*try(ExcelWriter excelWriter = EasyExcel.write(file).build()) { |
| | | WriteSheet writeSheet; |
| | | for (SheetInfoBean bean : sheetInfoList) { |
| | | // 构建sheet对象 |
| | | writeSheet = EasyExcel.writerSheet(bean.getSheetName()).head(bean.getHeadClass()).build(); |
| | | // 写出sheet数据 |
| | | excelWriter.write(bean.getDataList(), writeSheet); |
| | | } |
| | | // 关流 |
| | | excelWriter.finish(); |
| | | } catch (Exception e) { |
| | | // do something you want |
| | | }*/ |
| | | try{ |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | EasyExcel.write(response.getOutputStream(), list.get(0).getClass()).sheet(sheetName).doWrite(list); |
| | | }catch (Exception e){ |
| | | log.error("导出{}异常",sheetName,e); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | #云服务203: D:/apps/pms/nginx-1.24.0/html/webfiles/ |
| | | webFileAbsolutePath: D:/apps/pms/nginx-1.24.0/html/webfiles/ |
| | | #输出sql日志开关,控制PrintSqlInterceptor拦截器是否加载 |
| | | showSqlLog: false |
| | | showSqlLog: true |
| | | #是否开发阶段,true或false,开发阶段不进行登录验证及权限验证 |
| | | isDev: false |
| | | spring: |
| | |
| | | |
| | | #web分布式文件系统 |
| | | dy: |
| | | webFileAbsolutePath: E:/java/nginx-1.24.0/html/webfiles/ |
| | | webFileAbsolutePath: ${pmsGl.webFileAbsolutePath} |
| | | photoZipWidth: 400 #缩略图尺寸 |
| | | webFile: |
| | | fmUrl: http://127.0.0.1:${pms.other.webPort}/other # fm的web上下文 URL |
| | |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteAll"> |
| | | <!--@mbg.generated--> |
| | | delete from ba_privilege |
| | | </delete> |
| | | |
| | | <select id="selectByIds" parameterType="arraylist" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | |
| | | <if test="id != null"> |
| | | id, |
| | | </if> |
| | | <if test="code != null and code !=''"> |
| | | <if test="code != null"> |
| | | `code`, |
| | | </if> |
| | | <if test="name != null and name !=''"> |
| | | <if test="name != null"> |
| | | `name`, |
| | | </if> |
| | | <if test="type != null and type !=''"> |
| | | <if test="type != null"> |
| | | `type`, |
| | | </if> |
| | | <if test="image!= null and image !=''"> |
| | | <if test="image!= null"> |
| | | image, |
| | | </if> |
| | | <if test="director != null and director !=''"> |
| | | <if test="director != null"> |
| | | director, |
| | | </if> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | <if test="dMobile != null"> |
| | | d_mobile, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="dt != null"> |
| | | dt, |
| | | </if> |
| | | <if test="remark != null and remark !=''"> |
| | | <if test="remark != null"> |
| | | remark, |
| | | </if> |
| | | </trim> |
| | |
| | | <if test="id != null"> |
| | | #{id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="code != null and code !=''"> |
| | | <if test="code != null"> |
| | | #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="name != null and name !=''"> |
| | | <if test="name != null"> |
| | | #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null and type !=''"> |
| | | <if test="type != null"> |
| | | #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="image!= null and image !=''"> |
| | | <if test="image!= null"> |
| | | #{image,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="director != null and director !=''"> |
| | | <if test="director != null"> |
| | | #{director,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | <if test="dMobile != null"> |
| | | #{dMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | |
| | | <if test="dt != null"> |
| | | #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remark != null and remark !=''"> |
| | | <if test="remark != null"> |
| | | #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </trim> |
| | |
| | | <!--@mbg.generated--> |
| | | update plt_product |
| | | <set> |
| | | <if test="name != null and name !=''"> |
| | | <if test="name != null"> |
| | | `name` = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="type != null and type !=''"> |
| | | <if test="type != null"> |
| | | `type` = #{type,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="image!= null and image !=''"> |
| | | <if test="image!= null"> |
| | | image = #{image,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="director != null and director !=''"> |
| | | <if test="director != null"> |
| | | director = #{director,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="dMobile != null and dMobile !=''"> |
| | | <if test="dMobile != null"> |
| | | d_mobile = #{dMobile,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="dt != null"> |
| | | dt = #{dt,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="remark != null and remark !=''"> |
| | | <if test="remark != null"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="lineId != null">line_id,</if> |
| | | <if test="code != null and code !=''">code,</if> |
| | | <if test="name != null and name !=''">name,</if> |
| | | <if test="remark != null and remark !=''">remark,</if> |
| | | <if test="code != null">code,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="disabled != null">disabled,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="lineId != null">#{lineId,jdbcType=VARCHAR},</if> |
| | | <if test="code != null and code !=''">#{code,jdbcType=VARCHAR},</if> |
| | | <if test="name != null and name !=''">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="code != null">#{code,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | </trim> |
| | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltStation"> |
| | | update plt_station |
| | | <set> |
| | | <if test="code != null and code !=''"> |
| | | <if test="code != null"> |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="lineId != null"> |
| | | line_id = #{lineId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="name != null and name !=''"> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null and remark !=''"> |
| | | <if test="remark != null"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.util.ExportExcelUtil; |
| | | import com.dy.pmsGlobal.util.QrCodeConstant; |
| | | import com.dy.pmsGlobal.util.QrCodeUtil; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | vo.image = QrCodeUtil.genQrCode(vo.code); |
| | | list.add(vo) ; |
| | | } |
| | | QrCodeUtil.downloadExcel(response, fileName, sheetName, list); |
| | | ExportExcelUtil.downloadExcel(response, fileName, sheetName, list); |
| | | } |
| | | } |
| | |
| | | package com.dy.pmsBase.util; |
| | | |
| | | import com.dy.common.util.ConfigXml; |
| | | import com.dy.common.util.MD5; |
| | | import com.dy.common.util.NumUtil; |
| | | import com.dy.common.webListener.ConfigListener; |
| | | import com.dy.pmsGlobal.daoBa.BaPrivilegeMapper; |
| | | import com.dy.pmsGlobal.daoBa.BaPrivilegeMapper; |
| | | import com.dy.pmsGlobal.pojoBa.BaPrivilege; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import org.jdom2.Document; |
| | | import org.jdom2.Element; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | /* |
| | | if(!this.existPrivileges()){ |
| | | this.init(event); |
| | | } |
| | | */ |
| | | this.init(event); |
| | | } |
| | | } |
| | | |
| | |
| | | if(prs != null){ |
| | | List<Element> list = prs.getChildren() ; |
| | | if(list != null){ |
| | | for(Element ele : list){ |
| | | String num = ele.getAttributeValue("num") ; |
| | | String name = ele.getAttributeValue("name") ; |
| | | String type = ele.getAttributeValue("type") ; |
| | | String typeName = ele.getAttributeValue("typeName") ; |
| | | this.savePrivilege(num, name, type,typeName); |
| | | Long totalInDb = this.countTotalPrivileges() ; |
| | | if(list.size() != totalInDb){ |
| | | this.deleteAllPrivilegesInDb(); |
| | | for(Element ele : list){ |
| | | String num = ele.getAttributeValue("num") ; |
| | | String name = ele.getAttributeValue("name") ; |
| | | String type = ele.getAttributeValue("type") ; |
| | | String typeName = ele.getAttributeValue("typeName") ; |
| | | this.savePrivilege(num, name, type,typeName); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * 数据库中是否存在行政区划数据 |
| | | * 数据库中是否存在相关数据 |
| | | * @return 存在否 |
| | | */ |
| | | private boolean existPrivileges(){ |
| | |
| | | return (total != null && total > 0) ; |
| | | } |
| | | |
| | | /** |
| | | * 数据库中是否存在相关数据 |
| | | * @return 存在否 |
| | | */ |
| | | private Long countTotalPrivileges(){ |
| | | return this.privilegeDao.selectCount() ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 数据库中是否存在相关数据 |
| | | * @return 存在否 |
| | | */ |
| | | private void deleteAllPrivilegesInDb(){ |
| | | this.privilegeDao.deleteAll() ; |
| | | } |
| | | /** |
| | | * 保存权限 |
| | | * @param name 编码 |
| | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProduct; |
| | | import com.dy.pmsGlobal.pojoPlt.PltStation; |
| | | import com.dy.pmsGlobal.util.ExportExcelUtil; |
| | | import com.dy.pmsGlobal.util.QrCodeConstant; |
| | | import com.dy.pmsGlobal.util.QrCodeUtil; |
| | | import com.google.zxing.WriterException; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | */ |
| | | @GetMapping(path="getProduct") |
| | | @SsoPowerAop(power = "10300000") |
| | | @Log("可根据orderId查询产品") |
| | | @Log("根据orderId查询产品") |
| | | public BaseResponse<List<PltProduct>> getProduct(Long orderId){ |
| | | return BaseResponseUtils.buildSuccess(proSv.getProduct(orderId)); |
| | | } |
| | |
| | | public void export(@RequestBody QueryVo queryVo, HttpServletResponse response){ |
| | | List<Converter> list = new ArrayList<>() ; |
| | | |
| | | List<PltProduct> porList = proSv.selectAll(queryVo); |
| | | // 使用并行流提高性能 |
| | | List<PltProduct> products = proSv.selectAll(queryVo); |
| | | if(products != null){ |
| | | for(PltProduct product : products){ |
| | | ExcelVo vo = new ExcelVo(); |
| | | vo.name = product.name; |
| | | vo.type = product.type; |
| | | vo.code = product.code; |
| | | try { |
| | | vo.qrCode = QrCodeUtil.genQrCode(product.code); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (WriterException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | list.add(vo); |
| | | } |
| | | } |
| | | // 使用并行流提高性能,但生成的结果变成无序的了 |
| | | /* |
| | | porList.parallelStream().forEach(pro -> { |
| | | ExcelVo vo = new ExcelVo(); |
| | | vo.name = pro.name; |
| | |
| | | } |
| | | list.add(vo); |
| | | }); |
| | | QrCodeUtil.downloadExcel(response, fileName,sheetName,list); |
| | | */ |
| | | ExportExcelUtil.downloadExcel(response, fileName, sheetName, list); |
| | | } |
| | | |
| | | |
| | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.pojoPlt.PltStation; |
| | | import com.dy.pmsGlobal.util.ExportExcelUtil; |
| | | import com.dy.pmsGlobal.util.QrCodeConstant; |
| | | import com.dy.pmsGlobal.util.QrCodeUtil; |
| | | import com.google.zxing.WriterException; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import io.netty.channel.EventLoopGroup ; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | |
| | | List<Converter> list = new ArrayList<>() ; |
| | | |
| | | List<PltStation> stations = sv.selectAll(); |
| | | // 使用并行流提高性能 |
| | | if(stations != null){ |
| | | for(PltStation station : stations){ |
| | | ExcelVo vo = new ExcelVo(); |
| | | vo.name = station.name; |
| | | //vo.code = "103"+station.id; |
| | | vo.lineName = station.lineName; |
| | | try { |
| | | vo.qrCode = QrCodeUtil.genQrCode(QrCodeConstant.TypeStation+station.id); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } catch (WriterException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | list.add(vo); |
| | | } |
| | | } |
| | | // 使用并行流提高性能,但生成的结果变成无序的了 |
| | | /* |
| | | stations.parallelStream().forEach(station -> { |
| | | ExcelVo vo = new ExcelVo(); |
| | | vo.name = station.name; |
| | | // vo.code = "103"+station.id; |
| | | //vo.code = "103"+station.id; |
| | | vo.lineName = station.lineName; |
| | | try { |
| | | vo.qrCode = QrCodeUtil.genQrCode(QrCodeConstant.TypeStation+station.id); |
| | |
| | | } |
| | | list.add(vo); |
| | | }); |
| | | QrCodeUtil.downloadExcel(response, fileName,sheetName,list); |
| | | */ |
| | | ExportExcelUtil.downloadExcel(response, fileName, sheetName, list); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | private String getNextCode(){ |
| | | log.info("获取工站编号"); |
| | | String maxCode = dao.selectMaxCode(); |
| | | if (StringUtils.isBlank(maxCode)) { |
| | | return DEFAULT_CODE; |
| | |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; |
| | | import com.dy.pmsGlobal.pojoPr.PrDevice; |
| | | import com.dy.pmsGlobal.util.ExportExcelUtil; |
| | | import com.dy.pmsGlobal.util.QrCodeUtil; |
| | | import com.google.zxing.WriterException; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | |
| | | list.add(vo); |
| | | }); |
| | | log.info("导出设备号及二维码耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | QrCodeUtil.downloadExcel(response, fileName,sheetName,list); |
| | | ExportExcelUtil.downloadExcel(response, fileName,sheetName,list); |
| | | log.info("导出设备号及二维码耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | } |
| | | @GetMapping(path="exportDeviceNo") |
| | |
| | | PrAssemblyPlan plan = sv.selectByBatchId(batchId); |
| | | String fileNameStr = plan.name +"-"+ fileName; |
| | | log.info("导出设备号耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | QrCodeUtil.downloadExcel(response, fileNameStr,sheetName,list); |
| | | ExportExcelUtil.downloadExcel(response, fileNameStr,sheetName,list); |
| | | log.info("导出设备号耗时:"+(new Date().getTime()-start.getTime())+"ms"); |
| | | } |
| | | } |