Fancy
2024-07-20 5541562a51ddec2c25fcd6cd3febbc4765a2190d
deviceNo get product
5个文件已修改
106 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrAssemblyPlanMapper.java
@@ -35,6 +35,8 @@
    boolean exists(String name, Long id);
    PrAssemblyPlan selectByDeviceNo(String proCode, String batchNumber);
    List<PrAssemblyPlan> selectAssyPlanList(PrAssemblyPlan params);
    List<PrAssemblyPlan> selectAssyPlanSimplify(PrAssemblyPlan params);
pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml
@@ -29,7 +29,8 @@
        <association property="processName" column="process_id" javaType="java.lang.Long"
            select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectProcessNameById" fetchType="eager" />
        <collection property="process" ofType="com.dy.pmsGlobal.pojoPr.PrProductionProcess"
                    select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByPrimaryKey" fetchType="eager" column="process_id" />
                    select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByPrimaryKey" fetchType="eager"
                    column="process_id"/>
    </resultMap>
    <resultMap id="PlanResultMap" type="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan">
@@ -49,21 +50,40 @@
        <result property="inputNumber" column="input_number" jdbcType="INTEGER"/>
        <result property="outputNumber" column="output_number" jdbcType="INTEGER"/>
        <collection property="process" ofType="com.dy.pmsGlobal.pojoPr.PrProductionProcess"
                    select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByProcessId" fetchType="eager" column="process_id" />
                    select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectByProcessId" fetchType="eager"
                    column="process_id"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,pro_id,batch_id,
        id
        ,pro_id,batch_id,
        process_id,name,number,
        status,creator,
        dt,start_date,end_date,
        deleted,content,input_number,output_number
    </sql>
    <sql id="part_Column_List">
        ${alias}.id,
        ${alias}.pro_id,
        ${alias}.batch_id,
        ${alias}.process_id,
        ${alias}.name,
        ${alias}.number,
        ${alias}.status,
        ${alias}.creator,
        ${alias}.dt,
        ${alias}.start_date,
        ${alias}.end_date,
        ${alias}.deleted,
        ${alias}.content,
        ${alias}.input_number,
        ${alias}.output_number
    </sql>
    <select id="selectPlanNamesByProcessId" resultType="java.lang.String" >
        select GROUP_CONCAT(name SEPARATOR ',')
        from pr_assembly_plan
        where process_id = #{processId} and deleted = 0
        where process_id = #{processId}
          and deleted = 0
    </select>
    <select id="processIsQuote" resultType="java.lang.Boolean" parameterType="java.lang.Long">
        select count(1)
@@ -74,7 +94,9 @@
        </if>
    </select>
    <select id="selectNameByPlanId" parameterType="java.lang.Long" resultType="String">
        select name from pr_assembly_plan where id = #{id}
        select name
        from pr_assembly_plan
        where id = #{id}
    </select>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
@@ -87,7 +109,20 @@
        from pr_production_node
        where process_id = #{processId,jdbcType=BIGINT}
    </select>
    <select id="selectAssyPlanSimplify" resultMap="PlanResultMap" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan">
    <select id="selectByDeviceNo" parameterType="java.lang.String" resultMap="PlanResultMap">
        select
        <include refid="part_Column_List">
            <property name="alias" value="p"/>
        </include>
        from pr_assembly_plan p,plt_product pp,pr_batch_number b
        where p.pro_id = pp.id  and p.batch_id = b.id
          and pp.code = #{proCode,jdbcType=VARCHAR}
          and b.batch_number = #{batchNumber,jdbcType=VARCHAR}
    </select>
    <select id="selectAssyPlanSimplify" resultMap="PlanResultMap"
            parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan">
        select
        <include refid="Base_Column_List" />
        from pr_assembly_plan
@@ -177,10 +212,12 @@
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from pr_assembly_plan
        delete
        from pr_assembly_plan
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" useGeneratedKeys="true">
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"
            useGeneratedKeys="true">
        insert into pr_assembly_plan
        ( id,pro_id,batch_id
        ,process_id,name,number
@@ -191,9 +228,11 @@
        ,#{processId,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{number,jdbcType=INTEGER}
        ,#{status,jdbcType=TINYINT},#{creator,jdbcType=VARCHAR}
        ,#{dt,jdbcType=TIMESTAMP},#{startDate,jdbcType=VARCHAR},#{endDate,jdbcType=VARCHAR}
        ,#{deleted,jdbcType=TINYINT},#{content,jdbcType=VARCHAR},#{inputNumber,jdbcType=INTEGER},#{outputNumber,jdbcType=INTEGER})
               , #{deleted,jdbcType=TINYINT}, #{content,jdbcType=VARCHAR}, #{inputNumber,jdbcType=INTEGER}
               , #{outputNumber,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan" useGeneratedKeys="true">
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan"
            useGeneratedKeys="true">
        insert into pr_assembly_plan
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
@@ -280,8 +319,7 @@
    </update>
    <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan">
        update pr_assembly_plan
        set
            pro_id =  #{proId,jdbcType=BIGINT},
        set pro_id        = #{proId,jdbcType=BIGINT},
            batch_id =  #{batchId,jdbcType=BIGINT},
            process_id =  #{processId,jdbcType=BIGINT},
            name =  #{name,jdbcType=VARCHAR},
@@ -346,7 +384,8 @@
    </select>
    <update id="deleteLogicById" parameterType="java.lang.Long">
        update pr_assembly_plan set deleted = 1
        update pr_assembly_plan
        set deleted = 1
        where id = #{id}
    </update>
</mapper>
pms-parent/pms-global/src/main/resources/mapper/StaDeviceLastMapper.xml
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -7,6 +7,7 @@
import com.dy.pmsGlobal.pojoPlt.PltProductParams;
import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
import com.dy.pmsGlobal.pojoSta.StaDeviceLife;
import com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog;
@@ -147,4 +148,11 @@
        List<StaDeviceProductionLog> result = sv.queryLogByDeviceNo(deviceNo);
        return BaseResponseUtils.buildSuccess(result);
    }
    @GetMapping(path = "queryPlanByDeviceNo")
    public BaseResponse<PrAssemblyPlan> queryPlanByDeviceNo(String deviceNo) {
        log.info("AssemblyStepCtrl.queryLogByDeviceNo():" + deviceNo);
        PrAssemblyPlan result = sv.queryPlanByDeviceNo(deviceNo);
        return BaseResponseUtils.buildSuccess(result);
    }
}
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -504,37 +504,20 @@
        }
        return map;
    }
   /* public PrAssemblyPlan queryPlanByDeviceNo(String deviceNo) {
    //查询产品所在的任务
    public PrAssemblyPlan queryPlanByDeviceNo(String deviceNo) {
        String proCode = "";
        String lotCode = "";
        if (StringUtils.isNotEmpty(deviceNo) && deviceNo.length() == 22) {
            proCode = deviceNo.substring(3,6);
            lotCode = deviceNo.substring(6,15);
        }
        Map<String, String> map = new HashMap<>();
        map.put("deviceNo", deviceNo);
        map.put("proName", "");
        map.put("proType", "");
        map.put("proId", "");
        map.put("proCode", "");
        //判断是不是是本厂物料
        if(CollectionUtils.isEmpty(productList)){
            productList = productDao.selectAll(null);
        PrAssemblyPlan plan = assemblyPlanDao.selectByDeviceNo(proCode,lotCode);
        if(plan != null){
            plan.setBatchNo(lotCode);
        }
        PltProduct product = null;
        if (product != null) {
            map.put("deviceNo", deviceNo);
            map.put("proName", product.getName());
            map.put("proType", product.getType());
            BigInteger proId = BigInteger.valueOf(product.getId());
            map.put("proId", proId.toString());
            map.put("proCode",product.getCode());
        return plan;
        }
        return map;
    }
*/
    public List<StaDeviceLife> queryLifeByDeviceNo(String deviceNo) {
        return deviceLifeDao.selectByDeviceNo(deviceNo);
    }