完成工單/完成 API 改為僅 ADMIN;「工單生產流程」tab 僅 ADMIN 可見;「已提料」改為全部 POL completed;文案「未提料」→「未完成提料」/Pick incomplete。fix負數倉
| @@ -75,7 +75,7 @@ public class SecurityConfig { | |||||
| } | } | ||||
| /** | /** | ||||
| * FP-MTMS Version Checklist | Functions Ref. No. 51 | v1.0.0 | 2026-08-05 | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 51 | v1.0.1 | 2026-08-06 | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 3 | v1.0.5 | 2026-08-05 | * FP-MTMS Version Checklist | Functions Ref. No. 3 | v1.0.5 | 2026-08-05 | ||||
| * (stockAdjustment/submit → INVENTORY_ADJUST only) | * (stockAdjustment/submit → INVENTORY_ADJUST only) | ||||
| */ | */ | ||||
| @@ -122,9 +122,9 @@ public class SecurityConfig { | |||||
| .hasAuthority("ITEM_TRACING") | .hasAuthority("ITEM_TRACING") | ||||
| .requestMatchers(HttpMethod.GET, "/inventoryLotLine/trace/location/**") | .requestMatchers(HttpMethod.GET, "/inventoryLotLine/trace/location/**") | ||||
| .hasAuthority("ITEM_TRACING") | .hasAuthority("ITEM_TRACING") | ||||
| /* 工單 生產流程 完成工單 */ | |||||
| /* 工單 生產流程 完成工單:僅 ADMIN */ | |||||
| .requestMatchers(HttpMethod.POST, "/product-process/Demo/ProcessLine/complete/**") | .requestMatchers(HttpMethod.POST, "/product-process/Demo/ProcessLine/complete/**") | ||||
| .hasAuthority("PRODUCT_PROCESS") | |||||
| .hasAuthority("ADMIN") | |||||
| /* 工序「已完成」(Just Pass):僅 ADMIN */ | /* 工序「已完成」(Just Pass):僅 ADMIN */ | ||||
| .requestMatchers(HttpMethod.POST, "/product-process/Demo/ProcessLine/pass/**") | .requestMatchers(HttpMethod.POST, "/product-process/Demo/ProcessLine/pass/**") | ||||
| .hasAuthority("ADMIN") | .hasAuthority("ADMIN") | ||||
| @@ -256,31 +256,34 @@ fun findAllReleasedJoWorkbenchPickOrders( | |||||
| fun incrementSubmittedLines(@Param("pickOrderId") pickOrderId: Long): Int | fun incrementSubmittedLines(@Param("pickOrderId") pickOrderId: Long): Int | ||||
| /** | /** | ||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.0 | 2026-08-03 | |||||
| * JO ids that have at least one stock_out_line counted as picked | |||||
| * (checked / partially_completed / completed / picking, or rejected with qty > 0). | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.1 | 2026-08-06 | |||||
| * JO ids whose pick order lines are all completed (one JO ↔ one pick order in practice). | |||||
| * Used for production-process 「已提料」 bucket. | |||||
| */ | */ | ||||
| @Query( | @Query( | ||||
| value = """ | value = """ | ||||
| SELECT DISTINCT po.joId | |||||
| SELECT po.joId | |||||
| FROM pick_order po | FROM pick_order po | ||||
| INNER JOIN pick_order_line pol ON pol.poId = po.id AND pol.deleted = 0 | INNER JOIN pick_order_line pol ON pol.poId = po.id AND pol.deleted = 0 | ||||
| INNER JOIN stock_out_line sol ON sol.pickOrderLineId = pol.id AND sol.deleted = 0 | |||||
| WHERE po.deleted = 0 | WHERE po.deleted = 0 | ||||
| AND po.joId IN (:joIds) | AND po.joId IN (:joIds) | ||||
| AND ( | |||||
| LOWER(COALESCE(sol.status, '')) IN ('checked', 'partially_completed', 'completed', 'picking') | |||||
| OR (LOWER(COALESCE(sol.status, '')) = 'rejected' AND COALESCE(sol.qty, 0) > 0) | |||||
| ) | |||||
| GROUP BY po.joId, po.id | |||||
| HAVING COUNT(*) > 0 | |||||
| AND COUNT(*) = SUM( | |||||
| CASE WHEN LOWER(COALESCE(pol.status, '')) = 'completed' THEN 1 ELSE 0 END | |||||
| ) | |||||
| """, | """, | ||||
| nativeQuery = true, | nativeQuery = true, | ||||
| ) | ) | ||||
| fun findPickedJobOrderIds(@Param("joIds") joIds: Collection<Long>): List<Long> | fun findPickedJobOrderIds(@Param("joIds") joIds: Collection<Long>): List<Long> | ||||
| /** Unlimited: picked + product process still pending / not started. */ | |||||
| /** | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.1 | 2026-08-06 | |||||
| * Unlimited: all POL completed + product process still pending / not started. | |||||
| */ | |||||
| @Query( | @Query( | ||||
| value = """ | value = """ | ||||
| SELECT DISTINCT po.joId | |||||
| SELECT po.joId | |||||
| FROM pick_order po | FROM pick_order po | ||||
| INNER JOIN job_order jo | INNER JOIN job_order jo | ||||
| ON jo.id = po.joId | ON jo.id = po.joId | ||||
| @@ -293,13 +296,13 @@ fun incrementSubmittedLines(@Param("pickOrderId") pickOrderId: Long): Int | |||||
| AND LOWER(pp.status) = 'pending' | AND LOWER(pp.status) = 'pending' | ||||
| AND pp.startTime IS NULL | AND pp.startTime IS NULL | ||||
| INNER JOIN pick_order_line pol ON pol.poId = po.id AND pol.deleted = 0 | INNER JOIN pick_order_line pol ON pol.poId = po.id AND pol.deleted = 0 | ||||
| INNER JOIN stock_out_line sol ON sol.pickOrderLineId = pol.id AND sol.deleted = 0 | |||||
| WHERE po.deleted = 0 | WHERE po.deleted = 0 | ||||
| AND po.joId IS NOT NULL | AND po.joId IS NOT NULL | ||||
| AND ( | |||||
| LOWER(COALESCE(sol.status, '')) IN ('checked', 'partially_completed', 'completed', 'picking') | |||||
| OR (LOWER(COALESCE(sol.status, '')) = 'rejected' AND COALESCE(sol.qty, 0) > 0) | |||||
| ) | |||||
| GROUP BY po.joId, po.id | |||||
| HAVING COUNT(*) > 0 | |||||
| AND COUNT(*) = SUM( | |||||
| CASE WHEN LOWER(COALESCE(pol.status, '')) = 'completed' THEN 1 ELSE 0 END | |||||
| ) | |||||
| """, | """, | ||||
| nativeQuery = true, | nativeQuery = true, | ||||
| ) | ) | ||||
| @@ -57,7 +57,7 @@ interface ProductProcessRepository : JpaRepository<ProductProcess, Long>, JpaSpe | |||||
| ): List<JobOrderProcessAggregate> | ): List<JobOrderProcessAggregate> | ||||
| /** | /** | ||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.0 | 2026-08-03 | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.1 | 2026-08-06 | |||||
| * Production list lookback: inclusive date range on ProductProcess.date. | * Production list lookback: inclusive date range on ProductProcess.date. | ||||
| */ | */ | ||||
| @Query( | @Query( | ||||
| @@ -114,7 +114,7 @@ interface ProductProcessRepository : JpaRepository<ProductProcess, Long>, JpaSpe | |||||
| GROUP BY p.jobOrder.id | GROUP BY p.jobOrder.id | ||||
| """ | """ | ||||
| ) | ) | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.0 | 2026-08-03 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.1 | 2026-08-06 */ | |||||
| fun findCandidateJobOrderAggregatesByJobOrderIds( | fun findCandidateJobOrderAggregatesByJobOrderIds( | ||||
| @Param("jobOrderIds") jobOrderIds: Collection<Long>, | @Param("jobOrderIds") jobOrderIds: Collection<Long>, | ||||
| @Param("itemCode") itemCode: String?, | @Param("itemCode") itemCode: String?, | ||||
| @@ -1498,7 +1498,7 @@ open class ProductProcessService( | |||||
| } | } | ||||
| /** | /** | ||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.0 | 2026-08-03 | |||||
| * FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.1 | 2026-08-06 | |||||
| * QC 列表:按 jobOrder 粒度分页,qcReady 由该 jobOrder 下所有 productProcessLine 是否全部 Completed/Pass 决定。 | * QC 列表:按 jobOrder 粒度分页,qcReady 由该 jobOrder 下所有 productProcessLine 是否全部 Completed/Pass 决定。 | ||||
| * | * | ||||
| * 注意:date/itemCode/jobOrderCode/bomIds 用来筛选“候选 jobOrder”,但 qcReady 判断会用该 jobOrder 下全部 productProcessLine。 | * 注意:date/itemCode/jobOrderCode/bomIds 用来筛选“候选 jobOrder”,但 qcReady 判断会用该 jobOrder 下全部 productProcessLine。 | ||||
| @@ -200,7 +200,7 @@ class ProductProcessController( | |||||
| return productProcessService.getAllJoborderProductProcessInfo(bomType) | return productProcessService.getAllJoborderProductProcessInfo(bomType) | ||||
| } | } | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.0 | 2026-08-03 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 41 | v1.0.1 | 2026-08-06 */ | |||||
| @GetMapping("/Demo/Process/search") | @GetMapping("/Demo/Process/search") | ||||
| fun demoprocesssearch( | fun demoprocesssearch( | ||||
| @RequestParam(required = false) date: String?, | @RequestParam(required = false) date: String?, | ||||
| @@ -187,7 +187,7 @@ public class GroupService extends AbstractBaseEntityService<Group, Long, GroupRe | |||||
| } | } | ||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 51 | v1.0.0 | 2026-08-05 */ | |||||
| /** FP-MTMS Version Checklist | Functions Ref. No. 51 | v1.0.1 | 2026-08-06 */ | |||||
| @Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
| public List<Map<String, Object>> listAuth(Map<String, Object> args) { | public List<Map<String, Object>> listAuth(Map<String, Object> args) { | ||||
| @@ -3,6 +3,6 @@ | |||||
| --changeset fpsms:product_process_complete_authority | --changeset fpsms:product_process_complete_authority | ||||
| --preconditions onFail:MARK_RAN | --preconditions onFail:MARK_RAN | ||||
| --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM authority WHERE authority = 'PRODUCT_PROCESS' | --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM authority WHERE authority = 'PRODUCT_PROCESS' | ||||
| --comment: FP-MTMS Version Checklist | Functions Ref. No. 51 | v1.0.0 | 2026-08-05 — Allow completing job order product process lines (工單 生產流程 完成工單) | |||||
| --comment: FP-MTMS Version Checklist | Functions Ref. No. 51 | v1.0.1 | 2026-08-06 — Allow completing job order product process lines (工單 生產流程 完成工單) | |||||
| INSERT IGNORE INTO `authority` (`authority`, `name`, `module`, `description`) | INSERT IGNORE INTO `authority` (`authority`, `name`, `module`, `description`) | ||||
| VALUES ('PRODUCT_PROCESS', '工單 生產流程 完成工單', 'JOB_ORDER', 'Allow completing job order product process lines'); | VALUES ('PRODUCT_PROCESS', '工單 生產流程 完成工單', 'JOB_ORDER', 'Allow completing job order product process lines'); | ||||