| | |
| | | List<PrProductionNode> selectByProcess(Long processId); |
| | | |
| | | void deleteByProcessId(Long id); |
| | | |
| | | /** |
| | | * 节点是结束节点或之后的节点 |
| | | * @param currNode |
| | | * @return |
| | | */ |
| | | boolean isEndNode(Long currNode); |
| | | } |
| | |
| | | |
| | | import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Options; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | int insert(StaAssemblyWorkLast record); |
| | | |
| | | @Options(useGeneratedKeys = true, keyProperty = "id") |
| | | // @Options(useGeneratedKeys = true, keyProperty = "id") |
| | | int insertSelective(StaAssemblyWorkLast record); |
| | | |
| | | StaAssemblyWorkLast selectByPrimaryKey(Long id); |
| | |
| | | * 生产登录id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long claimId; |
| | | public Long workId; |
| | | /** |
| | | * 维修id |
| | | */ |
| | |
| | | * 生产登录id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long claimId; |
| | | public Long workId; |
| | | /** |
| | | * 维修id |
| | | */ |
| | |
| | | * 生产登录id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long claimId; |
| | | public Long workId; |
| | | /** |
| | | * 维修id |
| | | */ |
| | |
| | | @AllArgsConstructor |
| | | public class StaRepairInfo implements BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long id; |
| | | /** |
| | | * 设备码 |
| | | */ |
| | | public String equipNo; |
| | | /** |
| | | * 生产登录id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long workId; |
| | | /** |
| | | * 从哪个节点进入维修 |
| | | */ |
| | |
| | | */ |
| | | public String repairReason; |
| | | /** |
| | | * 去向节点 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long toNode; |
| | | /** |
| | | * 维修员工 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | |
| | | * 维修时间 |
| | | */ |
| | | public Date repairTime; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | public Date createTime; |
| | | /** |
| | | * 推送员工 |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long createBy; |
| | | |
| | | |
| | | } |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <select id="isEndNode" resultType="java.lang.Boolean"> |
| | | select |
| | | n.sort >=n1.sort |
| | | from pr_production_node n |
| | | left join pr_production_node n1 on n.process_id = n1.process_id |
| | | where n1.id = #{id} and n.is_end=1 |
| | | </select> |
| | | |
| | | <update id="deleteLogicById" parameterType="java.lang.Long"> |
| | | update pr_production_node set deleted = 1 |
| | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLast"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/> |
| | | <result property="claimId" column="claim_id" jdbcType="BIGINT"/> |
| | | <result property="workId" column="work_id" jdbcType="BIGINT"/> |
| | | <result property="repairId" column="repair_id" jdbcType="BIGINT"/> |
| | | <result property="planId" column="plan_id" jdbcType="BIGINT"/> |
| | | <result property="stationId" column="station_id" jdbcType="BIGINT"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,equip_no,claim_id, |
| | | id,equip_no,work_id, |
| | | repair_id,plan_id,station_id, |
| | | curr_node,node_content,equip_cycle_content, |
| | | status,result, |
| | |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLast" useGeneratedKeys="true"> |
| | | insert into sta_device_last |
| | | ( id,equip_no,claim_id |
| | | ( id,equip_no,work_id |
| | | ,repair_id,plan_id,station_id |
| | | ,curr_node,node_content,equip_cycle_content |
| | | ,status,result |
| | | ,error_code,assistants |
| | | ,updated_by,in_time,out_time |
| | | ,memo) |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{claimId,jdbcType=BIGINT} |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT} |
| | | ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT} |
| | | ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR} |
| | | ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT} |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="equipNo != null">equip_no,</if> |
| | | <if test="claimId != null">claim_id,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if> |
| | | <if test="claimId != null">#{claimId,jdbcType=BIGINT},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | |
| | | <if test="equipNo != null"> |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="claimId != null"> |
| | | claim_id = #{claimId,jdbcType=BIGINT}, |
| | | <if test="workId != null"> |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairId != null"> |
| | | repair_id = #{repairId,jdbcType=BIGINT}, |
| | |
| | | update sta_device_last |
| | | set |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | claim_id = #{claimId,jdbcType=BIGINT}, |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | repair_id = #{repairId,jdbcType=BIGINT}, |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | station_id = #{stationId,jdbcType=BIGINT}, |
| | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceLife"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/> |
| | | <result property="claimId" column="claim_id" jdbcType="BIGINT"/> |
| | | <result property="workId" column="work_id" jdbcType="BIGINT"/> |
| | | <result property="repairId" column="repair_id" jdbcType="BIGINT"/> |
| | | <result property="planId" column="plan_id" jdbcType="BIGINT"/> |
| | | <result property="stationId" column="station_id" jdbcType="BIGINT"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,equip_no,claim_id, |
| | | id,equip_no,work_id, |
| | | repair_id,plan_id,station_id, |
| | | curr_node,node_content,equip_cycle_content, |
| | | status,result, |
| | |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceLife" useGeneratedKeys="true"> |
| | | insert into sta_device_life |
| | | ( id,equip_no,claim_id |
| | | ( id,equip_no,work_id |
| | | ,repair_id,plan_id,station_id |
| | | ,curr_node,node_content,equip_cycle_content |
| | | ,status,result |
| | | ,error_code,assistants,in_time |
| | | ,out_time,updated_by,memo |
| | | ) |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{claimId,jdbcType=BIGINT} |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT} |
| | | ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT} |
| | | ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR} |
| | | ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT} |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="equipNo != null">equip_no,</if> |
| | | <if test="claimId != null">claim_id,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if> |
| | | <if test="claimId != null">#{claimId,jdbcType=BIGINT},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | |
| | | <if test="equipNo != null"> |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="claimId != null"> |
| | | claim_id = #{claimId,jdbcType=BIGINT}, |
| | | <if test="workId != null"> |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairId != null"> |
| | | repair_id = #{repairId,jdbcType=BIGINT}, |
| | |
| | | update sta_device_life |
| | | set |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | claim_id = #{claimId,jdbcType=BIGINT}, |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | repair_id = #{repairId,jdbcType=BIGINT}, |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | station_id = #{stationId,jdbcType=BIGINT}, |
| | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/> |
| | | <result property="claimId" column="claim_id" jdbcType="BIGINT"/> |
| | | <result property="workId" column="work_id" jdbcType="BIGINT"/> |
| | | <result property="repairId" column="repair_id" jdbcType="BIGINT"/> |
| | | <result property="planId" column="plan_id" jdbcType="BIGINT"/> |
| | | <result property="stationId" column="station_id" jdbcType="BIGINT"/> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,equip_no,claim_id, |
| | | id,equip_no,work_id, |
| | | repair_id,plan_id,station_id, |
| | | curr_node,node_content,equip_cycle_content, |
| | | status,result, |
| | |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaDeviceProductionLog" useGeneratedKeys="true"> |
| | | insert into sta_device_production_log |
| | | ( id,equip_no,claim_id |
| | | ( id,equip_no,work_id |
| | | ,repair_id,plan_id,station_id |
| | | ,curr_node,node_content,equip_cycle_content |
| | | ,status,result |
| | | ,error_code,assistants,in_time |
| | | ,out_time,updated_by,memo |
| | | ) |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{claimId,jdbcType=BIGINT} |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT} |
| | | ,#{repairId,jdbcType=BIGINT},#{planId,jdbcType=BIGINT},#{stationId,jdbcType=BIGINT} |
| | | ,#{currNode,jdbcType=BIGINT},#{nodeContent,jdbcType=VARCHAR},#{equipCycleContent,jdbcType=VARCHAR} |
| | | ,#{nextNode,jdbcType=BIGINT},#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT} |
| | | ,#{status,jdbcType=TINYINT},#{result,jdbcType=TINYINT} |
| | | ,#{errorCode,jdbcType=VARCHAR},#{assistants,jdbcType=VARCHAR},#{inTime,jdbcType=TIMESTAMP} |
| | | ,#{outTime,jdbcType=TIMESTAMP},#{updatedBy,jdbcType=BIGINT},#{memo,jdbcType=VARCHAR} |
| | | ) |
| | |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="equipNo != null">equip_no,</if> |
| | | <if test="claimId != null">claim_id,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="repairId != null">repair_id,</if> |
| | | <if test="planId != null">plan_id,</if> |
| | | <if test="stationId != null">station_id,</if> |
| | |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if> |
| | | <if test="claimId != null">#{claimId,jdbcType=BIGINT},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="repairId != null">#{repairId,jdbcType=BIGINT},</if> |
| | | <if test="planId != null">#{planId,jdbcType=BIGINT},</if> |
| | | <if test="stationId != null">#{stationId,jdbcType=BIGINT},</if> |
| | | <if test="currNode != null">#{currNode,jdbcType=BIGINT},</if> |
| | | <if test="nodeContent != null">#{nodeContent,jdbcType=VARCHAR},</if> |
| | | <if test="equipCycleContent != null">#{equipCycleContent,jdbcType=VARCHAR},</if> |
| | | <if test="nextNode != null">#{nextNode,jdbcType=BIGINT},</if> |
| | | <if test="status != null">#{status,jdbcType=TINYINT},</if> |
| | | <if test="result != null">#{result,jdbcType=TINYINT},</if> |
| | | <if test="errorCode != null">#{errorCode,jdbcType=VARCHAR},</if> |
| | |
| | | <if test="equipNo != null"> |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="claimId != null"> |
| | | claim_id = #{claimId,jdbcType=BIGINT}, |
| | | <if test="workId != null"> |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairId != null"> |
| | | repair_id = #{repairId,jdbcType=BIGINT}, |
| | |
| | | update sta_device_production_log |
| | | set |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | claim_id = #{claimId,jdbcType=BIGINT}, |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | repair_id = #{repairId,jdbcType=BIGINT}, |
| | | plan_id = #{planId,jdbcType=BIGINT}, |
| | | station_id = #{stationId,jdbcType=BIGINT}, |
| | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoSta.StaRepairInfo"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="equipNo" column="equip_no" jdbcType="VARCHAR"/> |
| | | <result property="workId" column="work_id" jdbcType="BIGINT"/> |
| | | <result property="fromNode" column="from_node" jdbcType="BIGINT"/> |
| | | <result property="repairReason" column="repair_reason" jdbcType="VARCHAR"/> |
| | | <result property="toNode" column="to_node" jdbcType="BIGINT"/> |
| | | <result property="repairBy" column="repair_by" jdbcType="BIGINT"/> |
| | | <result property="repairTime" column="repair_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createBy" column="create_by" jdbcType="BIGINT"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,equip_no,from_node, |
| | | repair_reason,to_node,repair_by, |
| | | repair_time,create_time,create_by |
| | | id,equip_no,work_id, |
| | | from_node,repair_reason,repair_by, |
| | | repair_time |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo" useGeneratedKeys="true"> |
| | | insert into sta_repair_info |
| | | ( id,equip_no,from_node |
| | | ,repair_reason,to_node,repair_by |
| | | ,repair_time,create_time,create_by |
| | | ) |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{fromNode,jdbcType=BIGINT} |
| | | ,#{repairReason,jdbcType=VARCHAR},#{toNode,jdbcType=BIGINT},#{repairBy,jdbcType=BIGINT} |
| | | ,#{repairTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{createBy,jdbcType=BIGINT} |
| | | ) |
| | | ( id,equip_no,work_id |
| | | ,from_node,repair_reason,repair_by |
| | | ,repair_time) |
| | | values (#{id,jdbcType=BIGINT},#{equipNo,jdbcType=VARCHAR},#{workId,jdbcType=BIGINT} |
| | | ,#{fromNode,jdbcType=BIGINT},#{repairReason,jdbcType=VARCHAR},#{repairBy,jdbcType=BIGINT} |
| | | ,#{repairTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo" useGeneratedKeys="true"> |
| | | insert into sta_repair_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="equipNo != null">equip_no,</if> |
| | | <if test="workId != null">work_id,</if> |
| | | <if test="fromNode != null">from_node,</if> |
| | | <if test="repairReason != null">repair_reason,</if> |
| | | <if test="toNode != null">to_node,</if> |
| | | <if test="repairBy != null">repair_by,</if> |
| | | <if test="repairTime != null">repair_time,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="equipNo != null">#{equipNo,jdbcType=VARCHAR},</if> |
| | | <if test="workId != null">#{workId,jdbcType=BIGINT},</if> |
| | | <if test="fromNode != null">#{fromNode,jdbcType=BIGINT},</if> |
| | | <if test="repairReason != null">#{repairReason,jdbcType=VARCHAR},</if> |
| | | <if test="toNode != null">#{toNode,jdbcType=BIGINT},</if> |
| | | <if test="repairBy != null">#{repairBy,jdbcType=BIGINT},</if> |
| | | <if test="repairTime != null">#{repairTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="createBy != null">#{createBy,jdbcType=BIGINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoSta.StaRepairInfo"> |
| | |
| | | <if test="equipNo != null"> |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="workId != null"> |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="fromNode != null"> |
| | | from_node = #{fromNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairReason != null"> |
| | | repair_reason = #{repairReason,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="toNode != null"> |
| | | to_node = #{toNode,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairBy != null"> |
| | | repair_by = #{repairBy,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="repairTime != null"> |
| | | repair_time = #{repairTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="createBy != null"> |
| | | create_by = #{createBy,jdbcType=BIGINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | |
| | | update sta_repair_info |
| | | set |
| | | equip_no = #{equipNo,jdbcType=VARCHAR}, |
| | | work_id = #{workId,jdbcType=BIGINT}, |
| | | from_node = #{fromNode,jdbcType=BIGINT}, |
| | | repair_reason = #{repairReason,jdbcType=VARCHAR}, |
| | | to_node = #{toNode,jdbcType=BIGINT}, |
| | | repair_by = #{repairBy,jdbcType=BIGINT}, |
| | | repair_time = #{repairTime,jdbcType=TIMESTAMP}, |
| | | create_time = #{createTime,jdbcType=TIMESTAMP}, |
| | | create_by = #{createBy,jdbcType=BIGINT} |
| | | repair_time = #{repairTime,jdbcType=TIMESTAMP} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | |
| | | @PostMapping(path = "save") |
| | | public BaseResponse save(@RequestBody @Valid QueryVo vo) { |
| | | log.info("AssemblyStepCtrl.test()"); |
| | | log.info("AssemblyStepCtrl.save()"); |
| | | int count = sv.save(vo); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | @PostMapping(path = "repair") |
| | | public BaseResponse repair(@RequestBody @Valid QueryVo vo) { |
| | | log.info("AssemblyStepCtrl.repair()"); |
| | | int count = sv.repair(vo); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | } |
| | |
| | | private PrAssemblyPlanMapper assemblyPlanDao; |
| | | // private PrProductionProcessMapper processDao; |
| | | private PrProductionNodeMapper nodeDao; |
| | | private StaRepairInfoMapper repairInfoDao; |
| | | @Autowired |
| | | public void setDeviceLastDao(StaDeviceLastMapper deviceLastDao) { |
| | | this.deviceLastDao = deviceLastDao; |
| | |
| | | public void setNodeDao(PrProductionNodeMapper nodeDao) { |
| | | this.nodeDao = nodeDao; |
| | | } |
| | | @Autowired |
| | | public void setRepairInfoDao(StaRepairInfoMapper repairInfoDao) { |
| | | this.repairInfoDao = repairInfoDao; |
| | | } |
| | | |
| | | public int save(QueryVo params) { |
| | | long taskId = Long.parseLong(params.taskId); |
| | | StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(taskId); |
| | | long workId = Long.parseLong(params.workId); |
| | | StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId); |
| | | if (workLast == null) { |
| | | throw new RuntimeException("工单不存在"); |
| | | } |
| | |
| | | throw new RuntimeException("设备号有且只能有一个"); |
| | | } |
| | | |
| | | StaDeviceLast deviceLast = saveDeviceLast(params, workLast, deviceList); |
| | | StaDeviceLast deviceLast = buildDeviceLast(params, workLast, deviceList.get(0)); |
| | | int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) : |
| | | deviceLastDao.updateByPrimaryKeySelective(deviceLast); |
| | | |
| | |
| | | deviceLifeDao.insertSelective(life); |
| | | } |
| | | |
| | | private StaDeviceLast saveDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, List<String> deviceList){ |
| | | private StaDeviceLast buildDeviceLast(QueryVo params, StaAssemblyWorkLast workLast, String deviceNo){ |
| | | //组装数据 |
| | | StaDeviceLast record = new StaDeviceLast(); |
| | | |
| | | StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceList.get(0)); |
| | | StaDeviceLast preRecord = deviceLastDao.selectByDeviceNo(deviceNo); |
| | | if(preRecord != null){ |
| | | record.id = preRecord.id; |
| | | record.inTime = preRecord.outTime; |
| | | } |
| | | record.outTime = new Date(); |
| | | |
| | | record.setPlanId(workLast.planId); |
| | | record.setClaimId(Long.parseLong(params.taskId)); |
| | | record.setStationId(workLast.stationId); |
| | | record.setEquipNo(deviceList.get(0)); |
| | | record.setCurrNode(workLast.nodeId); |
| | | record.planId = workLast.planId; |
| | | record.workId = Long.parseLong(params.workId); |
| | | record.stationId = workLast.stationId; |
| | | record.equipNo = deviceNo; |
| | | record.currNode = workLast.nodeId; |
| | | // record.setNextNode(getNextNode(params.status,workLast.nodeId)); |
| | | |
| | | record.updatedBy = workLast.userId; |
| | |
| | | default -> throw new RuntimeException("状态错误"); |
| | | }; |
| | | } |
| | | |
| | | public int repair(QueryVo vo) { |
| | | long workId = Long.parseLong(vo.workId); |
| | | StaAssemblyWorkLast workLast = assemblyWorkLastDao.selectByPrimaryKey(workId); |
| | | if (workLast == null) { |
| | | throw new RuntimeException("工单不存在"); |
| | | } |
| | | StaDeviceLast preDeviceRecord = deviceLastDao.selectByDeviceNo(vo.deviceNo); |
| | | StaRepairInfo repairInfo = new StaRepairInfo(); |
| | | repairInfo.workId = workId; |
| | | repairInfo.equipNo = vo.deviceNo; |
| | | repairInfo.repairTime = new Date(); |
| | | repairInfo.repairBy = workLast.userId; |
| | | repairInfo.repairReason = vo.errorMsg; |
| | | repairInfo.fromNode = preDeviceRecord.currNode; |
| | | repairInfoDao.insertSelective(repairInfo); |
| | | |
| | | StaDeviceLast deviceLast = new StaDeviceLast(); |
| | | BeanUtils.copyProperties(preDeviceRecord, deviceLast); |
| | | deviceLast.repairId = repairInfo.id; |
| | | deviceLast.errorCode = vo.errorMsg; |
| | | deviceLast.assistants = vo.assistants; |
| | | //如果原节点是结束节点或之后的节点,是则更新为完成,否则更新为组装中(默认维修节点的状态只能为 确定或 报废) |
| | | boolean isEndNode = nodeDao.isEndNode(preDeviceRecord.currNode); |
| | | if(QrCodeConstant.MarkWaste.equals(vo.status)){ |
| | | deviceLast.status = STATUS_WASTE; |
| | | }else{ |
| | | deviceLast.status = isEndNode? STATUS_COMPLETE:STATUS_OK; |
| | | } |
| | | int count = deviceLast.id == null ? deviceLastDao.insertSelective(deviceLast) : |
| | | deviceLastDao.updateByPrimaryKeySelective(deviceLast); |
| | | saveDeviceProductionLog(deviceLast); |
| | | |
| | | if (isEndNode) { |
| | | saveDeviceLife(deviceLast); |
| | | } |
| | | return count; |
| | | } |
| | | } |
| | |
| | | @NotEmpty(message = "设备编号不能为空") |
| | | public String deviceNo; |
| | | @NotNull(message = "任务编号不能为空") |
| | | public String taskId; |
| | | public String workId; |
| | | @NotNull(message = "状态不能为空") |
| | | public String status; |
| | | /** |
| | |
| | | */ |
| | | public String assistants; |
| | | |
| | | public void setTaskId(String taskId) { |
| | | taskId = taskId.replace("", "103"); |
| | | this.taskId = taskId; |
| | | } |
| | | } |