| | |
| | | |
| | | /** 需求追溯ID */ |
| | | @Excel(name = "需求追溯ID") |
| | | private String requireId; |
| | | private String requireTrackId; |
| | | /**单号*/ |
| | | private String docNum; |
| | | |
| | |
| | | |
| | | /** 需求ID */ |
| | | @Excel(name = "需求ID") |
| | | private String requireId; |
| | | private Long requireId; |
| | | |
| | | /** 需求追溯ID */ |
| | | @Excel(name = "需求追溯ID") |
| | |
| | | |
| | | /** 需求追溯ID */ |
| | | @Excel(name = "需求ID") |
| | | private String requireId; |
| | | private Long requireId; |
| | | /** 需求追溯ID */ |
| | | @Excel(name = "需求追溯ID") |
| | | private String requireTrackId; |
| | |
| | | /** 需求Id号 */ |
| | | @Excel(name = "需求Id号") |
| | | @Schema(description = "需求Id号") |
| | | private String requireId; |
| | | private Long requireId; |
| | | |
| | | /** 工单号 */ |
| | | @Excel(name = "工单号") |
| | |
| | | */ |
| | | public int deleteApsPlateStandardRequireBomStockDetailById(Long id); |
| | | |
| | | void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount,String requireId); |
| | | void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount,Long requireId); |
| | | } |
| | |
| | | /* 记录工单与净需求的匹配关系*/ |
| | | ApsPlateStandardRequireBomOrderDetail bomOrderDetail = ApsPlateStandardRequireBomOrderDetail.builder() |
| | | .id(IdUtil.getSnowflakeNextId()) |
| | | .requireId(require.getId().toString()) |
| | | .requireTrackId(require.getRequireId()) |
| | | .requireId(require.getId()) |
| | | .requireTrackId(require.getRequireTrackId()) |
| | | .bomLineId(require.getBomLineId()) |
| | | .bomLineCode(require.getBomLineCode()) |
| | | .docNo(platePlan.getDocumentNumber()) |
| | |
| | | * 计算物料剩余库存 并保存物料剩余库存明细。 |
| | | * */ |
| | | @Override |
| | | public void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount,String requireId){ |
| | | public void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount,Long requireId){ |
| | | /*更新物料剩余库存*/ |
| | | itemStorageMapper.updateMaterialStorageByVersion(afterStockAmount,itemStorage.getVersion()); |
| | | /*记录扣减明细*/ |
| | |
| | | /*构建需求信息*/ |
| | | ApsPlateStandardRequire require = new ApsPlateStandardRequire(); |
| | | require.setId(IdUtil.getSnowflakeNextId()); |
| | | require.setRequireId(plan.getId()); |
| | | require.setRequireTrackId(plan.getId()); |
| | | require.setBatchNumber(batchNum); |
| | | require.setDocNum(plan.getDocumentNumber()); |
| | | require.setOrgCode(plant); |
| | |
| | | afterStockAmount = remainderStock.subtract(deductionAmount); |
| | | require.setNetRequirement(BigDecimal.ZERO); |
| | | } |
| | | bomStockDetailService.saveStorageAndDetail(storage, plan, bomLine, batchNum, deductionAmount, afterStockAmount,require.getId().toString()); |
| | | bomStockDetailService.saveStorageAndDetail(storage, plan, bomLine, batchNum, deductionAmount, afterStockAmount,require.getId()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | private void saveRequireError(ApsPlateStandardRequire require,String message) { |
| | | ApsPlateStandardRequireError data = ApsPlateStandardRequireError.builder() |
| | | .requireId(require.getRequireId()) |
| | | .requireId(require.getId()) |
| | | .batchNumber(require.getBatchNumber()) |
| | | .docNum(require.getDocNum()) |
| | | .itemNum(require.getBomLineCode()) |
| | |
| | | |
| | | <resultMap type="ApsPlateStandardRequire" id="ApsPlateStandardRequireResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="requireId" column="require_id" /> |
| | | <result property="requireTrackId" column="require_track_id" /> |
| | | <result property="bomLineId" column="bom_line_id" /> |
| | | <result property="bomLineCode" column="bom_line_code" /> |
| | | <result property="bomLineLevel" column="bom_line_level" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsPlateStandardRequireVo"> |
| | | select id, require_id, bom_line_id, bom_line_code, bom_line_level, bom_use_amount, process_route_id, process_route_hours, require_amount, net_requirement, start_date, complete_date, demand_date, org_code, production_base, match_state, match_mode, unmatched_demand_amount, suggested_completion_date, has_delay_risk, batch_number, del_flag, create_time, create_by, update_by, update_time from aps_plate_standard_require |
| | | select id, require_track_id, bom_line_id, bom_line_code, bom_line_level, bom_use_amount, |
| | | process_route_id, process_route_hours, require_amount, net_requirement, start_date, |
| | | complete_date, demand_date, org_code, production_base, match_state, match_mode, |
| | | unmatched_demand_amount, suggested_completion_date, has_delay_risk, batch_number, |
| | | del_flag, create_time, create_by, update_by, update_time |
| | | from aps_plate_standard_require |
| | | </sql> |
| | | |
| | | <select id="selectApsPlateStandardRequireList" parameterType="ApsPlateStandardRequire" resultMap="ApsPlateStandardRequireResult"> |
| | | <include refid="selectApsPlateStandardRequireVo"/> |
| | | <where> |
| | | <if test="requireId != null and requireId != ''"> and require_id = #{requireId}</if> |
| | | <if test="requireTrackId != null and requireTrackId != ''"> and require_track_id = #{requireTrackId}</if> |
| | | <if test="bomLineId != null and bomLineId != ''"> and bom_line_id = #{bomLineId}</if> |
| | | <if test="bomLineCode != null and bomLineCode != ''"> and bom_line_code = #{bomLineCode}</if> |
| | | <if test="bomLineLevel != null "> and bom_line_level = #{bomLineLevel}</if> |
| | |
| | | insert into aps_plate_standard_require |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="requireId != null">require_id,</if> |
| | | <if test="requireTrackId != null">require_track_id,</if> |
| | | <if test="bomLineId != null">bom_line_id,</if> |
| | | <if test="bomLineCode != null">bom_line_code,</if> |
| | | <if test="bomLineLevel != null">bom_line_level,</if> |
| | |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="requireId != null">#{requireId},</if> |
| | | <if test="requireTrackId != null">#{requireTrackId},</if> |
| | | <if test="bomLineId != null">#{bomLineId},</if> |
| | | <if test="bomLineCode != null">#{bomLineCode},</if> |
| | | <if test="bomLineLevel != null">#{bomLineLevel},</if> |
| | |
| | | <update id="updateApsPlateStandardRequire" parameterType="ApsPlateStandardRequire"> |
| | | update aps_plate_standard_require |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="requireId != null">require_id = #{requireId},</if> |
| | | <if test="requireTrackId != null">require_track_id = #{requireTrackId},</if> |
| | | <if test="bomLineId != null">bom_line_id = #{bomLineId},</if> |
| | | <if test="bomLineCode != null">bom_line_code = #{bomLineCode},</if> |
| | | <if test="bomLineLevel != null">bom_line_level = #{bomLineLevel},</if> |
| | |
| | | </delete> |
| | | |
| | | <select id="selectPlateSupplyGapList" parameterType="ApsPlateStandardRequire" resultMap="ApsPlateStandardRequireResult"> |
| | | select id, require_id, bom_line_code, bom_line_level, match_state, match_mode, unmatched_demand_amount, start_date, complete_date, demand_date, org_code, production_base |
| | | select id, require_track_id, bom_line_code, bom_line_level, |
| | | match_state, match_mode, unmatched_demand_amount, start_date, |
| | | complete_date, demand_date, org_code, production_base |
| | | from aps_plate_standard_require where unmatched_demand_amount>0 |
| | | <if test="requireId != null and requireId != ''"> and require_id like '%' || #{requireId} || '%'</if> |
| | | <if test="requireTrackId != null and requireTrackId != ''"> and require_track_id like '%' || #{requireTrackId} || '%'</if> |
| | | <if test="bomLineCode != null and bomLineCode != ''"> and bom_line_code like '%' || #{bomLineCode} || '%'</if> |
| | | </select> |
| | | |
| | | <insert id="batchInsert" parameterType="java.util.List"> |
| | | insert into aps_plate_standard_require |
| | | (id, require_id,doc_num,batch_number, org_code, bom_line_id, bom_line_code, bom_line_level, bom_use_amount, process_route_id, |
| | | (id, require_track_id,doc_num,batch_number, org_code, bom_line_id, bom_line_code, bom_line_level, bom_use_amount, process_route_id, |
| | | process_route_hours, require_amount, net_requirement, start_date, complete_date, demand_date, |
| | | production_base, match_state, match_mode, unmatched_demand_amount, suggested_completion_date, |
| | | has_delay_risk, batch_number, del_flag, create_time, create_by) |
| | |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.Id}, |
| | | #{item.requireId}, |
| | | #{item.requireTrackId}, |
| | | #{item.docNum}, |
| | | #{item.batchNumber}, |
| | | #{item.orgCode}, |