Fancy
2024-07-05 eead3af59c94c35422463fbbd19d26dffcbacc06
edit work last
3个文件已修改
132 ■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaAssemblyWorkLast.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml 95 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoSta/StaAssemblyWorkLast.java
@@ -6,7 +6,6 @@
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import jakarta.validation.constraints.NotNull;
import lombok.*;
@@ -58,6 +57,12 @@
    @TableField(exist = false)
    public String stationName;
    @TableField(exist = false)
    public String proName;
    @TableField(exist = false)
    public String devicePrefix;
    /**
    * 组装生产任务实体编号
    */
@@ -89,8 +94,8 @@
    public Integer nodeType;
    @TableField(exist = false)
    public PrAssemblyPlan plan;
    /**
    * 任务认领时间
    */
pms-parent/pms-global/src/main/resources/mapper/StaAssemblyWorkLastMapper.xml
@@ -20,12 +20,20 @@
            <result property="assistants" column="assistants" jdbcType="VARCHAR"/>
            <association property="userName" column="user_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectNameByUserId" fetchType="eager" />
            <association property="stationName" column="station_id" javaType="java.lang.Long"
       <!-- <association property="stationName" column="station_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPlt.PltStationMapper.selectNameByStationId" fetchType="eager" />
        <association property="planName" column="plan_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper.selectNameByPlanId" fetchType="eager"/>
        <association property="processName" column="process_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPr.PrProductionProcessMapper.selectProcessNameById" fetchType="eager"/>
        <association property="nodeName" column="node_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPr.PrProductionNodeMapper.selectNameByNodeId" fetchType="eager"/>-->
            <association property="lineName" column="line_id" javaType="java.lang.Long"
                     select="com.dy.pmsGlobal.daoPlt.PltProductionLineMapper.selectNameByLineId" fetchType="eager" />
            <collection property="assistantsList" ofType="com.dy.pmsGlobal.pojoBa.BaUser"
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager" column="assistants" />
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager"
                    column="assistants"/>
    </resultMap>
    <resultMap id="SelectResultMap" type="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast">
@@ -49,29 +57,58 @@
        <result property="nodeName" column="node_name" jdbcType="VARCHAR"/>
        <result property="lineName" column="line_name" jdbcType="VARCHAR"/>
        <collection property="assistantsList" ofType="com.dy.pmsGlobal.pojoBa.BaUser"
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager" column="assistants" />
                    select="com.dy.pmsGlobal.daoBa.BaUserMapper.selectByAssistants" fetchType="eager"
                    column="assistants"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,user_id,line_id,
        id
        ,user_id,line_id,
        station_id,plan_id,process_id,
        node_id,node_type,dt,status,
        start_time,end_time,assistants
    </sql>
    <sql id="part_Column_List">
        ${alias}.id,
        ${alias}.user_id,
        ${alias}.line_id,
        ${alias}.station_id,
        ${alias}.plan_id,
        ${alias}.process_id,
        ${alias}.node_id,
        ${alias}.node_type,
        ${alias}.dt,
        ${alias}.status,
        ${alias}.start_time,
        ${alias}.end_time,
        ${alias}.assistants
        ${alias}
        .
        id
        ,
        ${alias}
        .
        user_id,
        ${alias}
        .
        line_id,
        ${alias}
        .
        station_id,
        ${alias}
        .
        plan_id,
        ${alias}
        .
        process_id,
        ${alias}
        .
        node_id,
        ${alias}
        .
        node_type,
        ${alias}
        .
        dt,
        ${alias}
        .
        status,
        ${alias}
        .
        start_time,
        ${alias}
        .
        end_time,
        ${alias}
        .
        assistants
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
@@ -146,7 +183,8 @@
        select
        <include refid="part_Column_List" >
            <property name="alias" value="l"/>
        </include>,
        </include>
        ,
               u.name as user_name,
               s.name as station_name,
               p.name as plan_name,
@@ -280,23 +318,25 @@
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from sta_assembly_work_last
        delete
        from sta_assembly_work_last
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast" useGeneratedKeys="true">
    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast"
            useGeneratedKeys="true">
        insert into sta_assembly_work_last
        ( id,user_id,line_id
        ,station_id,plan_id,process_id
        ,node_id,node_type,dt,status
        ,start_time,end_time,assistants
        )
        , start_time, end_time, assistants)
        values (#{id,jdbcType=BIGINT},#{userId,jdbcType=BIGINT},#{lineId,jdbcType=BIGINT}
        ,#{stationId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{processId,jdbcType=BIGINT}
        ,#{nodeId,jdbcType=BIGINT},#{nodeType,jdbcType=TINYINT},#{dt,jdbcType=TIMESTAMP},#{status,jdbcType=TINYINT}
        ,#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{assistants,jdbcType=VARCHAR}
        )
               , #{nodeId,jdbcType=BIGINT}, #{nodeType,jdbcType=TINYINT}, #{dt,jdbcType=TIMESTAMP}
               , #{status,jdbcType=TINYINT}
               , #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{assistants,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast" useGeneratedKeys="true">
    <insert id="insertSelective" keyColumn="id" keyProperty="id"
            parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast" useGeneratedKeys="true">
        insert into sta_assembly_work_last
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
@@ -373,8 +413,7 @@
    </update>
    <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast">
        update sta_assembly_work_last
        set
            user_id =  #{userId,jdbcType=BIGINT},
        set user_id    = #{userId,jdbcType=BIGINT},
            line_id =  #{lineId,jdbcType=BIGINT},
            station_id =  #{stationId,jdbcType=BIGINT},
            plan_id =  #{planId,jdbcType=BIGINT},
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
@@ -9,6 +9,7 @@
import com.dy.pmsGlobal.daoSta.StaAssemblyWorkHistoryMapper;
import com.dy.pmsGlobal.daoSta.StaAssemblyWorkLastMapper;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
@@ -146,7 +147,17 @@
                //直接删除记录
                logout(workLasts.get(0).getId().toString());
            } else {
                result.setPlan(assyPlan);
                result.setPlanName(assyPlan.getName());
                result.setProcessName(assyPlan.getProcessName());
                result.setNodeName(assyPlan.getProcess().getNodes().get(0).getContent());
                //找到对应的产品信息
                PltProduct  product = productDao.selectByPrimaryKey(assyPlan.getProId());
                if (product == null) {
                    throw new RuntimeException("产品信息有误或被其他人员修改,请登录管理系统查看任务关联产品ID为:" + assyPlan.getProId());
                }
                result.setProName(product.getName());
                String devicePrefix = "110" + product.getCode() + assyPlan.getBatchNo();
                result.setDevicePrefix(devicePrefix);
            }
        }
        result.setStationId(stationInfo.getId());
@@ -249,8 +260,17 @@
        StaAssemblyWorkLast result = assemblyWorkLastDao.selectByPrimaryKey(staLast.getId());
        List<PrProductionNode> nodeInfo = assyPlan.getProcess().getNodes().stream()
                .filter(node -> node.id.equals(vo.getNodeId())).collect(Collectors.toList());
        assyPlan.getProcess().setNodes(nodeInfo);
        result.setPlan(assyPlan);
        result.setPlanName(assyPlan.getName());
        result.setProcessName(assyPlan.getProcessName());
        result.setNodeName(assyPlan.getProcess().getNodes().get(0).getContent());
        //找到对应的产品信息
        PltProduct  product = productDao.selectByPrimaryKey(assyPlan.getProId());
        if (product == null) {
            throw new RuntimeException("产品信息有误或被其他人员修改,请登录管理系统查看任务关联产品ID为:" + assyPlan.getProId());
        }
        result.setProName(product.getName());
        String devicePrefix = "110" + product.getCode() + assyPlan.getBatchNo();
        result.setDevicePrefix(devicePrefix);
        return result;
    }