# `Sp_Sis_CopeEventList` (procedure)

> 未清单据强制完工取消完工


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sFormGuid` | `varchar(100)` |
| 2 | IN | `sDataGuid` | `varchar(1000)` |
| 3 | IN | `iType` | `int` |
| 4 | IN | `sMemo` | `varchar(500)` |
| 5 | IN | `sCheckPerson` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(4000)` |
| 7 | IN | `sBrId` | `varchar(100)` |
| 8 | IN | `sSuId` | `varchar(100)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Sis_CopeEventList`'`._

## Narrative

**Business context:** 系统工具 — 未清单据强制完工/取消完工 dispatcher. A single proc that handles "完成处理"/"取消处理" for the entire family of unclosed-bill grids (production-arrange, work-order-process, purchase-order, quotation, sales-contact, deliver-notify, supply, MRP, etc.), each routed by `sFormGuid` and `iType` (0=complete, 1=cancel).

**What it does:** Branches on `sFormGuid` through ~50 `elseif` arms; for each arm builds a dynamic `Update ... Set bComplete/iProcessComplete/dDispatchQty/tEndDate ...` against the form's master/slave table (`MftWorkOrderProcess`, `PurPurchaseOrderSlave`, `QuoQuotationMaster`, `SalSalesContactRecord`, `MitMaterialsStoreVirtual`, etc.) scoped by `sId IN (sDataGuid)`, then `PREPARE`/`EXECUTE`. Several arms also `call Sp_Sis_GetConst('Working', …)` to refuse when the source row is locked by `SysLocking`, and re-fan `Sp_Manufacture_MftProductionArrange` when work-order outsourcing is toggled. Some forms branch on `CbxWorkOrderComplete` / `CbxSoftCustomer` system settings.

**Invocation:** Not bound on `gdsmodule` and not called from xly-src or any other DB routine in this snapshot — only the install scripts `script/标版/30100101/Sp_Sis_CopeEventList.sql` (standard) and `script/客户/千彩/Sp_Sis_CopeEventList.sql` (千彩 customer override). Likely reached via a generic "强制完工"/"取消完工" toolbar button dispatched by `GenericProcedureCallServiceImpl` against the `{GUID}`-style `sFormGuid` literals embedded in the body — but those forms aren't bound to it through standard metadata, so the binding (if active) is button-side. Status: candidate for maintainer audit — confirm whether any live toolbar still wires to this proc.
