刘小明
2024-07-06 a3202d4c62be404247d23f0676e95f8c5d146983
添加根据设备号查询生产日志,生命周期,和相关信息;限制上传文档类型
15个文件已修改
172 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/application-global.yml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
@@ -25,4 +25,6 @@
    String selectMaxCode();
    boolean exists(String name, Long id);
    PltProduct selectByCode(String productCode);
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoSta/StaWipSnExMapper.java
@@ -3,6 +3,8 @@
import com.dy.pmsGlobal.pojoSta.StaWipSnEx;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author User
* @description 针对表【sta_wip_sn_ex(设备关联表)】的数据库操作Mapper
@@ -24,4 +26,5 @@
    int updateByPrimaryKey(StaWipSnEx record);
    List<StaWipSnEx> selectByDeviceNo(String deviceNo);
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/global/WebFileCtrl.java
@@ -36,6 +36,9 @@
    @Value("${dy.webFile.fmUrl}")
    private String fmUrl ;
    //支持的文件类型
    @Value("${dy.webFile.supportedFileTypes}")
    private String supportedFileTypes ;
    /**
     * 上传照片图片文件 (当前只对png jpg格式图片支持缩略图)
@@ -170,6 +173,10 @@
                String[] fileNameGrp = fileOp.splitFileName(file) ;
                if(fileNameGrp != null && fileNameGrp[0] != null && fileNameGrp[1] != null){
                    if(!fileNameGrp[1].trim().equals("")){
                       String fileExtName = fileNameGrp[1];
                       if(!supportedFileTypes.contains(fileExtName)){
                           return BaseResponseUtils.buildError("请上传Word,Excel,PowerPoint,PDF类型文档");
                       }
                        FileRestVo frVo = fileOp.saveFile(file,
                                fmUrl,
                                FileConstant.fileRequestMapping,
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLast.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -98,5 +99,12 @@
    */
    public String memo;
    @TableField(exist = false)
    public String planName;
    @TableField(exist = false)
    public String stationName;
    @TableField(exist = false)
    public String updateUserName;
    @TableField(exist = false)
    public String assistantNames;
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceLife.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -99,5 +100,12 @@
    */
    public String memo;
    @TableField(exist = false)
    public String planName;
    @TableField(exist = false)
    public String stationName;
    @TableField(exist = false)
    public String updateUserName;
    @TableField(exist = false)
    public String assistantNames;
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaDeviceProductionLog.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -98,5 +99,12 @@
    */
    public String memo;
    @TableField(exist = false)
    public String planName;
    @TableField(exist = false)
    public String stationName;
    @TableField(exist = false)
    public String updateUserName;
    @TableField(exist = false)
    public String assistantNames;
}
pms-parent/pms-global/src/main/resources/application-global.yml
@@ -107,6 +107,7 @@
    photoZipWidth: 400 #缩略图尺寸
    webFile:
        fmUrl: http://127.0.0.1:${pms.other.webPort}/other # fm的web上下文 URL
        supportedFileTypes: docx,xlsx,pdf
        sv1:
            id: dyFile1
            absolutePath: E:/java/nginx-1.24.0/html/webfiles/
pms-parent/pms-global/src/main/resources/mapper/BaUserMapper.xml
@@ -143,6 +143,14 @@
      </if>
    </trim>
  </select>
  <select id="selectNamesByAssistants" parameterType="java.lang.String" resultType="java.lang.String">
    SELECT GROUP_CONCAT(name) AS assistantNames FROM ba_user WHERE id IN
    <if test="assistants != null">
      <foreach collection="assistants.split(',')" item="item" separator="," open="(" close=")">
        #{item,jdbcType=BIGINT}
      </foreach>
    </if>
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -201,5 +201,11 @@
            and id != #{id}
        </if>
    </select>
    <select id="selectByCode" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct">
        select
        <include refid="Base_Column_List" />
        from plt_product p
        where p.deleted!=1 and p.code = #{code}
    </select>
</mapper>
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
@@ -23,6 +23,13 @@
            <result property="outTime" column="out_time" jdbcType="TIMESTAMP"/>
            <result property="memo" column="memo" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
        <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
        <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
        <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
        <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
    </resultMap>
    <sql id="Base_Column_List">
        id,equip_no,work_id,
@@ -33,6 +40,17 @@
        updated_by,in_time,out_time,
        memo
    </sql>
    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
        select
            t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
        FROM
            sta_device_last t
                left join pr_assembly_plan p on t.plan_id=p.id
                left join plt_station s on s.id = t.station_id
                left JOIN ba_user u on u.id=t.updated_by
        where  t.equip_no = #{equipNo,jdbcType=VARCHAR}
        ORDER BY t.id DESC
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLifeMapper.xml
@@ -23,6 +23,13 @@
            <result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
            <result property="memo" column="memo" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
        <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
        <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
        <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
        <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
    </resultMap>
    <sql id="Base_Column_List">
        id,equip_no,work_id,
@@ -40,14 +47,19 @@
        where  id = #{id,jdbcType=BIGINT} 
    </select>
    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="BaseResultMap">
    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
        select
        <include refid="Base_Column_List" />
        from sta_device_life
        where  equip_no = #{equipNo,jdbcType=VARCHAR}
        order by id desc
            t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
        FROM
        sta_device_life t
        left join pr_assembly_plan p on t.plan_id=p.id
        left join plt_station s on s.id = t.station_id
        left JOIN ba_user u on u.id=t.updated_by
        where  t.equip_no = #{equipNo,jdbcType=VARCHAR}
        ORDER BY t.id DESC
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from sta_device_life
        where  id = #{id,jdbcType=BIGINT} 
pms-parent/pms-global/src/main/resources/mapper/StaDeviceProductionLogMapper.xml
@@ -23,6 +23,13 @@
            <result property="updatedBy" column="updated_by" jdbcType="BIGINT"/>
            <result property="memo" column="memo" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="joinResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife" extends="BaseResultMap">
        <result property="planName" column="plan_name" jdbcType="VARCHAR"/>
        <result property="stationName" column="station_name" jdbcType="VARCHAR"/>
        <result property="updateUserName" column="update_user_name" jdbcType="VARCHAR"/>
        <association property="assistantNames" jdbcType="VARCHAR" column="assistants"
                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNamesByAssistants" fetchType="eager" />
    </resultMap>
    <sql id="Base_Column_List">
        id,equip_no,work_id,
@@ -33,19 +40,23 @@
        out_time,updated_by,memo
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from sta_device_production_log
        where  id = #{id,jdbcType=BIGINT} 
    </select>
    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="BaseResultMap">
    <select id="selectByEquipNo" parameterType="java.lang.String" resultMap="joinResultMap">
        select
        <include refid="Base_Column_List" />
        from sta_device_production_log
        where  equip_no = #{equipNo,jdbcType=VARCHAR}
        order by id desc
            t.* ,p.`name` plan_name,s.`name` station_name,u.`name` update_user_name
        FROM
            sta_device_last t
                left join pr_assembly_plan p on t.plan_id=p.id
                left join plt_station s on s.id = t.station_id
                left JOIN ba_user u on u.id=t.updated_by
        where  t.equip_no = #{equipNo,jdbcType=VARCHAR}
        ORDER BY t.id DESC
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
pms-parent/pms-global/src/main/resources/mapper/StaWipSnExMapper.xml
@@ -26,6 +26,12 @@
        from sta_wip_sn_ex
        where  id = #{id,jdbcType=BIGINT} 
    </select>
    <select id="selectByDeviceNo" resultType="com.dy.pmsGlobal.pojoSta.StaWipSnEx">
        select
        <include refid="Base_Column_List" />
        from sta_wip_sn_ex
        where  device_no = #{deviceNo,jdbcType=VARCHAR}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from sta_wip_sn_ex
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -7,12 +7,15 @@
import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
import com.dy.pmsGlobal.pojoSta.StaDeviceLife;
import com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 *记录组装各步骤
@@ -109,4 +112,25 @@
            return BaseResponseUtils.buildSuccess(true);
        }
    }
    @GetMapping(path = "queryByDeviceNo")
    public BaseResponse<Map<String,String>> queryByDeviceNo(String deviceNo) {
        log.info("AssemblyStepCtrl.queryByDeviceNo():"+deviceNo);
        Map<String,String> result = sv.queryByDeviceNo(deviceNo);
        return BaseResponseUtils.buildSuccess(result);
    }
    @GetMapping(path = "queryLifeByDeviceNo")
    public BaseResponse<?> queryLifeByDeviceNo(String deviceNo) {
        log.info("AssemblyStepCtrl.queryLifeByDeviceNo():"+deviceNo);
        List<StaDeviceLife> result = sv.queryLifeByDeviceNo(deviceNo);
        return BaseResponseUtils.buildSuccess(result);
    }
    @GetMapping(path = "queryLogByDeviceNo")
    public BaseResponse<?> queryLogByDeviceNo(String deviceNo) {
        log.info("AssemblyStepCtrl.queryLogByDeviceNo():"+deviceNo);
        List<StaDeviceProductionLog> result = sv.queryLogByDeviceNo(deviceNo);
        return BaseResponseUtils.buildSuccess(result);
    }
}
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -390,4 +390,26 @@
        FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash);
        return fileRestVo.fileWebUrl + file.filePath;
    }
    public Map<String,String> queryByDeviceNo(String deviceNo) {
        Map<String,String> map = new HashMap<>();
        map.put("deviceNo", deviceNo);
        map.put("proName", "-");
        map.put("proType", "-");
        PltProduct product = productDao.selectByCode(deviceNo.substring(3,6));
        if(product != null){
            map.put("proName", product.getName());
            map.put("proType", product.getType());
        }
        return map;
    }
    public List<StaDeviceLife> queryLifeByDeviceNo(String deviceNo) {
        return deviceLifeDao.selectByEquipNo(deviceNo);
    }
    public List<StaDeviceProductionLog> queryLogByDeviceNo(String devoiceNo) {
        return deviceProductionLogDao.selectByEquipNo(devoiceNo);
    }
}