Fancy
2024-07-10 c64161f9e685b4a2c74dcc7e6cd7ba75a35c8351
add a inputQty and outputQty
4个文件已修改
45 ■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrAssemblyPlan.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblySv.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrAssemblyPlan.java
@@ -6,13 +6,11 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import java.util.Date;
import java.util.List;
/**
 * 组装生产任务计划
@@ -74,6 +72,15 @@
    public Integer status;
    /**
     * 投入生产数量
     */
    public Integer inputNumber;
    /**
     * 产出数量
     */
    public Integer outputNumber;
    /**
     * 创建人
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
pms-parent/pms-global/src/main/resources/mapper/PrAssemblyPlanMapper.xml
@@ -18,6 +18,8 @@
        <result property="endDate" column="end_date" jdbcType="VARCHAR"/>
        <result property="deleted" column="deleted" jdbcType="TINYINT"/>
        <result property="content" column="content" jdbcType="VARCHAR"/>
        <result property="inputNumber" column="input_number" jdbcType="INTEGER"/>
        <result property="outputNumber" column="output_number" jdbcType="INTEGER"/>
        <association property="proName" column="pro_id" javaType="java.lang.Long"
            select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager" />
        <association property="creatorName" column="creator" javaType="java.lang.Long"
@@ -44,6 +46,8 @@
        <result property="endDate" column="end_date" jdbcType="VARCHAR"/>
        <result property="deleted" column="deleted" jdbcType="TINYINT"/>
        <result property="content" column="content" jdbcType="VARCHAR"/>
        <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" />
    </resultMap>
@@ -53,7 +57,7 @@
        process_id,name,number,
        status,creator,
        dt,start_date,end_date,
        deleted,content
        deleted,content,input_number,output_number
    </sql>
    <select id="selectPlanNamesByProcessId" resultType="java.lang.String" >
@@ -182,12 +186,12 @@
        ,process_id,name,number
        ,status,creator
        ,dt,start_date,end_date
        ,deleted,content)
        ,deleted,content,input_number,output_number)
        values (#{id,jdbcType=BIGINT},#{proId,jdbcType=BIGINT},#{batchId,jdbcType=BIGINT}
        ,#{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})
        ,#{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 into pr_assembly_plan
@@ -205,6 +209,8 @@
                <if test="endDate != null">end_date,</if>
                <if test="deleted != null">deleted,</if>
                <if test="content != null">content,</if>
                <if test="inputNumber != null">input_number,</if>
                <if test="outputNumber != null">output_number,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=BIGINT},</if>
@@ -220,6 +226,8 @@
                <if test="endDate != null">#{endDate,jdbcType=VARCHAR},</if>
                <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
                <if test="content != null">#{content,jdbcType=VARCHAR},</if>
                <if test="inputNumber != null">#{intputNumber,jdbcType=INTEGER},</if>
                <if test="outputNumber != null">#{outputNumber,jdbcType=INTEGER},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrAssemblyPlan">
@@ -261,6 +269,12 @@
            <if test="content != null">
                content = #{content,jdbcType=VARCHAR},
            </if>
            <if test="inputNumber != null">
                input_number = #{inputNumber,jdbcType=INTEGER},
            </if>
            <if test="outputNumber != null">
                output_number = #{outputNumber,jdbcType=INTEGER},
            </if>
        </set>
        where   id = #{id,jdbcType=BIGINT} 
    </update>
@@ -278,7 +292,9 @@
            start_date =  #{startDate,jdbcType=VARCHAR},
            end_date =  #{endDate,jdbcType=VARCHAR},
            deleted =  #{deleted,jdbcType=TINYINT},
            content =  #{content,jdbcType=VARCHAR}
            content =  #{content,jdbcType=VARCHAR},
            input_number = #{inputNumber,jdbcType=INTEGER},
            output_number = #{outputNumber,jdbcType=INTEGER}
        where   id = #{id,jdbcType=BIGINT} 
    </update>
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/taskPlan/AssemblySv.java
@@ -106,6 +106,7 @@
        if(process == null || !process.proId.equals(plan.proId)){
            throw new RuntimeException("产品与生产流程不匹配");
        }
        //如果有投入,产品和流程不能变更
        //Fancy add 2024/07/09   如果状态为执行 ,则结束日期必须大于等于当前日期
        if(plan.status == PlanStatusEnum.NORMAL.getCode()){
            String endDateStr = plan.getEndDate();
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepSv.java
@@ -192,11 +192,14 @@
    private StaDeviceLast buildDeviceLast(QueryVo params, StaAssemblyWorkLast workLast,String deviceNo) {
        //组装数据
        StaDeviceLast record = new StaDeviceLast();
        //pr_assembly_plan input_number +1  投入数加1
        PrAssemblyPlan assemblyPlan = assemblyPlanDao.selectByPrimaryKey(workLast.planId);
        StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceNo);
        if (preRecord != null) {
            record.id = preRecord.id;
            record.inTime = preRecord.outTime;
        }else{
            assemblyPlan.setInputNumber(assemblyPlan.getInputNumber() + 1);
        }
        record.outTime = new Date();
@@ -215,6 +218,10 @@
        if (node.isRecord) {
            record.deviceCycleContent = node.deviceCycleContent;
        }
        if(node.getIsEnd()){
            assemblyPlan.setOutputNumber(assemblyPlan.getOutputNumber() + 1);
        }
        assemblyPlanDao.updateByPrimaryKeySelective(assemblyPlan);
        record.status = getStatus(params.status, node.isEnd,workLast.workType.toString());
        return record;
    }