From 5ec8d62c24fc5844d1b88a91398178856ec76b12 Mon Sep 17 00:00:00 2001 From: sfd <sun.sunshine@163.com> Date: 星期四, 08 五月 2025 15:46:17 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.50.149:8085/r/aps-backend into dev --- aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomOrderDetail.java | 6 ++ aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlateStandardRequireBomStockDetailService.java | 2 aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java | 31 ++------------- aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomStockDetail.java | 6 ++- aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml | 12 +++++ aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java | 3 + aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml | 10 ++++ aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java | 5 +- 8 files changed, 39 insertions(+), 36 deletions(-) diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomOrderDetail.java b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomOrderDetail.java index 6bbf5c7..80cbc87 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomOrderDetail.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomOrderDetail.java @@ -26,9 +26,13 @@ private Long id; + /** 闇�姹侷D */ + @Excel(name = "闇�姹侷D") + private String requireId; + /** 闇�姹傝拷婧疘D */ @Excel(name = "闇�姹傝拷婧疘D") - private String requireId; + private String requireTrackId; /** bom_line_id */ @Excel(name = "bom_line_id") diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomStockDetail.java b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomStockDetail.java index 25fc2b1..df97283 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomStockDetail.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsPlateStandardRequireBomStockDetail.java @@ -28,9 +28,11 @@ private Long id; /** 闇�姹傝拷婧疘D */ - @Excel(name = "闇�姹傝拷婧疘D") + @Excel(name = "闇�姹侷D") private String requireId; - + /** 闇�姹傝拷婧疘D */ + @Excel(name = "闇�姹傝拷婧疘D") + private String requireTrackId; /** bom_line_id */ @Excel(name = "bom_line_id") private String bomLineId; diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlateStandardRequireBomStockDetailService.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlateStandardRequireBomStockDetailService.java index 9a187ed..44a0e68 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlateStandardRequireBomStockDetailService.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/IApsPlateStandardRequireBomStockDetailService.java @@ -64,5 +64,5 @@ */ public int deleteApsPlateStandardRequireBomStockDetailById(Long id); - void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount); + void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount,String requireId); } diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java index 29b53d1..e82eee2 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomOrderDetailServiceImpl.java @@ -108,7 +108,8 @@ /* 璁板綍宸ュ崟涓庡噣闇�姹傜殑鍖归厤鍏崇郴*/ ApsPlateStandardRequireBomOrderDetail bomOrderDetail = ApsPlateStandardRequireBomOrderDetail.builder() .id(IdUtil.getSnowflakeNextId()) - .requireId(require.getRequireId()) + .requireId(require.getId().toString()) + .requireTrackId(require.getRequireId()) .bomLineId(require.getBomLineId()) .bomLineCode(require.getBomLineCode()) .docNo(platePlan.getDocumentNumber()) diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java index 33b8409..054cf44 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireBomStockDetailServiceImpl.java @@ -109,13 +109,14 @@ * 璁$畻鐗╂枡鍓╀綑搴撳瓨 骞朵繚瀛樼墿鏂欏墿浣欏簱瀛樻槑缁嗐�� * */ @Override - public void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount){ + public void saveStorageAndDetail(ApsMaterialStorageManagement itemStorage, ApsPlatePlan plan, ApsBom bomLine, String batchNum, BigDecimal deductionAmount, BigDecimal afterStockAmount,String requireId){ /*鏇存柊鐗╂枡鍓╀綑搴撳瓨*/ itemStorageMapper.updateMaterialStorageByVersion(afterStockAmount,itemStorage.getVersion()); /*璁板綍鎵e噺鏄庣粏*/ ApsPlateStandardRequireBomStockDetail bomStockDetail = ApsPlateStandardRequireBomStockDetail.builder() .id(IdUtil.getSnowflakeNextId()) - .requireId(plan.getRequireId()) + .requireId(requireId) + .requireTrackId(plan.getRequireId()) .bomLineId(bomLine.getBomLineId()) .bomLineCode(bomLine.getItemCode()) .beforeStockAmount(itemStorage.getRemainderStock()) diff --git a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java index 7029b83..0e40df7 100644 --- a/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java +++ b/aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsPlateStandardRequireServiceImpl.java @@ -160,8 +160,6 @@ String plantCode="FORTUNA"; /*瀹氫箟涓诲崟绫诲瀷涓洪挘閲戜富鍗�*/ String mainOrderType = "閽i噾涓讳欢"; - /*瀹氫箟瀛愬崟绫诲瀷涓洪挘閲戝瓙鍗�*/ - String subOrderType = "閽i噾瀛愪欢"; /*鐢熸垚鏂版壒娆″彿*/ String batchNum=getBatch(); /*鑾峰彇閽i噾涓诲崟淇℃伅*/ @@ -187,17 +185,14 @@ } } } - - - - } + /** + * 鏋勫缓闇�姹備俊鎭� + * */ private void getBomRequires(String plant, ApsBom bomLine, String batchNum, Date upLevelStartDate, ApsPlatePlan plan, List<ApsPlateStandardRequire> allRequires, Long level) { String itemNumber = bomLine.getItemCode(); - String productivityModel_combined_batch = "鍚堟壒"; - String productivityModel_monopolize = "鐙崰"; /*鏋勫缓闇�姹備俊鎭�*/ ApsPlateStandardRequire require = new ApsPlateStandardRequire(); require.setId(IdUtil.getSnowflakeNextId()); @@ -242,7 +237,7 @@ afterStockAmount = remainderStock.subtract(deductionAmount); require.setNetRequirement(BigDecimal.ZERO); } - bomStockDetailService.saveStorageAndDetail(storage, plan, bomLine, batchNum, deductionAmount, afterStockAmount); + bomStockDetailService.saveStorageAndDetail(storage, plan, bomLine, batchNum, deductionAmount, afterStockAmount,require.getId().toString()); } } @@ -288,7 +283,6 @@ require.setMatchState("寰呭尮閰�"); require.setMatchMode("宸ュ崟鍖归厤"); } - require.setHasDelayRisk("鏃犻闄�"); /*浣跨敤瀛愪欢宸ュ崟杩涜闇�姹傚尮閰�*/ matchRequireAndSubPlan(require); @@ -300,23 +294,6 @@ getBomRequires(plant, line, batchNum, require.getStartDate(), plan, allRequires, level + 1); }); } - } - - private BigDecimal getRouteLineTotalTime(ApsStandardProcessRouteHeader routeHeader, String productivityModel_monopolize, BigDecimal netRequirement) { - ApsStandardProcessRouteLine routeLineParam = ApsStandardProcessRouteLine.builder() - .routeId(routeHeader.getRouteId()) - .build(); - List<ApsStandardProcessRouteLine> apsStandardProcessRouteLines = ApsStandardProcessRouteLineMapper.selectApsStandardProcessRouteLineList(routeLineParam); - /*宸ヨ壓璺嚎Line 鎬诲伐鏃�*/ - BigDecimal totalRouteTime = BigDecimal.ZERO; - apsStandardProcessRouteLines.forEach(line -> { - line.setRouteTime(line.getDesignCapacity()); - if (line.getProductivityModel().equals(productivityModel_monopolize)) { - line.setRouteTime(line.getDesignCapacity().multiply(netRequirement)); - } - totalRouteTime.add(line.getRouteTime()); - }); - return totalRouteTime; } /** diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml index 702ac58..149e3fc 100644 --- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml +++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomOrderDetailMapper.xml @@ -7,6 +7,7 @@ <resultMap type="ApsPlateStandardRequireBomOrderDetail" id="ApsPlateStandardRequireBomOrderDetailResult"> <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="docNo" column="doc_no" /> @@ -23,13 +24,17 @@ </resultMap> <sql id="selectApsPlateStandardRequireBomOrderDetailVo"> - select id, require_id, bom_line_id, bom_line_code, doc_no, before_prod_amount, deduction_amount, after_prod_amount, org_code, batch_number, del_flag, create_time, create_by, update_by, update_time from aps_plate_standard_require_bom_order_detail + select id, require_id,require_track_id, bom_line_id, bom_line_code, doc_no, + before_prod_amount, deduction_amount, after_prod_amount, + org_code, batch_number, del_flag, create_time, create_by, update_by, update_time + from aps_plate_standard_require_bom_order_detail </sql> <select id="selectApsPlateStandardRequireBomOrderDetailList" parameterType="ApsPlateStandardRequireBomOrderDetail" resultMap="ApsPlateStandardRequireBomOrderDetailResult"> <include refid="selectApsPlateStandardRequireBomOrderDetailVo"/> <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="docNo != null and docNo != ''"> and doc_no = #{docNo}</if> @@ -51,6 +56,8 @@ <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="docNo != null">doc_no,</if> @@ -68,6 +75,8 @@ <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="docNo != null">#{docNo},</if> @@ -88,6 +97,7 @@ update aps_plate_standard_require_bom_order_detail <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="docNo != null">doc_no = #{docNo},</if> diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml index 117c0fb..e94a2cd 100644 --- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml +++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsPlateStandardRequireBomStockDetailMapper.xml @@ -7,6 +7,7 @@ <resultMap type="ApsPlateStandardRequireBomStockDetail" id="ApsPlateStandardRequireBomStockDetailResult"> <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="beforeStockAmount" column="before_stock_amount" /> @@ -22,13 +23,17 @@ </resultMap> <sql id="selectApsPlateStandardRequireBomStockDetailVo"> - select id, require_id, bom_line_id, bom_line_code, before_stock_amount, deduction_amount, after_stock_amount, org_code, batch_number, del_flag, create_time, create_by, update_by, update_time from aps_plate_standard_require_bom_stock_detail + select id, require_id,require_track_id, bom_line_id, bom_line_code, before_stock_amount, + deduction_amount, after_stock_amount, org_code, batch_number, del_flag, + create_time, create_by, update_by, update_time + from aps_plate_standard_require_bom_stock_detail </sql> <select id="selectApsPlateStandardRequireBomStockDetailList" parameterType="ApsPlateStandardRequireBomStockDetail" resultMap="ApsPlateStandardRequireBomStockDetailResult"> <include refid="selectApsPlateStandardRequireBomStockDetailVo"/> <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="beforeStockAmount != null and beforeStockAmount != ''"> and before_stock_amount = #{beforeStockAmount}</if> @@ -49,6 +54,7 @@ <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="beforeStockAmount != null">before_stock_amount,</if> @@ -65,6 +71,7 @@ <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="beforeStockAmount != null">#{beforeStockAmount},</if> @@ -84,6 +91,7 @@ update aps_plate_standard_require_bom_stock_detail <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="beforeStockAmount != null">before_stock_amount = #{beforeStockAmount},</if> -- Gitblit v1.9.3