1、优化配置文件;
2、优化ID生成器代码;
3、修改注释;
4、修改权限初始化时算法;
5、导出Excel文件功能归为一个新类;
6、工站数据库存入验空修改;
14个文件已修改
1个文件已添加
307 ■■■■■ 已修改文件
pms-parent/pms-common/src/main/java/com/dy/common/mybatis/AutoGenerateIdInterceptor.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-common/src/main/java/com/dy/common/util/ConfigXml.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/util/ExportExcelUtil.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/util/QrCodeUtil.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/application-global.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/BaPrivilegeMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PltStationMapper.xml 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/MarkQrCode/MarkQrCodeCtrl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblyPlanCtrl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-common/src/main/java/com/dy/common/mybatis/AutoGenerateIdInterceptor.java
@@ -53,20 +53,25 @@
                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){
                }
pms-parent/pms-common/src/main/java/com/dy/common/util/ConfigXml.java
@@ -106,7 +106,7 @@
    }
    /**
     * 检查元素是否存在
     * 得到元素
     * @param doc doc对象
     * @param elementName 元素名称
     * @return 返回结果  返回结果
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoBa/BaPrivilegeMapper.java
@@ -38,7 +38,7 @@
     * @param roleId 用户ID
     * @return List<Integer>
     */
    List<Integer> selectPrivilegeByRoleId(@Param("roleId") Long roleId) ;
    Long selectPrivilegeByRoleId(@Param("roleId") Long roleId) ;
    int insert(BaPrivilege record);
@@ -50,4 +50,6 @@
    int updateByPrimaryKey(BaPrivilege record);
    int deleteByPrimaryKey(Long id);
    int deleteAll();
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/util/ExportExcelUtil.java
New file
@@ -0,0 +1,61 @@
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);
        }
    }
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/util/QrCodeUtil.java
@@ -71,47 +71,6 @@
        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);
        }
    }
}
pms-parent/pms-global/src/main/resources/application-global.yml
@@ -6,7 +6,7 @@
    #云服务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:
@@ -130,7 +130,7 @@
#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
pms-parent/pms-global/src/main/resources/mapper/BaPrivilegeMapper.xml
@@ -144,6 +144,11 @@
    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" />
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -59,22 +59,22 @@
        <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">
@@ -83,7 +83,7 @@
        <if test="dt != null">
          dt,
        </if>
        <if test="remark != null and remark !=''">
        <if test="remark != null">
          remark,
        </if>
    </trim>
@@ -91,22 +91,22 @@
        <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">
@@ -115,7 +115,7 @@
        <if test="dt != null">
          #{dt,jdbcType=TIMESTAMP},
        </if>
        <if test="remark != null and remark !=''">
        <if test="remark != null">
          #{remark,jdbcType=VARCHAR},
        </if>
    </trim>
@@ -124,25 +124,25 @@
    <!--@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>
pms-parent/pms-global/src/main/resources/mapper/PltStationMapper.xml
@@ -43,18 +43,18 @@
        <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>
@@ -62,16 +62,16 @@
    <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">
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/MarkQrCode/MarkQrCodeCtrl.java
@@ -7,6 +7,7 @@
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;
@@ -68,6 +69,6 @@
            vo.image = QrCodeUtil.genQrCode(vo.code);
            list.add(vo) ;
        }
        QrCodeUtil.downloadExcel(response, fileName, sheetName, list);
        ExportExcelUtil.downloadExcel(response, fileName, sheetName, list);
    }
}
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/util/PrivilegeListener.java
@@ -1,13 +1,10 @@
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;
@@ -48,9 +45,12 @@
        } catch (InterruptedException e) {
            e.printStackTrace();
        }finally {
            /*
            if(!this.existPrivileges()){
                this.init(event);
            }
            */
            this.init(event);
        }
    }
@@ -76,12 +76,16 @@
            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);
                        }
                    }
                }
            }
@@ -90,7 +94,7 @@
    /**
     * 数据库中是否存在行政区划数据
     * 数据库中是否存在相关数据
     * @return 存在否
     */
    private boolean existPrivileges(){
@@ -98,7 +102,22 @@
        return (total != null && total > 0) ;
    }
    /**
     * 数据库中是否存在相关数据
     * @return 存在否
     */
    private Long countTotalPrivileges(){
        return this.privilegeDao.selectCount() ;
    }
    /**
     * 数据库中是否存在相关数据
     * @return 存在否
     */
    private void deleteAllPrivilegesInDb(){
        this.privilegeDao.deleteAll() ;
    }
    /**
     * 保存权限
     * @param name 编码
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java
@@ -7,6 +7,9 @@
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;
@@ -137,7 +140,7 @@
     */
    @GetMapping(path="getProduct")
    @SsoPowerAop(power = "10300000")
    @Log("可根据orderId查询产品")
    @Log("根据orderId查询产品")
    public BaseResponse<List<PltProduct>> getProduct(Long orderId){
        return BaseResponseUtils.buildSuccess(proSv.getProduct(orderId));
    }
@@ -149,8 +152,25 @@
    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;
@@ -165,7 +185,8 @@
            }
            list.add(vo);
        });
        QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
         */
        ExportExcelUtil.downloadExcel(response, fileName, sheetName, list);
    }
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationCtrl.java
@@ -9,6 +9,7 @@
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;
@@ -17,7 +18,6 @@
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;
@@ -150,11 +150,28 @@
        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);
@@ -165,7 +182,8 @@
            }
            list.add(vo);
        });
        QrCodeUtil.downloadExcel(response, fileName,sheetName,list);
         */
        ExportExcelUtil.downloadExcel(response, fileName, sheetName, list);
    }
}
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
@@ -71,7 +71,6 @@
    }
    private String getNextCode(){
        log.info("获取工站编号");
        String maxCode = dao.selectMaxCode();
        if (StringUtils.isBlank(maxCode)) {
            return DEFAULT_CODE;
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblyPlanCtrl.java
@@ -8,6 +8,7 @@
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;
@@ -147,7 +148,7 @@
            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")
@@ -168,7 +169,7 @@
        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");
    }
}