liuxm
2024-05-23 9dfc64b4c99218a82ab56549908a11281e804c18
品检添加排序;用户,工站,产品,列表中添加二维码;修改下载链接
10个文件已修改
109 ■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoBa/BaUser.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltProduct.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltProductQualityInspectionItems.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltStation.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PltProductQualityInspectionItemsMapper.xml 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PltProductScrappingReasonMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserSv.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoBa/BaUser.java
@@ -92,6 +92,11 @@
    // 以下不是数据库实体属性
    //////////////////////////////////////
    /**
     * 二维码
     */
    @TableField(exist = false)
    public String qrCode;
    /**
     * 用户所关联的角色集合
     */
    @TableField(exist = false)
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltProduct.java
@@ -55,6 +55,11 @@
    @TableField(exist = false)
    public String imageWebPathZip;
    /**
     * 二维码
     */
    @TableField(exist = false)
    public String qrCode;
    /**
    * 技术负责人
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltProductQualityInspectionItems.java
@@ -45,6 +45,11 @@
     */
    @NotEmpty(message = "品检项目不能为空")
    public String item;
    /**
     * 排序(从大到小)
     */
    public int sort;
    /**
     * 是否禁用,1是,0否
     */
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPlt/PltStation.java
@@ -71,5 +71,10 @@
     * 是否删除,1是,0否
     */
    public Boolean deleted;
    /**
     * 二维码
     */
    @TableField(exist = false)
    public String qrCode;
}
pms-parent/pms-global/src/main/resources/mapper/PltProductQualityInspectionItemsMapper.xml
@@ -8,6 +8,7 @@
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="proId" column="pro_id" jdbcType="BIGINT"/>
        <result property="item" column="item" jdbcType="VARCHAR"/>
        <result property="sort" column="sort" jdbcType="INTEGER"/>
        <result column="disabled" property="disabled" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/>
        <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/>
        <association property="proName" column="pro_id" javaType="java.lang.Long"
@@ -15,13 +16,14 @@
    </resultMap>
    <sql id="Base_Column_List">
        id,pro_id,item,disabled,
        id,pro_id,item,disabled,sort,
        deleted
    </sql>
    <sql id="part_Column_List">
        ${alias}.id,
        ${alias}.pro_id,
        ${alias}.item,
        ${alias}.sort,
        ${alias}.disabled,
        ${alias}.deleted
    </sql>
@@ -38,18 +40,20 @@
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems" useGeneratedKeys="true">
        insert into plt_product_quality_inspection_items
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="proId != null">pro_id,</if>
                <if test="item != null">item,</if>
                <if test="disabled != null">disabled,</if>
                <if test="deleted != null">deleted,</if>
            <if test="id != null">id,</if>
            <if test="proId != null">pro_id,</if>
            <if test="item != null">item,</if>
            <if test="sort != null">sort,</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="proId != null">#{proId,jdbcType=BIGINT},</if>
                <if test="item != null">#{item,jdbcType=VARCHAR},</if>
                <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if>
                <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="proId != null">#{proId,jdbcType=BIGINT},</if>
            <if test="item != null">#{item,jdbcType=VARCHAR},</if>
            <if test="sort != null">#{sort,jdbcType=INTEGER},</if>
            <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if>
            <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems">
@@ -63,6 +67,9 @@
            </if>
            <if test="item != null">
                item = #{item,jdbcType=VARCHAR},
            </if>
            <if test="sort != null">
                sort = #{sort,jdbcType=INTEGER},
            </if>
        </set>
        where   id = #{id,jdbcType=BIGINT} 
@@ -81,7 +88,7 @@
                t.item like concat('%', #{item}, '%') and
            </if>
        </trim>
        order by id desc
        order by sort desc
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start}, #{count}
pms-parent/pms-global/src/main/resources/mapper/PltProductScrappingReasonMapper.xml
@@ -55,7 +55,7 @@
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="reason != null">#{reason,jdbcType=VARCHAR},</if>
            <if test="proId != null">#{proId,jdbcType=VARCHAR},</if>
            <if test="sort != null">#{sort,jdbcType=VARCHAR},</if>
            <if test="sort != null">#{sort,jdbcType=INTEGER},</if>
            <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
        </trim>
    </insert>
@@ -69,7 +69,7 @@
                pro_id = #{proId,jdbcType=VARCHAR},
            </if>
            <if test="sort != null">
                sort = #{sort,jdbcType=VARCHAR},
                sort = #{sort,jdbcType=INTEGER},
            </if>
            <if test="disabled != null">
                disabled = #{disabled,jdbcType=TINYINT},
pms-parent/pms-web-base/src/main/java/com/dy/pmsBase/user/UserSv.java
@@ -1,16 +1,20 @@
package com.dy.pmsBase.user;
import cn.hutool.core.codec.Base64;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoBa.BaUserMapper;
import com.dy.pmsGlobal.daoBa.BaUserRoleMapper;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoBa.BaUserRole;
import com.dy.pmsGlobal.util.QrCodeUtil;
import com.google.zxing.WriterException;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Random;
@@ -22,6 +26,7 @@
    private BaUserMapper dao;
    @Autowired
    private BaUserRoleMapper urDao;
    private static final String stationPrefix = "101" ;
    /**
     * 生成指定位数随机数字密码
@@ -70,6 +75,16 @@
        //查询符合条件的记录
        rsVo.obj = this.dao.selectSome(params) ;
        rsVo.obj.parallelStream().forEach(item->{
            try {
                byte[] codes = QrCodeUtil.genQrCode(stationPrefix+item.id);
                item.qrCode = "data:image/jpeg;base64," + Base64.encode(codes);
            } catch (IOException e) {
                e.printStackTrace();
            } catch (WriterException e) {
                e.printStackTrace();
            }
        });
        return rsVo ;
    }
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
@@ -1,5 +1,6 @@
package com.dy.pmsPlatform.product;
import cn.hutool.core.codec.Base64;
import com.alibaba.excel.util.StringUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoOth.OthFileMapper;
@@ -12,6 +13,8 @@
import com.dy.pmsGlobal.pojoOth.OthFile;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPlt.PltProductFile;
import com.dy.pmsGlobal.util.QrCodeUtil;
import com.google.zxing.WriterException;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@@ -22,6 +25,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
@@ -166,8 +170,7 @@
                     return;
                 }
                 FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash);
                 doc.webUrl = fileRestVo.fileWebUrl + file.filePath;
                 doc.webUrl = fileRestVo.fileSysRestUrl + fileRestVo.fileWebDownloadPath + doc.fileId;
                 doc.orgName = file.orgName;
                 doc.extName = file.extName;
             });
@@ -195,8 +198,16 @@
        //查询符合条件的记录
        rsVo.obj = dao.selectSome(params) ;
        if(CollectionUtils.isNotEmpty(rsVo.obj)){
            rsVo.obj.forEach(pro->{
                pro = addWebUrl(pro);
            rsVo.obj.parallelStream().forEach(item->{
                try {
                    byte[] codes = QrCodeUtil.genQrCode(item.code);
                    item.qrCode = "data:image/jpeg;base64," + Base64.encode(codes);
                    item = addWebUrl(item);
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (WriterException e) {
                    e.printStackTrace();
                }
            });
        }
        return rsVo ;
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/station/StationSv.java
@@ -1,15 +1,19 @@
package com.dy.pmsPlatform.station;
import cn.hutool.core.codec.Base64;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoPlt.PltStationMapper;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.util.QrCodeUtil;
import com.google.zxing.WriterException;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@@ -18,6 +22,7 @@
public class StationSv {
    private PltStationMapper dao;
    private static final String stationPrefix = "103" ;
    @Autowired
    public void setDao(PltStationMapper dao) {
@@ -74,6 +79,16 @@
        //查询符合条件的记录
        rsVo.obj = this.dao.selectSome(params) ;
        rsVo.obj.parallelStream().forEach(item->{
            try {
                byte[] codes = QrCodeUtil.genQrCode(stationPrefix+item.id);
                item.qrCode = "data:image/jpeg;base64," + Base64.encode(codes);
            } catch (IOException e) {
                e.printStackTrace();
            } catch (WriterException e) {
                e.printStackTrace();
            }
        });
        return rsVo ;
    }
pms-parent/pms-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java
@@ -263,8 +263,9 @@
     * @return
     */
    private String generateCaptcha() {
        Random r = new Random();
        return r.nextInt(9000) + 1000 + "";
//        Random r = new Random();
//        return r.nextInt(9000) + 1000 + "";
        return "1234";
    }
    /**
     * 用户登录