品检添加排序;用户,工站,产品,列表中添加二维码;修改下载链接
| | |
| | | // 以下不是数据库实体属性 |
| | | ////////////////////////////////////// |
| | | /** |
| | | * 二维码 |
| | | */ |
| | | @TableField(exist = false) |
| | | public String qrCode; |
| | | /** |
| | | * 用户所关联的角色集合 |
| | | */ |
| | | @TableField(exist = false) |
| | |
| | | |
| | | @TableField(exist = false) |
| | | public String imageWebPathZip; |
| | | /** |
| | | * 二维码 |
| | | */ |
| | | @TableField(exist = false) |
| | | public String qrCode; |
| | | |
| | | /** |
| | | * 技术负责人 |
| | |
| | | */ |
| | | @NotEmpty(message = "品检项目不能为空") |
| | | public String item; |
| | | |
| | | /** |
| | | * 排序(从大到小) |
| | | */ |
| | | public int sort; |
| | | /** |
| | | * 是否禁用,1是,0否 |
| | | */ |
| | |
| | | * 是否删除,1是,0否 |
| | | */ |
| | | public Boolean deleted; |
| | | /** |
| | | * 二维码 |
| | | */ |
| | | @TableField(exist = false) |
| | | public String qrCode; |
| | | |
| | | } |
| | |
| | | <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" |
| | |
| | | </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> |
| | |
| | | <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"> |
| | |
| | | </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} |
| | |
| | | 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} |
| | |
| | | <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> |
| | |
| | | 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}, |
| | |
| | | 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; |
| | |
| | | private BaUserMapper dao; |
| | | @Autowired |
| | | private BaUserRoleMapper urDao; |
| | | private static final String stationPrefix = "101" ; |
| | | |
| | | /** |
| | | * 生成指定位数随机数字密码 |
| | |
| | | |
| | | //查询符合条件的记录 |
| | | 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 ; |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | }); |
| | |
| | | //查询符合条件的记录 |
| | | 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 ; |
| | |
| | | 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; |
| | | |
| | |
| | | public class StationSv { |
| | | |
| | | private PltStationMapper dao; |
| | | private static final String stationPrefix = "103" ; |
| | | |
| | | @Autowired |
| | | public void setDao(PltStationMapper dao) { |
| | |
| | | |
| | | //查询符合条件的记录 |
| | | 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 ; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | private String generateCaptcha() { |
| | | Random r = new Random(); |
| | | return r.nextInt(9000) + 1000 + ""; |
| | | // Random r = new Random(); |
| | | // return r.nextInt(9000) + 1000 + ""; |
| | | return "1234"; |
| | | } |
| | | /** |
| | | * 用户登录 |